Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DTTTrigWriter_H
0002 #define DTTTrigWriter_H
0003 
0004 /* Program to evaluate ttrig and sigma ttrig from TB histograms
0005  *  and write the results to a file for each SL
0006  
0007  *  \author S. Bolognesi
0008  */
0009 
0010 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0011 #include "FWCore/Framework/interface/ESHandle.h"
0012 // #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
0013 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0014 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0015 
0016 #include <string>
0017 
0018 namespace edm {
0019   class ParameterSet;
0020   class Event;
0021   class EventSetup;
0022 }  // namespace edm
0023 
0024 class TFile;
0025 class DTTimeBoxFitter;
0026 class DTSuperLayerId;
0027 class DTTtrig;
0028 
0029 class DTTTrigWriter : public edm::one::EDAnalyzer<> {
0030 public:
0031   /// Constructor
0032   DTTTrigWriter(const edm::ParameterSet& pset);
0033 
0034   /// Destructor
0035   ~DTTTrigWriter() override;
0036 
0037   // Operations
0038 
0039   /// Compute the ttrig by fiting the TB rising edge
0040   void analyze(const edm::Event& event, const edm::EventSetup& eventSetup) override;
0041 
0042   /// Write ttrig in the DB
0043   void endJob() override;
0044 
0045 protected:
0046 private:
0047   // Generate the time box name
0048   std::string getTBoxName(const DTSuperLayerId& slId) const;
0049 
0050   // Debug flag
0051   bool debug;
0052   // the kfactor to be uploaded in the ttrig DB
0053   double kFactor;
0054 
0055   // The file which contains the tMax histograms
0056   TFile* theFile;
0057 
0058   // The name of the input root file which contains the tMax histograms
0059   std::string theRootInputFile;
0060 
0061   // The fitter
0062   DTTimeBoxFitter* theFitter;
0063 
0064   // The object to be written to DB
0065   DTTtrig* tTrig;
0066 
0067   //geom
0068   edm::ESHandle<DTGeometry> dtGeom;
0069   const edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
0070 };
0071 #endif