File indexing completed on 2024-04-06 12:28:27
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef CD_NuclearTester_H_
0009 #define CD_NuclearTester_H_
0010 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h"
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012 #include "FWCore/Framework/interface/EventSetup.h"
0013 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0014 #include "TrackingTools/DetLayers/interface/MeasurementEstimator.h"
0015
0016 class NuclearTester {
0017 private:
0018 typedef TrajectoryMeasurement TM;
0019 typedef std::vector<TM> TMContainer;
0020 typedef TrajectoryMeasurement::ConstRecHitPointer ConstRecHitPointer;
0021 typedef std::pair<TrajectoryMeasurement, TMContainer> TMPair;
0022 typedef std::vector<TMPair> TMPairVector;
0023
0024 public:
0025 NuclearTester(unsigned int max_hits, const MeasurementEstimator* est, const TrackerGeometry* track_geom);
0026
0027 bool isNuclearInteraction();
0028
0029 double meanHitDistance(const std::vector<TrajectoryMeasurement>& vecTM) const;
0030
0031 std::vector<GlobalPoint> HitPositions(const std::vector<TrajectoryMeasurement>& vecTM) const;
0032
0033 double fwdEstimate(const std::vector<TrajectoryMeasurement>& vecTM) const;
0034
0035 std::vector<TM>::const_iterator lastValidTM(const std::vector<TM>& vecTM) const;
0036
0037 void push_back(const TM& init_tm, const TMContainer& vecTM) {
0038 allTM.push_back(std::make_pair(init_tm, vecTM));
0039 compatible_hits.push_back(vecTM.size());
0040 }
0041
0042 const TMContainer& back() const { return allTM.back().second; }
0043
0044 double meanHitDistance() const { return meanHitDistance(back()); }
0045
0046 double fwdEstimate() const { return fwdEstimate(back()); }
0047
0048 void reset(unsigned int nMeasurements) {
0049 allTM.clear();
0050 compatible_hits.clear();
0051 maxHits = (nMeasurements < maxHits) ? nMeasurements : maxHits;
0052 }
0053
0054 int nuclearIndex() const { return NuclearIndex; }
0055
0056 const TMPair& goodTMPair() const { return *(allTM.begin() + nuclearIndex() - 1); }
0057
0058 unsigned int nHitsChecked() const { return compatible_hits.size(); }
0059
0060 std::vector<int> compatibleHits() const { return compatible_hits; }
0061
0062 private:
0063
0064 TMPairVector allTM;
0065 std::vector<int> compatible_hits;
0066 int NuclearIndex;
0067
0068
0069 unsigned int maxHits;
0070 const MeasurementEstimator* theEstimator;
0071 const TrackerGeometry* trackerGeom;
0072
0073 bool checkWithMultiplicity();
0074 };
0075 #endif