CMS 3D CMS Logo

EcalTBTDCRawInfoDumper.cc
Go to the documentation of this file.
7 
8 #include <TFile.h>
11 
13 {
14  rawInfoCollection_ = ps.getParameter<std::string>("rawInfoCollection");
15  rawInfoProducer_ = ps.getParameter<std::string>("rawInfoProducer");
16  rootfile_ = ps.getUntrackedParameter<std::string>("rootfile","ecalTDCRawInfoPlots.root");
17 }
18 
20 }
21 
22 //========================================================================
23 void
25 {
26  //========================================================================
27  h_TDCrawValue_ = new TH1F("h_TDCrawValue","TDC raw value",2048,-0.5,2047.5);
28 }
29 
30 //========================================================================
31 void
33 //========================================================================
34  TFile f(rootfile_.c_str(),"RECREATE");
35  h_TDCrawValue_->Write();
36  f.Close();
37 }
38 
40 {
41  // Get input
43  const EcalTBTDCRawInfo* tdcRawInfo = nullptr;
44  //evt.getByLabel( digiProducer_, digiCollection_, pDigis);
45  e.getByLabel( rawInfoProducer_, ecalRawTDC);
46  if (!ecalRawTDC.isValid()) {
47  edm::LogError("EcalTBTDCRecInfoError") << "Error! can't get the product " << rawInfoCollection_.c_str() ;
48  } else {
49  tdcRawInfo = ecalRawTDC.product();
50  }
51 
52 
53  if (tdcRawInfo)
54  {
55  int tdcd = (*tdcRawInfo)[0].tdcValue();
56  h_TDCrawValue_->Fill(tdcd);
57  }
58  // Create empty output
59 }
60 
61 
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void analyze(const edm::Event &, const edm::EventSetup &) override
double f[11][100]
bool isValid() const
Definition: HandleBase.h:74
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:535
T const * product() const
Definition: Handle.h:81
EcalTBTDCRawInfoDumper(const edm::ParameterSet &ps)