CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/RecoTracker/DeDx/plugins/DeDxDiscriminatorLearner.h

Go to the documentation of this file.
00001 #ifndef TrackRecoDeDx_DeDxDiscriminatorLearner_H
00002 #define TrackRecoDeDx_DeDxDiscriminatorLearner_H
00003 
00004 #include "FWCore/Framework/interface/Frameworkfwd.h"
00005 #include "FWCore/Framework/interface/Event.h"
00006 #include "FWCore/Framework/interface/MakerMacros.h"
00007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00008 
00009 #include "CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h"
00010 #include "CondFormats/PhysicsToolsObjects/interface/Histogram3D.h"
00011 
00012 #include "TrackingTools/PatternTools/interface/Trajectory.h"
00013 #include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h"
00014 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00015 
00016 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit1D.h"
00017 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h"
00018 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2D.h"
00019 
00020 #include "RecoTracker/DeDx/interface/DeDxDiscriminatorTools.h"
00021 
00022 #include "TFile.h"
00023 #include "TH3F.h"
00024 #include <ext/hash_map>
00025 
00026 //using namespace edm;
00027 //using namespace reco;
00028 //using namespace std;
00029 //using namespace __gnu_cxx;
00030 
00031 
00032 class DeDxDiscriminatorLearner : public ConditionDBWriter<PhysicsTools::Calibration::HistogramD3D> {
00033 
00034 public:
00035 
00036   explicit DeDxDiscriminatorLearner(const edm::ParameterSet&);
00037   ~DeDxDiscriminatorLearner();
00038 
00039 private:
00040   virtual void algoBeginJob(const edm::EventSetup&) ;
00041   virtual void algoAnalyze(const edm::Event&, const edm::EventSetup&);
00042   virtual void algoEndJob();
00043 
00044   void         Learn(const SiStripCluster*   cluster, TrajectoryStateOnSurface trajState);
00045 
00046   PhysicsTools::Calibration::HistogramD3D * getNewObject();
00047 
00048 
00049   // ----------member data ---------------------------
00050   edm::InputTag                     m_trajTrackAssociationTag;
00051   edm::InputTag                     m_tracksTag;
00052 
00053   bool   usePixel;
00054   bool   useStrip;
00055   double MeVperADCPixel;
00056   double MeVperADCStrip;
00057 
00058   const TrackerGeometry* m_tracker;
00059 
00060   double       MinTrackMomentum;
00061   double       MaxTrackMomentum;
00062   double       MinTrackEta;
00063   double       MaxTrackEta;
00064   unsigned int MaxNrStrips;
00065   unsigned int MinTrackHits;
00066   double       MaxTrackChiOverNdf;
00067 
00068 
00069   double P_Min;
00070   double P_Max;
00071   int    P_NBins; 
00072   double Path_Min;
00073   double Path_Max;
00074   int    Path_NBins;
00075   double Charge_Min;
00076   double Charge_Max;
00077   int    Charge_NBins;
00078 
00079 
00080   std::string       algoMode;
00081   std::string       HistoFile;
00082 
00083   TH3F*        Charge_Vs_Path;
00084 
00085 private :
00086   struct stModInfo{int DetId; int SubDet; float Eta; float R; float Thickness; int NAPV; };
00087 
00088   class isEqual{
00089   public:
00090     template <class T> bool operator () (const T& PseudoDetId1, const T& PseudoDetId2) { return PseudoDetId1==PseudoDetId2; }
00091   };
00092 
00093   __gnu_cxx::hash_map<unsigned int, stModInfo*,  __gnu_cxx::hash<unsigned int>, isEqual > MODsColl;
00094 };
00095 
00096 #endif
00097