CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
22 
24 
25  public:
26  explicit ZdcTBAnalyzer(const edm::ParameterSet&);
28  virtual void analyze(const edm::Event&, const edm::EventSetup&);
29  virtual void endJob();
30 
31 private:
39 
45 };
46 
48  zdcRecHitCollectionTag(iConfig.getParameter<edm::InputTag>("zdcRecHitCollectionTag")),
49  hcalTBTriggerDataTag(iConfig.getParameter<edm::InputTag>("hcalTBTriggerDataTag")),
50  hcalTBTimingTag(iConfig.getParameter<edm::InputTag>("hcalTBTimingTag")),
51  hcalTBBeamCountersTag(iConfig.getParameter<edm::InputTag>("hcalTBBeamCountersTag")),
52  hcalTBEventPositionTag(iConfig.getParameter<edm::InputTag>("hcalTBEventPositionTag"))
53 {
54  std::cout<<"**************** ZdcTBAnalizer Start**************************"<<std::endl;
55  edm::ParameterSet para = iConfig.getParameter<edm::ParameterSet>("ZdcTBAnalyzer");
56 
57  beamDetectorsADCInfo = para.getParameter<bool>("beamDetectorsADCInfoFlag");
58  beamDetectorsTDCInfo = para.getParameter<bool>("beamDetectorsTDCInfoFlag");
59  wireChambersInfo = para.getParameter<bool>("wireChambersInfoFlag");
60  triggerInfo = para.getParameter<bool>("triggerInfoFlag");
61  outputFileName = para.getParameter<std::string>("ntupleOutputFileName");
62  zdcTBAnalysis.setup(outputFileName);
63 }
64 
66 
68  using namespace edm;
74 
75  e.getByLabel(zdcRecHitCollectionTag, zdcRecHits);
76  if(triggerInfo){
79  }
81  e.getByLabel(hcalTBTimingTag, times); // e.getByLabel("tbunpacker2",times);
83  }
87  }
88  if(wireChambersInfo){
90  zdcTBAnalysis.analyze(*chpos);
91  }
92  zdcTBAnalysis.analyze(*zdcRecHits);
94 }
95 
98 std::cout<<"****************ZdcTBAnalizer End**************************"<<std::endl;
99 }
100 
101 //define this as a plug-in
T getParameter(std::string const &) const
std::string inputFileName
bool beamDetectorsTDCInfo
std::string outputFileName
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void analyze(const ZDCRecHitCollection &hf)
void setup(const std::string &histoFileName)
Definition: ZdcTBAnalysis.cc:8
virtual void analyze(const edm::Event &, const edm::EventSetup &)
edm::InputTag hcalTBBeamCountersTag
bool beamDetectorsADCInfo
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
edm::InputTag hcalTBTimingTag
virtual void endJob()
edm::InputTag hcalTBEventPositionTag
ZdcTBAnalysis zdcTBAnalysis
tuple cout
Definition: gather_cfg.py:121
edm::InputTag hcalTBTriggerDataTag
edm::InputTag zdcRecHitCollectionTag
ZdcTBAnalyzer(const edm::ParameterSet &)