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
ZdcTBAnalyzer::wireChambersInfo
bool wireChambersInfo
Definition: ZdcTBAnalyzer.cc:34
ZdcTBAnalysis::fillTree
void fillTree()
Definition: ZdcTBAnalysis.cc:302
HcalTBTiming.h
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
HcalTBTriggerData.h
ZdcTBAnalysis::analyze
void analyze(const ZDCRecHitCollection &hf)
Definition: ZdcTBAnalysis.cc:241
gather_cfg.cout
cout
Definition: gather_cfg.py:144
ZdcTBAnalyzer
Definition: ZdcTBAnalyzer.cc:22
ZdcTBAnalyzer::triggerInfo
bool triggerInfo
Definition: ZdcTBAnalyzer.cc:35
ZdcTBAnalyzer::tok_zdc_
edm::EDGetTokenT< ZDCRecHitCollection > tok_zdc_
Definition: ZdcTBAnalyzer.cc:38
EDAnalyzer.h
ZdcTBAnalyzer::beamDetectorsADCInfo
bool beamDetectorsADCInfo
Definition: ZdcTBAnalyzer.cc:32
edm::Handle
Definition: AssociativeIterator.h:50
ZdcTBAnalyzer::tok_pos_
edm::EDGetTokenT< HcalTBEventPosition > tok_pos_
Definition: ZdcTBAnalyzer.cc:42
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
ZdcTBAnalyzer::tok_bc_
edm::EDGetTokenT< HcalTBBeamCounters > tok_bc_
Definition: ZdcTBAnalyzer.cc:41
MakerMacros.h
ZdcTBAnalysis::done
void done()
Definition: ZdcTBAnalysis.cc:304
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ZdcTBAnalyzer::beamDetectorsTDCInfo
bool beamDetectorsTDCInfo
Definition: ZdcTBAnalyzer.cc:33
ZdcTBAnalyzer::tok_timing_
edm::EDGetTokenT< HcalTBTiming > tok_timing_
Definition: ZdcTBAnalyzer.cc:40
ZdcTBAnalyzer::outputFileName
std::string outputFileName
Definition: ZdcTBAnalyzer.cc:30
HcalTBBeamCounters.h
ZdcTBAnalyzer::zdcTBAnalysis
ZdcTBAnalysis zdcTBAnalysis
Definition: ZdcTBAnalyzer.cc:36
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
ZdcTBAnalyzer::inputFileName
std::string inputFileName
Definition: ZdcTBAnalyzer.cc:31
ZdcTBAnalysis::setup
void setup(const std::string &histoFileName)
Definition: ZdcTBAnalysis.cc:8
edm::EventSetup
Definition: EventSetup.h:58
ZdcTBAnalyzer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: ZdcTBAnalyzer.cc:65
InputTag.h
Frameworkfwd.h
HcalTBEventPosition.h
ZdcTBAnalysis
Definition: ZdcTBAnalysis.h:132
ZdcTBAnalyzer::tok_tb_
edm::EDGetTokenT< HcalTBTriggerData > tok_tb_
Definition: ZdcTBAnalyzer.cc:39
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HcalRecHitCollections.h
ZdcTBAnalyzer::~ZdcTBAnalyzer
~ZdcTBAnalyzer() override
Definition: ZdcTBAnalyzer.cc:63
ZdcTBAnalyzer::ZdcTBAnalyzer
ZdcTBAnalyzer(const edm::ParameterSet &)
Definition: ZdcTBAnalyzer.cc:45
ParameterSet.h
ZdcTBAnalyzer::endJob
void endJob() override
Definition: ZdcTBAnalyzer.cc:94
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
ZdcTBAnalysis.h