Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:10

0001 #ifndef DTANALYZER_H
0002 #define DTANALYZER_H
0003 
0004 /** \class DTEffAnalyzer
0005  *
0006  * Description:
0007  *  
0008  *  detailed description
0009  *
0010  * \author : Stefano Lacaprara - INFN LNL <stefano.lacaprara@pd.infn.it>
0011  *
0012  * Modification:
0013  *
0014  */
0015 
0016 /* Base Class Headers */
0017 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0018 namespace edm {
0019   class ParameterSet;
0020   class Event;
0021   class EventSetup;
0022 }  // namespace edm
0023 
0024 /* Collaborating Class Declarations */
0025 #include "DataFormats/Common/interface/Handle.h"
0026 #include "FWCore/Framework/interface/ESHandle.h"
0027 class TFile;
0028 class TH1F;
0029 class TH2F;
0030 class DTLayerId;
0031 class DTSuperLayerId;
0032 class DTChamberId;
0033 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0034 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0035 #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
0036 class DTTTrigBaseSync;
0037 
0038 /* C++ Headers */
0039 #include <iosfwd>
0040 
0041 /* ====================================================================== */
0042 
0043 /* Class DTEffAnalyzer Interface */
0044 
0045 class DTEffAnalyzer : public edm::one::EDAnalyzer<> {
0046 public:
0047   /* Constructor */
0048   DTEffAnalyzer(const edm::ParameterSet& pset);
0049 
0050   /* Destructor */
0051   ~DTEffAnalyzer();
0052 
0053   /* Operations */
0054 
0055   void analyze(const edm::Event& event, const edm::EventSetup& eventSetup);
0056   void beginJob();
0057 
0058 private:
0059   TH1F* histo(const std::string& name) const;
0060   TH2F* histo2d(const std::string& name) const;
0061 
0062   void effSegments(const edm::Event& event, const edm::EventSetup& eventSetup);
0063 
0064   const DTRecSegment4D& getBestSegment(const DTRecSegment4DCollection::range& segs) const;
0065   const DTRecSegment4D* getBestSegment(const DTRecSegment4D* s1, const DTRecSegment4D* s2) const;
0066   bool isGoodSegment(const DTRecSegment4D& seg) const;
0067   LocalPoint interpolate(const DTRecSegment4D& seg1, const DTRecSegment4D& seg3, const DTChamberId& MB2) const;
0068 
0069   void evaluateEff(const DTChamberId& MidId, int bottom, int top) const;
0070 
0071   void createTH1F(const std::string& name,
0072                   const std::string& title,
0073                   const std::string& suffix,
0074                   int nbin,
0075                   const double& binMin,
0076                   const double& binMax) const;
0077 
0078   void createTH2F(const std::string& name,
0079                   const std::string& title,
0080                   const std::string& suffix,
0081                   int nBinX,
0082                   const double& binXMin,
0083                   const double& binXMax,
0084                   int nBinY,
0085                   const double& binYMin,
0086                   const double& binYMax) const;
0087 
0088   std::string toString(const DTChamberId& id) const;
0089   template <class T>
0090   std::string hName(const std::string& s, const T& id) const;
0091 
0092 private:
0093   bool debug;
0094   std::string theRootFileName;
0095   TFile* theFile;
0096   //static std::string theAlgoName;
0097   std::string theDTLocalTriggerLabel;
0098   std::string theRecHits4DLabel;
0099   std::string theRecHits2DLabel;
0100   std::string theRecHits1DLabel;
0101   std::string theSTAMuonLabel;
0102   unsigned int theMinHitsSegment;
0103   double theMinChi2NormSegment;
0104   double theMinCloseDist;
0105 
0106   edm::ESHandle<DTGeometry> dtGeom;
0107   edm::ESGetToken<DTGeometry, MuonGeometryRecord> theDtGeomToken;
0108   edm::Handle<DTRecSegment4DCollection> segs;
0109 
0110 protected:
0111 };
0112 #endif  // DTANALYZER_H