|
|
#include <EcalRecHitsValidation.h>
|
void | analyze (const edm::Event &e, const edm::EventSetup &c) override |
| Analyze. More...
|
|
void | bookHistograms (DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override |
|
void | findBarrelMatrix (int nCellInEta, int nCellInPhi, int CentralEta, int CentralPhi, int CentralZ, MapType &themap) |
|
void | findEndcapMatrix (int nCellInX, int nCellInY, int CentralX, int CentralY, int CentralZ, MapType &themap) |
|
uint32_t | getUnitWithMaxEnergy (MapType &themap) |
|
uint64_t | meId () const |
|
|
typedef std::map< uint32_t, float, std::less< uint32_t > > | MapType |
|
Definition at line 43 of file EcalRecHitsValidation.h.
◆ MapType
◆ EcalRecHitsValidation()
◆ ~EcalRecHitsValidation()
EcalRecHitsValidation::~EcalRecHitsValidation |
( |
| ) |
|
|
override |
◆ analyze()
Analyze.
Reimplemented from DQMEDAnalyzer.
Definition at line 291 of file EcalRecHitsValidation.cc.
294 LogInfo(
"EcalRecHitsTask, EventInfo: ") <<
" Run = " <<
e.id().run() <<
" Event = " <<
e.id().event();
300 const double barrelADCtoGeV_ = agc->
getEBValue();
301 const double endcapADCtoGeV_ = agc->
getEEValue();
312 bool skipBarrel =
false;
316 if (EcalUncalibRecHitEB.
isValid()) {
322 bool skipEndcap =
false;
327 if (EcalUncalibRecHitEE.
isValid()) {
355 bool skipPreshower =
false;
361 ESRecHit = EcalRecHitES.
product();
363 skipPreshower =
true;
366 skipPreshower =
true;
372 for (HepMC::GenEvent::particle_const_iterator
p = MCEvt->
GetEvent()->particles_begin();
375 double htheta = (*p)->momentum().theta();
376 double heta = -99999.;
377 if (
tan(htheta * 0.5) > 0) {
378 heta = -
log(
tan(htheta * 0.5));
380 double hphi = (*p)->momentum().phi();
381 hphi = (hphi >= 0) ? hphi : hphi + 2 *
M_PI;
382 hphi = hphi /
M_PI * 180.;
384 LogDebug(
"EventInfo") <<
"EcalRecHitsTask: Particle gun type form MC = " <<
abs((*p)->pdg_id()) <<
"\n"
385 <<
"Energy = " << (*p)->momentum().e() <<
"\n"
386 <<
"Eta = " << heta <<
"\n"
389 if ((*p)->momentum().e() > eGun)
390 eGun = (*p)->momentum().e();
411 const int ebcSize = 90;
412 double ebcontr[ebcSize];
413 double ebcontr25[ebcSize];
414 for (
int i = 0;
i < ebcSize;
i++) {
423 LogDebug(
"SimHitInfo, barrel") <<
"CaloHit " << iHit.getName() <<
" DetID = " << iHit.id() <<
"\n"
424 <<
"Energy = " << iHit.energy() <<
" Time = " << iHit.time() <<
"\n"
425 <<
"EBDetId = " << ebid.
ieta() <<
" " << ebid.
iphi();
427 uint32_t crystid = ebid.
rawId();
428 ebSimMap[crystid] += iHit.energy();
441 ebRecMap[EBid.
rawId()] += myRecHit->energy();
444 ebtotal += myRecHit->energy();
445 if (myRecHit->energy() > 0) {
448 int log10i =
int((log10(myRecHit->energy()) + 5.) * 10.);
449 if (log10i >= 0 and log10i < ebcSize)
450 ebcontr[log10i] += myRecHit->energy();
454 if (ebSimMap[EBid.
rawId()] != 0.) {
455 double uncEnergy = uncalibRecHit->amplitude() * barrelADCtoGeV_;
465 if (ebSimMap[EBid.
rawId()] != 0.) {
478 if (ecs !=
nullptr) {
481 if (csmi != ecs->
end())
483 sc =
csc.getStatusCode();
498 double ttSimEnergy = 0;
499 if (ttMap !=
nullptr) {
502 for (std::vector<DetId>::const_iterator dit =
vid.begin(); dit !=
vid.end(); dit++) {
504 ttSimEnergy += ebSimMap[ttEBid.
rawId()];
507 ttSimEnergy = ttSimEnergy /
vid.size();
512 int flag = myRecHit->recoFlag();
538 int bx = myEBid.ietaAbs();
539 int by = myEBid.iphi();
540 int bz = myEBid.zside();
549 if (log10i25 >= 0 && log10i25 < ebcSize)
562 for (
int i = 0;
i < ebcSize;
i++) {
568 for (
int i = 0;
i < ebcSize;
i++) {
584 const int eecSize = 90;
585 double eecontr[eecSize];
586 double eecontr25[eecSize];
587 for (
int i = 0;
i < eecSize;
i++) {
596 LogDebug(
"Endcap, HitInfo") <<
" CaloHit " << iHit.getName() <<
" DetID = " << iHit.id() <<
"\n"
597 <<
"Energy = " << iHit.energy() <<
" Time = " << iHit.time() <<
"\n"
598 <<
"EEDetId side " << eeid.zside() <<
" = " << eeid.ix() <<
" " << eeid.iy();
600 uint32_t crystid = eeid.rawId();
601 eeSimMap[crystid] += iHit.energy();
614 eeRecMap[EEid.
rawId()] += myRecHit->energy();
617 eetotal += myRecHit->energy();
618 if (myRecHit->energy() > 0) {
621 int log10i =
int((log10(myRecHit->energy()) + 5.) * 10.);
622 if (log10i >= 0 and log10i < eecSize)
623 eecontr[log10i] += myRecHit->energy();
627 if (eeSimMap[EEid.
rawId()] != 0.) {
628 double uncEnergy = uncalibRecHit->amplitude() * endcapADCtoGeV_;
638 if (eeSimMap[EEid.
rawId()] != 0.) {
651 if (ecs !=
nullptr) {
654 if (csmi != ecs->
end())
656 uint16_t sc =
csc.getStatusCode();
668 int flag = myRecHit->recoFlag();
679 if (EEid.
zside() > 0) {
687 if (EEid.
zside() < 0) {
703 int bx = myEEid.ix();
704 int by = myEEid.iy();
705 int bz = myEEid.zside();
714 if (log10i25 >= 0 && log10i25 < eecSize)
727 for (
int i = 0;
i < eecSize;
i++) {
733 for (
int i = 0;
i < eecSize;
i++) {
742 if (!skipPreshower) {
748 const int escSize = 90;
749 double escontr[escSize];
750 for (
int i = 0;
i < escSize;
i++) {
757 LogDebug(
"Preshower, HitInfo") <<
" CaloHit " << iHit.getName() <<
" DetID = " << iHit.id() <<
"\n"
758 <<
"Energy = " << iHit.energy() <<
" Time = " << iHit.time() <<
"\n"
759 <<
"ESDetId strip " << esid.strip() <<
" = " << esid.six() <<
" " << esid.siy();
761 uint32_t crystid = esid.rawId();
762 esSimMap[crystid] += iHit.energy();
768 if (esSimMap[ESid.
rawId()] != 0.) {
770 estotal +=
recHit->energy();
771 if (
recHit->energy() > 0) {
774 int log10i =
int((log10(
recHit->energy()) + 5.) * 10.);
775 if (log10i >= 0 and log10i < escSize)
776 escontr[log10i] +=
recHit->energy();
787 for (
int i = 0;
i < escSize;
i++) {
References funct::abs(), HLT_2018_cff::barrelHits, edm::SortedCollection< T, SORT >::begin(), l1GtPatternGenerator_cfi::bx, HltBtagPostValidation_cff::c, EcalTrigTowerConstituentsMap::constituentsOf(), MillePedeFileConverter_cfg::e, CollectionTags_cfi::EBRecHit, CollectionTags_cfi::EBUncalibRecHit, CollectionTags_cfi::EERecHit, CollectionTags_cfi::EEUncalibRecHit, EcalCondObjectContainer< T >::end(), edm::SortedCollection< T, SORT >::end(), HLT_2018_cff::endcapHits, EcalCondObjectContainer< T >::find(), RemoveAddSevLevel::flag, get, EcalADCToGeVConstant::getEBValue(), EcalADCToGeVConstant::getEEValue(), edm::HepMCProduct::GetEvent(), mps_fire::i, EBDetId::ieta(), EBDetId::ietaAbs(), createfilelist::int, EBDetId::iphi(), edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), EEDetId::ix(), EEDetId::iy(), EcalRecHit::kDead, EcalRecHit::kLeadingEdgeRecovered, EcalRecHit::kNeighboursRecovered, EcalRecHit::kSaturated, EcalRecHit::kTowerRecovered, dqm-mbProfile::log, LogDebug, M_PI, AlCaHLTBitMon_ParallelJobs::p, gedPhotons_cfi::preshowerHits, edm::Handle< T >::product(), edm::ESHandle< T >::product(), DetId::rawId(), rpcPointValidation_cfi::recHit, funct::tan(), EBDetId::tower(), EBDetId::zside(), and EEDetId::zside().
◆ bookHistograms()
Implements DQMEDAnalyzer.
Definition at line 124 of file EcalRecHitsValidation.cc.
127 ibooker.setCurrentFolder(
"EcalRecHitsV/EcalRecHitsTask");
129 histo =
"EcalRecHitsTask Gun Momentum";
132 histo =
"EcalRecHitsTask Gun Eta";
135 histo =
"EcalRecHitsTask Gun Phi";
138 histo =
"EcalRecHitsTask Barrel RecSimHit Ratio";
141 histo =
"EcalRecHitsTask Barrel RecSimHit Ratio gt 3p5 GeV";
144 histo =
"EcalRecHitsTask Barrel Unc RecSimHit Ratio";
147 histo =
"EcalRecHitsTask Barrel RecSimHit Ratio Channel Status=10 11";
150 histo =
"EcalRecHitsTask Barrel RecSimHit Ratio Channel Status=12";
153 histo =
"EcalRecHitsTask Barrel RecSimHit Ratio Channel Status=13";
156 histo =
"EcalRecHitsTask Barrel Unc RecSimHit Ratio gt 3p5 GeV";
159 histo =
"EcalRecHitsTask Barrel Rec E5x5";
162 histo =
"EcalRecHitsTask Barrel Rec E5x5 over Sim E5x5";
165 histo =
"EcalRecHitsTask Barrel Rec E5x5 over gun energy";
169 ibooker.book1D(
"EcalRecHitsTask Barrel Log10 Energy",
"EcalRecHitsTask Barrel Log10 Energy", 90, -5., 4.);
171 "EcalRecHits Barrel Log10En vs Hit Contribution",
179 "EcalRecHits Barrel Log10En5x5 vs Hit Contribution",
187 histo =
"EB Occupancy Flag=5 6";
189 histo =
"EB Occupancy Flag=8 9";
192 histo =
"EcalRecHitsTask Barrel Reco Flags";
194 histo =
"EcalRecHitsTask Barrel RecSimHit Ratio vs SimHit Flag=5 6";
196 histo =
"EcalRecHitsTask Barrel RecSimHit Ratio Flag=6";
198 histo =
"EcalRecHitsTask Barrel RecSimHit Ratio Flag=7";
200 histo =
"EcalRecHitsTask Barrel 5x5 RecSimHit Ratio vs SimHit Flag=8";
204 histo =
"EcalRecHitsTask Preshower RecSimHit Ratio";
207 histo =
"EcalRecHitsTask Endcap RecSimHit Ratio";
210 histo =
"EcalRecHitsTask Endcap RecSimHit Ratio gt 3p5 GeV";
213 histo =
"EcalRecHitsTask Endcap Unc RecSimHit Ratio";
216 histo =
"EcalRecHitsTask Endcap RecSimHit Ratio Channel Status=10 11";
219 histo =
"EcalRecHitsTask Endcap RecSimHit Ratio Channel Status=12";
222 histo =
"EcalRecHitsTask Endcap RecSimHit Ratio Channel Status=13";
225 histo =
"EcalRecHitsTask Endcap Unc RecSimHit Ratio gt 3p5 GeV";
228 histo =
"EcalRecHitsTask Endcap Rec E5x5";
231 histo =
"EcalRecHitsTask Endcap Rec E5x5 over Sim E5x5";
234 histo =
"EcalRecHitsTask Endcap Rec E5x5 over gun energy";
238 ibooker.book1D(
"EcalRecHitsTask Endcap Log10 Energy",
"EcalRecHitsTask Endcap Log10 Energy", 90, -5., 4.);
240 ibooker.book1D(
"EcalRecHitsTask Preshower Log10 Energy",
"EcalRecHitsTask Preshower Log10 Energy", 90, -5., 4.);
243 "EcalRecHits Endcap Log10En vs Hit Contribution",
251 "EcalRecHits Preshower Log10En vs Hit Contribution",
260 "EcalRecHits Endcap Log10En5x5 vs Hit Contribution",
268 histo =
"EE+ Occupancy Flag=5 6";
270 histo =
"EE- Occupancy Flag=5 6";
272 histo =
"EE+ Occupancy Flag=8 9";
274 histo =
"EE- Occupancy Flag=8 9";
277 histo =
"EcalRecHitsTask Endcap Reco Flags";
280 histo =
"EcalRecHitsTask Endcap RecSimHit Ratio vs SimHit Flag=5 6";
283 histo =
"EcalRecHitsTask Endcap RecSimHit Ratio Flag=6";
286 histo =
"EcalRecHitsTask Endcap RecSimHit Ratio Flag=7";
References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::IBooker::bookProfile(), timingPdfMaker::histo, dqm::implementation::NavigatorBase::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.
◆ findBarrelMatrix()
void EcalRecHitsValidation::findBarrelMatrix |
( |
int |
nCellInEta, |
|
|
int |
nCellInPhi, |
|
|
int |
CentralEta, |
|
|
int |
CentralPhi, |
|
|
int |
CentralZ, |
|
|
MapType & |
themap |
|
) |
| |
|
protected |
◆ findEndcapMatrix()
void EcalRecHitsValidation::findEndcapMatrix |
( |
int |
nCellInX, |
|
|
int |
nCellInY, |
|
|
int |
CentralX, |
|
|
int |
CentralY, |
|
|
int |
CentralZ, |
|
|
MapType & |
themap |
|
) |
| |
|
protected |
Definition at line 840 of file EcalRecHitsValidation.cc.
842 int goBackInX = nCellInX / 2;
843 int goBackInY = nCellInY / 2;
846 int startX = CentralX - goBackInX;
847 int startY = CentralY - goBackInY;
849 for (
int ix = startX; ix < startX + nCellInX; ix++) {
850 for (
int iy = startY; iy < startY + nCellInY; iy++) {
References DetId::rawId(), and EEDetId::validDetId().
◆ getUnitWithMaxEnergy()
uint32_t EcalRecHitsValidation::getUnitWithMaxEnergy |
( |
MapType & |
themap | ) |
|
|
protected |
◆ crystalMatrix
std::vector<uint32_t> EcalRecHitsValidation::crystalMatrix |
|
private |
◆ EBHits_Token_
◆ EBrechitCollection_
◆ EBrechitCollection_Token_
◆ EBuncalibrechitCollection_
◆ EBuncalibrechitCollection_Token_
◆ EEHits_Token_
◆ EErechitCollection_
◆ EErechitCollection_Token_
◆ EEuncalibrechitCollection_
◆ EEuncalibrechitCollection_Token_
◆ enableEndcaps_
bool EcalRecHitsValidation::enableEndcaps_ |
|
private |
◆ ESHits_Token_
◆ ESrechitCollection_
◆ ESrechitCollection_Token_
◆ HepMCLabel
std::string EcalRecHitsValidation::HepMCLabel |
|
private |
◆ HepMCLabel_Token_
◆ hitsProducer_
std::string EcalRecHitsValidation::hitsProducer_ |
|
private |
◆ meEB5x5RecHitSimHitvsSimHitFlag8_
MonitorElement* EcalRecHitsValidation::meEB5x5RecHitSimHitvsSimHitFlag8_ |
|
private |
◆ meEBe5x5_
◆ meEBe5x5OverGun_
◆ meEBe5x5OverSimHits_
◆ meEBRecHitFlags_
◆ meEBRecHitLog10Energy5x5Contr_
◆ meEBRecHitLog10Energy_
◆ meEBRecHitLog10EnergyContr_
◆ meEBRecHitSimHitFlag6_
◆ meEBRecHitSimHitFlag7_
◆ meEBRecHitSimHitRatio1011_
◆ meEBRecHitSimHitRatio12_
◆ meEBRecHitSimHitRatio13_
◆ meEBRecHitSimHitRatio_
◆ meEBRecHitSimHitRatioGt35_
◆ meEBRecHitSimHitvsSimHitFlag5_6_
MonitorElement* EcalRecHitsValidation::meEBRecHitSimHitvsSimHitFlag5_6_ |
|
private |
◆ meEBRecHitsOccupancyFlag5_6_
◆ meEBRecHitsOccupancyFlag8_9_
◆ meEBUnRecHitSimHitRatio_
◆ meEBUnRecHitSimHitRatioGt35_
◆ meEEe5x5_
◆ meEEe5x5OverGun_
◆ meEEe5x5OverSimHits_
◆ meEERecHitFlags_
◆ meEERecHitLog10Energy5x5Contr_
◆ meEERecHitLog10Energy_
◆ meEERecHitLog10EnergyContr_
◆ meEERecHitSimHitFlag6_
◆ meEERecHitSimHitFlag7_
◆ meEERecHitSimHitRatio1011_
◆ meEERecHitSimHitRatio12_
◆ meEERecHitSimHitRatio13_
◆ meEERecHitSimHitRatio_
◆ meEERecHitSimHitRatioGt35_
◆ meEERecHitSimHitvsSimHitFlag5_6_
MonitorElement* EcalRecHitsValidation::meEERecHitSimHitvsSimHitFlag5_6_ |
|
private |
◆ meEERecHitsOccupancyMinusFlag5_6_
MonitorElement* EcalRecHitsValidation::meEERecHitsOccupancyMinusFlag5_6_ |
|
private |
◆ meEERecHitsOccupancyMinusFlag8_9_
MonitorElement* EcalRecHitsValidation::meEERecHitsOccupancyMinusFlag8_9_ |
|
private |
◆ meEERecHitsOccupancyPlusFlag5_6_
MonitorElement* EcalRecHitsValidation::meEERecHitsOccupancyPlusFlag5_6_ |
|
private |
◆ meEERecHitsOccupancyPlusFlag8_9_
MonitorElement* EcalRecHitsValidation::meEERecHitsOccupancyPlusFlag8_9_ |
|
private |
◆ meEEUnRecHitSimHitRatio_
◆ meEEUnRecHitSimHitRatioGt35_
◆ meESRecHitLog10Energy_
◆ meESRecHitLog10EnergyContr_
◆ meESRecHitSimHitRatio_
◆ meGunEnergy_
◆ meGunEta_
◆ meGunPhi_
◆ outputFile_
std::string EcalRecHitsValidation::outputFile_ |
|
private |
◆ verbose_
bool EcalRecHitsValidation::verbose_ |
|
private |
MonitorElement * meEBRecHitSimHitFlag6_
T const * product() const
const_iterator end() const
int ieta() const
get the crystal ieta
MonitorElement * meEERecHitLog10Energy_
std::vector< T >::const_iterator const_iterator
edm::InputTag EEuncalibrechitCollection_
T const * product() const
MonitorElement * meEBRecHitSimHitRatio13_
MonitorElement * meEEUnRecHitSimHitRatio_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
MonitorElement * meEBRecHitsOccupancyFlag8_9_
std::vector< uint32_t > crystalMatrix
MonitorElement * meEBRecHitSimHitRatio1011_
edm::InputTag ESrechitCollection_
MonitorElement * meEBRecHitSimHitFlag7_
MonitorElement * meEEe5x5OverGun_
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meEBRecHitFlags_
MonitorElement * meEEe5x5_
MonitorElement * meEBe5x5_
MonitorElement * meEERecHitSimHitRatio12_
MonitorElement * meEBRecHitSimHitRatioGt35_
MonitorElement * meEBRecHitLog10Energy_
MonitorElement * meEERecHitFlags_
MonitorElement * meEBUnRecHitSimHitRatio_
MonitorElement * meEBUnRecHitSimHitRatioGt35_
void findBarrelMatrix(int nCellInEta, int nCellInPhi, int CentralEta, int CentralPhi, int CentralZ, MapType &themap)
edm::InputTag EBuncalibrechitCollection_
edm::EDGetTokenT< EBRecHitCollection > EBrechitCollection_Token_
EcalTrigTowerDetId tower() const
get the HCAL/trigger iphi of this crystal
MonitorElement * meEERecHitSimHitRatio13_
MonitorElement * meGunEnergy_
const_iterator begin() const
MonitorElement * meESRecHitLog10Energy_
MonitorElement * meEERecHitsOccupancyMinusFlag8_9_
const_iterator find(uint32_t rawId) const
MonitorElement * meEBRecHitsOccupancyFlag5_6_
MonitorElement * meEEUnRecHitSimHitRatioGt35_
MonitorElement * meEERecHitSimHitFlag7_
MonitorElement * meEBRecHitLog10EnergyContr_
edm::EDGetTokenT< ESRecHitCollection > ESrechitCollection_Token_
edm::EDGetTokenT< EEUncalibratedRecHitCollection > EEuncalibrechitCollection_Token_
const_iterator end() const
MonitorElement * meEBRecHitSimHitRatio_
edm::InputTag EErechitCollection_
MonitorElement * meEERecHitLog10EnergyContr_
Tan< T >::type tan(const T &t)
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
MonitorElement * meEERecHitSimHitvsSimHitFlag5_6_
MonitorElement * meEERecHitSimHitRatio_
MonitorElement * meEERecHitSimHitFlag6_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
MonitorElement * meEB5x5RecHitSimHitvsSimHitFlag8_
edm::EDGetTokenT< EBUncalibratedRecHitCollection > EBuncalibrechitCollection_Token_
edm::EDGetTokenT< EERecHitCollection > EErechitCollection_Token_
const HepMC::GenEvent * GetEvent() const
MonitorElement * meEERecHitSimHitRatioGt35_
MonitorElement * meEERecHitsOccupancyPlusFlag5_6_
MonitorElement * meEBe5x5OverGun_
T getParameter(std::string const &) const
void findEndcapMatrix(int nCellInX, int nCellInY, int CentralX, int CentralY, int CentralZ, MapType &themap)
MonitorElement * meGunEta_
constexpr uint32_t rawId() const
get the raw id
MonitorElement * meEBRecHitSimHitvsSimHitFlag5_6_
std::vector< DetId > constituentsOf(const EcalTrigTowerDetId &id) const
Get the constituent detids for this tower id.
std::string hitsProducer_
MonitorElement * meESRecHitSimHitRatio_
MonitorElement * meEERecHitSimHitRatio1011_
MonitorElement * meEEe5x5OverSimHits_
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
std::vector< Item >::const_iterator const_iterator
int iphi() const
get the crystal iphi
Abs< T >::type abs(const T &t)
edm::EDGetTokenT< edm::HepMCProduct > HepMCLabel_Token_
edm::InputTag EBrechitCollection_
MonitorElement * meEERecHitLog10Energy5x5Contr_
MonitorElement * meEBe5x5OverSimHits_
MonitorElement * meESRecHitLog10EnergyContr_
MonitorElement * meEERecHitsOccupancyMinusFlag5_6_
MonitorElement * meGunPhi_
uint32_t getUnitWithMaxEnergy(MapType &themap)
MonitorElement * meEBRecHitLog10Energy5x5Contr_
MonitorElement * meEBRecHitSimHitRatio12_
MonitorElement * meEERecHitsOccupancyPlusFlag8_9_