CMS 3D CMS Logo

ZdcTBAnalyzer.cc
Go to the documentation of this file.
1 
2 
9 
16 #include "TFile.h"
17 #include "TTree.h"
18 #include "TH1.h"
19 #include <iostream>
20 #include <memory>
21 
23 public:
24  explicit ZdcTBAnalyzer(const edm::ParameterSet&);
25  ~ZdcTBAnalyzer() override;
26  void analyze(const edm::Event&, const edm::EventSetup&) override;
27  void endJob() override;
28 
29 private:
37 
43 };
44 
46  tok_zdc_ = consumes<ZDCRecHitCollection>(iConfig.getParameter<edm::InputTag>("zdcRecHitCollectionTag"));
47  tok_tb_ = consumes<HcalTBTriggerData>(iConfig.getParameter<edm::InputTag>("hcalTBTriggerDataTag"));
48  tok_timing_ = consumes<HcalTBTiming>(iConfig.getParameter<edm::InputTag>("hcalTBTimingTag"));
49  tok_bc_ = consumes<HcalTBBeamCounters>(iConfig.getParameter<edm::InputTag>("hcalTBBeamCountersTag"));
50  tok_pos_ = consumes<HcalTBEventPosition>(iConfig.getParameter<edm::InputTag>("hcalTBEventPositionTag"));
51 
52  std::cout << "**************** ZdcTBAnalizer Start**************************" << std::endl;
53  edm::ParameterSet para = iConfig.getParameter<edm::ParameterSet>("ZdcTBAnalyzer");
54 
55  beamDetectorsADCInfo = para.getParameter<bool>("beamDetectorsADCInfoFlag");
56  beamDetectorsTDCInfo = para.getParameter<bool>("beamDetectorsTDCInfoFlag");
57  wireChambersInfo = para.getParameter<bool>("wireChambersInfoFlag");
58  triggerInfo = para.getParameter<bool>("triggerInfoFlag");
59  outputFileName = para.getParameter<std::string>("ntupleOutputFileName");
61 }
62 
64 
66  using namespace edm;
72 
73  e.getByToken(tok_zdc_, zdcRecHits);
74  if (triggerInfo) {
75  e.getByToken(tok_tb_, triggers);
76  zdcTBAnalysis.analyze(*triggers);
77  }
79  e.getByToken(tok_timing_, times); // e.getByLabel("tbunpacker2",times);
80  zdcTBAnalysis.analyze(*times);
81  }
83  e.getByToken(tok_bc_, bc);
85  }
86  if (wireChambersInfo) {
87  e.getByToken(tok_pos_, chpos);
88  zdcTBAnalysis.analyze(*chpos);
89  }
90  zdcTBAnalysis.analyze(*zdcRecHits);
92 }
93 
96  std::cout << "****************ZdcTBAnalizer End**************************" << std::endl;
97 }
98 
99 //define this as a plug-in
void endJob() override
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string inputFileName
bool beamDetectorsTDCInfo
std::string outputFileName
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< HcalTBBeamCounters > tok_bc_
void analyze(const ZDCRecHitCollection &hf)
void setup(const std::string &histoFileName)
Definition: ZdcTBAnalysis.cc:8
edm::EDGetTokenT< HcalTBTriggerData > tok_tb_
bool beamDetectorsADCInfo
edm::EDGetTokenT< HcalTBEventPosition > tok_pos_
ZdcTBAnalysis zdcTBAnalysis
~ZdcTBAnalyzer() override
HLT enums.
edm::EDGetTokenT< ZDCRecHitCollection > tok_zdc_
edm::EDGetTokenT< HcalTBTiming > tok_timing_
ZdcTBAnalyzer(const edm::ParameterSet &)