prepare related storearrays of SpacePoints, SVD- and PXDClusters and MCParticles
101 {
102 spacePointData.registerInDataStore();
103 pxdClusterData.registerInDataStore();
104 svdClusterData.registerInDataStore();
105 mcParticleData.registerInDataStore();
106
107 spacePointData.registerRelationTo(pxdClusterData);
108 pxdClusterData.registerRelationTo(mcParticleData);
109
110 spacePointData.registerRelationTo(svdClusterData);
111 svdClusterData.registerRelationTo(mcParticleData);
112
114
115
116 for (unsigned int i = 1; i < 3; ++i) {
117 MCParticle* aParticle = mcParticleData.appendNew();
118
119 aParticle->
setMomentum(
float(i),
float(i),
float(i));
120
121 VxdID aVxdID = VxdID(i, i, i);
122
123 VXD::SensorInfoBase aSensorInfo =
provideSensorInfo(aVxdID, (
unsigned short)i, (
unsigned short)i + 1., (
unsigned short)i + 2.);
124
125 const PXDCluster* pxdCluster = pxdClusterData.appendNew(
providePXDCluster(0., 0., aVxdID));
127
128 SpacePoint* newSP = spacePointData.appendNew(pxdCluster, &aSensorInfo);
129 B2DEBUG(10,
" setup: new spacePoint got arrayIndex: " << newSP->
getArrayIndex() <<
" and VxdID " << newSP->
getVxdID());
131 }
132
134 mcParticleData[1]->setPDG(
Const::muon.getPDGCode());
136
137
138 for (unsigned int i = 3; i < 7; ++i) {
139
140 VxdID aVxdID = VxdID(i, i, i);
141
142 VXD::SensorInfoBase aSensorInfo =
provideSensorInfo(aVxdID, (
unsigned short)i, (
unsigned short)i + 1., (
unsigned short)i + 2.);
143
144 unsigned int pID = (i - 3) / 2;
145
146 const SVDCluster* clusterU = svdClusterData.appendNew(
provideSVDCluster(aVxdID,
true, 0.));
148 const SVDCluster* clusterV = svdClusterData.appendNew(
provideSVDCluster(aVxdID,
false, 0.));
150
151 std::vector<const SVDCluster*> clusterVector = {clusterU, clusterV};
152
153 SpacePoint* newSP = spacePointData.appendNew(clusterVector, &aSensorInfo);
156 }
157
158 B2INFO("ObserversTest:SetUP: created " << mcParticleData.getEntries() << "/" << pxdClusterData.getEntries() << "/" <<
159 svdClusterData.getEntries() << "/" << spacePointData.getEntries() << " mcParticles/pxdClusters/svdClusters/SpacePoints");
160 }
static const ChargedStable muon
muon particle
static const ChargedStable electron
electron particle
static DataStore & Instance()
Instance of singleton Store.
void setInitializeActive(bool active)
Setter for m_initializeActive.
@ c_PrimaryParticle
bit 0: Particle is primary particle.
void setMomentum(const ROOT::Math::XYZVector &momentum)
Set particle momentum.
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
VxdID getVxdID() const
Return the VxdID of the sensor on which the the cluster of the SpacePoint lives.
SVDCluster provideSVDCluster(VxdID aVxdID, bool isU, double position, double error=0.1)
returns a svdCluster with given sensorID, uType and local position
PXDCluster providePXDCluster(double u, double v, VxdID aVxdID, double uError=0.1, double vError=0.1)
returns a pxdCluster with given sensorID and local coordinates
VXD::SensorInfoBase provideSensorInfo(VxdID aVxdID, double globalX=0., double globalY=0., double globalZ=-0.)
this is a small helper function to create a sensorInfo to be used