Belle II Software development
CDCSimpleSimulation.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <tracking/trackFindingCDC/sim/CDCSimpleSimulation.h>
10
11#include <tracking/trackingUtilities/eventdata/tracks/CDCTrack.h>
12
13#include <tracking/trackingUtilities/eventdata/hits/CDCRecoHit3D.h>
14#include <tracking/trackingUtilities/eventdata/hits/CDCRLWireHit.h>
15#include <tracking/trackingUtilities/eventdata/hits/CDCWireHit.h>
16
17#include <cdc/topology/CDCWire.h>
18#include <cdc/topology/CDCWireLayer.h>
19#include <cdc/topology/CDCWireTopology.h>
20
21#include <tracking/trackingUtilities/utilities/VectorRange.h>
22
23#include <framework/gearbox/Const.h>
24#include <framework/logging/Logger.h>
25
26#include <Math/Vector3D.h>
27#include <Math/Vector2D.h>
28#include <TRandom.h>
29
30#include <algorithm>
31
32using namespace Belle2;
33using namespace CDC;
34using namespace TrackFindingCDC;
35using namespace TrackingUtilities;
36
37ConstVectorRange<CDCWireHit> CDCSimpleSimulation::getWireHits() const
38{
39 if (m_sharedWireHits) {
40 return {m_sharedWireHits->begin(), m_sharedWireHits->end()};
41 } else {
42 return ConstVectorRange<CDCWireHit>();
43 }
44}
45
47{
48 return std::move(simulate(std::vector<CDCTrajectory3D>(1, trajectory3D)).front());
49}
50
51
52std::vector<CDCTrack> CDCSimpleSimulation::simulate(const std::vector<CDCTrajectory3D>& trajectories3D)
53{
54 std::vector<SimpleSimHit> simpleSimHits;
55 const size_t nMCTracks = trajectories3D.size();
56
57 for (size_t iMCTrack = 0; iMCTrack < nMCTracks; ++iMCTrack) {
58 const CDCTrajectory3D& trajectory3D = trajectories3D[iMCTrack];
59
60 const UncertainHelix& localHelix = trajectory3D.getLocalHelix();
61 const ROOT::Math::XYZVector& localOrigin = trajectory3D.getLocalOrigin();
62
63 Helix globalHelix = localHelix;
64 const double arcLength2DOffset = globalHelix.passiveMoveBy(-localOrigin);
65 std::vector<SimpleSimHit> simpleSimHitsForTrajectory = createHits(globalHelix, arcLength2DOffset);
66
67 for (SimpleSimHit& simpleSimHit : simpleSimHitsForTrajectory) {
68 simpleSimHit.m_iMCTrack = iMCTrack;
69 simpleSimHits.push_back(simpleSimHit);
70 }
71 }
72
73 std::vector<CDCTrack> mcTracks = constructMCTracks(nMCTracks, std::move(simpleSimHits));
74
76 for (size_t iMCTrack = 0; iMCTrack < nMCTracks; ++iMCTrack) {
77 CDCTrack& mcTrack = mcTracks[iMCTrack];
78 CDCTrajectory3D mcTrajectory = trajectories3D[iMCTrack];
79 if (not mcTrack.empty()) {
80 mcTrajectory.setLocalOrigin(mcTrack.front().getRecoPos3D());
81 mcTrack.setStartTrajectory3D(mcTrajectory);
82 mcTrajectory.setLocalOrigin(mcTrack.back().getRecoPos3D());
83 mcTrack.setEndTrajectory3D(mcTrajectory);
84 } else {
85 mcTrack.setStartTrajectory3D(mcTrajectory);
86 mcTrack.setEndTrajectory3D(mcTrajectory);
87 }
88 }
89 return mcTracks;
90}
91
92std::vector<CDCTrack>
93CDCSimpleSimulation::constructMCTracks(int nMCTracks, std::vector<SimpleSimHit> simpleSimHits)
94{
95
96 // Sort the hits along side their wire hits
97 std::stable_sort(simpleSimHits.begin(), simpleSimHits.end(),
98 [](const SimpleSimHit & lhs, const SimpleSimHit & rhs) -> bool {
99 return lhs.m_wireHit < rhs.m_wireHit;
100 });
101
102 // Discard multiple hits on the same wire up to the maximal exceeding the maximal desired number
103 if (m_maxNHitOnWire > 0) {
104 const CDCWire* lastWire = nullptr;
105 size_t nSameWire = 0;
106 const size_t maxNHitOnWire = m_maxNHitOnWire;
107
108 auto exceedsMaxNHitOnWire =
109 [&lastWire, &nSameWire, maxNHitOnWire](const SimpleSimHit & simpleSimHit) -> bool {
110
111 if (&(simpleSimHit.m_wireHit.getWire()) == lastWire)
112 {
113 ++nSameWire;
114 } else
115 {
116 nSameWire = 1;
117 lastWire = &(simpleSimHit.m_wireHit.getWire());
118 }
119 return nSameWire > maxNHitOnWire ? true : false;
120 };
121
122 auto itLast = std::remove_if(simpleSimHits.begin(), simpleSimHits.end(), exceedsMaxNHitOnWire);
123 simpleSimHits.erase(itLast, simpleSimHits.end());
124 }
125
126 // Write the created hits and move them to the their storage place.
127 {
128 std::vector<CDCWireHit> wireHits;
129 wireHits.reserve(simpleSimHits.size());
130 for (SimpleSimHit& simpleSimHit : simpleSimHits) {
131 wireHits.push_back(simpleSimHit.m_wireHit);
132 }
133
134 B2ASSERT("WireHits should be sorted as a result from sorting the SimpleSimHits. "
135 "Algorithms may relay on the sorting o the WireHits",
136 std::is_sorted(wireHits.begin(), wireHits.end()));
137
138 m_sharedWireHits.reset(new const std::vector<CDCWireHit>(std::move(wireHits)));
139 }
140
141 // TODO: Decide if the EventMeta should be incremented after write.
142
143 // Now construct the tracks.
144 std::vector<CDCTrack> mcTracks;
145 mcTracks.resize(nMCTracks);
146 ConstVectorRange<CDCWireHit> wireHits = getWireHits();
147 const size_t nWireHits = wireHits.size();
148
149 for (size_t iWireHit = 0; iWireHit < nWireHits; ++iWireHit) {
150 const CDCWireHit& wireHit = wireHits[iWireHit];
151 const SimpleSimHit& simpleSimHit = simpleSimHits[iWireHit];
152
153 CDCTrack& mcTrack = mcTracks[simpleSimHit.m_iMCTrack];
154
155 CDCRLWireHit rlWireHit(&wireHit, simpleSimHit.m_rlInfo);
156 CDCRecoHit3D recoHit3D(rlWireHit, simpleSimHit.m_pos3D, simpleSimHit.m_arcLength2D);
157 mcTrack.push_back(recoHit3D);
158 }
159
161 for (CDCTrack& mcTrack : mcTracks) {
162 mcTrack.sortByArcLength2D();
163 }
164
165 return mcTracks;
166}
167
168
169
170std::vector<CDCSimpleSimulation::SimpleSimHit>
172 double arcLength2DOffset) const
173{
174
175 std::vector<SimpleSimHit> simpleSimHits;
176
178 const double outerWallCylinderR = wireTopology.getOuterCylindricalR();
179
180 const double minR = globalHelix.minimalCylindricalR();
181 const double maxR = globalHelix.maximalCylindricalR();
182
183 const double globalArcLength2DToOuterWall = globalHelix.arcLength2DToCylindricalR(outerWallCylinderR);
184 const double localArcLength2DToOuterWall = arcLength2DOffset + globalArcLength2DToOuterWall;
185
186 if (localArcLength2DToOuterWall < 0) {
187 // Trajectory starts outside the CDC and initially flys away from it
188 // Do not try to createHit hits for it
189 B2WARNING("Simple simulation got trajectory outside CDC that moves away from the detector.");
190 return simpleSimHits;
191 }
192
193 // Two dimensional arc length where the trajectory
194 // * leaves the outer wall of the CDC or
195 // * made a full circle (cut off for curlers)
196 const bool isCurler = std::isnan(localArcLength2DToOuterWall);
197 const double perimeterXY = globalHelix.perimeterXY();
198 const double maxArcLength2D = isCurler ? fabs(perimeterXY) : localArcLength2DToOuterWall;
199
200 if (isCurler) {
201 B2INFO("Simulating curler");
202 }
203
204 for (const CDCWireLayer& wireLayer : wireTopology.getWireLayers()) {
205 double outerR = wireLayer.getOuterCylindricalR();
206 double innerR = wireLayer.getInnerCylindricalR();
207
208 if ((maxR < innerR) or (outerR < minR)) {
209 // Trajectory does not reaching the layer
210 continue;
211 }
212
213 double centerR = (std::min(outerR, maxR) + std::max(innerR, minR)) / 2;
214
215 double globalArcLength2D = globalHelix.arcLength2DToCylindricalR(centerR);
216 double localArcLength2D = arcLength2DOffset + globalArcLength2D;
217
218
219 std::vector<SimpleSimHit> simpleSimHitsInLayer;
220 if (localArcLength2D > 0 and localArcLength2D < maxArcLength2D) {
221
222 ROOT::Math::XYZVector pos3DAtLayer = globalHelix.atArcLength2D(globalArcLength2D);
223 const CDCWire& closestWire = wireLayer.getClosestWire(pos3DAtLayer);
224
225 simpleSimHitsInLayer = createHitsForLayer(closestWire, globalHelix, arcLength2DOffset);
226
227 for (SimpleSimHit& simpleSimHit : simpleSimHitsInLayer) {
228 if (simpleSimHit.m_arcLength2D < maxArcLength2D) {
229 simpleSimHits.push_back(simpleSimHit);
230 }
231 }
232 } else {
233 B2INFO("Arc length to long");
234 }
235
236 bool oneSegment = outerR > maxR or innerR < minR;
237 if (not oneSegment) {
238
239 // Check the second branch for more hits
240 double secondGlobalArcLength2D = -globalArcLength2D;
241 double secondArcLength2DOffset = arcLength2DOffset;
242 double secondLocalArcLength2D = secondArcLength2DOffset + secondGlobalArcLength2D;
243
244 if (isCurler and secondLocalArcLength2D < 0) {
245 secondLocalArcLength2D += perimeterXY;
246 secondArcLength2DOffset += perimeterXY;
247 secondGlobalArcLength2D += perimeterXY;
248 }
249
250 if (secondLocalArcLength2D > 0 and secondLocalArcLength2D < maxArcLength2D) {
251 ROOT::Math::XYZVector pos3DAtLayer = globalHelix.atArcLength2D(secondGlobalArcLength2D);
252 const CDCWire& closestWire = wireLayer.getClosestWire(pos3DAtLayer);
253
254 // Check again if the wire has been hit before
255 bool wireAlreadyHit = false;
256 for (const SimpleSimHit& simpleSimHit : simpleSimHits) {
257 if (simpleSimHit.m_wireHit.isOnWire(closestWire)) {
258 wireAlreadyHit = true;
259 }
260 }
261 if (not wireAlreadyHit) {
262 std::vector<SimpleSimHit> secondSimpleSimHitsInLayer =
263 createHitsForLayer(closestWire, globalHelix, secondArcLength2DOffset);
264
265 for (SimpleSimHit& simpleSimHit : secondSimpleSimHitsInLayer) {
266 if (simpleSimHit.m_arcLength2D < maxArcLength2D) {
267 simpleSimHits.push_back(simpleSimHit);
268 }
269 }
270 }
271 }
272 }
273 }
274
275 return simpleSimHits;
276}
277
278std::vector<CDCSimpleSimulation::SimpleSimHit>
280 const Helix& globalHelix,
281 double arcLength2DOffset) const
282{
283 std::vector<SimpleSimHit> result;
284
285 SimpleSimHit simpleSimHit = createHitForCell(nearWire, globalHelix, arcLength2DOffset);
286 if (not std::isnan(simpleSimHit.m_wireHit.getRefDriftLength())) {
287 result.push_back(simpleSimHit);
288 }
289
291 const CDCWire* ccwWire = nearWire.getNeighborCCW();
292 while (true) {
293 SimpleSimHit simpleSimHitForWire = createHitForCell(*ccwWire, globalHelix, arcLength2DOffset);
294 if (std::isnan(simpleSimHitForWire.m_arcLength2D) or
295 std::isnan(simpleSimHitForWire.m_trueDriftLength)) {
296 break;
297 }
298 result.push_back(simpleSimHitForWire);
299 ccwWire = ccwWire->getNeighborCCW();
300 }
301
303 const CDCWire* cwWire = nearWire.getNeighborCW();
304 while (true) {
305 SimpleSimHit simpleSimHitForWire = createHitForCell(*cwWire, globalHelix, arcLength2DOffset);
306 if (std::isnan(simpleSimHitForWire.m_arcLength2D) or
307 std::isnan(simpleSimHitForWire.m_trueDriftLength)) {
308 break;
309 }
310 result.push_back(simpleSimHitForWire);
311 cwWire = cwWire->getNeighborCW();
312 }
313
314 return result;
315}
316
317
320 const Helix& globalHelix,
321 double arcLength2DOffset) const
322{
323 double arcLength2D = globalHelix.arcLength2DToXY(wire.getRefPos2D());
324 if ((arcLength2D + arcLength2DOffset) < 0) {
325 arcLength2D += globalHelix.perimeterXY();
326 }
327
328 ROOT::Math::XYZVector pos3D = globalHelix.atArcLength2D(arcLength2D);
329
330 ROOT::Math::XYZVector correctedPos3D = pos3D;
331 ROOT::Math::XYVector correctedWirePos(wire.getWirePos2DAtZ(correctedPos3D.z()));
332 double correctedArcLength2D = arcLength2D;
333
334 for (int c_Iter = 0; c_Iter < 2; c_Iter++) {
335 // Iterate the extrapolation to the stereo shifted position.
336 correctedWirePos = wire.getWirePos2DAtZ(correctedPos3D.z());
337 correctedArcLength2D = globalHelix.arcLength2DToXY(correctedWirePos);
338
339 if ((correctedArcLength2D + arcLength2DOffset) < 0) {
340 correctedArcLength2D += globalHelix.perimeterXY();
341 }
342 correctedPos3D = globalHelix.atArcLength2D(correctedArcLength2D);
343 }
344
345 const double trueDriftLength = wire.getDriftLength(correctedPos3D);
346 const double smearedDriftLength = trueDriftLength + gRandom->Gaus(0, m_driftLengthSigma);
347
348 double delayTime = getEventTime();
349 if (m_addTOFDelay) {
350 double arcLength3D = hypot2(1, globalHelix.tanLambda()) * (correctedArcLength2D + arcLength2DOffset);
351 delayTime += arcLength3D / Const::speedOfLight;
352 }
353
355 double backwardZ = wire.getBackwardZ();
356 // Position where wire has been hit
357 ROOT::Math::XYZVector wirePos = wire.getClosest(correctedPos3D);
358 double distanceToBack = (wirePos.z() - backwardZ) * hypot2(1, wire.getTanStereoAngle());
359
360 delayTime += distanceToBack / m_propSpeed;
361 }
362
363 double measuredDriftLength = smearedDriftLength + delayTime * m_driftSpeed;
364
365 ERightLeft rlInfo = globalHelix.circleXY().isRightOrLeft(correctedWirePos);
366
367 // if (not std::isnan(trueDriftLength)){
368 // B2INFO("Delay time " << delayTime);
369 // B2INFO("True dirft length " << trueDriftLength);
370 // B2INFO("Measured drift length " << measuredDriftLength);
371 // B2INFO("Absolute deviation " << measuredDriftLength - trueDriftLength);
372 // B2INFO("Relative deviation " << (measuredDriftLength / trueDriftLength - 1) * 100 << "%");
373 // }
374
375 return SimpleSimHit{
376 CDCWireHit(wire.getWireID(), measuredDriftLength, m_driftLengthVariance),
377 0,
378 rlInfo,
379 correctedPos3D,
380 correctedArcLength2D,
381 trueDriftLength
382 };
383}
384
385
386std::vector<CDCTrack>
388{
389 const size_t nMCTracks = 2;
390 std::vector<SimpleSimHit> simpleSimHits;
391 simpleSimHits.reserve(128 + 64); // First plus second mc track
392
393 // First MC track
395 size_t iMCTrack = 0;
396
397 // SL 6
398 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 4, 251), 0.104), iMCTrack, ERightLeft::c_Left});
399 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 4, 250), 0.272), iMCTrack, ERightLeft::c_Left});
400 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 4, 249), 0.488), iMCTrack, ERightLeft::c_Left});
401 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 4, 248), 0.764), iMCTrack, ERightLeft::c_Left});
402 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 3, 247), 0.9), iMCTrack, ERightLeft::c_Right});
403 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 4, 247), 1.024), iMCTrack, ERightLeft::c_Left});
404 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 3, 246), 0.64), iMCTrack, ERightLeft::c_Right});
405 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 3, 245), 0.304), iMCTrack, ERightLeft::c_Right});
406 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 3, 244), 0.012), iMCTrack, ERightLeft::c_Right});
407 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 3, 243), 0.352), iMCTrack, ERightLeft::c_Left});
408 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 3, 242), 0.74), iMCTrack, ERightLeft::c_Left});
409 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 2, 241), 0.46), iMCTrack, ERightLeft::c_Right});
410 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 2, 240), 0.02), iMCTrack, ERightLeft::c_Right});
411 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 2, 239), 0.46), iMCTrack, ERightLeft::c_Left});
412 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 2, 238), 0.884), iMCTrack, ERightLeft::c_Left});
413 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 1, 238), 1.104), iMCTrack, ERightLeft::c_Right});
414 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 1, 237), 0.612), iMCTrack, ERightLeft::c_Right});
415 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 1, 236), 0.12), iMCTrack, ERightLeft::c_Right});
416 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 1, 235), 0.356), iMCTrack, ERightLeft::c_Left});
417 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 1, 234), 0.884), iMCTrack, ERightLeft::c_Left});
418 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 0, 235), 1.032), iMCTrack, ERightLeft::c_Right});
419 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 0, 234), 0.52), iMCTrack, ERightLeft::c_Right});
420 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 0, 233), 0.06), iMCTrack, ERightLeft::c_Left});
421 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 0, 232), 0.62), iMCTrack, ERightLeft::c_Left});
422
423 // SL 5
424 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 5, 206), 1.116), iMCTrack, ERightLeft::c_Right});
425 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 5, 205), 0.464), iMCTrack, ERightLeft::c_Right});
426 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 5, 204), 0.168), iMCTrack, ERightLeft::c_Right});
427 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 4, 204), 1.08), iMCTrack, ERightLeft::c_Right});
428 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 4, 203), 0.392), iMCTrack, ERightLeft::c_Right});
429 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 4, 202), 0.304), iMCTrack, ERightLeft::c_Left});
430 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 3, 201), 0.968), iMCTrack, ERightLeft::c_Right});
431 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 3, 200), 0.252), iMCTrack, ERightLeft::c_Right});
432 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 3, 199), 0.476), iMCTrack, ERightLeft::c_Left});
433 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 2, 199), 0.736), iMCTrack, ERightLeft::c_Right});
434 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 2, 198), 0.008), iMCTrack, ERightLeft::c_Left});
435 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 2, 197), 0.788), iMCTrack, ERightLeft::c_Left});
436 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 1, 197), 1.188), iMCTrack, ERightLeft::c_Right});
437 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 1, 196), 0.404), iMCTrack, ERightLeft::c_Right});
438 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 1, 195), 0.356), iMCTrack, ERightLeft::c_Left});
439 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 0, 195), 0.74), iMCTrack, ERightLeft::c_Right});
440 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 0, 194), 0.04), iMCTrack, ERightLeft::c_Left});
441 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 0, 193), 0.832), iMCTrack, ERightLeft::c_Left});
442
443 // SL 4
444 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 5, 173), 0.692), iMCTrack, ERightLeft::c_Right});
445 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 5, 172), 0.22), iMCTrack, ERightLeft::c_Left});
446 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 5, 171), 1.132), iMCTrack, ERightLeft::c_Left});
447 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 4, 172), 0.816), iMCTrack, ERightLeft::c_Right});
448 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 4, 171), 0.136), iMCTrack, ERightLeft::c_Left});
449 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 4, 170), 1.048), iMCTrack, ERightLeft::c_Left});
450 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 3, 170), 0.884), iMCTrack, ERightLeft::c_Right});
451 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 3, 169), 0.032), iMCTrack, ERightLeft::c_Left});
452 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 3, 168), 0.96), iMCTrack, ERightLeft::c_Left});
453 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 2, 169), 0.972), iMCTrack, ERightLeft::c_Right});
454 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 2, 168), 0.044), iMCTrack, ERightLeft::c_Right});
455 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 2, 167), 0.872), iMCTrack, ERightLeft::c_Left});
456 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 1, 167), 1.004), iMCTrack, ERightLeft::c_Right});
457 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 1, 166), 0.1), iMCTrack, ERightLeft::c_Right});
458 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 1, 165), 0.828), iMCTrack, ERightLeft::c_Left});
459 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 0, 166), 1.004), iMCTrack, ERightLeft::c_Right});
460 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 0, 165), 0.084), iMCTrack, ERightLeft::c_Right});
461 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 0, 164), 0.82), iMCTrack, ERightLeft::c_Left});
462
463 // SL 3
464 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 5, 145), 0.508), iMCTrack, ERightLeft::c_Right});
465 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 5, 144), 0.5), iMCTrack, ERightLeft::c_Left});
466 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 4, 145), 1.348), iMCTrack, ERightLeft::c_Right});
467 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 4, 144), 0.292), iMCTrack, ERightLeft::c_Right});
468 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 4, 143), 0.68), iMCTrack, ERightLeft::c_Left});
469 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 3, 143), 1.136), iMCTrack, ERightLeft::c_Right});
470 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 3, 142), 0.12), iMCTrack, ERightLeft::c_Right});
471 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 3, 141), 0.872), iMCTrack, ERightLeft::c_Left});
472 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 2, 142), 0.96), iMCTrack, ERightLeft::c_Right});
473 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 2, 141), 0.036), iMCTrack, ERightLeft::c_Left});
474 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 1, 140), 0.756), iMCTrack, ERightLeft::c_Right});
475 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 1, 139), 0.204), iMCTrack, ERightLeft::c_Left});
476 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 0, 139), 0.588), iMCTrack, ERightLeft::c_Right});
477 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 0, 138), 0.332), iMCTrack, ERightLeft::c_Left});
478
479 // SL 2
480 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 5, 116), 1.1), iMCTrack, ERightLeft::c_Right});
481 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 5, 115), 0.008), iMCTrack, ERightLeft::c_Left});
482 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 5, 114), 1.048), iMCTrack, ERightLeft::c_Left});
483 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 4, 115), 0.712), iMCTrack, ERightLeft::c_Right});
484 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 4, 114), 0.316), iMCTrack, ERightLeft::c_Left});
485 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 3, 113), 0.428), iMCTrack, ERightLeft::c_Right});
486 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 3, 112), 0.572), iMCTrack, ERightLeft::c_Left});
487 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 2, 112), 0.188), iMCTrack, ERightLeft::c_Right});
488 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 2, 111), 0.776), iMCTrack, ERightLeft::c_Left});
489 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 1, 111), 0.92), iMCTrack, ERightLeft::c_Right});
490 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 1, 110), 0.024), iMCTrack, ERightLeft::c_Left});
491 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 1, 109), 0.928), iMCTrack, ERightLeft::c_Left});
492 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 0, 110), 0.776), iMCTrack, ERightLeft::c_Right});
493 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 0, 109), 0.116), iMCTrack, ERightLeft::c_Left});
494 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 0, 108), 0.992), iMCTrack, ERightLeft::c_Left});
495
496 // SL 1
497 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 5, 87), 0.664), iMCTrack, ERightLeft::c_Right});
498 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 5, 86), 0.3), iMCTrack, ERightLeft::c_Left});
499 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 4, 86), 0.504), iMCTrack, ERightLeft::c_Right});
500 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 4, 85), 0.424), iMCTrack, ERightLeft::c_Left});
501 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 3, 85), 1.256), iMCTrack, ERightLeft::c_Right});
502 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 3, 84), 0.388), iMCTrack, ERightLeft::c_Right});
503 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 3, 83), 0.5), iMCTrack, ERightLeft::c_Left});
504 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 2, 84), 1.128), iMCTrack, ERightLeft::c_Right});
505 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 2, 83), 0.28), iMCTrack, ERightLeft::c_Right});
506 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 2, 82), 0.532), iMCTrack, ERightLeft::c_Left});
507 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 1, 82), 1.084), iMCTrack, ERightLeft::c_Right});
508 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 1, 81), 0.3), iMCTrack, ERightLeft::c_Right});
509 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 1, 80), 0.472), iMCTrack, ERightLeft::c_Left});
510 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 0, 81), 1.124), iMCTrack, ERightLeft::c_Right});
511 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 0, 80), 0.428), iMCTrack, ERightLeft::c_Right});
512 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 0, 79), 0.296), iMCTrack, ERightLeft::c_Left});
513 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 0, 78), 0.972), iMCTrack, ERightLeft::c_Left});
514
515 // SL 0
516 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 7, 81), 0.192), iMCTrack, ERightLeft::c_Right});
517 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 7, 80), 0.452), iMCTrack, ERightLeft::c_Left});
518 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 6, 80), 0.596), iMCTrack, ERightLeft::c_Right});
519 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 6, 79), 0.024), iMCTrack, ERightLeft::c_Left});
520 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 6, 78), 0.66), iMCTrack, ERightLeft::c_Left});
521 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 5, 79), 0.388), iMCTrack, ERightLeft::c_Right});
522 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 5, 78), 0.184), iMCTrack, ERightLeft::c_Left});
523 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 4, 77), 0.296), iMCTrack, ERightLeft::c_Right});
524 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 4, 76), 0.244), iMCTrack, ERightLeft::c_Left});
525 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 3, 76), 0.268), iMCTrack, ERightLeft::c_Right});
526 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 3, 75), 0.212), iMCTrack, ERightLeft::c_Left});
527 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 2, 74), 0.316), iMCTrack, ERightLeft::c_Right});
528 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 2, 73), 0.112), iMCTrack, ERightLeft::c_Right});
529 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 2, 72), 0.588), iMCTrack, ERightLeft::c_Left});
530 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 1, 73), 0.464), iMCTrack, ERightLeft::c_Right});
531 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 1, 72), 0.028), iMCTrack, ERightLeft::c_Left});
532 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 0, 70), 0.284), iMCTrack, ERightLeft::c_Right});
533 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 0, 69), 0.088), iMCTrack, ERightLeft::c_Left});
534 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 0, 68), 0.416), iMCTrack, ERightLeft::c_Left});
535
536 // Second MC track
538 iMCTrack = 1;
539
540 // SL 0
541 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 1, 140), 0.308), iMCTrack, ERightLeft::c_Left});
542 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 2, 139), 0.08), iMCTrack, ERightLeft::c_Left});
543 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 3, 139), 0.16), iMCTrack, ERightLeft::c_Right});
544 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 4, 139), 0.404), iMCTrack, ERightLeft::c_Left});
545 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 4, 138), 0.38), iMCTrack, ERightLeft::c_Right});
546 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 5, 139), 0.132), iMCTrack, ERightLeft::c_Left});
547 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 6, 138), 0.108), iMCTrack, ERightLeft::c_Right});
548 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 7, 139), 0.48), iMCTrack, ERightLeft::c_Left});
549 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(0, 7, 138), 0.424), iMCTrack, ERightLeft::c_Right});
550
551 // SL 1
552 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 0, 136), 0.532), iMCTrack, ERightLeft::c_Left});
553 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 0, 135), 0.452), iMCTrack, ERightLeft::c_Right});
554 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 1, 135), 0.396), iMCTrack, ERightLeft::c_Left});
555 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 2, 135), 0.26), iMCTrack, ERightLeft::c_Left});
556 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 1, 134), 0.64), iMCTrack, ERightLeft::c_Right});
557 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 3, 134), 0.092), iMCTrack, ERightLeft::c_Left});
558 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 4, 134), 0.16), iMCTrack, ERightLeft::c_Right});
559 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(1, 5, 133), 0.524), iMCTrack, ERightLeft::c_Right});
560
561 // SL 2
562 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 0, 163), 0.228), iMCTrack, ERightLeft::c_Right});
563 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 1, 162), 0.356), iMCTrack, ERightLeft::c_Right});
564 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 2, 163), 0.776), iMCTrack, ERightLeft::c_Left});
565 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 2, 162), 0.46), iMCTrack, ERightLeft::c_Right});
566 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 3, 162), 0.744), iMCTrack, ERightLeft::c_Left});
567 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 3, 161), 0.58), iMCTrack, ERightLeft::c_Right});
568 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 4, 162), 0.656), iMCTrack, ERightLeft::c_Left});
569 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 4, 161), 0.68), iMCTrack, ERightLeft::c_Right});
570 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 5, 161), 0.568), iMCTrack, ERightLeft::c_Left});
571 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(2, 5, 160), 0.812), iMCTrack, ERightLeft::c_Right});
572
573 // SL 3
574 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 0, 190), 0.54), iMCTrack, ERightLeft::c_Left});
575 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 1, 188), 0.688), iMCTrack, ERightLeft::c_Right});
576 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 2, 188), 0.656), iMCTrack, ERightLeft::c_Right});
577 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 3, 188), 0.664), iMCTrack, ERightLeft::c_Left});
578 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 3, 187), 0.68), iMCTrack, ERightLeft::c_Right});
579 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 4, 188), 0.724), iMCTrack, ERightLeft::c_Left});
580 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 4, 187), 0.656), iMCTrack, ERightLeft::c_Right});
581 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(3, 5, 186), 0.676), iMCTrack, ERightLeft::c_Right});
582
583 // SL 4
584 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 0, 211), 0.42), iMCTrack, ERightLeft::c_Left});
585 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 0, 210), 0.872), iMCTrack, ERightLeft::c_Right});
586 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 1, 210), 0.548), iMCTrack, ERightLeft::c_Left});
587 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 1, 209), 0.796), iMCTrack, ERightLeft::c_Right});
588 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 2, 210), 0.716), iMCTrack, ERightLeft::c_Left});
589 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 2, 209), 0.656), iMCTrack, ERightLeft::c_Right});
590 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 3, 209), 0.856), iMCTrack, ERightLeft::c_Left});
591 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 4, 209), 1.056), iMCTrack, ERightLeft::c_Left});
592 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 4, 208), 0.36), iMCTrack, ERightLeft::c_Right});
593 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(4, 5, 207), 0.232), iMCTrack, ERightLeft::c_Right});
594
595 // SL 5
596 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 0, 231), 0.224), iMCTrack, ERightLeft::c_Left});
597 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 0, 230), 1.088), iMCTrack, ERightLeft::c_Right});
598 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 1, 230), 0.452), iMCTrack, ERightLeft::c_Left});
599 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 1, 229), 0.912), iMCTrack, ERightLeft::c_Right});
600 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 2, 230), 0.72), iMCTrack, ERightLeft::c_Left});
601 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 2, 229), 0.632), iMCTrack, ERightLeft::c_Right});
602 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 3, 229), 1.016), iMCTrack, ERightLeft::c_Left});
603 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 3, 228), 0.34), iMCTrack, ERightLeft::c_Right});
604 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 4, 228), 0.04), iMCTrack, ERightLeft::c_Right});
605 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 5, 227), 0.22), iMCTrack, ERightLeft::c_Left});
606 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(5, 5, 226), 1.196), iMCTrack, ERightLeft::c_Right});
607
608 // SL 6
609 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 0, 254), 0.104), iMCTrack, ERightLeft::c_Left});
610 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 1, 253), 0.504), iMCTrack, ERightLeft::c_Left});
611 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 1, 252), 0.78), iMCTrack, ERightLeft::c_Right});
612 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 2, 253), 0.968), iMCTrack, ERightLeft::c_Left});
613 simpleSimHits.push_back(SimpleSimHit{CDCWireHit(WireID(6, 2, 252), 0.332), iMCTrack, ERightLeft::c_Right});
614
615 std::vector<CDCTrack> mcTracks = constructMCTracks(nMCTracks, std::move(simpleSimHits));
616 return mcTracks;
617}
Class representing a sense wire layer in the central drift chamber.
Class representing the sense wire arrangement in the whole of the central drift chamber.
const std::vector< 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.
Class representing a sense wire in the central drift chamber.
Definition CDCWire.h:50
const ROOT::Math::XYVector & getRefPos2D() const
Getter for the wire reference position for 2D tracking Gives the wire's reference position projected ...
Definition CDCWire.h:221
const WireID & getWireID() const
Getter for the wire id.
Definition CDCWire.h:114
TrackingUtilities::MayBePtr< const CDCWire > getNeighborCCW() const
Gives the closest neighbor in the counterclockwise direction - always exists.
Definition CDCWire.cc:159
ROOT::Math::XYVector getWirePos2DAtZ(const double z) const
Gives the xy projected position of the wire at the given z coordinate.
Definition CDCWire.h:184
double getDriftLength(const ROOT::Math::XYZVector &pos3D) const
Calculates the straight drift length from the position to the wire This is essentially the same as th...
Definition CDCWire.h:206
TrackingUtilities::MayBePtr< const CDCWire > getNeighborCW() const
Gives the closest neighbor in the clockwise direction - always exists.
Definition CDCWire.cc:164
double getTanStereoAngle() const
Getter for the tangents of the stereo angle of the wire.
Definition CDCWire.h:232
double getBackwardZ() const
Getter for the z coordinate at the backward joint points of the wires.
Definition CDCWire.h:272
ROOT::Math::XYZVector getClosest(const ROOT::Math::XYZVector &pos3D) const
Calculates the closest approach in the wire to the position.
Definition CDCWire.h:196
Helix parameter class.
Definition Helix.h:48
static const double speedOfLight
[cm/ns]
Definition Const.h:695
TrackingUtilities::ConstVectorRange< TrackingUtilities::CDCWireHit > getWireHits() const
Getter for the wire hits created in the simulation.
std::shared_ptr< const std::vector< TrackingUtilities::CDCWireHit > > m_sharedWireHits
Space for the memory of the generated wire hits.
std::vector< TrackingUtilities::CDCTrack > constructMCTracks(int nMCTracks, std::vector< SimpleSimHit > simpleSimHits)
Creates TrackingUtilities::CDCWireHits and uses them to construct the true TrackingUtilities::CDCTrac...
bool m_addInWireSignalDelay
Switch to activate the in wire signal delay.
double m_propSpeed
Electrical current propagation speed in the wires.
std::vector< SimpleSimHit > createHits(const TrackingUtilities::Helix &globalHelix, double arcLength2DOffset) const
Generate hits for the given helix in starting from the two dimensional arc length.
std::vector< TrackingUtilities::CDCTrack > simulate(const std::vector< TrackingUtilities::CDCTrajectory3D > &trajectories3D)
Propagates the trajectories through the CDC as without energy loss until they first leave the CDC.
double getEventTime() const
Getter for a global event time offset.
double m_driftLengthVariance
Variance by which the drift length should be smeared.
bool m_addTOFDelay
Switch to activate the addition of the time of flight.
int m_maxNHitOnWire
Maximal number of hits allowed on each wire (0 means all).
double m_driftLengthSigma
Standard deviation by which the drift length should be smeared.
std::vector< TrackingUtilities::CDCTrack > loadPreparedEvent()
Fills the wire hits with a hard coded event from the real simulation.
SimpleSimHit createHitForCell(const CDC::CDCWire &wire, const TrackingUtilities::Helix &globalHelix, double arcLength2DOffset) const
Generate a hit for the given wire.
std::vector< SimpleSimHit > createHitsForLayer(const CDC::CDCWire &nearWire, const TrackingUtilities::Helix &globalHelix, double arcLength2DOffset) const
Generate connected hits for wires in the same layer close to the given wire.
double m_driftSpeed
Electron drift speed in the cdc gas.
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
Class representing a three dimensional reconstructed hit.
Class representing a sequence of three dimensional reconstructed hits.
Definition CDCTrack.h:37
void setStartTrajectory3D(const CDCTrajectory3D &startTrajectory3D)
Setter for the two dimensional trajectory.
Definition CDCTrack.h:94
void setEndTrajectory3D(const CDCTrajectory3D &endTrajectory3D)
Setter for the three dimensional trajectory.
Definition CDCTrack.h:101
Particle full three dimensional trajectory.
double setLocalOrigin(const ROOT::Math::XYZVector &localOrigin)
Setter for the origin of the local coordinate system.
const UncertainHelix & getLocalHelix() const
Getter for the helix in local coordinates.
const ROOT::Math::XYZVector & getLocalOrigin() const
Getter for the origin of the local coordinate system.
Class representing a hit wire in the central drift chamber.
Definition CDCWireHit.h:56
double getRefDriftLength() const
Getter for the drift length at the reference position of the wire.
Definition CDCWireHit.h:225
std::size_t size() const
Returns the total number of objects in this range.
Definition Range.h:76
This class represents an ideal helix in perigee parameterization including the covariance matrix of t...
Class to identify a wire inside the CDC.
Definition WireID.h:34
Abstract base class for different kinds of events.
Structure to accommodate information about the individual hits during the simulation.
double m_arcLength2D
Memory for the true two dimensional arc length on the helix to this hit.
double m_trueDriftLength
Memory for the true drift length from the true position to the wire.
TrackingUtilities::ERightLeft m_rlInfo
Memory for the true right left passage information.
size_t m_iMCTrack
Memory for the true index of the track this hit is contained in.
ROOT::Math::XYZVector m_pos3D
Memory for the true position on the track closest to the wire.
TrackingUtilities::CDCWireHit m_wireHit
Memory for the wire hit instance that will be given to the reconstruction.