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 
8 
15 #include "TFile.h"
16 #include "TTree.h"
17 #include "TH1.h"
18 #include <iostream>
19 #include <memory>
20 
21 
23 
24  public:
25  explicit ZdcTBAnalyzer(const edm::ParameterSet&);
27  virtual void analyze(const edm::Event&, const edm::EventSetup&);
28  virtual void endJob();
29 
30 private:
31  std::string outputFileName;
32  std::string inputFileName;
38 };
39 
41 {
42  std::cout<<"**************** ZdcTBAnalizer Start**************************"<<std::endl;
43  edm::ParameterSet para = iConfig.getParameter<edm::ParameterSet>("ZdcTBAnalyzer");
44 
45  beamDetectorsADCInfo = para.getParameter<bool>("beamDetectorsADCInfoFlag");
46  beamDetectorsTDCInfo = para.getParameter<bool>("beamDetectorsTDCInfoFlag");
47  wireChambersInfo = para.getParameter<bool>("wireChambersInfoFlag");
48  triggerInfo = para.getParameter<bool>("triggerInfoFlag");
49  outputFileName = para.getParameter<std::string>("ntupleOutputFileName");
50  zdcTBAnalysis.setup(outputFileName);
51 }
52 
54 
56  using namespace edm;
62 
63  e.getByType(zdcRecHits);
64  if(triggerInfo){
67  }
69  e.getByType(times); // e.getByLabel("tbunpacker2",times);
71  }
73  e.getByType(bc);
75  }
76  if(wireChambersInfo){
77  e.getByType(chpos);
78  zdcTBAnalysis.analyze(*chpos);
79  }
80  zdcTBAnalysis.analyze(*zdcRecHits);
82 }
83 
86 std::cout<<"****************ZdcTBAnalizer End**************************"<<std::endl;
87 }
88 
89 //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
bool getByType(Handle< PROD > &result) const
Definition: Event.h:398
void analyze(const ZDCRecHitCollection &hf)
void setup(const std::string &histoFileName)
Definition: ZdcTBAnalysis.cc:8
virtual void analyze(const edm::Event &, const edm::EventSetup &)
bool beamDetectorsADCInfo
virtual void endJob()
ZdcTBAnalysis zdcTBAnalysis
tuple cout
Definition: gather_cfg.py:121
ZdcTBAnalyzer(const edm::ParameterSet &)