CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ecaldqm::RecoSummaryTask Class Reference

#include <RecoSummaryTask.h>

Inheritance diagram for ecaldqm::RecoSummaryTask:
ecaldqm::DQWorkerTask ecaldqm::DQWorker

Public Member Functions

void addDependencies (DependencySet &) override
 
bool analyze (void const *, Collections) override
 
void endEvent (edm::Event const &, edm::EventSetup const &) override
 
bool filterRunType (short const *) override
 
 RecoSummaryTask ()
 
void runOnBasicClusters (edm::View< reco::CaloCluster > const &, Collections)
 
void runOnRecHits (EcalRecHitCollection const &, Collections)
 
void runOnReducedRecHits (EcalRecHitCollection const &, Collections)
 
 ~RecoSummaryTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
virtual void beginEvent (edm::Event const &, edm::EventSetup const &, bool const &, bool &)
 
 DQWorkerTask ()
 
virtual bool filterTrigger (edm::TriggerResultsByName const &)
 
virtual void setTokens (edm::ConsumesCollector &)
 
 ~DQWorkerTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void bookMEs (DQMStore::IBooker &)
 
bool checkElectronicsMap (bool=true)
 
bool checkGeometry (bool=true)
 
bool checkTopology (bool=true)
 
bool checkTrigTowerMap (bool=true)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
EcalDQMSetupObjects const getEcalDQMSetupObjects ()
 
EcalElectronicsMapping const * GetElectronicsMap ()
 
CaloGeometry const * GetGeometry ()
 
std::string const & getName () const
 
CaloTopology const * GetTopology ()
 
EcalTrigTowerConstituentsMap const * GetTrigTowerMap ()
 
bool onlineMode () const
 
virtual void releaseMEs ()
 
void setEventNumber (edm::EventNumber_t _e)
 
void setLumiNumber (edm::LuminosityBlockNumber_t _l)
 
void setRunNumber (edm::RunNumber_t _r)
 
void setSetupObjects (edm::EventSetup const &)
 
void setSetupObjectsEndLumi (edm::EventSetup const &)
 
void setTime (time_t _t)
 
void setTokens (edm::ConsumesCollector &)
 
virtual ~DQWorker () noexcept(false)
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

EcalRecHitCollection const * ebHits_
 
EcalRecHitCollection const * eeHits_
 
bool fillRecoFlagReduced_
 
float rechitThresholdEB_
 
float rechitThresholdEE_
 

Additional Inherited Members

- Public Types inherited from ecaldqm::DQWorkerTask
typedef EcalDCCHeaderBlock::EcalDCCEventSettings EventSettings
 
- Static Public Member Functions inherited from ecaldqm::DQWorkerTask
static void fillDescriptions (edm::ParameterSetDescription &)
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void fillDescriptions (edm::ParameterSetDescription &_desc)
 
- Public Attributes inherited from ecaldqm::DQWorker
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandle
 
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandleEndLumi
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandle
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandleEndLumi
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandle
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandleEndLumi
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandle
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandleEndLumi
 
- Protected Types inherited from ecaldqm::DQWorker
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from ecaldqm::DQWorkerTask
void setME (edm::ParameterSet const &) final
 
- Protected Member Functions inherited from ecaldqm::DQWorker
void initialize (std::string const &_name, edm::ParameterSet const &)
 
void print_ (std::string const &, int=0) const
 
virtual void setSource (edm::ParameterSet const &)
 
void setVerbosity (int _verbosity)
 
- Protected Attributes inherited from ecaldqm::DQWorker
bool booked_
 
MESetCollection MEs_
 
std::string name_
 
bool onlineMode_
 
Timestamp timestamp_
 
int verbosity_
 
bool willConvertToEDM_
 

Detailed Description

Definition at line 13 of file RecoSummaryTask.h.

Constructor & Destructor Documentation

◆ RecoSummaryTask()

ecaldqm::RecoSummaryTask::RecoSummaryTask ( )

Definition at line 14 of file RecoSummaryTask.cc.

15  : DQWorkerTask(),
18  ebHits_(nullptr),
19  eeHits_(nullptr),
20  fillRecoFlagReduced_(true) {}
EcalRecHitCollection const * ebHits_
EcalRecHitCollection const * eeHits_

◆ ~RecoSummaryTask()

ecaldqm::RecoSummaryTask::~RecoSummaryTask ( )
inlineoverride

Definition at line 16 of file RecoSummaryTask.h.

16 {}

Member Function Documentation

◆ addDependencies()

void ecaldqm::RecoSummaryTask::addDependencies ( DependencySet _dependencies)
overridevirtual

◆ analyze()

bool ecaldqm::RecoSummaryTask::analyze ( void const *  _p,
Collections  _collection 
)
inlineoverridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 39 of file RecoSummaryTask.h.

References runTheMatrix::const, fillRecoFlagReduced_, ecaldqm::kEBBasicCluster, ecaldqm::kEBRecHit, ecaldqm::kEBReducedRecHit, ecaldqm::kEEBasicCluster, ecaldqm::kEERecHit, ecaldqm::kEEReducedRecHit, runOnBasicClusters(), runOnRecHits(), and runOnReducedRecHits().

39  {
40  switch (_collection) {
41  case kEBRecHit:
42  case kEERecHit:
43  if (_p)
44  runOnRecHits(*static_cast<EcalRecHitCollection const*>(_p), _collection);
45  return true;
46  break;
47  case kEBReducedRecHit:
48  case kEEReducedRecHit:
49  if (_p && fillRecoFlagReduced_)
50  runOnReducedRecHits(*static_cast<EcalRecHitCollection const*>(_p), _collection);
51  return fillRecoFlagReduced_;
52  break;
53  case kEBBasicCluster:
54  case kEEBasicCluster:
55  if (_p)
56  runOnBasicClusters(*static_cast<edm::View<reco::CaloCluster> const*>(_p), _collection);
57  return true;
58  break;
59  default:
60  break;
61  }
62  return false;
63  }
void runOnReducedRecHits(EcalRecHitCollection const &, Collections)
void runOnRecHits(EcalRecHitCollection const &, Collections)
void runOnBasicClusters(edm::View< reco::CaloCluster > const &, Collections)

◆ endEvent()

void ecaldqm::RecoSummaryTask::endEvent ( edm::Event const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 48 of file RecoSummaryTask.cc.

References ebHits_, and eeHits_.

48  {
49  ebHits_ = nullptr;
50  eeHits_ = nullptr;
51  }
EcalRecHitCollection const * ebHits_
EcalRecHitCollection const * eeHits_

◆ filterRunType()

bool ecaldqm::RecoSummaryTask::filterRunType ( short const *  _runType)
overridevirtual

◆ runOnBasicClusters()

void ecaldqm::RecoSummaryTask::runOnBasicClusters ( edm::View< reco::CaloCluster > const &  _bcs,
Collections  _collection 
)

Definition at line 126 of file RecoSummaryTask.cc.

References ecaldqm::MESetCollection::at(), edm::View< T >::begin(), reco::CaloID::DET_ECAL_BARREL, reco::CaloID::DET_ECAL_ENDCAP, ebHits_, EcalBarrel, EcalEndcap, eeHits_, edm::View< T >::end(), dqmdumpme::first, ecaldqm::DQWorker::getEcalDQMSetupObjects(), PixelPluginsPhase0_cfi::isBarrel, ecaldqm::kEBBasicCluster, and ecaldqm::DQWorker::MEs_.

Referenced by analyze().

126  {
127  bool isBarrel(_collection == kEBBasicCluster);
128 
129  MESet& meRecoFlag(MEs_.at("RecoFlagBasicCluster"));
130 
131  EcalRecHitCollection const* hitCol(isBarrel ? ebHits_ : eeHits_);
132  int subdet(isBarrel ? EcalBarrel : EcalEndcap);
133 
134  for (edm::View<reco::CaloCluster>::const_iterator bcItr(_bcs.begin()); bcItr != _bcs.end(); ++bcItr) {
135  if (bcItr->caloID().detectors() != 0) {
136  if (isBarrel && !bcItr->caloID().detector(reco::CaloID::DET_ECAL_BARREL))
137  continue;
138  if (!isBarrel && !bcItr->caloID().detector(reco::CaloID::DET_ECAL_ENDCAP))
139  continue;
140  }
141 
142  std::vector<std::pair<DetId, float> > const& haf(bcItr->hitsAndFractions());
143  for (unsigned iH(0); iH != haf.size(); ++iH) {
144  if (isBarrel && haf[iH].first.subdetId() != EcalBarrel)
145  continue;
146  if (!isBarrel && haf[iH].first.subdetId() != EcalEndcap)
147  continue;
148  EcalRecHitCollection::const_iterator hItr(hitCol->find(haf[iH].first));
149  if (hItr == hitCol->end())
150  continue;
151  meRecoFlag.fill(getEcalDQMSetupObjects(), subdet, hItr->recoFlag());
152  }
153  }
154  }
MESet & at(const std::string &key)
Definition: MESet.h:399
std::vector< EcalRecHit >::const_iterator const_iterator
EcalRecHitCollection const * ebHits_
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
EcalRecHitCollection const * eeHits_
MESetCollection MEs_
Definition: DQWorker.h:131
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
const_iterator begin() const
const_iterator end() const

◆ runOnRecHits()

void ecaldqm::RecoSummaryTask::runOnRecHits ( EcalRecHitCollection const &  _hits,
Collections  _collection 
)

Definition at line 53 of file RecoSummaryTask.cc.

References ecaldqm::MESetCollection::at(), edm::SortedCollection< T, SORT >::begin(), ebHits_, EcalBarrel, EcalEndcap, eeHits_, edm::SortedCollection< T, SORT >::end(), HCALHighEnergyHPDFilter_cfi::energy, ecaldqm::DQWorker::getEcalDQMSetupObjects(), PixelPluginsPhase0_cfi::isBarrel, ecaldqm::kEBRecHit, HLT_2023v12_cff::maxE, ecaldqm::DQWorker::MEs_, rechitThresholdEB_, rechitThresholdEE_, and EcalTools::swissCross().

Referenced by analyze().

53  {
54  bool isBarrel(_collection == kEBRecHit);
55 
56  MESet& meEnergyMax(MEs_.at("EnergyMax"));
57  MESet& meChi2(MEs_.at("Chi2"));
58  MESet& meTime(MEs_.at("Time"));
59  MESet* meSwissCross(isBarrel ? &MEs_.at("SwissCross") : nullptr);
60  MESet& meRecoFlag(MEs_.at("RecoFlagAll"));
61 
62  double maxE[2] = {-1., -1};
63  int subdet(isBarrel ? EcalBarrel : EcalEndcap);
64 
65  for (EcalRecHitCollection::const_iterator hitItr(_hits.begin()); hitItr != _hits.end(); ++hitItr) {
66  meRecoFlag.fill(getEcalDQMSetupObjects(), subdet, hitItr->recoFlag());
67  float energy(hitItr->energy());
68 
69  int signedSubdet;
70  float rechitThreshold;
71 
72  if (isBarrel) {
73  signedSubdet = EcalBarrel;
74  rechitThreshold = rechitThresholdEB_;
75 
76  if (energy > 3.) {
77  EBDetId ebId(hitItr->id());
78  if (ebId.ieta() != 85)
79  meSwissCross->fill(getEcalDQMSetupObjects(), EcalTools::swissCross(ebId, _hits, 0.));
80  }
81 
82  if (energy > maxE[0])
83  maxE[0] = energy;
84  } else {
85  rechitThreshold = rechitThresholdEE_;
86 
87  EEDetId eeId(hitItr->id());
88  if (eeId.zside() < 0) {
89  signedSubdet = -EcalEndcap;
90  if (energy > maxE[0])
91  maxE[0] = energy;
92  } else {
93  signedSubdet = EcalEndcap;
94  if (energy > maxE[1])
95  maxE[1] = energy;
96  }
97  }
98 
99  if (energy > rechitThreshold) {
100  meChi2.fill(getEcalDQMSetupObjects(), signedSubdet, hitItr->chi2());
101  meTime.fill(getEcalDQMSetupObjects(), signedSubdet, hitItr->time());
102  }
103  }
104 
105  if (isBarrel) {
106  meEnergyMax.fill(getEcalDQMSetupObjects(), EcalBarrel, maxE[0]);
107 
108  ebHits_ = &_hits;
109  } else {
110  meEnergyMax.fill(getEcalDQMSetupObjects(), -EcalEndcap, maxE[0]);
111  meEnergyMax.fill(getEcalDQMSetupObjects(), EcalEndcap, maxE[1]);
112 
113  eeHits_ = &_hits;
114  }
115  }
MESet & at(const std::string &key)
Definition: MESet.h:399
std::vector< EcalRecHit >::const_iterator const_iterator
EcalRecHitCollection const * ebHits_
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
EcalRecHitCollection const * eeHits_
MESetCollection MEs_
Definition: DQWorker.h:131
static float swissCross(const DetId &id, const EcalRecHitCollection &recHits, float recHitThreshold, bool avoidIeta85=true)
the good old 1-e4/e1. Ignore hits below recHitThreshold
Definition: EcalTools.cc:9

◆ runOnReducedRecHits()

void ecaldqm::RecoSummaryTask::runOnReducedRecHits ( EcalRecHitCollection const &  _hits,
Collections  _collections 
)

Definition at line 117 of file RecoSummaryTask.cc.

References ecaldqm::MESetCollection::at(), edm::SortedCollection< T, SORT >::begin(), EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::kEBReducedRecHit, and ecaldqm::DQWorker::MEs_.

Referenced by analyze().

117  {
118  MESet& meRecoFlag(MEs_.at("RecoFlagReduced"));
119 
120  int subdet(_collections == kEBReducedRecHit ? EcalBarrel : EcalEndcap);
121 
122  for (EcalRecHitCollection::const_iterator hitItr(_hits.begin()); hitItr != _hits.end(); ++hitItr)
123  meRecoFlag.fill(getEcalDQMSetupObjects(), subdet, hitItr->recoFlag());
124  }
MESet & at(const std::string &key)
Definition: MESet.h:399
std::vector< EcalRecHit >::const_iterator const_iterator
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
MESetCollection MEs_
Definition: DQWorker.h:131

◆ setParams()

void ecaldqm::RecoSummaryTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 22 of file RecoSummaryTask.cc.

References l1extraParticles_cfi::_params, ecaldqm::MESetCollection::erase(), fillRecoFlagReduced_, ecaldqm::DQWorker::MEs_, rechitThresholdEB_, rechitThresholdEE_, and AlCaHLTBitMon_QueryRunRegistry::string.

22  {
23  rechitThresholdEB_ = _params.getUntrackedParameter<double>("rechitThresholdEB");
24  rechitThresholdEE_ = _params.getUntrackedParameter<double>("rechitThresholdEE");
25  fillRecoFlagReduced_ = _params.getUntrackedParameter<bool>("fillRecoFlagReduced");
26  if (!fillRecoFlagReduced_) {
27  MEs_.erase(std::string("RecoFlagReduced"));
28  }
29  }
MESetCollection MEs_
Definition: DQWorker.h:131
void erase(const std::string &key)
Definition: MESet.h:390

Member Data Documentation

◆ ebHits_

EcalRecHitCollection const* ecaldqm::RecoSummaryTask::ebHits_
private

Definition at line 34 of file RecoSummaryTask.h.

Referenced by endEvent(), runOnBasicClusters(), and runOnRecHits().

◆ eeHits_

EcalRecHitCollection const* ecaldqm::RecoSummaryTask::eeHits_
private

Definition at line 35 of file RecoSummaryTask.h.

Referenced by endEvent(), runOnBasicClusters(), and runOnRecHits().

◆ fillRecoFlagReduced_

bool ecaldqm::RecoSummaryTask::fillRecoFlagReduced_
private

Definition at line 36 of file RecoSummaryTask.h.

Referenced by analyze(), and setParams().

◆ rechitThresholdEB_

float ecaldqm::RecoSummaryTask::rechitThresholdEB_
private

Definition at line 32 of file RecoSummaryTask.h.

Referenced by runOnRecHits(), and setParams().

◆ rechitThresholdEE_

float ecaldqm::RecoSummaryTask::rechitThresholdEE_
private

Definition at line 33 of file RecoSummaryTask.h.

Referenced by runOnRecHits(), and setParams().