RecoTBCalo
EcalTBTDCReconstructor
src
EcalTBTDCRawInfoDumper.cc
Go to the documentation of this file.
1
#include "
RecoTBCalo/EcalTBTDCReconstructor/interface/EcalTBTDCRawInfoDumper.h
"
2
#include "
TBDataFormats/EcalTBObjects/interface/EcalTBTDCRawInfo.h
"
3
#include "
DataFormats/Common/interface/EDCollection.h
"
4
#include "
DataFormats/Common/interface/Handle.h
"
5
#include "
FWCore/Framework/interface/ESHandle.h
"
6
#include "
FWCore/Framework/interface/EventSetup.h
"
7
8
#include <TFile.h>
9
#include <
FWCore/Framework/interface/MakerMacros.h
>
10
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
11
12
EcalTBTDCRawInfoDumper::EcalTBTDCRawInfoDumper
(
edm::ParameterSet
const
& ps) {
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
18
EcalTBTDCRawInfoDumper::~EcalTBTDCRawInfoDumper
() {}
19
20
//========================================================================
21
void
EcalTBTDCRawInfoDumper::beginJob
() {
22
//========================================================================
23
h_TDCrawValue_
=
new
TH1F(
"h_TDCrawValue"
,
"TDC raw value"
, 2048, -0.5, 2047.5);
24
}
25
26
//========================================================================
27
void
EcalTBTDCRawInfoDumper::endJob
() {
28
//========================================================================
29
TFile
f
(
rootfile_
.c_str(),
"RECREATE"
);
30
h_TDCrawValue_
->Write();
31
f
.Close();
32
}
33
34
void
EcalTBTDCRawInfoDumper::analyze
(
const
edm::Event
&
e
,
const
edm::EventSetup
& es) {
35
// Get input
36
edm::Handle<EcalTBTDCRawInfo>
ecalRawTDC;
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
}
Handle.h
MessageLogger.h
edm::Handle::product
T const * product() const
Definition:
Handle.h:70
EcalTBTDCRawInfoDumper::beginJob
void beginJob() override
Definition:
EcalTBTDCRawInfoDumper.cc:21
EcalTBTDCRawInfoDumper::rawInfoProducer_
std::string rawInfoProducer_
Definition:
EcalTBTDCRawInfoDumper.h:26
ESHandle.h
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
EcalTBTDCRawInfoDumper.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle
Definition:
AssociativeIterator.h:50
EcalTBTDCRawInfoDumper::rootfile_
std::string rootfile_
Definition:
EcalTBTDCRawInfoDumper.h:28
EcalTBTDCRawInfoDumper::rawInfoCollection_
std::string rawInfoCollection_
Definition:
EcalTBTDCRawInfoDumper.h:27
MakerMacros.h
EcalTBTDCRawInfoDumper::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
EcalTBTDCRawInfoDumper.cc:34
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:47
EcalTBTDCRawInfoDumper::endJob
void endJob() override
Definition:
EcalTBTDCRawInfoDumper.cc:27
EcalTBTDCRawInfo.h
EcalTBTDCRawInfo
Definition:
EcalTBTDCRawInfo.h:13
EcalTBTDCRawInfoDumper::EcalTBTDCRawInfoDumper
EcalTBTDCRawInfoDumper(const edm::ParameterSet &ps)
Definition:
EcalTBTDCRawInfoDumper.cc:12
EcalTBTDCRawInfoDumper::h_TDCrawValue_
TH1F * h_TDCrawValue_
Definition:
EcalTBTDCRawInfoDumper.h:29
edm::EventSetup
Definition:
EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:123
EcalTBTDCRawInfoDumper::~EcalTBTDCRawInfoDumper
~EcalTBTDCRawInfoDumper() override
Definition:
EcalTBTDCRawInfoDumper.cc:18
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
edm::HandleBase::isValid
bool isValid() const
Definition:
HandleBase.h:70
edm::Event
Definition:
Event.h:73
EDCollection.h
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16