Belle II Software development
CDCSimpleSimulation Class Reference

Class providing a simple simulation of the CDC mainly for quick unit test checks. More...

#include <CDCSimpleSimulation.h>

Classes

struct  SimpleSimHit
 Structure to accomdate information about the individual hits during the simluation. More...
 

Public Member Functions

ConstVectorRange< CDCWireHitgetWireHits () const
 Getter for the wire hits created in the simulation.
 
std::vector< CDCTracksimulate (const std::vector< CDCTrajectory3D > &trajectories3D)
 Propagates the trajectories through the CDC as without energy loss until they first leave the CDC.
 
CDCTrack simulate (const CDCTrajectory3D &trajectory3D)
 Same as above for one trajectory.
 
std::vector< CDCTrackloadPreparedEvent ()
 Fills the wire hits with a hard coded event from the real simulation.
 
double getEventTime () const
 Getter for a global event time offset.
 
void setEventTime (double eventTime)
 Setter for a global event time offset.
 
void activateTOFDelay (bool activate=true)
 Activate the TOF time delay.
 
void activateInWireSignalDelay (bool activate=true)
 Activate the in wire signal delay.
 
int getMaxNHitOnWire () const
 Getter for the maximal number of hits that are allowed on each layer.
 
void setMaxNHitOnWire (int maxNHitOnWire)
 Setter for the maximal number of hits that are allowed on each layer.
 

Private Member Functions

std::vector< CDCTrackconstructMCTracks (int nMCTracks, std::vector< SimpleSimHit > simpleSimHits)
 Creates CDCWireHits and uses them to construct the true CDCTracks.
 
std::vector< SimpleSimHitcreateHits (const Helix &globalHelix, double arcLength2DOffset) const
 Generate hits for the given helix in starting from the two dimensional arc length.
 
std::vector< SimpleSimHitcreateHitsForLayer (const CDCWire &nearWire, const Helix &globalHelix, double arcLength2DOffset) const
 Generate connected hits for wires in the same layer close to the given wire.
 
SimpleSimHit createHitForCell (const CDCWire &wire, const Helix &globalHelix, double arcLength2DOffset) const
 Generate a hit for the given wire.
 

Private Attributes

std::shared_ptr< const std::vector< CDCWireHit > > m_sharedWireHits
 Space for the memory of the generated wire hits.
 
const double s_nominalDriftLengthVariance = 0.000169
 Default drift length variance.
 
const double s_nominalPropSpeed = 27.25
 Default in wire signal propagation speed - 27.25 cm / ns.
 
const double s_nominalDriftSpeed = 4e-3
 Default electron drift speed in cdc gas - 4 * 10^-3 cm / ns.
 
int m_maxNHitOnWire = 0
 Maximal number of hits allowed on each wire (0 means all).
 
double m_eventTime = 0
 A global event time.
 
bool m_addTOFDelay = false
 Switch to activate the addition of the time of flight.
 
bool m_addInWireSignalDelay = false
 Switch to activate the in wire signal delay.
 
double m_driftLengthVariance = s_nominalDriftLengthVariance
 Variance by which the drift length should be smeared.
 
double m_driftLengthSigma = std::sqrt(m_driftLengthVariance)
 Standard deviation by which the drift length should be smeared.
 
double m_propSpeed = s_nominalPropSpeed
 Electrical current propagation speed in the wires.
 
double m_driftSpeed = s_nominalDriftSpeed
 Electron drift speed in the cdc gas.
 

Detailed Description

Class providing a simple simulation of the CDC mainly for quick unit test checks.

Most aspects of the detection are idealized

  • Trajectories are ideal helices
  • Wires are straight lines
  • Drift relation linear
  • No detection inefficiencies are enabled
  • T0, TOF and signal delay in the wire are not taken into account (but can eventually implemented to study them)

Nevertheless drift length a smeared by one gaussian distribution of fixed width to have a realistic check for the accuracy of fast fitting procedures in terms of their chi2 distributions.

Definition at line 44 of file CDCSimpleSimulation.h.

Member Function Documentation

◆ activateInWireSignalDelay()

void activateInWireSignalDelay ( bool  activate = true)
inline

Activate the in wire signal delay.

Definition at line 150 of file CDCSimpleSimulation.h.

151 { m_addInWireSignalDelay = activate; }
bool m_addInWireSignalDelay
Switch to activate the in wire signal delay.

◆ activateTOFDelay()

void activateTOFDelay ( bool  activate = true)
inline

Activate the TOF time delay.

Definition at line 146 of file CDCSimpleSimulation.h.

147 { m_addTOFDelay = activate; }
bool m_addTOFDelay
Switch to activate the addition of the time of flight.

◆ constructMCTracks()

std::vector< CDCTrack > constructMCTracks ( int  nMCTracks,
std::vector< SimpleSimHit simpleSimHits 
)
private

Creates CDCWireHits and uses them to construct the true CDCTracks.

Sort the hits by the order of their occurance

Definition at line 89 of file CDCSimpleSimulation.cc.

90{
91
92 // Sort the hits along side their wire hits
93 std::stable_sort(simpleSimHits.begin(), simpleSimHits.end(),
94 [](const SimpleSimHit & lhs, const SimpleSimHit & rhs) -> bool {
95 return lhs.m_wireHit < rhs.m_wireHit;
96 });
97
98 // Discard multiple hits on the same wire up to the maximal exceeding the maximal desired number
99 if (m_maxNHitOnWire > 0) {
100 const CDCWire* lastWire = nullptr;
101 size_t nSameWire = 0;
102 const size_t maxNHitOnWire = m_maxNHitOnWire;
103
104 auto exceedsMaxNHitOnWire =
105 [&lastWire, &nSameWire, maxNHitOnWire](const SimpleSimHit & simpleSimHit) -> bool {
106
107 if (&(simpleSimHit.m_wireHit.getWire()) == lastWire)
108 {
109 ++nSameWire;
110 } else {
111 nSameWire = 1;
112 lastWire = &(simpleSimHit.m_wireHit.getWire());
113 }
114 return nSameWire > maxNHitOnWire ? true : false;
115 };
116
117 auto itLast = std::remove_if(simpleSimHits.begin(), simpleSimHits.end(), exceedsMaxNHitOnWire);
118 simpleSimHits.erase(itLast, simpleSimHits.end());
119 }
120
121 // Write the created hits and move them to the their storage place.
122 {
123 std::vector<CDCWireHit> wireHits;
124 wireHits.reserve(simpleSimHits.size());
125 for (SimpleSimHit& simpleSimHit : simpleSimHits) {
126 wireHits.push_back(simpleSimHit.m_wireHit);
127 }
128
129 B2ASSERT("WireHits should be sorted as a result from sorting the SimpleSimHits. "
130 "Algorithms may relay on the sorting o the WireHits",
131 std::is_sorted(wireHits.begin(), wireHits.end()));
132
133 m_sharedWireHits.reset(new const std::vector<CDCWireHit>(std::move(wireHits)));
134 }
135
136 // TODO: Decide if the EventMeta should be incremented after write.
137
138 // Now construct the tracks.
139 std::vector<CDCTrack> mcTracks;
140 mcTracks.resize(nMCTracks);
142 const size_t nWireHits = wireHits.size();
143
144 for (size_t iWireHit = 0; iWireHit < nWireHits; ++iWireHit) {
145 const CDCWireHit& wireHit = wireHits[iWireHit];
146 const SimpleSimHit& simpleSimHit = simpleSimHits[iWireHit];
147
148 CDCTrack& mcTrack = mcTracks[simpleSimHit.m_iMCTrack];
149
150 CDCRLWireHit rlWireHit(&wireHit, simpleSimHit.m_rlInfo);
151 CDCRecoHit3D recoHit3D(rlWireHit, simpleSimHit.m_pos3D, simpleSimHit.m_arcLength2D);
152 mcTrack.push_back(recoHit3D);
153 }
154
156 for (CDCTrack& mcTrack : mcTracks) {
157 mcTrack.sortByArcLength2D();
158 }
159
160 return mcTracks;
161}
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
Definition: CDCRLWireHit.h:41
Class representing a three dimensional reconstructed hit.
Definition: CDCRecoHit3D.h:52
ConstVectorRange< CDCWireHit > getWireHits() const
Getter for the wire hits created in the simulation.
std::shared_ptr< const std::vector< CDCWireHit > > m_sharedWireHits
Space for the memory of the generated wire hits.
int m_maxNHitOnWire
Maximal number of hits allowed on each wire (0 means all).
Class representing a sequence of three dimensional reconstructed hits.
Definition: CDCTrack.h:41
void sortByArcLength2D()
Sort the recoHits according to their perpS information.
Definition: CDCTrack.cc:412
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:55
Class representing a sense wire in the central drift chamber.
Definition: CDCWire.h:58
A pair of iterators usable with the range base for loop.
Definition: Range.h:25
std::size_t size() const
Returns the total number of objects in this range.
Definition: Range.h:76

◆ createHitForCell()

CDCSimpleSimulation::SimpleSimHit createHitForCell ( const CDCWire wire,
const Helix globalHelix,
double  arcLength2DOffset 
) const
private

Generate a hit for the given wire.

Definition at line 314 of file CDCSimpleSimulation.cc.

317{
318 double arcLength2D = globalHelix.arcLength2DToXY(wire.getRefPos2D());
319 if ((arcLength2D + arcLength2DOffset) < 0) {
320 arcLength2D += globalHelix.perimeterXY();
321 }
322
323 Vector3D pos3D = globalHelix.atArcLength2D(arcLength2D);
324
325 Vector3D correctedPos3D = pos3D;
326 Vector2D correctedWirePos(wire.getWirePos2DAtZ(correctedPos3D.z()));
327 double correctedArcLength2D = arcLength2D;
328
329 for (int c_Iter = 0; c_Iter < 2; c_Iter++) {
330 // Iterate the extrapolation to the stereo shifted position.
331 correctedWirePos = wire.getWirePos2DAtZ(correctedPos3D.z());
332 correctedArcLength2D = globalHelix.arcLength2DToXY(correctedWirePos);
333
334 if ((correctedArcLength2D + arcLength2DOffset) < 0) {
335 correctedArcLength2D += globalHelix.perimeterXY();
336 }
337 correctedPos3D = globalHelix.atArcLength2D(correctedArcLength2D);
338 }
339
340 const double trueDriftLength = wire.getDriftLength(correctedPos3D);
341 const double smearedDriftLength = trueDriftLength + gRandom->Gaus(0, m_driftLengthSigma);
342
343 double delayTime = getEventTime();
344 if (m_addTOFDelay) {
345 double arcLength3D = hypot2(1, globalHelix.tanLambda()) * (correctedArcLength2D + arcLength2DOffset);
346 delayTime += arcLength3D / Const::speedOfLight;
347 }
348
350 double backwardZ = wire.getBackwardZ();
351 // Position where wire has been hit
352 Vector3D wirePos = wire.getClosest(correctedPos3D);
353 double distanceToBack = (wirePos.z() - backwardZ) * hypot2(1, wire.getTanStereoAngle());
354
355 delayTime += distanceToBack / m_propSpeed;
356 }
357
358 double measuredDriftLength = smearedDriftLength + delayTime * m_driftSpeed;
359
360 ERightLeft rlInfo = globalHelix.circleXY().isRightOrLeft(correctedWirePos);
361
362 // if (not std::isnan(trueDriftLength)){
363 // B2INFO("Delay time " << delayTime);
364 // B2INFO("True dirft length " << trueDriftLength);
365 // B2INFO("Measured drift length " << measuredDriftLength);
366 // B2INFO("Absolute deviation " << measuredDriftLength - trueDriftLength);
367 // B2INFO("Relative deviation " << (measuredDriftLength / trueDriftLength - 1) * 100 << "%");
368 // }
369
370 return SimpleSimHit{
371 CDCWireHit(wire.getWireID(), measuredDriftLength, m_driftLengthVariance),
372 0,
373 rlInfo,
374 correctedPos3D,
375 correctedArcLength2D,
376 trueDriftLength
377 };
378}
static const double speedOfLight
[cm/ns]
Definition: Const.h:695
double m_propSpeed
Electrical current propagation speed in the wires.
double getEventTime() const
Getter for a global event time offset.
double m_driftLengthVariance
Variance by which the drift length should be smeared.
double m_driftLengthSigma
Standard deviation by which the drift length should be smeared.
double m_driftSpeed
Electron drift speed in the cdc gas.
double getDriftLength(const Vector3D &pos3D) const
Calculates the straight drift length from the position to the wire This is essentially the same as th...
Definition: CDCWire.h:214
const WireID & getWireID() const
Getter for the wire id.
Definition: CDCWire.h:122
Vector2D getWirePos2DAtZ(const double z) const
Gives the xy projected position of the wire at the given z coordinate.
Definition: CDCWire.h:192
Vector3D getClosest(const Vector3D &pos3D) const
Calculates the closest approach in the wire to the position.
Definition: CDCWire.h:204
const Vector2D & getRefPos2D() const
Getter for the wire reference position for 2D tracking Gives the wire's reference position projected ...
Definition: CDCWire.h:229
double getTanStereoAngle() const
Getter for the tangents of the stereo angle of the wire.
Definition: CDCWire.h:240
double getBackwardZ() const
Getter for the z coordinate at the backward joint points of the wires.
Definition: CDCWire.h:280
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:32
A three dimensional vector.
Definition: Vector3D.h:33
double z() const
Getter for the z coordinate.
Definition: Vector3D.h:496
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:25

◆ createHits()

std::vector< CDCSimpleSimulation::SimpleSimHit > createHits ( const Helix globalHelix,
double  arcLength2DOffset 
) const
private

Generate hits for the given helix in starting from the two dimensional arc length.

Definition at line 166 of file CDCSimpleSimulation.cc.

168{
169
170 std::vector<SimpleSimHit> simpleSimHits;
171
173 const double outerWallCylinderR = wireTopology.getOuterCylindricalR();
174
175 const double minR = globalHelix.minimalCylindricalR();
176 const double maxR = globalHelix.maximalCylindricalR();
177
178 const double globalArcLength2DToOuterWall = globalHelix.arcLength2DToCylindricalR(outerWallCylinderR);
179 const double localArcLength2DToOuterWall = arcLength2DOffset + globalArcLength2DToOuterWall;
180
181 if (localArcLength2DToOuterWall < 0) {
182 // Trajectory starts outside the CDC and initially flys away from it
183 // Do not try to createHit hits for it
184 B2WARNING("Simple simulation got trajectory outside CDC that moves away from the detector.");
185 return simpleSimHits;
186 }
187
188 // Two dimensional arc length where the trajectory
189 // * leaves the outer wall of the CDC or
190 // * made a full circle (cut off for curlers)
191 const bool isCurler = std::isnan(localArcLength2DToOuterWall);
192 const double perimeterXY = globalHelix.perimeterXY();
193 const double maxArcLength2D = isCurler ? fabs(perimeterXY) : localArcLength2DToOuterWall;
194
195 if (isCurler) {
196 B2INFO("Simulating curler");
197 }
198
199 for (const CDCWireLayer& wireLayer : wireTopology.getWireLayers()) {
200 double outerR = wireLayer.getOuterCylindricalR();
201 double innerR = wireLayer.getInnerCylindricalR();
202
203 if ((maxR < innerR) or (outerR < minR)) {
204 // Trajectory does not reaching the layer
205 continue;
206 }
207
208 double centerR = (std::min(outerR, maxR) + std::max(innerR, minR)) / 2;
209
210 double globalArcLength2D = globalHelix.arcLength2DToCylindricalR(centerR);
211 double localArcLength2D = arcLength2DOffset + globalArcLength2D;
212
213
214 std::vector<SimpleSimHit> simpleSimHitsInLayer;
215 if (localArcLength2D > 0 and localArcLength2D < maxArcLength2D) {
216
217 Vector3D pos3DAtLayer = globalHelix.atArcLength2D(globalArcLength2D);
218 const CDCWire& closestWire = wireLayer.getClosestWire(pos3DAtLayer);
219
220 simpleSimHitsInLayer = createHitsForLayer(closestWire, globalHelix, arcLength2DOffset);
221
222 for (SimpleSimHit& simpleSimHit : simpleSimHitsInLayer) {
223 if (simpleSimHit.m_arcLength2D < maxArcLength2D) {
224 simpleSimHits.push_back(simpleSimHit);
225 }
226 }
227 } else {
228 B2INFO("Arc length to long");
229 }
230
231 bool oneSegment = outerR > maxR or innerR < minR;
232 if (not oneSegment) {
233
234 // Check the second branch for more hits
235 double secondGlobalArcLength2D = -globalArcLength2D;
236 double secondArcLength2DOffset = arcLength2DOffset;
237 double secondLocalArcLength2D = secondArcLength2DOffset + secondGlobalArcLength2D;
238
239 if (isCurler and secondLocalArcLength2D < 0) {
240 secondLocalArcLength2D += perimeterXY;
241 secondArcLength2DOffset += perimeterXY;
242 secondGlobalArcLength2D += perimeterXY;
243 }
244
245 if (secondLocalArcLength2D > 0 and secondLocalArcLength2D < maxArcLength2D) {
246 Vector3D pos3DAtLayer = globalHelix.atArcLength2D(secondGlobalArcLength2D);
247 const CDCWire& closestWire = wireLayer.getClosestWire(pos3DAtLayer);
248
249 // Check again if the wire has been hit before
250 bool wireAlreadyHit = false;
251 for (const SimpleSimHit& simpleSimHit : simpleSimHits) {
252 if (simpleSimHit.m_wireHit.isOnWire(closestWire)) {
253 wireAlreadyHit = true;
254 }
255 }
256 if (not wireAlreadyHit) {
257 std::vector<SimpleSimHit> secondSimpleSimHitsInLayer =
258 createHitsForLayer(closestWire, globalHelix, secondArcLength2DOffset);
259
260 for (SimpleSimHit& simpleSimHit : secondSimpleSimHitsInLayer) {
261 if (simpleSimHit.m_arcLength2D < maxArcLength2D) {
262 simpleSimHits.push_back(simpleSimHit);
263 }
264 }
265 }
266 }
267 }
268 }
269
270 return simpleSimHits;
271}
std::vector< SimpleSimHit > createHitsForLayer(const CDCWire &nearWire, const Helix &globalHelix, double arcLength2DOffset) const
Generate connected hits for wires in the same layer close to the given wire.
Class representating a sense wire layer in the central drift chamber.
Definition: CDCWireLayer.h:42
Class representating the sense wire arrangement in the whole of the central drift chamber.
const std::vector< Belle2::TrackFindingCDC::CDCWireLayer > & getWireLayers() const
Getter for the underlying storing layer vector.
static CDCWireTopology & getInstance()
Getter for the singleton instance of the wire topology.
double getOuterCylindricalR() const
Getter for the outer radius of the outer most wire layer.

◆ createHitsForLayer()

std::vector< CDCSimpleSimulation::SimpleSimHit > createHitsForLayer ( const CDCWire nearWire,
const Helix globalHelix,
double  arcLength2DOffset 
) const
private

Generate connected hits for wires in the same layer close to the given wire.

Iter counter clockwise for more hits

Iter clockwise for more hits

Definition at line 274 of file CDCSimpleSimulation.cc.

277{
278 std::vector<SimpleSimHit> result;
279
280 SimpleSimHit simpleSimHit = createHitForCell(nearWire, globalHelix, arcLength2DOffset);
281 if (not std::isnan(simpleSimHit.m_wireHit.getRefDriftLength())) {
282 result.push_back(simpleSimHit);
283 }
284
286 const CDCWire* ccwWire = nearWire.getNeighborCCW();
287 while (true) {
288 SimpleSimHit simpleSimHitForWire = createHitForCell(*ccwWire, globalHelix, arcLength2DOffset);
289 if (std::isnan(simpleSimHitForWire.m_arcLength2D) or
290 std::isnan(simpleSimHitForWire.m_trueDriftLength)) {
291 break;
292 }
293 result.push_back(simpleSimHitForWire);
294 ccwWire = ccwWire->getNeighborCCW();
295 }
296
298 const CDCWire* cwWire = nearWire.getNeighborCW();
299 while (true) {
300 SimpleSimHit simpleSimHitForWire = createHitForCell(*cwWire, globalHelix, arcLength2DOffset);
301 if (std::isnan(simpleSimHitForWire.m_arcLength2D) or
302 std::isnan(simpleSimHitForWire.m_trueDriftLength)) {
303 break;
304 }
305 result.push_back(simpleSimHitForWire);
306 cwWire = cwWire->getNeighborCW();
307 }
308
309 return result;
310}
SimpleSimHit createHitForCell(const CDCWire &wire, const Helix &globalHelix, double arcLength2DOffset) const
Generate a hit for the given wire.
MayBePtr< const CDCWire > getNeighborCCW() const
Gives the closest neighbor in the counterclockwise direction - always exists.
Definition: CDCWire.cc:159
MayBePtr< const CDCWire > getNeighborCW() const
Gives the closest neighbor in the clockwise direction - always exists.
Definition: CDCWire.cc:164

◆ getEventTime()

double getEventTime ( ) const
inline

Getter for a global event time offset.

Definition at line 138 of file CDCSimpleSimulation.h.

139 { return m_eventTime; }

◆ getMaxNHitOnWire()

int getMaxNHitOnWire ( ) const
inline

Getter for the maximal number of hits that are allowed on each layer.

Definition at line 154 of file CDCSimpleSimulation.h.

155 { return m_maxNHitOnWire; }

◆ getWireHits()

ConstVectorRange< CDCWireHit > getWireHits ( ) const

Getter for the wire hits created in the simulation.

Definition at line 33 of file CDCSimpleSimulation.cc.

34{
35 if (m_sharedWireHits) {
36 return {m_sharedWireHits->begin(), m_sharedWireHits->end()};
37 } else {
39 }
40}

◆ loadPreparedEvent()

std::vector< CDCTrack > loadPreparedEvent ( )

Fills the wire hits with a hard coded event from the real simulation.

Definition at line 382 of file CDCSimpleSimulation.cc.

383{
384 const size_t nMCTracks = 2;
385 std::vector<SimpleSimHit> simpleSimHits;
386 simpleSimHits.reserve(128 + 64); // First plus second mc track
387
388 // First MC track
390 size_t iMCTrack = 0;
391
392 // SL 6
393 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 4, 251), 0.104), iMCTrack, ERightLeft::c_Left});
394 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 4, 250), 0.272), iMCTrack, ERightLeft::c_Left});
395 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 4, 249), 0.488), iMCTrack, ERightLeft::c_Left});
396 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 4, 248), 0.764), iMCTrack, ERightLeft::c_Left});
397 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 3, 247), 0.9), iMCTrack, ERightLeft::c_Right});
398 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 4, 247), 1.024), iMCTrack, ERightLeft::c_Left});
399 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 3, 246), 0.64), iMCTrack, ERightLeft::c_Right});
400 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 3, 245), 0.304), iMCTrack, ERightLeft::c_Right});
401 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 3, 244), 0.012), iMCTrack, ERightLeft::c_Right});
402 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 3, 243), 0.352), iMCTrack, ERightLeft::c_Left});
403 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 3, 242), 0.74), iMCTrack, ERightLeft::c_Left});
404 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 2, 241), 0.46), iMCTrack, ERightLeft::c_Right});
405 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 2, 240), 0.02), iMCTrack, ERightLeft::c_Right});
406 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 2, 239), 0.46), iMCTrack, ERightLeft::c_Left});
407 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 2, 238), 0.884), iMCTrack, ERightLeft::c_Left});
408 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 1, 238), 1.104), iMCTrack, ERightLeft::c_Right});
409 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 1, 237), 0.612), iMCTrack, ERightLeft::c_Right});
410 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 1, 236), 0.12), iMCTrack, ERightLeft::c_Right});
411 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 1, 235), 0.356), iMCTrack, ERightLeft::c_Left});
412 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 1, 234), 0.884), iMCTrack, ERightLeft::c_Left});
413 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 0, 235), 1.032), iMCTrack, ERightLeft::c_Right});
414 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 0, 234), 0.52), iMCTrack, ERightLeft::c_Right});
415 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 0, 233), 0.06), iMCTrack, ERightLeft::c_Left});
416 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 0, 232), 0.62), iMCTrack, ERightLeft::c_Left});
417
418 // SL 5
419 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 5, 206), 1.116), iMCTrack, ERightLeft::c_Right});
420 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 5, 205), 0.464), iMCTrack, ERightLeft::c_Right});
421 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 5, 204), 0.168), iMCTrack, ERightLeft::c_Right});
422 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 4, 204), 1.08), iMCTrack, ERightLeft::c_Right});
423 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 4, 203), 0.392), iMCTrack, ERightLeft::c_Right});
424 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 4, 202), 0.304), iMCTrack, ERightLeft::c_Left});
425 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 3, 201), 0.968), iMCTrack, ERightLeft::c_Right});
426 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 3, 200), 0.252), iMCTrack, ERightLeft::c_Right});
427 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 3, 199), 0.476), iMCTrack, ERightLeft::c_Left});
428 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 2, 199), 0.736), iMCTrack, ERightLeft::c_Right});
429 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 2, 198), 0.008), iMCTrack, ERightLeft::c_Left});
430 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 2, 197), 0.788), iMCTrack, ERightLeft::c_Left});
431 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 1, 197), 1.188), iMCTrack, ERightLeft::c_Right});
432 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 1, 196), 0.404), iMCTrack, ERightLeft::c_Right});
433 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 1, 195), 0.356), iMCTrack, ERightLeft::c_Left});
434 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 0, 195), 0.74), iMCTrack, ERightLeft::c_Right});
435 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 0, 194), 0.04), iMCTrack, ERightLeft::c_Left});
436 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 0, 193), 0.832), iMCTrack, ERightLeft::c_Left});
437
438 // SL 4
439 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 5, 173), 0.692), iMCTrack, ERightLeft::c_Right});
440 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 5, 172), 0.22), iMCTrack, ERightLeft::c_Left});
441 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 5, 171), 1.132), iMCTrack, ERightLeft::c_Left});
442 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 4, 172), 0.816), iMCTrack, ERightLeft::c_Right});
443 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 4, 171), 0.136), iMCTrack, ERightLeft::c_Left});
444 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 4, 170), 1.048), iMCTrack, ERightLeft::c_Left});
445 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 3, 170), 0.884), iMCTrack, ERightLeft::c_Right});
446 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 3, 169), 0.032), iMCTrack, ERightLeft::c_Left});
447 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 3, 168), 0.96), iMCTrack, ERightLeft::c_Left});
448 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 2, 169), 0.972), iMCTrack, ERightLeft::c_Right});
449 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 2, 168), 0.044), iMCTrack, ERightLeft::c_Right});
450 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 2, 167), 0.872), iMCTrack, ERightLeft::c_Left});
451 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 1, 167), 1.004), iMCTrack, ERightLeft::c_Right});
452 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 1, 166), 0.1), iMCTrack, ERightLeft::c_Right});
453 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 1, 165), 0.828), iMCTrack, ERightLeft::c_Left});
454 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 0, 166), 1.004), iMCTrack, ERightLeft::c_Right});
455 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 0, 165), 0.084), iMCTrack, ERightLeft::c_Right});
456 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 0, 164), 0.82), iMCTrack, ERightLeft::c_Left});
457
458 // SL 3
459 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 5, 145), 0.508), iMCTrack, ERightLeft::c_Right});
460 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 5, 144), 0.5), iMCTrack, ERightLeft::c_Left});
461 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 4, 145), 1.348), iMCTrack, ERightLeft::c_Right});
462 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 4, 144), 0.292), iMCTrack, ERightLeft::c_Right});
463 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 4, 143), 0.68), iMCTrack, ERightLeft::c_Left});
464 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 3, 143), 1.136), iMCTrack, ERightLeft::c_Right});
465 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 3, 142), 0.12), iMCTrack, ERightLeft::c_Right});
466 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 3, 141), 0.872), iMCTrack, ERightLeft::c_Left});
467 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 2, 142), 0.96), iMCTrack, ERightLeft::c_Right});
468 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 2, 141), 0.036), iMCTrack, ERightLeft::c_Left});
469 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 1, 140), 0.756), iMCTrack, ERightLeft::c_Right});
470 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 1, 139), 0.204), iMCTrack, ERightLeft::c_Left});
471 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 0, 139), 0.588), iMCTrack, ERightLeft::c_Right});
472 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 0, 138), 0.332), iMCTrack, ERightLeft::c_Left});
473
474 // SL 2
475 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 5, 116), 1.1), iMCTrack, ERightLeft::c_Right});
476 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 5, 115), 0.008), iMCTrack, ERightLeft::c_Left});
477 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 5, 114), 1.048), iMCTrack, ERightLeft::c_Left});
478 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 4, 115), 0.712), iMCTrack, ERightLeft::c_Right});
479 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 4, 114), 0.316), iMCTrack, ERightLeft::c_Left});
480 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 3, 113), 0.428), iMCTrack, ERightLeft::c_Right});
481 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 3, 112), 0.572), iMCTrack, ERightLeft::c_Left});
482 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 2, 112), 0.188), iMCTrack, ERightLeft::c_Right});
483 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 2, 111), 0.776), iMCTrack, ERightLeft::c_Left});
484 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 1, 111), 0.92), iMCTrack, ERightLeft::c_Right});
485 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 1, 110), 0.024), iMCTrack, ERightLeft::c_Left});
486 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 1, 109), 0.928), iMCTrack, ERightLeft::c_Left});
487 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 0, 110), 0.776), iMCTrack, ERightLeft::c_Right});
488 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 0, 109), 0.116), iMCTrack, ERightLeft::c_Left});
489 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 0, 108), 0.992), iMCTrack, ERightLeft::c_Left});
490
491 // SL 1
492 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 5, 87), 0.664), iMCTrack, ERightLeft::c_Right});
493 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 5, 86), 0.3), iMCTrack, ERightLeft::c_Left});
494 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 4, 86), 0.504), iMCTrack, ERightLeft::c_Right});
495 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 4, 85), 0.424), iMCTrack, ERightLeft::c_Left});
496 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 3, 85), 1.256), iMCTrack, ERightLeft::c_Right});
497 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 3, 84), 0.388), iMCTrack, ERightLeft::c_Right});
498 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 3, 83), 0.5), iMCTrack, ERightLeft::c_Left});
499 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 2, 84), 1.128), iMCTrack, ERightLeft::c_Right});
500 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 2, 83), 0.28), iMCTrack, ERightLeft::c_Right});
501 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 2, 82), 0.532), iMCTrack, ERightLeft::c_Left});
502 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 1, 82), 1.084), iMCTrack, ERightLeft::c_Right});
503 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 1, 81), 0.3), iMCTrack, ERightLeft::c_Right});
504 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 1, 80), 0.472), iMCTrack, ERightLeft::c_Left});
505 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 0, 81), 1.124), iMCTrack, ERightLeft::c_Right});
506 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 0, 80), 0.428), iMCTrack, ERightLeft::c_Right});
507 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 0, 79), 0.296), iMCTrack, ERightLeft::c_Left});
508 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 0, 78), 0.972), iMCTrack, ERightLeft::c_Left});
509
510 // SL 0
511 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 7, 81), 0.192), iMCTrack, ERightLeft::c_Right});
512 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 7, 80), 0.452), iMCTrack, ERightLeft::c_Left});
513 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 6, 80), 0.596), iMCTrack, ERightLeft::c_Right});
514 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 6, 79), 0.024), iMCTrack, ERightLeft::c_Left});
515 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 6, 78), 0.66), iMCTrack, ERightLeft::c_Left});
516 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 5, 79), 0.388), iMCTrack, ERightLeft::c_Right});
517 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 5, 78), 0.184), iMCTrack, ERightLeft::c_Left});
518 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 4, 77), 0.296), iMCTrack, ERightLeft::c_Right});
519 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 4, 76), 0.244), iMCTrack, ERightLeft::c_Left});
520 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 3, 76), 0.268), iMCTrack, ERightLeft::c_Right});
521 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 3, 75), 0.212), iMCTrack, ERightLeft::c_Left});
522 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 2, 74), 0.316), iMCTrack, ERightLeft::c_Right});
523 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 2, 73), 0.112), iMCTrack, ERightLeft::c_Right});
524 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 2, 72), 0.588), iMCTrack, ERightLeft::c_Left});
525 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 1, 73), 0.464), iMCTrack, ERightLeft::c_Right});
526 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 1, 72), 0.028), iMCTrack, ERightLeft::c_Left});
527 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 0, 70), 0.284), iMCTrack, ERightLeft::c_Right});
528 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 0, 69), 0.088), iMCTrack, ERightLeft::c_Left});
529 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 0, 68), 0.416), iMCTrack, ERightLeft::c_Left});
530
531 // Second MC track
533 iMCTrack = 1;
534
535 // SL 0
536 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 1, 140), 0.308), iMCTrack, ERightLeft::c_Left});
537 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 2, 139), 0.08), iMCTrack, ERightLeft::c_Left});
538 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 3, 139), 0.16), iMCTrack, ERightLeft::c_Right});
539 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 4, 139), 0.404), iMCTrack, ERightLeft::c_Left});
540 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 4, 138), 0.38), iMCTrack, ERightLeft::c_Right});
541 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 5, 139), 0.132), iMCTrack, ERightLeft::c_Left});
542 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 6, 138), 0.108), iMCTrack, ERightLeft::c_Right});
543 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 7, 139), 0.48), iMCTrack, ERightLeft::c_Left});
544 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 7, 138), 0.424), iMCTrack, ERightLeft::c_Right});
545
546 // SL 1
547 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 0, 136), 0.532), iMCTrack, ERightLeft::c_Left});
548 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 0, 135), 0.452), iMCTrack, ERightLeft::c_Right});
549 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 1, 135), 0.396), iMCTrack, ERightLeft::c_Left});
550 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 2, 135), 0.26), iMCTrack, ERightLeft::c_Left});
551 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 1, 134), 0.64), iMCTrack, ERightLeft::c_Right});
552 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 3, 134), 0.092), iMCTrack, ERightLeft::c_Left});
553 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 4, 134), 0.16), iMCTrack, ERightLeft::c_Right});
554 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 5, 133), 0.524), iMCTrack, ERightLeft::c_Right});
555
556 // SL 2
557 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 0, 163), 0.228), iMCTrack, ERightLeft::c_Right});
558 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 1, 162), 0.356), iMCTrack, ERightLeft::c_Right});
559 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 2, 163), 0.776), iMCTrack, ERightLeft::c_Left});
560 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 2, 162), 0.46), iMCTrack, ERightLeft::c_Right});
561 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 3, 162), 0.744), iMCTrack, ERightLeft::c_Left});
562 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 3, 161), 0.58), iMCTrack, ERightLeft::c_Right});
563 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 4, 162), 0.656), iMCTrack, ERightLeft::c_Left});
564 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 4, 161), 0.68), iMCTrack, ERightLeft::c_Right});
565 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 5, 161), 0.568), iMCTrack, ERightLeft::c_Left});
566 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 5, 160), 0.812), iMCTrack, ERightLeft::c_Right});
567
568 // SL 3
569 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 0, 190), 0.54), iMCTrack, ERightLeft::c_Left});
570 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 1, 188), 0.688), iMCTrack, ERightLeft::c_Right});
571 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 2, 188), 0.656), iMCTrack, ERightLeft::c_Right});
572 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 3, 188), 0.664), iMCTrack, ERightLeft::c_Left});
573 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 3, 187), 0.68), iMCTrack, ERightLeft::c_Right});
574 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 4, 188), 0.724), iMCTrack, ERightLeft::c_Left});
575 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 4, 187), 0.656), iMCTrack, ERightLeft::c_Right});
576 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 5, 186), 0.676), iMCTrack, ERightLeft::c_Right});
577
578 // SL 4
579 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 0, 211), 0.42), iMCTrack, ERightLeft::c_Left});
580 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 0, 210), 0.872), iMCTrack, ERightLeft::c_Right});
581 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 1, 210), 0.548), iMCTrack, ERightLeft::c_Left});
582 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 1, 209), 0.796), iMCTrack, ERightLeft::c_Right});
583 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 2, 210), 0.716), iMCTrack, ERightLeft::c_Left});
584 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 2, 209), 0.656), iMCTrack, ERightLeft::c_Right});
585 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 3, 209), 0.856), iMCTrack, ERightLeft::c_Left});
586 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 4, 209), 1.056), iMCTrack, ERightLeft::c_Left});
587 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 4, 208), 0.36), iMCTrack, ERightLeft::c_Right});
588 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 5, 207), 0.232), iMCTrack, ERightLeft::c_Right});
589
590 // SL 5
591 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 0, 231), 0.224), iMCTrack, ERightLeft::c_Left});
592 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 0, 230), 1.088), iMCTrack, ERightLeft::c_Right});
593 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 1, 230), 0.452), iMCTrack, ERightLeft::c_Left});
594 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 1, 229), 0.912), iMCTrack, ERightLeft::c_Right});
595 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 2, 230), 0.72), iMCTrack, ERightLeft::c_Left});
596 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 2, 229), 0.632), iMCTrack, ERightLeft::c_Right});
597 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 3, 229), 1.016), iMCTrack, ERightLeft::c_Left});
598 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 3, 228), 0.34), iMCTrack, ERightLeft::c_Right});
599 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 4, 228), 0.04), iMCTrack, ERightLeft::c_Right});
600 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 5, 227), 0.22), iMCTrack, ERightLeft::c_Left});
601 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 5, 226), 1.196), iMCTrack, ERightLeft::c_Right});
602
603 // SL 6
604 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 0, 254), 0.104), iMCTrack, ERightLeft::c_Left});
605 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 1, 253), 0.504), iMCTrack, ERightLeft::c_Left});
606 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 1, 252), 0.78), iMCTrack, ERightLeft::c_Right});
607 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 2, 253), 0.968), iMCTrack, ERightLeft::c_Left});
608 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 2, 252), 0.332), iMCTrack, ERightLeft::c_Right});
609
610 std::vector<CDCTrack> mcTracks = constructMCTracks(nMCTracks, std::move(simpleSimHits));
611 return mcTracks;
612}
std::vector< CDCTrack > constructMCTracks(int nMCTracks, std::vector< SimpleSimHit > simpleSimHits)
Creates CDCWireHits and uses them to construct the true CDCTracks.
Class to identify a wire inside the CDC.
Definition: WireID.h:34

◆ setEventTime()

void setEventTime ( double  eventTime)
inline

Setter for a global event time offset.

Definition at line 142 of file CDCSimpleSimulation.h.

143 { m_eventTime = eventTime; }

◆ setMaxNHitOnWire()

void setMaxNHitOnWire ( int  maxNHitOnWire)
inline

Setter for the maximal number of hits that are allowed on each layer.

Definition at line 158 of file CDCSimpleSimulation.h.

159 { m_maxNHitOnWire = maxNHitOnWire; }

◆ simulate() [1/2]

CDCTrack simulate ( const CDCTrajectory3D trajectory3D)

Same as above for one trajectory.

Definition at line 42 of file CDCSimpleSimulation.cc.

43{
44 return std::move(simulate(std::vector<CDCTrajectory3D>(1, trajectory3D)).front());
45}
std::vector< CDCTrack > simulate(const std::vector< CDCTrajectory3D > &trajectories3D)
Propagates the trajectories through the CDC as without energy loss until they first leave the CDC.

◆ simulate() [2/2]

std::vector< CDCTrack > simulate ( const std::vector< CDCTrajectory3D > &  trajectories3D)

Propagates the trajectories through the CDC as without energy loss until they first leave the CDC.

Parameters
trajectories3DIdeal trajectories to be propagated.
Returns
The true tracks containing the hits generated in this process

Assign mc trajectories to the tracks

Definition at line 48 of file CDCSimpleSimulation.cc.

49{
50 std::vector<SimpleSimHit> simpleSimHits;
51 const size_t nMCTracks = trajectories3D.size();
52
53 for (size_t iMCTrack = 0; iMCTrack < nMCTracks; ++iMCTrack) {
54 const CDCTrajectory3D& trajectory3D = trajectories3D[iMCTrack];
55
56 const UncertainHelix& localHelix = trajectory3D.getLocalHelix();
57 const Vector3D& localOrigin = trajectory3D.getLocalOrigin();
58
59 Helix globalHelix = localHelix;
60 const double arcLength2DOffset = globalHelix.passiveMoveBy(-localOrigin);
61 std::vector<SimpleSimHit> simpleSimHitsForTrajectory = createHits(globalHelix, arcLength2DOffset);
62
63 for (SimpleSimHit& simpleSimHit : simpleSimHitsForTrajectory) {
64 simpleSimHit.m_iMCTrack = iMCTrack;
65 simpleSimHits.push_back(simpleSimHit);
66 }
67 }
68
69 std::vector<CDCTrack> mcTracks = constructMCTracks(nMCTracks, std::move(simpleSimHits));
70
72 for (size_t iMCTrack = 0; iMCTrack < nMCTracks; ++iMCTrack) {
73 CDCTrack& mcTrack = mcTracks[iMCTrack];
74 CDCTrajectory3D mcTrajectory = trajectories3D[iMCTrack];
75 if (not mcTrack.empty()) {
76 mcTrajectory.setLocalOrigin(mcTrack.front().getRecoPos3D());
77 mcTrack.setStartTrajectory3D(mcTrajectory);
78 mcTrajectory.setLocalOrigin(mcTrack.back().getRecoPos3D());
79 mcTrack.setEndTrajectory3D(mcTrajectory);
80 } else {
81 mcTrack.setStartTrajectory3D(mcTrajectory);
82 mcTrack.setEndTrajectory3D(mcTrajectory);
83 }
84 }
85 return mcTracks;
86}
Helix parameter class.
Definition: Helix.h:48
std::vector< SimpleSimHit > createHits(const Helix &globalHelix, double arcLength2DOffset) const
Generate hits for the given helix in starting from the two dimensional arc length.
void setStartTrajectory3D(const CDCTrajectory3D &startTrajectory3D)
Setter for the two dimensional trajectory.
Definition: CDCTrack.h:98
void setEndTrajectory3D(const CDCTrajectory3D &endTrajectory3D)
Setter for the three dimensional trajectory.
Definition: CDCTrack.h:105
Particle full three dimensional trajectory.
const UncertainHelix & getLocalHelix() const
Getter for the helix in local coordinates.
double setLocalOrigin(const Vector3D &localOrigin)
Setter for the origin of the local coordinate system.
const Vector3D & getLocalOrigin() const
Getter for the origin of the local coordinate system.
This class represents an ideal helix in perigee parameterization including the covariance matrix of t...

Member Data Documentation

◆ m_addInWireSignalDelay

bool m_addInWireSignalDelay = false
private

Switch to activate the in wire signal delay.

Definition at line 184 of file CDCSimpleSimulation.h.

◆ m_addTOFDelay

bool m_addTOFDelay = false
private

Switch to activate the addition of the time of flight.

Definition at line 181 of file CDCSimpleSimulation.h.

◆ m_driftLengthSigma

double m_driftLengthSigma = std::sqrt(m_driftLengthVariance)
private

Standard deviation by which the drift length should be smeared.

Definition at line 191 of file CDCSimpleSimulation.h.

◆ m_driftLengthVariance

double m_driftLengthVariance = s_nominalDriftLengthVariance
private

Variance by which the drift length should be smeared.

Definition at line 188 of file CDCSimpleSimulation.h.

◆ m_driftSpeed

double m_driftSpeed = s_nominalDriftSpeed
private

Electron drift speed in the cdc gas.

Definition at line 197 of file CDCSimpleSimulation.h.

◆ m_eventTime

double m_eventTime = 0
private

A global event time.

Definition at line 178 of file CDCSimpleSimulation.h.

◆ m_maxNHitOnWire

int m_maxNHitOnWire = 0
private

Maximal number of hits allowed on each wire (0 means all).

Definition at line 175 of file CDCSimpleSimulation.h.

◆ m_propSpeed

double m_propSpeed = s_nominalPropSpeed
private

Electrical current propagation speed in the wires.

Definition at line 194 of file CDCSimpleSimulation.h.

◆ m_sharedWireHits

std::shared_ptr<const std::vector<CDCWireHit> > m_sharedWireHits
private

Space for the memory of the generated wire hits.

Definition at line 163 of file CDCSimpleSimulation.h.

◆ s_nominalDriftLengthVariance

const double s_nominalDriftLengthVariance = 0.000169
private

Default drift length variance.

Definition at line 166 of file CDCSimpleSimulation.h.

◆ s_nominalDriftSpeed

const double s_nominalDriftSpeed = 4e-3
private

Default electron drift speed in cdc gas - 4 * 10^-3 cm / ns.

Definition at line 172 of file CDCSimpleSimulation.h.

◆ s_nominalPropSpeed

const double s_nominalPropSpeed = 27.25
private

Default in wire signal propagation speed - 27.25 cm / ns.

Definition at line 169 of file CDCSimpleSimulation.h.


The documentation for this class was generated from the following files: