Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:14:36

0001 #ifndef TrackRecoDeDx_DeDxDiscriminatorLearner_H
0002 #define TrackRecoDeDx_DeDxDiscriminatorLearner_H
0003 
0004 #include "FWCore/Framework/interface/Frameworkfwd.h"
0005 #include "FWCore/Framework/interface/Event.h"
0006 #include "FWCore/Framework/interface/MakerMacros.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008 
0009 #include "CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h"
0010 #include "CondFormats/PhysicsToolsObjects/interface/Histogram3D.h"
0011 
0012 #include "TrackingTools/PatternTools/interface/Trajectory.h"
0013 #include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h"
0014 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0015 
0016 #include "RecoTracker/DeDx/interface/DeDxTools.h"
0017 
0018 #include "TFile.h"
0019 #include "TH3F.h"
0020 
0021 #include <memory>
0022 
0023 class DeDxDiscriminatorLearner : public ConditionDBWriter<PhysicsTools::Calibration::HistogramD3D> {
0024 public:
0025   explicit DeDxDiscriminatorLearner(const edm::ParameterSet&);
0026   ~DeDxDiscriminatorLearner() override;
0027 
0028 private:
0029   void algoBeginJob(const edm::EventSetup&) override;
0030   void algoAnalyze(const edm::Event&, const edm::EventSetup&) override;
0031   void algoEndJob() override;
0032 
0033   void processHit(const TrackingRecHit* recHit,
0034                   float trackMomentum,
0035                   float& cosine,
0036                   const TrajectoryStateOnSurface& trajState);
0037   void algoAnalyzeTheTree(const edm::EventSetup& iSetup);
0038 
0039   std::unique_ptr<PhysicsTools::Calibration::HistogramD3D> getNewObject() override;
0040 
0041   // ----------member data ---------------------------
0042   edm::EDGetTokenT<TrajTrackAssociationCollection> m_trajTrackAssociationTag;
0043   edm::EDGetTokenT<reco::TrackCollection> m_tracksTag;
0044 
0045   edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> m_tkGeomToken;
0046 
0047   float MinTrackMomentum;
0048   float MaxTrackMomentum;
0049   float MinTrackEta;
0050   float MaxTrackEta;
0051   unsigned int MaxNrStrips;
0052   unsigned int MinTrackHits;
0053   float MaxTrackChiOverNdf;
0054 
0055   float P_Min;
0056   float P_Max;
0057   int P_NBins;
0058   float Path_Min;
0059   float Path_Max;
0060   int Path_NBins;
0061   float Charge_Min;
0062   float Charge_Max;
0063   int Charge_NBins;
0064 
0065   std::vector<std::string> VInputFiles;
0066   std::string algoMode;
0067   std::string HistoFile;
0068 
0069   TH3F* Charge_Vs_Path;
0070 
0071   std::string m_calibrationPath;
0072   bool useCalibration;
0073   bool shapetest;
0074 
0075   std::vector<std::vector<float> > calibGains;
0076   unsigned int m_off;
0077 };
0078 
0079 #endif