Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DTT0Analyzer_H
0002 #define DTT0Analyzer_H
0003 
0004 /** \class DTT0Analyzer
0005  *  Plot the t0 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 "FWCore/Utilities/interface/ESGetToken.h"
0014 #include "DataFormats/MuonDetId/interface/DTLayerId.h"
0015 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0016 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0017 #include "CondFormats/DataRecord/interface/DTT0Rcd.h"
0018 #include "CondFormats/DTObjects/interface/DTT0.h"
0019 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0020 
0021 #include <string>
0022 #include <fstream>
0023 #include <vector>
0024 
0025 class DTT0;
0026 class TFile;
0027 class TH1D;
0028 
0029 class DTT0Analyzer : public edm::one::EDAnalyzer<> {
0030 public:
0031   /// Constructor
0032   DTT0Analyzer(const edm::ParameterSet& pset);
0033 
0034   /// Destructor
0035   virtual ~DTT0Analyzer();
0036 
0037   /// Operations
0038   //Read the DTGeometry and the t0 DB
0039   virtual void beginRun(const edm::Run&, const edm::EventSetup& setup);
0040   void analyze(const edm::Event& event, const edm::EventSetup& setup) {}
0041   //Do the real work
0042   void endJob();
0043 
0044 protected:
0045 private:
0046   std::string getHistoName(const DTLayerId& lId) const;
0047 
0048   //The DTGeometry
0049   edm::ESHandle<DTGeometry> dtGeom;
0050 
0051   // The file which will contain the histos
0052   TFile* theFile;
0053 
0054   //The t0 map
0055   const DTT0* tZeroMap;
0056 
0057   // Map of the t0 and sigma histos by layer
0058   std::map<DTLayerId, TH1D*> theMeanHistoMap;
0059   std::map<DTLayerId, TH1D*> theSigmaHistoMap;
0060 
0061   edm::ESGetToken<DTT0, DTT0Rcd> t0Token_;
0062   edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
0063 };
0064 #endif