CMS 3D CMS Logo

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