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
MeasurementEstimator
Definition: MeasurementEstimator.h:19
NuclearTester::theEstimator
const MeasurementEstimator * theEstimator
Definition: NuclearTester.h:70
TrackerGeometry.h
NuclearTester::TMContainer
std::vector< TM > TMContainer
Definition: NuclearTester.h:19
NuclearTester::TMPair
std::pair< TrajectoryMeasurement, TMContainer > TMPair
Definition: NuclearTester.h:21
TrajectoryMeasurement.h
NuclearTester::push_back
void push_back(const TM &init_tm, const TMContainer &vecTM)
Definition: NuclearTester.h:37
NuclearTester::TMPairVector
std::vector< TMPair > TMPairVector
Definition: NuclearTester.h:22
NuclearTester::trackerGeom
const TrackerGeometry * trackerGeom
Definition: NuclearTester.h:71
NuclearTester::TM
TrajectoryMeasurement TM
Definition: NuclearTester.h:18
NuclearTester::allTM
TMPairVector allTM
Definition: NuclearTester.h:64
NuclearTester::goodTMPair
const TMPair & goodTMPair() const
Definition: NuclearTester.h:56
NuclearTester::nuclearIndex
int nuclearIndex() const
Definition: NuclearTester.h:54
MeasurementEstimator.h
NuclearTester::lastValidTM
std::vector< TM >::const_iterator lastValidTM(const std::vector< TM > &vecTM) const
Definition: NuclearTester.cc:132
NuclearTester::back
const TMContainer & back() const
Definition: NuclearTester.h:42
NuclearTester::nHitsChecked
unsigned int nHitsChecked() const
Definition: NuclearTester.h:58
NuclearTester::fwdEstimate
double fwdEstimate() const
Definition: NuclearTester.h:46
NuclearTester::maxHits
unsigned int maxHits
Definition: NuclearTester.h:69
NuclearTester::compatible_hits
std::vector< int > compatible_hits
Definition: NuclearTester.h:65
NuclearTester::compatibleHits
std::vector< int > compatibleHits() const
Definition: NuclearTester.h:60
NuclearTester::isNuclearInteraction
bool isNuclearInteraction()
Definition: NuclearTester.cc:11
NuclearTester::ConstRecHitPointer
TrajectoryMeasurement::ConstRecHitPointer ConstRecHitPointer
Definition: NuclearTester.h:20
NuclearTester::checkWithMultiplicity
bool checkWithMultiplicity()
Definition: NuclearTester.cc:39
NuclearTester
Class used to test if a track has interacted nuclearly.
Definition: NuclearTester.h:16
TrajectoryMeasurement::ConstRecHitPointer
TrackingRecHit::ConstRecHitPointer ConstRecHitPointer
Definition: TrajectoryMeasurement.h:28
NuclearTester::meanHitDistance
double meanHitDistance() const
Definition: NuclearTester.h:44
EventSetup.h
NuclearTester::NuclearTester
NuclearTester(unsigned int max_hits, const MeasurementEstimator *est, const TrackerGeometry *track_geom)
Definition: NuclearTester.cc:5
NuclearTester::HitPositions
std::vector< GlobalPoint > HitPositions(const std::vector< TrajectoryMeasurement > &vecTM) const
Definition: NuclearTester.cc:94
NuclearTester::NuclearIndex
int NuclearIndex
Definition: NuclearTester.h:66
ParameterSet.h
NuclearTester::reset
void reset(unsigned int nMeasurements)
Definition: NuclearTester.h:48
TrajectoryMeasurement
Definition: TrajectoryMeasurement.h:25
TrackerGeometry
Definition: TrackerGeometry.h:14