CMS 3D CMS Logo

NuclearTester.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
7 //-----------------------------------------------------------------------------
8 #ifndef CD_NuclearTester_H_
9 #define CD_NuclearTester_H_
15 
17 private:
19  typedef std::vector<TM> TMContainer;
21  typedef std::pair<TrajectoryMeasurement, TMContainer> TMPair;
22  typedef std::vector<TMPair> TMPairVector;
23 
24 public:
25  NuclearTester(unsigned int max_hits, const MeasurementEstimator* est, const TrackerGeometry* track_geom);
26 
27  bool isNuclearInteraction();
28 
29  double meanHitDistance(const std::vector<TrajectoryMeasurement>& vecTM) const;
30 
31  std::vector<GlobalPoint> HitPositions(const std::vector<TrajectoryMeasurement>& vecTM) const;
32 
33  double fwdEstimate(const std::vector<TrajectoryMeasurement>& vecTM) const;
34 
35  std::vector<TM>::const_iterator lastValidTM(const std::vector<TM>& vecTM) const;
36 
37  void push_back(const TM& init_tm, const TMContainer& vecTM) {
38  allTM.push_back(std::make_pair(init_tm, vecTM));
39  compatible_hits.push_back(vecTM.size());
40  }
41 
42  const TMContainer& back() const { return allTM.back().second; }
43 
44  double meanHitDistance() const { return meanHitDistance(back()); }
45 
46  double fwdEstimate() const { return fwdEstimate(back()); }
47 
48  void reset(unsigned int nMeasurements) {
49  allTM.clear();
50  compatible_hits.clear();
51  maxHits = (nMeasurements < maxHits) ? nMeasurements : maxHits;
52  }
53 
54  int nuclearIndex() const { return NuclearIndex; }
55 
56  const TMPair& goodTMPair() const { return *(allTM.begin() + nuclearIndex() - 1); }
57 
58  unsigned int nHitsChecked() const { return compatible_hits.size(); }
59 
60  std::vector<int> compatibleHits() const { return compatible_hits; }
61 
62 private:
63  // data members
65  std::vector<int> compatible_hits;
67 
68  // input parameters
69  unsigned int maxHits;
72 
73  bool checkWithMultiplicity();
74 };
75 #endif
TMPairVector allTM
Definition: NuclearTester.h:64
std::vector< int > compatible_hits
Definition: NuclearTester.h:65
std::vector< TM >::const_iterator lastValidTM(const std::vector< TM > &vecTM) const
bool checkWithMultiplicity()
const MeasurementEstimator * theEstimator
Definition: NuclearTester.h:70
std::pair< TrajectoryMeasurement, TMContainer > TMPair
Definition: NuclearTester.h:21
std::vector< TMPair > TMPairVector
Definition: NuclearTester.h:22
std::vector< TM > TMContainer
Definition: NuclearTester.h:19
const TMPair & goodTMPair() const
Definition: NuclearTester.h:56
bool isNuclearInteraction()
void push_back(const TM &init_tm, const TMContainer &vecTM)
Definition: NuclearTester.h:37
std::vector< GlobalPoint > HitPositions(const std::vector< TrajectoryMeasurement > &vecTM) const
const TMContainer & back() const
Definition: NuclearTester.h:42
void reset(unsigned int nMeasurements)
Definition: NuclearTester.h:48
std::vector< int > compatibleHits() const
Definition: NuclearTester.h:60
unsigned int nHitsChecked() const
Definition: NuclearTester.h:58
unsigned int maxHits
Definition: NuclearTester.h:69
TrajectoryMeasurement::ConstRecHitPointer ConstRecHitPointer
Definition: NuclearTester.h:20
TrackingRecHit::ConstRecHitPointer ConstRecHitPointer
double meanHitDistance() const
Definition: NuclearTester.h:44
NuclearTester(unsigned int max_hits, const MeasurementEstimator *est, const TrackerGeometry *track_geom)
Definition: NuclearTester.cc:5
const TrackerGeometry * trackerGeom
Definition: NuclearTester.h:71
Class used to test if a track has interacted nuclearly.
Definition: NuclearTester.h:16
TrajectoryMeasurement TM
Definition: NuclearTester.h:18
int nuclearIndex() const
Definition: NuclearTester.h:54
double fwdEstimate() const
Definition: NuclearTester.h:46