Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DTVDriftAnalyzer_H
0002 #define DTVDriftAnalyzer_H
0003 
0004 /** \class DTVDriftAnalyzer
0005  *  Plot the vdrift 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/DTMtimeRcd.h"
0015 #include "CondFormats/DataRecord/interface/DTRecoConditionsVdriftRcd.h"
0016 
0017 #include <string>
0018 #include <fstream>
0019 #include <map>
0020 #include <vector>
0021 
0022 class DTMtime;
0023 class DTRecoConditions;
0024 class TFile;
0025 class TH1D;
0026 
0027 class DTVDriftAnalyzer : public edm::one::EDAnalyzer<> {
0028 public:
0029   /// Constructor
0030   DTVDriftAnalyzer(const edm::ParameterSet& pset);
0031 
0032   /// Destructor
0033   virtual ~DTVDriftAnalyzer();
0034 
0035   /// Operations
0036   //Read the DTGeometry and the vdrift DB
0037   virtual void beginRun(const edm::Run& run, const edm::EventSetup& setup);
0038   void analyze(const edm::Event& event, const edm::EventSetup& setup) {}
0039   //Do the real work
0040   void endJob();
0041 
0042 protected:
0043 private:
0044   std::string getHistoName(const DTWireId& lId) const;
0045   std::string getDistribName(const DTWireId& wId) const;
0046 
0047   // The file which will contain the histos
0048   TFile* theFile;
0049 
0050   //The t0 map
0051   const DTMtime* mTimeMap;             // legacy DB object
0052   const DTRecoConditions* vDriftMap_;  // DB object in new format
0053   bool readLegacyVDriftDB;             // which one to use
0054 
0055   // Map of the vdrift, reso histos by wheel/sector/SL
0056   std::map<std::pair<int, int>, TH1D*> theVDriftHistoMap;
0057   std::map<std::pair<int, int>, TH1D*> theResoHistoMap;
0058   // Map of the vdrift, reso distributions by wheel/station/SL
0059   std::map<std::vector<int>, TH1D*> theVDriftDistribMap;
0060   std::map<std::vector<int>, TH1D*> theResoDistribMap;
0061 
0062   edm::ESGetToken<DTMtime, DTMtimeRcd> mTimeMapToken_;
0063   edm::ESGetToken<DTRecoConditions, DTRecoConditionsVdriftRcd> vDriftMapToken_;
0064 };
0065 #endif