File indexing completed on 2024-04-06 12:26:10
0001 #ifndef DTANALYZER_H
0002 #define DTANALYZER_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0018 namespace edm {
0019 class ParameterSet;
0020 class Event;
0021 class EventSetup;
0022 }
0023
0024
0025 #include "DataFormats/Common/interface/Handle.h"
0026 class TFile;
0027 class TH1F;
0028 class TH2F;
0029 class DTLayerId;
0030 class DTSuperLayerId;
0031 class DTChamberId;
0032 class DTTTrigBaseSync;
0033 class DTGeometry;
0034 class MuonGeometryRecord;
0035
0036
0037 #include <iosfwd>
0038 #include <bitset>
0039
0040
0041
0042
0043
0044 class DTSegAnalyzer : public edm::one::EDAnalyzer<> {
0045 public:
0046
0047 DTSegAnalyzer(const edm::ParameterSet& pset);
0048
0049
0050 ~DTSegAnalyzer();
0051
0052
0053 void analyze(const edm::Event& event, const edm::EventSetup& eventSetup);
0054
0055 private:
0056 void analyzeDTHits(const edm::Event& event, const edm::EventSetup& eventSetup);
0057 void analyzeDTSegments(const edm::Event& event, const edm::EventSetup& eventSetup);
0058
0059 TH1F* histo(const std::string& name) const;
0060 TH2F* histo2d(const std::string& name) const;
0061
0062 void createTH1F(const std::string& name,
0063 const std::string& title,
0064 const std::string& suffix,
0065 int nbin,
0066 const double& binMin,
0067 const double& binMax) const;
0068
0069 void createTH2F(const std::string& name,
0070 const std::string& title,
0071 const std::string& suffix,
0072 int nBinX,
0073 const double& binXMin,
0074 const double& binXMax,
0075 int nBinY,
0076 const double& binYMin,
0077 const double& binYMax) const;
0078
0079 std::string toString(const DTLayerId& id) const;
0080 std::string toString(const DTSuperLayerId& id) const;
0081 std::string toString(const DTChamberId& id) const;
0082 template <class T>
0083 std::string hName(const std::string& s, const T& id) const;
0084
0085 private:
0086 bool debug;
0087 int _ev;
0088 std::string theRootFileName;
0089 TFile* theFile;
0090
0091 std::string theRecHits4DLabel;
0092 std::string theRecHits2DLabel;
0093 std::string theRecHits1DLabel;
0094
0095 bool doHits;
0096 bool doSegs;
0097
0098 std::unique_ptr<DTTTrigBaseSync> theSync;
0099 edm::ESGetToken<DTGeometry, MuonGeometryRecord> theDTGeomToken;
0100 };
0101 #endif