Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:09:05

0001 // -*- C++ -*-
0002 //
0003 //
0004 /**\class dEdxHitAnalyzer dEdxHitAnalyzer.cc 
0005 Monitoring source for general quantities related to track dEdx.
0006 */
0007 // Original Author: Loic Quertenmont 2012/07/25
0008 
0009 #include <memory>
0010 #include <fstream>
0011 
0012 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0013 #include "DQMServices/Core/interface/DQMStore.h"
0014 #include "DataFormats/Common/interface/ValueMap.h"
0015 #include "DataFormats/TrackReco/interface/DeDxHitInfo.h"
0016 #include "DataFormats/TrackReco/interface/Track.h"
0017 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0018 #include "FWCore/Framework/interface/ConsumesCollector.h"
0019 #include "FWCore/Framework/interface/Event.h"
0020 #include "FWCore/Framework/interface/EventSetup.h"
0021 #include "FWCore/Framework/interface/Frameworkfwd.h"
0022 #include "FWCore/Framework/interface/MakerMacros.h"
0023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0024 #include "FWCore/ServiceRegistry/interface/Service.h"
0025 #include "FWCore/Utilities/interface/EDGetToken.h"
0026 
0027 class GenericTriggerEventFlag;
0028 
0029 class dEdxHitAnalyzer : public DQMEDAnalyzer {
0030 public:
0031   explicit dEdxHitAnalyzer(const edm::ParameterSet&);
0032   ~dEdxHitAnalyzer() override;
0033 
0034   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0035 
0036   void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override;
0037   double harmonic2(const reco::DeDxHitInfo* dedxHits);
0038   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0039   void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override;
0040 
0041 private:
0042   // ----------member data ---------------------------
0043   edm::ParameterSet fullconf_;
0044   edm::ParameterSet conf_;
0045 
0046   bool doAllPlots_;
0047   bool doDeDxPlots_;
0048 
0049   struct dEdxMEs {
0050     MonitorElement* ME_StripHitDeDx;
0051     MonitorElement* ME_PixelHitDeDx;
0052     MonitorElement* ME_NHitDeDx;
0053     MonitorElement* ME_Harm2DeDx;
0054 
0055     dEdxMEs() : ME_StripHitDeDx(nullptr), ME_PixelHitDeDx(nullptr), ME_NHitDeDx(nullptr), ME_Harm2DeDx(nullptr) {}
0056   };
0057 
0058   edm::InputTag trackInputTag_;
0059   edm::EDGetTokenT<reco::TrackCollection> trackToken_;
0060 
0061   std::vector<std::string> dEdxInputList_;
0062   std::vector<edm::EDGetTokenT<reco::DeDxHitInfoAss> > dEdxTokenList_;
0063 
0064   std::string TrackName;
0065   std::vector<std::string> AlgoNames;
0066   std::vector<dEdxMEs> dEdxMEsVector;
0067   std::string histname;  //for naming the histograms according to algorithm used
0068 
0069   GenericTriggerEventFlag* genTriggerEventFlag_;
0070 
0071   std::string MEFolderName;
0072 
0073   int dEdxNHitBin;
0074   double dEdxNHitMin;
0075   double dEdxNHitMax;
0076 
0077   int dEdxStripBin;
0078   double dEdxStripMin;
0079   double dEdxStripMax;
0080 
0081   int dEdxPixelBin;
0082   double dEdxPixelMin;
0083   double dEdxPixelMax;
0084 
0085   int dEdxHarm2Bin;
0086   double dEdxHarm2Min;
0087   double dEdxHarm2Max;
0088 };