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