Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:30

0001 #ifndef DTTTrigAnalyzer_H
0002 #define DTTTrigAnalyzer_H
0003 
0004 /** \class DTTTrigAnalyzer
0005  *  Plot the ttrig from the DB
0006  *
0007  *  \author S. Bolognesi - INFN Torino
0008  */
0009 
0010 #include "FWCore/Framework/interface/Frameworkfwd.h"
0011 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0012 #include "FWCore/Framework/interface/ESHandle.h"
0013 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0014 #include "CondFormats/DataRecord/interface/DTTtrigRcd.h"
0015 
0016 #include <string>
0017 #include <fstream>
0018 #include <map>
0019 #include <vector>
0020 
0021 class DTTtrig;
0022 class TFile;
0023 class TH1D;
0024 
0025 class DTTTrigAnalyzer : public edm::one::EDAnalyzer<> {
0026 public:
0027   /// Constructor
0028   DTTTrigAnalyzer(const edm::ParameterSet& pset);
0029 
0030   /// Destructor
0031   virtual ~DTTTrigAnalyzer();
0032 
0033   /// Operations
0034   //Read the DTGeometry and teh t0 DB
0035   virtual void beginRun(const edm::Run&, const edm::EventSetup& setup);
0036   void analyze(const edm::Event& event, const edm::EventSetup& setup) {}
0037   //Do the real work
0038   void endJob();
0039 
0040 protected:
0041 private:
0042   std::string getHistoName(const DTWireId& lId) const;
0043   std::string getDistribName(const DTWireId& wId) const;
0044 
0045   // The file which will contain the histos
0046   TFile* theFile;
0047 
0048   //The t0 map
0049   const DTTtrig* tTrigMap;
0050 
0051   //The k factor
0052   //double kfactor;
0053 
0054   // Map of the ttrig, tmean, sigma histos by wheel/sector/SL
0055   std::map<std::pair<int, int>, TH1D*> theTTrigHistoMap;
0056   std::map<std::pair<int, int>, TH1D*> theTMeanHistoMap;
0057   std::map<std::pair<int, int>, TH1D*> theSigmaHistoMap;
0058   std::map<std::pair<int, int>, TH1D*> theKFactorHistoMap;
0059   // Map of the ttrig, tmean, sigma distributions by wheel/station/SL
0060   std::map<std::vector<int>, TH1D*> theTTrigDistribMap;
0061   std::map<std::vector<int>, TH1D*> theTMeanDistribMap;
0062   std::map<std::vector<int>, TH1D*> theSigmaDistribMap;
0063   std::map<std::vector<int>, TH1D*> theKFactorDistribMap;
0064 
0065   edm::ESGetToken<DTTtrig, DTTtrigRcd> ttrigToken_;
0066 };
0067 #endif