CMS 3D CMS Logo

RecoSummaryTask.cc
Go to the documentation of this file.
2 
7 
10 
12 
13 namespace ecaldqm {
15  : DQWorkerTask(),
16  rechitThresholdEB_(0.),
17  rechitThresholdEE_(0.),
18  ebHits_(nullptr),
19  eeHits_(nullptr),
20  fillRecoFlagReduced_(true) {}
21 
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  }
30 
34  }
35 
36  bool RecoSummaryTask::filterRunType(short const* _runType) {
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  }
47 
49  ebHits_ = nullptr;
50  eeHits_ = nullptr;
51  }
52 
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  }
116 
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  }
125 
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  }
155 
157 } // namespace ecaldqm
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
Definition: DQWorker.h:24
ecaldqm::kEBBasicCluster
Definition: Collections.h:40
ecaldqm::DependencySet
Definition: DQWorkerTask.h:44
reco::CaloID::DET_ECAL_ENDCAP
Definition: CaloID.h:21
EBDetId
Definition: EBDetId.h:17
EcalDetIdCollections.h
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
edm::SortedCollection< EcalRecHit >
ecaldqm::Dependency
Definition: DQWorkerTask.h:19
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
ecaldqm::RecoSummaryTask::addDependencies
void addDependencies(DependencySet &) override
Definition: RecoSummaryTask.cc:31
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
ecaldqm::RecoSummaryTask
Definition: RecoSummaryTask.h:13
EcalDCCHeaderBlock::PHYSICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:37
ecaldqm::RecoSummaryTask::ebHits_
EcalRecHitCollection const * ebHits_
Definition: RecoSummaryTask.h:34
ecaldqm::DQWorkerTask
Definition: DQWorkerTask.h:71
ecaldqm::RecoSummaryTask::filterRunType
bool filterRunType(short const *) override
Definition: RecoSummaryTask.cc:36
ecaldqm::RecoSummaryTask::endEvent
void endEvent(edm::Event const &, edm::EventSetup const &) override
Definition: RecoSummaryTask.cc:48
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
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
EcalSubdetector.h
EcalEndcap
Definition: EcalSubdetector.h:10
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
edm::View
Definition: CaloClusterFwd.h:14
funct::true
true
Definition: Factorize.h:173
ecaldqm::RecoSummaryTask::rechitThresholdEB_
float rechitThresholdEB_
Definition: RecoSummaryTask.h:32
edm::ParameterSet
Definition: ParameterSet.h:36
ecaldqm::RecoSummaryTask::eeHits_
EcalRecHitCollection const * eeHits_
Definition: RecoSummaryTask.h:35
ecaldqm::RecoSummaryTask::rechitThresholdEE_
float rechitThresholdEE_
Definition: RecoSummaryTask.h:33
RecoSummaryTask.h
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
ecaldqm::RecoSummaryTask::runOnRecHits
void runOnRecHits(EcalRecHitCollection const &, Collections)
Definition: RecoSummaryTask.cc:53
EcalDCCHeaderBlock::PHYSICS_LOCAL
Definition: EcalDCCHeaderBlock.h:48
EcalClusterTools.h
ecaldqm::DependencySet::push_back
void push_back(Dependency const &_d)
Definition: DQWorkerTask.h:46
ecaldqm::Collections
Collections
Definition: Collections.h:8
ecaldqm::RecoSummaryTask::RecoSummaryTask
RecoSummaryTask()
Definition: RecoSummaryTask.cc:14
EcalDCCHeaderBlock.h
edm::EventSetup
Definition: EventSetup.h:57
HLT_2018_cff.maxE
maxE
Definition: HLT_2018_cff.py:12256
EcalTools.h
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
DEFINE_ECALDQM_WORKER
#define DEFINE_ECALDQM_WORKER(TYPE)
Definition: DQWorker.h:112
ecaldqm::RecoSummaryTask::setParams
void setParams(edm::ParameterSet const &) override
Definition: RecoSummaryTask.cc:22
edm::View::end
const_iterator end() const
ParameterSet.h
ecaldqm::kEEBasicCluster
Definition: Collections.h:41
edm::Event
Definition: Event.h:73
reco::CaloID::DET_ECAL_BARREL
Definition: CaloID.h:20
EcalDQMCommonUtils.h
ecaldqm::MESet
Definition: MESet.h:27