33 #include <Math/VectorUtil.h>
79 iConfig.getUntrackedParameter<std::
string>(
"HistOutFile", std::
string(
"AlCaElectronsTest.root"))) {
88 fs->
make<TH2F>(
"m_barrelGlobalCrystalsMap",
"m_barrelGlobalCrystalsMap", 171, -85, 86, 360, 0, 360);
90 fs->
make<TH2F>(
"m_barrelLocalCrystalsMap",
"m_barrelLocalCrystalsMap", 20, -10, 10, 20, -10, 10);
92 fs->
make<TH2F>(
"m_endcapGlobalCrystalsMap",
"m_endcapGlobalCrystalsMap", 100, 0, 100, 100, 0, 100);
94 fs->
make<TH2F>(
"m_endcapLocalCrystalsMap",
"m_endcapLocalCrystalsMap", 20, -10, 10, 20, -10, 10);
96 fs->
make<TH2F>(
"m_barrelGlobalCrystalsEnergy",
"m_barrelGlobalCrystalsEnergy", 171, -85, 86, 360, 0, 360);
98 fs->
make<TH2F>(
"m_barrelLocalCrystalsEnergy",
"m_barrelLocalCrystalsEnergy", 20, -10, 10, 20, -10, 10);
100 fs->
make<TH2F>(
"m_endcapGlobalCrystalsEnergy",
"m_endcapGlobalCrystalsEnergy", 100, 0, 100, 100, 0, 100);
102 fs->
make<TH2F>(
"m_endcapLocalCrystalsEnergy",
"m_endcapLocalCrystalsEnergy", 20, -10, 10, 20, -10, 10);
104 fs->
make<TH2F>(
"m_barrelGlobalCrystalsEnergyMap",
"m_barrelGlobalCrystalsEnergyMap", 171, -85, 86, 360, 0, 360);
106 fs->
make<TH2F>(
"m_endcapGlobalCrystalsEnergyMap",
"m_endcapGlobalCrystalsEnergyMap", 100, 0, 100, 100, 0, 100);
113 edm::LogVerbatim(
"ElectronsTest") <<
"[AlCaElectronsTest] analysing event " << iEvent.
id();
119 if (!barrelRecHitsHandle.
isValid()) {
122 edm::LogError(
"ElectronsTest") <<
"[AlCaElectronsTest] caught std::exception in rertieving " << labels.
module;
131 fillAroundBarrel(barrelHitsCollection, barrelMaxId.ieta(), barrelMaxId.iphi());
137 if (!endcapRecHitsHandle.
isValid()) {
140 edm::LogError(
"ElectronsTest") <<
"[AlCaElectronsTest] caught std::exception in rertieving " << labels.
module;
159 if (elem->energy() >
energy) {
160 energy = elem->energy();
171 EBDetId elementId = elem->id();
183 EEDetId elementId = elem->id();
static const std::string kSharedResource
Log< level::Info, true > LogVerbatim
void fillAroundBarrel(const EcalRecHitCollection *recHits, int eta, int phi)
TH2F * m_endcapGlobalCrystalsEnergyMap
ECAL EnergyMap.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< EcalRecHit >::const_iterator const_iterator
TH2F * m_endcapGlobalCrystalsEnergy
ECAL Energy.
~AlCaElectronsTest()=default
T * make(const Args &...args) const
make new ROOT object
Log< level::Error, false > LogError
std::string m_outputFileName
int iphi() const
get the crystal iphi
TH2F * m_endcapLocalCrystalsEnergy
local Energy
TH2F * m_barrelGlobalCrystalsMap
ECAL map.
edm::EDGetTokenT< EERecHitCollection > m_endcapAlCa
int ieta() const
get the crystal ieta
TH2F * m_barrelLocalCrystalsMap
local map
void fillAroundEndcap(const EcalRecHitCollection *recHits, int ics, int ips)
const_iterator end() const
DetId id() const
get the id
T const * product() const
TH2F * m_endcapGlobalCrystalsMap
ECAL map.
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
TH2F * m_barrelGlobalCrystalsEnergyMap
ECAL EnergyMap.
AlCaElectronsTest(const edm::ParameterSet &)
TH2F * m_barrelGlobalCrystalsEnergy
ECAL Energy.
edm::EDGetTokenT< EBRecHitCollection > m_barrelAlCa
EcalRecHit getMaximum(const EcalRecHitCollection *recHits)
TH2F * m_barrelLocalCrystalsEnergy
local Energy
const_iterator begin() const
TH2F * m_endcapLocalCrystalsMap
local map