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 &)
 
 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 &)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
const std::string & getName () const
 
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 setTime (time_t _t)
 
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)
 
- 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) {}

◆ ~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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 31 of file RecoSummaryTask.cc.

31  {
32  _dependencies.push_back(Dependency(kEBBasicCluster, kEBRecHit));
33  _dependencies.push_back(Dependency(kEEBasicCluster, kEERecHit));
34  }

References ecaldqm::kEBBasicCluster, ecaldqm::kEBRecHit, ecaldqm::kEEBasicCluster, ecaldqm::kEERecHit, and ecaldqm::DependencySet::push_back().

◆ analyze()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 39 of file RecoSummaryTask.h.

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  }

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

◆ endEvent()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 48 of file RecoSummaryTask.cc.

48  {
49  ebHits_ = nullptr;
50  eeHits_ = nullptr;
51  }

References ebHits_, and eeHits_.

◆ filterRunType()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 36 of file RecoSummaryTask.cc.

36  {
37  for (unsigned iFED(0); iFED != ecaldqm::nDCC; iFED++) {
38  if (_runType[iFED] == EcalDCCHeaderBlock::COSMIC || _runType[iFED] == EcalDCCHeaderBlock::MTCC ||
39  _runType[iFED] == EcalDCCHeaderBlock::COSMICS_GLOBAL ||
40  _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_GLOBAL || _runType[iFED] == EcalDCCHeaderBlock::COSMICS_LOCAL ||
41  _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_LOCAL)
42  return true;
43  }
44 
45  return false;
46  }

References EcalDCCHeaderBlock::COSMIC, EcalDCCHeaderBlock::COSMICS_GLOBAL, EcalDCCHeaderBlock::COSMICS_LOCAL, EcalDCCHeaderBlock::MTCC, ecaldqm::nDCC, EcalDCCHeaderBlock::PHYSICS_GLOBAL, and EcalDCCHeaderBlock::PHYSICS_LOCAL.

◆ runOnBasicClusters()

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

Definition at line 126 of file RecoSummaryTask.cc.

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(subdet, hItr->recoFlag());
152  }
153  }
154  }

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

Referenced by analyze().

◆ runOnRecHits()

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

Definition at line 53 of file RecoSummaryTask.cc.

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(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(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(signedSubdet, hitItr->chi2());
101  meTime.fill(signedSubdet, hitItr->time());
102  }
103  }
104 
105  if (isBarrel) {
106  meEnergyMax.fill(EcalBarrel, maxE[0]);
107 
108  ebHits_ = &_hits;
109  } else {
110  meEnergyMax.fill(-EcalEndcap, maxE[0]);
111  meEnergyMax.fill(EcalEndcap, maxE[1]);
112 
113  eeHits_ = &_hits;
114  }
115  }

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

Referenced by analyze().

◆ runOnReducedRecHits()

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

Definition at line 117 of file RecoSummaryTask.cc.

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(subdet, hitItr->recoFlag());
124  }

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

Referenced by analyze().

◆ setParams()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 22 of file RecoSummaryTask.cc.

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  }

References l1extraParticles_cfi::_params, fillRecoFlagReduced_, ecaldqm::DQWorker::MEs_, rechitThresholdEB_, rechitThresholdEE_, and AlCaHLTBitMon_QueryRunRegistry::string.

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().

EcalDCCHeaderBlock::COSMICS_LOCAL
Definition: EcalDCCHeaderBlock.h:49
edm::View::begin
const_iterator begin() const
ecaldqm::RecoSummaryTask::fillRecoFlagReduced_
bool fillRecoFlagReduced_
Definition: RecoSummaryTask.h:36
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
ecaldqm::kEBBasicCluster
Definition: Collections.h:40
reco::CaloID::DET_ECAL_ENDCAP
Definition: CaloID.h:21
ecaldqm::kEEReducedRecHit
Definition: Collections.h:39
EBDetId
Definition: EBDetId.h:17
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
edm::SortedCollection< EcalRecHit >
EcalTools::swissCross
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:11
watchdog.const
const
Definition: watchdog.py:83
dqmdumpme.first
first
Definition: dqmdumpme.py:55
EcalBarrel
Definition: EcalSubdetector.h:10
ecaldqm::RecoSummaryTask::runOnBasicClusters
void runOnBasicClusters(edm::View< reco::CaloCluster > const &, Collections)
Definition: RecoSummaryTask.cc:126
EcalDCCHeaderBlock::PHYSICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:37
ecaldqm::RecoSummaryTask::ebHits_
EcalRecHitCollection const * ebHits_
Definition: RecoSummaryTask.h:34
ecaldqm::DQWorkerTask::DQWorkerTask
DQWorkerTask()
Definition: DQWorkerTask.cc:8
ecaldqm::kEBRecHit
Definition: Collections.h:36
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:78
EEDetId
Definition: EEDetId.h:14
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalEndcap
Definition: EcalSubdetector.h:10
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
edm::View
Definition: CaloClusterFwd.h:14
ecaldqm::RecoSummaryTask::rechitThresholdEB_
float rechitThresholdEB_
Definition: RecoSummaryTask.h:32
ecaldqm::RecoSummaryTask::eeHits_
EcalRecHitCollection const * eeHits_
Definition: RecoSummaryTask.h:35
ecaldqm::RecoSummaryTask::rechitThresholdEE_
float rechitThresholdEE_
Definition: RecoSummaryTask.h:33
ecaldqm::RecoSummaryTask::runOnRecHits
void runOnRecHits(EcalRecHitCollection const &, Collections)
Definition: RecoSummaryTask.cc:53
EcalDCCHeaderBlock::PHYSICS_LOCAL
Definition: EcalDCCHeaderBlock.h:48
HLT_2018_cff.maxE
maxE
Definition: HLT_2018_cff.py:12256
ecaldqm::kEERecHit
Definition: Collections.h:37
EcalDCCHeaderBlock::COSMICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:38
ecaldqm::RecoSummaryTask::runOnReducedRecHits
void runOnReducedRecHits(EcalRecHitCollection const &, Collections)
Definition: RecoSummaryTask.cc:117
EcalDCCHeaderBlock::MTCC
Definition: EcalDCCHeaderBlock.h:25
ecaldqm::kEBReducedRecHit
Definition: Collections.h:38
EcalDCCHeaderBlock::COSMIC
Definition: EcalDCCHeaderBlock.h:22
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
ecaldqm::nDCC
Definition: EcalDQMCommonUtils.h:92
edm::View::end
const_iterator end() const
ecaldqm::kEEBasicCluster
Definition: Collections.h:41
reco::CaloID::DET_ECAL_BARREL
Definition: CaloID.h:20