CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/RecoTracker/NuclearSeedGenerator/interface/NuclearTester.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00007 //-----------------------------------------------------------------------------
00008 #ifndef CD_NuclearTester_H_
00009 #define CD_NuclearTester_H_
00010 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h"
00011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00012 #include "FWCore/Framework/interface/EventSetup.h"
00013 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00014 #include "TrackingTools/PatternTools/interface/MeasurementEstimator.h"
00015 
00016 class NuclearTester {
00017 private:
00018 
00019   typedef TrajectoryMeasurement TM;
00020   typedef std::vector<TM> TMContainer;
00021   typedef TrajectoryMeasurement::ConstRecHitPointer    ConstRecHitPointer;
00022   typedef std::pair<TrajectoryMeasurement, TMContainer > TMPair;
00023   typedef std::vector< TMPair >  TMPairVector;
00024 
00025 public :
00026   NuclearTester(unsigned int max_hits, const MeasurementEstimator* est, const TrackerGeometry* track_geom); 
00027 
00028   bool isNuclearInteraction();
00029 
00030   double meanHitDistance(const std::vector<TrajectoryMeasurement>& vecTM) const;
00031 
00032   std::vector<GlobalPoint> HitPositions(const std::vector<TrajectoryMeasurement>& vecTM) const;
00033 
00034   double fwdEstimate(const std::vector<TrajectoryMeasurement>& vecTM) const;
00035 
00036   std::vector<TM>::const_iterator lastValidTM(const std::vector<TM>& vecTM) const;
00037 
00038   void push_back(const TM & init_tm, const TMContainer & vecTM) { 
00039              allTM.push_back(std::make_pair(init_tm, vecTM) ); 
00040              compatible_hits.push_back(vecTM.size()); 
00041   }
00042 
00043   const TMContainer& back() const { return allTM.back().second; }
00044 
00045   double meanHitDistance() const { return meanHitDistance( back() ); }
00046 
00047   double fwdEstimate() const { return fwdEstimate( back() ); }
00048 
00049   void reset(unsigned int nMeasurements) { 
00050                allTM.clear(); 
00051                compatible_hits.clear(); 
00052                maxHits = (nMeasurements < maxHits) ? nMeasurements : maxHits; 
00053   }
00054 
00055   int nuclearIndex() const { return NuclearIndex; }
00056 
00057   const TMPair& goodTMPair() const { return *(allTM.begin()+nuclearIndex()-1); }
00058 
00059   unsigned int nHitsChecked() const { return compatible_hits.size(); }
00060 
00061   std::vector<int> compatibleHits() const { return compatible_hits; }
00062   
00063 private :
00064 
00065   // data members
00066   TMPairVector allTM;
00067   std::vector< int > compatible_hits;
00068   int NuclearIndex;
00069 
00070   // input parameters
00071   unsigned int maxHits;
00072   const MeasurementEstimator*     theEstimator;
00073   const TrackerGeometry*          trackerGeom;
00074 
00075   bool checkWithMultiplicity();
00076 };
00077 #endif