CMS 3D CMS Logo

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

#include <ClusterTask.h>

Inheritance diagram for ecaldqm::ClusterTask:
ecaldqm::DQWorkerTask ecaldqm::DQWorker

Public Types

enum  TriggerTypes {
  kEcalTrigger, kHcalTrigger, kCSCTrigger, kDTTrigger,
  kRPCTrigger, nTriggerTypes
}
 
- Public Types inherited from ecaldqm::DQWorkerTask
typedef EcalDCCHeaderBlock::EcalDCCEventSettings EventSettings
 

Public Member Functions

void addDependencies (DependencySet &) override
 
bool analyze (void const *, Collections) override
 
void beginEvent (edm::Event const &, edm::EventSetup const &, bool const &, bool &) override
 
 ClusterTask ()
 
void endEvent (edm::Event const &, edm::EventSetup const &) override
 
bool filterRunType (short const *) override
 
void runOnBasicClusters (edm::View< reco::CaloCluster > const &, Collections)
 
void runOnRecHits (EcalRecHitCollection const &, Collections)
 
void runOnSuperClusters (reco::SuperClusterCollection const &, Collections)
 
void setTokens (edm::ConsumesCollector &) override
 
 ~ClusterTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
 DQWorkerTask ()
 
virtual bool filterTrigger (edm::TriggerResultsByName const &)
 
 ~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

bool doExtra_
 
EcalRecHitCollection const * ebHits_
 
EcalRecHitCollection const * eeHits_
 
std::vector< std::string > egTriggerAlgos_
 
float energyThreshold_
 
edm::InputTag L1GlobalTriggerReadoutRecordTag_
 
edm::EDGetTokenT< L1GlobalTriggerReadoutRecordL1GlobalTriggerReadoutRecordToken_
 
edm::InputTag L1MuGMTReadoutCollectionTag_
 
edm::EDGetTokenT< L1MuGMTReadoutCollectionL1MuGMTReadoutCollectionToken_
 
float swissCrossMaxThreshold_
 
std::bitset< nTriggerTypestriggered_
 
unsigned trigTypeToME_ [nTriggerTypes]
 

Additional Inherited Members

- 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 20 of file ClusterTask.h.

Member Enumeration Documentation

◆ TriggerTypes

Enumerator
kEcalTrigger 
kHcalTrigger 
kCSCTrigger 
kDTTrigger 
kRPCTrigger 
nTriggerTypes 

Definition at line 40 of file ClusterTask.h.

Constructor & Destructor Documentation

◆ ClusterTask()

ecaldqm::ClusterTask::ClusterTask ( )

Definition at line 21 of file ClusterTask.cc.

22  : DQWorkerTask(),
23  ebHits_(nullptr),
24  eeHits_(nullptr),
25  // ievt_(0),
26  // massCalcPrescale_(_workerParams.getUntrackedParameter<int>("massCalcPrescale")),
27  doExtra_(true),
28  energyThreshold_(0.),
31  trigTypeToME_{0, 1, 2, 3, 4},

◆ ~ClusterTask()

ecaldqm::ClusterTask::~ClusterTask ( )
inlineoverride

Definition at line 23 of file ClusterTask.h.

23 {}

Member Function Documentation

◆ addDependencies()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 72 of file ClusterTask.cc.

72  {
73  _dependencies.push_back(Dependency(kEBSuperCluster, kEBRecHit));
74  _dependencies.push_back(Dependency(kEESuperCluster, kEERecHit));
75  }

References ecaldqm::kEBRecHit, ecaldqm::kEBSuperCluster, ecaldqm::kEERecHit, ecaldqm::kEESuperCluster, and ecaldqm::DependencySet::push_back().

◆ analyze()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 62 of file ClusterTask.h.

62  {
63  switch (_collection) {
64  case kEBRecHit:
65  case kEERecHit:
66  if (_p)
67  runOnRecHits(*static_cast<EcalRecHitCollection const*>(_p), _collection);
68  return true;
69  break;
70  case kEBBasicCluster:
71  case kEEBasicCluster:
72  if (_p)
73  runOnBasicClusters(*static_cast<edm::View<reco::CaloCluster> const*>(_p), _collection);
74  return true;
75  break;
76  case kEBSuperCluster:
77  case kEESuperCluster:
78  if (_p)
79  runOnSuperClusters(*static_cast<reco::SuperClusterCollection const*>(_p), _collection);
80  return true;
81  break;
82  default:
83  break;
84  }
85 
86  return false;
87  }

References watchdog::const, ecaldqm::kEBBasicCluster, ecaldqm::kEBRecHit, ecaldqm::kEBSuperCluster, ecaldqm::kEEBasicCluster, ecaldqm::kEERecHit, ecaldqm::kEESuperCluster, runOnBasicClusters(), runOnRecHits(), and runOnSuperClusters().

◆ beginEvent()

void ecaldqm::ClusterTask::beginEvent ( edm::Event const &  _evt,
edm::EventSetup const &  _es,
bool const &  ,
bool &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 77 of file ClusterTask.cc.

77  {
78  if (!doExtra_)
79  return;
80 
81  triggered_.reset();
82 
83  // TODO IS THIS THE MOST UP-TO-DATE ACCESSOR TO L1 INFO?
84 
86  _evt.getByToken(L1GlobalTriggerReadoutRecordToken_, l1GTHndl);
87  DecisionWord const& dWord(l1GTHndl->decisionWord());
88 
89  //Ecal
91  _es.get<L1GtTriggerMenuRcd>().get(menuRcd);
92  L1GtTriggerMenu const* menu(menuRcd.product());
93 
94  if (!dWord.empty()) { //protect against no L1GT in run
95  for (unsigned iT(0); iT != egTriggerAlgos_.size(); ++iT) {
96  if (menu->gtAlgorithmResult(egTriggerAlgos_[iT], dWord)) {
98  break;
99  }
100  }
101  }
102 
103  //Hcal
104  bool hcal_top = false;
105  bool hcal_bot = false;
106  const L1GtPsbWord psb = l1GTHndl->gtPsbWord(0xbb0d, 0);
107  std::vector<int> valid_phi;
108  if ((psb.aData(4) & 0x3f) >= 1) {
109  valid_phi.push_back((psb.aData(4) >> 10) & 0x1f);
110  }
111  if ((psb.bData(4) & 0x3f) >= 1) {
112  valid_phi.push_back((psb.bData(4) >> 10) & 0x1f);
113  }
114  if ((psb.aData(5) & 0x3f) >= 1) {
115  valid_phi.push_back((psb.aData(5) >> 10) & 0x1f);
116  }
117  if ((psb.bData(5) & 0x3f) >= 1) {
118  valid_phi.push_back((psb.bData(5) >> 10) & 0x1f);
119  }
120  std::vector<int>::const_iterator iphi;
121  for (iphi = valid_phi.begin(); iphi != valid_phi.end(); iphi++) {
122  if (*iphi < 9)
123  hcal_top = true;
124  if (*iphi > 8)
125  hcal_bot = true;
126  }
127  if (hcal_top && hcal_bot)
129 
130  //Muons
132  if (!_evt.getByToken(L1MuGMTReadoutCollectionToken_, l1MuHndl))
133  return;
134  std::vector<L1MuGMTReadoutRecord> const& records(l1MuHndl->getRecords());
135 
136  for (unsigned iR(0); iR != records.size(); ++iR) {
137  if (records[iR].getBxInEvent() != 0)
138  continue;
139 
140  unsigned iC(0);
141 
142  //DT triggers
143  std::vector<L1MuRegionalCand> dtBXCands(records[iR].getDTBXCands());
144  for (iC = 0; iC != dtBXCands.size(); ++iC)
145  if (!dtBXCands[iC].empty())
146  break;
147  if (iC != dtBXCands.size())
148  triggered_.set(kDTTrigger);
149 
150  //RPC triggers
151  std::vector<L1MuRegionalCand> brlRPCCands(records[iR].getBrlRPCCands());
152  for (iC = 0; iC != brlRPCCands.size(); ++iC)
153  if (!brlRPCCands[iC].empty())
154  break;
155  if (iC != brlRPCCands.size())
156  triggered_.set(kRPCTrigger);
157 
158  //CSC Triggers
159  std::vector<L1MuRegionalCand> cscCands(records[iR].getCSCCands());
160  for (iC = 0; iC != cscCands.size(); ++iC)
161  if (!cscCands[iC].empty())
162  break;
163  if (iC != cscCands.size())
164  triggered_.set(kCSCTrigger);
165  }
166 
167  if (triggered_.none())
168  return;
169 
170  MESet& meTriggers(MEs_.at("Triggers"));
171  MESet& meExclusiveTriggers(MEs_.at("ExclusiveTriggers"));
172 
173  for (unsigned iT(0); iT != nTriggerTypes; ++iT) {
174  if (!triggered_[iT])
175  continue;
176  meTriggers.fill(iT + 0.5);
177  if (triggered_.count() == 1)
178  meExclusiveTriggers.fill(iT + 0.5);
179  }
180  }

References L1GtPsbWord::aData(), ecaldqm::MESetCollection::at(), L1GtPsbWord::bData(), L1GlobalTriggerReadoutRecord::decisionWord(), doExtra_, egTriggerAlgos_, relativeConstraints::empty, ecaldqm::MESet::fill(), edm::EventSetup::get(), get, edm::Event::getByToken(), L1MuGMTReadoutCollection::getRecords(), L1GlobalTriggerReadoutRecord::gtPsbWord(), LEDCalibrationChannels::iphi, kCSCTrigger, kDTTrigger, kEcalTrigger, kHcalTrigger, kRPCTrigger, L1GlobalTriggerReadoutRecordToken_, L1MuGMTReadoutCollectionToken_, optionsL1T::menu, ecaldqm::DQWorker::MEs_, nTriggerTypes, and triggered_.

◆ endEvent()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 182 of file ClusterTask.cc.

182  {
183  // ++ievt_;
184 
185  ebHits_ = nullptr;
186  eeHits_ = nullptr;
187  }

References ebHits_, and eeHits_.

◆ filterRunType()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 189 of file ClusterTask.cc.

189  {
190  for (unsigned iFED(0); iFED != nDCC; iFED++) {
191  if (_runType[iFED] == EcalDCCHeaderBlock::COSMIC || _runType[iFED] == EcalDCCHeaderBlock::MTCC ||
192  _runType[iFED] == EcalDCCHeaderBlock::COSMICS_GLOBAL ||
193  _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_GLOBAL || _runType[iFED] == EcalDCCHeaderBlock::COSMICS_LOCAL ||
194  _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_LOCAL)
195  return true;
196  }
197 
198  return false;
199  }

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

◆ runOnBasicClusters()

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

Definition at line 214 of file ClusterTask.cc.

214  {
215  MESet& meBCE(MEs_.at("BCE"));
216  MESet& meBCEMap(MEs_.at("BCEMap"));
217  MESet& meBCEMapProjEta(MEs_.at("BCEMapProjEta"));
218  MESet& meBCEMapProjPhi(MEs_.at("BCEMapProjPhi"));
219  MESet& meBCEtMapProjEta(MEs_.at("BCEtMapProjEta"));
220  MESet& meBCEtMapProjPhi(MEs_.at("BCEtMapProjPhi"));
221  MESet& meBCOccupancy(MEs_.at("BCOccupancy"));
222  MESet& meBCOccupancyProjEta(MEs_.at("BCOccupancyProjEta"));
223  MESet& meBCOccupancyProjPhi(MEs_.at("BCOccupancyProjPhi"));
224  MESet& meBCSize(MEs_.at("BCSize"));
225  MESet& meTrendBCSize(MEs_.at("TrendBCSize"));
226  MESet& meBCSizeMap(MEs_.at("BCSizeMap"));
227  MESet& meBCSizeMapProjEta(MEs_.at("BCSizeMapProjEta"));
228  MESet& meBCSizeMapProjPhi(MEs_.at("BCSizeMapProjPhi"));
229  MESet& meBCNum(MEs_.at("BCNum"));
230  MESet& meTrendNBC(MEs_.at("TrendNBC"));
231 
232  int nBC[] = {0, 0};
233  bool isBarrel(_collection == kEBBasicCluster);
234 
235  // vector<reco::BasicCluster const*> lowMassCands;
236 
237  for (edm::View<reco::CaloCluster>::const_iterator bcItr(_bcs.begin()); bcItr != _bcs.end(); ++bcItr) {
238  if (bcItr->caloID().detectors() != 0) {
239  if (isBarrel && !bcItr->caloID().detector(reco::CaloID::DET_ECAL_BARREL))
240  continue;
241  if (!isBarrel && !bcItr->caloID().detector(reco::CaloID::DET_ECAL_ENDCAP))
242  continue;
243  }
244 
245  math::XYZPoint const& position(bcItr->position());
246 
247  DetId id(bcItr->seed());
248  if (id.null()) {
249  GlobalPoint gp(position.x(), position.y(), position.z());
250  CaloSubdetectorGeometry const* subgeom(
251  getGeometry()->getSubdetectorGeometry(DetId::Ecal, isBarrel ? EcalBarrel : EcalEndcap));
252 
253  id = subgeom->getClosestCell(gp);
254  }
255 
256  if (id.null() || (id.subdetId() == EcalBarrel && !isBarrel) || (id.subdetId() == EcalEndcap && isBarrel))
257  continue;
258 
259  float energy(bcItr->energy());
260  float posEta(position.eta());
261  float posPhi(phi(position.phi()));
262  float et(energy / std::cosh(posEta));
263  int subdet(isBarrel ? EcalBarrel : EcalEndcap);
264  if (subdet == EcalEndcap && position.z() < 0.)
265  subdet = -EcalEndcap;
266 
267  meBCE.fill(id, energy);
268 
269  meBCEMap.fill(id, energy);
270  meBCEMapProjEta.fill(posEta, energy);
271  meBCEMapProjPhi.fill(subdet, posPhi, energy);
272  meBCEtMapProjEta.fill(posEta, et);
273  meBCEtMapProjPhi.fill(subdet, posPhi, et);
274 
275  meBCOccupancy.fill(id);
276  meBCOccupancyProjEta.fill(posEta);
277  meBCOccupancyProjPhi.fill(subdet, posPhi);
278 
279  float size(bcItr->size());
280 
281  meBCSize.fill(id, size);
282  meTrendBCSize.fill(id, double(timestamp_.iLumi), size);
283 
284  meBCSizeMap.fill(id, size);
285  meBCSizeMapProjEta.fill(posEta, size);
286  meBCSizeMapProjPhi.fill(subdet, posPhi, size);
287 
288  int zside(position.z() > 0 ? 1 : 0);
289  nBC[zside]++;
290 
291  // if(ievt_ % massCalcPrescale_ != 0) continue;
292 
293  // if(energy > 10.) continue;
294 
295  // EcalRecHitCollection::const_iterator hitItr(isBarrel ? ebHits_->find(id) : eeHits_->find(id));
296  // if(hitItr == (isBarrel ? ebHits_->end() : eeHits_->end())) continue;
297 
298  // // cuts here must be parametrized
299  // if(hitItr->energy() < 0.5) continue;
300 
301  // if(hitItr->energy() / energy > 0.95) continue;
302 
303  // lowMassCands.push_back(&(*bcItr));
304  }
305 
306  if (isBarrel) {
307  meBCNum.fill(EcalBarrel, nBC[0] + nBC[1]);
308  meTrendNBC.fill(EcalBarrel, double(timestamp_.iLumi), nBC[0] + nBC[1]);
309  } else {
310  meBCNum.fill(-EcalEndcap, nBC[0]);
311  meBCNum.fill(EcalEndcap, nBC[1]);
312  meTrendNBC.fill(EcalEndcap, double(timestamp_.iLumi), nBC[0] + nBC[1]);
313  }
314 
315  // if(ievt_ % massCalcPrescale_ != 0) return;
316 
317  // double const pi(3.14159265);
318 
319  // for(vector<reco::BasicCluster const*>::iterator bcItr1(lowMassCands.begin()); bcItr1 != lowMassCands.end(); ++bcItr1){
320  // reco::BasicCluster const& bc1(**bcItr1);
321  // float energy1(bc1.energy());
322  // float px1(energy1 * sin(bc1.position().theta()) * cos(bc1.phi()));
323  // float py1(energy1 * sin(bc1.position().theta()) * sin(bc1.phi()));
324  // float pz1(energy1 * cos(bc1.position().theta()));
325 
326  // for(vector<reco::BasicCluster const*>::iterator bcItr2(lowMassCands.begin()); bcItr2 != lowMassCands.end(); ++bcItr2){
327  // if(*bcItr1 == *bcItr2) continue;
328  // reco::BasicCluster const& bc2(**bcItr2);
329  // float energy2(bc2.energy());
330  // float px2(energy2 * sin(bc2.position().theta()) * cos(bc2.phi()));
331  // float py2(energy2 * sin(bc2.position().theta()) * sin(bc2.phi()));
332  // float pz2(energy2 * cos(bc2.position().theta()));
333 
334  // float ptpair(sqrt((px1 + px2) * (px1 + px2) + (py1 + py2) * (py1 + py2)));
335  // if(ptpair < 2.5) continue;
336 
337  // float epair(energy1 + energy2);
338  // float pzpair(abs(pz1 + pz2));
339 
340  // float m2(epair * epair - pzpair * pzpair - ptpair * ptpair);
341  // if(m2 < 0.) continue;
342 
343  // float eta(0.5 * log((epair + pzpair)/(epair - pzpair)));
344  // float phi(atan2(px1 + px2, py1 + py2));
345 
346  // float iso(0.);
347  // for(reco::BasicClusterCollection::const_iterator bcItr(_bcs.begin()); bcItr != _bcs.end(); ++bcItr){
348  // float dEta(bcItr->eta() - eta);
349  // float dPhi(bcItr->phi() - phi);
350  // if(dPhi > 2. * pi) dPhi -= 2. * pi;
351  // else if(dPhi < -2. * pi) dPhi += 2. * pi;
352  // if(sqrt(dEta * dEta + dPhi * dPhi) < 0.2) iso += bcItr->energy() * sin(bcItr->position().theta());
353  // }
354  // if(iso > 0.5) continue;
355 
356  // float mass(sqrt(m2));
357  // MEs_[kPi0]->fill(mass);
358  // MEs_[kJPsi]->fill(mass);
359  // }
360  // }
361  }

References ecaldqm::MESetCollection::at(), edm::View< T >::begin(), reco::CaloID::DET_ECAL_BARREL, reco::CaloID::DET_ECAL_ENDCAP, DetId::Ecal, EcalBarrel, EcalEndcap, edm::View< T >::end(), HCALHighEnergyHPDFilter_cfi::energy, EgHLTOffHistBins_cfi::et, ecaldqm::getGeometry(), runTauDisplay::gp, triggerObjects_cff::id, ecaldqm::DQWorker::Timestamp::iLumi, PixelPluginsPhase0_cfi::isBarrel, ecaldqm::kEBBasicCluster, ecaldqm::DQWorker::MEs_, ecaldqm::phi(), position, findQualityFiles::size, ecaldqm::DQWorker::timestamp_, and ecaldqm::zside().

Referenced by analyze().

◆ runOnRecHits()

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

Definition at line 201 of file ClusterTask.cc.

201  {
202  switch (_collection) {
203  case kEBRecHit:
204  ebHits_ = &_hits;
205  break;
206  case kEERecHit:
207  eeHits_ = &_hits;
208  break;
209  default:
210  break;
211  }
212  }

References ebHits_, eeHits_, ecaldqm::kEBRecHit, and ecaldqm::kEERecHit.

Referenced by analyze().

◆ runOnSuperClusters()

void ecaldqm::ClusterTask::runOnSuperClusters ( reco::SuperClusterCollection const &  _scs,
Collections  _collection 
)

Definition at line 363 of file ClusterTask.cc.

363  {
364  bool isBarrel(_collection == kEBSuperCluster);
366 
367  MESet& meSCE(MEs_.at("SCE"));
368  MESet& meSCELow(MEs_.at("SCELow"));
369  MESet& meSCRawE(MEs_.at("SCRawE"));
370  MESet& meSCRawELow(MEs_.at("SCRawELow"));
371  MESet& meSCNBCs(MEs_.at("SCNBCs"));
372  MESet& meSCNcrystals(MEs_.at("SCNcrystals"));
373  MESet& meTrendSCSize(MEs_.at("TrendSCSize"));
374  MESet& meSCSeedEnergy(MEs_.at("SCSeedEnergy"));
375  MESet& meSCClusterVsSeed(MEs_.at("SCClusterVsSeed"));
376  MESet& meSCSeedOccupancy(MEs_.at("SCSeedOccupancy"));
377  MESet& meSingleCrystalCluster(MEs_.at("SingleCrystalCluster"));
378  MESet& meSCR9(MEs_.at("SCR9"));
379  MESet& meSCR9Raw(MEs_.at("SCR9Raw"));
380  MESet& meSCR9Full(MEs_.at("SCR9Full"));
381  MESet& meSCR9FullRaw(MEs_.at("SCR9FullRaw"));
382 
383  MESet* meSCSizeVsEnergy(doExtra_ ? &MEs_.at("SCSizeVsEnergy") : nullptr);
384  MESet* meSCSeedOccupancyHighE(doExtra_ ? &MEs_.at("SCSeedOccupancyHighE") : nullptr);
385  MESet* meSCSeedOccupancyTrig(doExtra_ ? &MEs_.at("SCSeedOccupancyTrig") : nullptr);
386  MESet* meSCSeedTimeTrigEx(doExtra_ ? &MEs_.at("SCSeedTimeTrigEx") : nullptr);
387  MESet* meSCSeedTimeMapTrigEx(doExtra_ ? &MEs_.at("SCSeedTimeMapTrigEx") : nullptr);
388  MESet* meSCOccupancyProjEta(doExtra_ ? &MEs_.at("SCOccupancyProjEta") : nullptr);
389  MESet* meSCOccupancyProjPhi(doExtra_ ? &MEs_.at("SCOccupancyProjPhi") : nullptr);
390  MESet* meSCSwissCross(doExtra_ ? &MEs_.at("SCSwissCross") : nullptr);
391 
393 
394  // reco::SuperCluster const* leading(0);
395  // reco::SuperCluster const* subLeading(0);
396 
397  int nSC(0);
398 
399  for (reco::SuperClusterCollection::const_iterator scItr(_scs.begin()); scItr != _scs.end(); ++scItr) {
400  DetId seedId(scItr->seed()->seed());
401  if (seedId.null()) {
402  math::XYZPoint const& position(scItr->position());
403 
404  GlobalPoint gp(position.x(), position.y(), position.z());
405 
406  CaloSubdetectorGeometry const* subgeom(
407  getGeometry()->getSubdetectorGeometry(DetId::Ecal, isBarrel ? EcalBarrel : EcalEndcap));
408 
409  seedId = subgeom->getClosestCell(gp);
410  }
411 
412  if (seedId.null() || (seedId.subdetId() != subdet))
413  continue;
414 
415  EcalRecHitCollection::const_iterator seedItr(hits->find(seedId));
416  if (seedItr == hits->end())
417  continue;
418 
419  ++nSC;
420 
421  float energy(scItr->energy());
422  float rawEnergy(scItr->rawEnergy());
423  float size(scItr->size());
424 
425  meSCE.fill(seedId, energy);
426  meSCELow.fill(seedId, energy);
427 
428  meSCRawE.fill(seedId, rawEnergy);
429  meSCRawELow.fill(seedId, rawEnergy);
430 
431  meSCNBCs.fill(seedId, scItr->clustersSize());
432  meSCNcrystals.fill(seedId, size);
433 
434  if (doExtra_)
435  meSCSizeVsEnergy->fill(subdet, energy, size);
436 
437  meTrendSCSize.fill(seedId, double(timestamp_.iLumi), size);
438 
439  meSCSeedEnergy.fill(seedId, seedItr->energy());
440  meSCClusterVsSeed.fill(seedId, seedItr->energy(), energy);
441 
442  meSCSeedOccupancy.fill(seedId);
444  meSCSeedOccupancyHighE->fill(seedId);
445 
446  if (scItr->size() == 1)
447  meSingleCrystalCluster.fill(seedId);
448 
449  float e3x3(EcalClusterTools::e3x3(*scItr->seed(), hits, getTopology()));
450  float e3x3Full(noZS::EcalClusterTools::e3x3(*scItr->seed(), hits, getTopology()));
451 
452  meSCR9.fill(seedId, e3x3 / energy);
453  meSCR9Raw.fill(seedId, e3x3 / rawEnergy);
454  meSCR9Full.fill(seedId, e3x3Full / energy);
455  meSCR9FullRaw.fill(seedId, e3x3Full / rawEnergy);
456 
457  if (doExtra_) {
458  for (unsigned iT(0); iT != nTriggerTypes; ++iT) {
459  if (!triggered_[iT])
460  continue;
461 
462  static_cast<MESetMulti*>(meSCSeedOccupancyTrig)->use(trigTypeToME_[iT]);
463  meSCSeedOccupancyTrig->fill(seedId);
464 
465  // exclusive
466  if (triggered_.count() == 1) {
467  static_cast<MESetMulti*>(meSCSeedTimeTrigEx)->use(trigTypeToME_[iT]);
468  static_cast<MESetMulti*>(meSCSeedTimeMapTrigEx)->use(trigTypeToME_[iT]);
469  meSCSeedTimeTrigEx->fill(subdet, seedItr->time());
470  meSCSeedTimeMapTrigEx->fill(seedId, seedItr->time());
471  }
472  }
473 
474  meSCOccupancyProjEta->fill(subdet, scItr->eta());
475  meSCOccupancyProjPhi->fill(subdet, phi(scItr->phi()));
476 
477  if (isBarrel) {
478  float e1(EcalClusterTools::eMax(*scItr, ebHits_));
479  if (e1 > swissCrossMaxThreshold_) {
480  float e4(EcalClusterTools::eTop(*scItr, ebHits_, getTopology()) +
481  EcalClusterTools::eRight(*scItr, ebHits_, getTopology()) +
482  EcalClusterTools::eBottom(*scItr, ebHits_, getTopology()) +
483  EcalClusterTools::eLeft(*scItr, ebHits_, getTopology()));
484 
485  meSCSwissCross->fill(1. - e4 / e1);
486  }
487  }
488  }
489 
490  // if(ievt_ % massCalcPrescale_ != 0) continue;
491 
492  // float et(energy * sin(scItr->position().theta()));
493  // if(!leading || et > leading->energy() * sin(leading->position().theta())){
494  // subLeading = leading;
495  // leading = &(*scItr);
496  // }
497  // else if(!subLeading || et > subLeading->energy() * sin(subLeading->position().theta())){
498  // subLeading = &(*scItr);
499  // }
500  }
501 
502  MEs_.at("SCNum").fill(subdet, nSC);
503  MEs_.at("TrendNSC").fill(subdet, double(timestamp_.iLumi), nSC);
504 
505  // if(ievt_ % massCalcPrescale_ != 0) return;
506 
507  // // implement isolation & cuts
508  // if(!leading || !subLeading) return;
509  // float e(leading->energy() + subLeading->energy());
510  // float px(leading->energy() * sin(leading->position().theta()) * cos(leading->phi()) + subLeading->energy() * sin(subLeading->position().theta()) * cos(subLeading->phi()));
511  // float py(leading->energy() * sin(leading->position().theta()) * sin(leading->phi()) + subLeading->energy() * sin(subLeading->position().theta()) * sin(subLeading->phi()));
512  // float pz(leading->energy() * cos(leading->position().theta()) + subLeading->energy() * cos(subLeading->position().theta()));
513  // float m2(e * e - px * px - py * py - pz * pz);
514  // if(m2 < 0.) return;
515  // float mass(sqrt(m2));
516  // MEs_[kZ]->fill(mass);
517  // MEs_[kHighMass]->fill(mass);
518  }

References ecaldqm::MESetCollection::at(), doExtra_, StorageManager_cfg::e1, EcalClusterToolsT< noZS >::e3x3(), vertexPlots::e4, ebHits_, DetId::Ecal, EcalBarrel, EcalEndcap, eeHits_, cosmicPhotonAnalyzer_cfi::eMax, HCALHighEnergyHPDFilter_cfi::energy, energyThreshold_, ecaldqm::MESet::fill(), ecaldqm::getGeometry(), ecaldqm::getTopology(), runTauDisplay::gp, hfClusterShapes_cfi::hits, ecaldqm::DQWorker::Timestamp::iLumi, PixelPluginsPhase0_cfi::isBarrel, ecaldqm::kEBSuperCluster, ecaldqm::DQWorker::MEs_, nTriggerTypes, ecaldqm::phi(), position, findQualityFiles::size, swissCrossMaxThreshold_, ecaldqm::DQWorker::timestamp_, triggered_, and trigTypeToME_.

Referenced by analyze().

◆ setParams()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 37 of file ClusterTask.cc.

37  {
38  doExtra_ = _params.getUntrackedParameter<bool>("doExtra");
39 
40  if (!doExtra_) {
41  MEs_.erase(std::string("SCSizeVsEnergy"));
42  MEs_.erase(std::string("SCSeedOccupancyHighE"));
43  MEs_.erase(std::string("SCSeedOccupancyTrig"));
44  MEs_.erase(std::string("SCSeedTimeTrigEx"));
45  MEs_.erase(std::string("SCSeedTimeMapTrigEx"));
46  MEs_.erase(std::string("SCOccupancyProjEta"));
47  MEs_.erase(std::string("SCOccupancyProjPhi"));
48  MEs_.erase(std::string("SCSwissCross"));
49  MEs_.erase(std::string("Triggers"));
50  MEs_.erase(std::string("ExclusiveTriggers"));
51 
52  return;
53  }
54 
55  energyThreshold_ = _params.getUntrackedParameter<double>("energyThreshold");
56  swissCrossMaxThreshold_ = _params.getUntrackedParameter<double>("swissCrossMaxThreshold");
57  egTriggerAlgos_ = _params.getUntrackedParameter<std::vector<std::string> >("egTriggerAlgos");
58  L1GlobalTriggerReadoutRecordTag_ = _params.getUntrackedParameter<edm::InputTag>("L1GlobalTriggerReadoutRecordTag");
59  L1MuGMTReadoutCollectionTag_ = _params.getUntrackedParameter<edm::InputTag>("L1MuGMTReadoutCollectionTag");
60 
62 
63  std::string triggerTypeNames[nTriggerTypes] = {"ECAL", "HCAL", "CSC", "DT", "RPC"};
64 
65  MESetMulti& occupancy(static_cast<MESetMulti&>(MEs_.at("SCSeedOccupancyTrig")));
66  for (unsigned iT(0); iT != nTriggerTypes; ++iT) {
67  repl["trig"] = triggerTypeNames[iT];
68  trigTypeToME_[iT] = occupancy.getIndex(repl);
69  }
70  }

References l1extraParticles_cfi::_params, ecaldqm::MESetCollection::at(), doExtra_, egTriggerAlgos_, energyThreshold_, ecaldqm::MESetCollection::erase(), ecaldqm::MESetMulti::getIndex(), L1GlobalTriggerReadoutRecordTag_, L1MuGMTReadoutCollectionTag_, ecaldqm::DQWorker::MEs_, nTriggerTypes, AlCaHLTBitMon_QueryRunRegistry::string, swissCrossMaxThreshold_, and trigTypeToME_.

◆ setTokens()

void ecaldqm::ClusterTask::setTokens ( edm::ConsumesCollector _collector)
overridevirtual

Member Data Documentation

◆ doExtra_

bool ecaldqm::ClusterTask::doExtra_
private

Definition at line 49 of file ClusterTask.h.

Referenced by beginEvent(), runOnSuperClusters(), and setParams().

◆ ebHits_

EcalRecHitCollection const* ecaldqm::ClusterTask::ebHits_
private

Definition at line 45 of file ClusterTask.h.

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

◆ eeHits_

EcalRecHitCollection const* ecaldqm::ClusterTask::eeHits_
private

Definition at line 46 of file ClusterTask.h.

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

◆ egTriggerAlgos_

std::vector<std::string> ecaldqm::ClusterTask::egTriggerAlgos_
private

Definition at line 52 of file ClusterTask.h.

Referenced by beginEvent(), and setParams().

◆ energyThreshold_

float ecaldqm::ClusterTask::energyThreshold_
private

Definition at line 50 of file ClusterTask.h.

Referenced by runOnSuperClusters(), and setParams().

◆ L1GlobalTriggerReadoutRecordTag_

edm::InputTag ecaldqm::ClusterTask::L1GlobalTriggerReadoutRecordTag_
private

Definition at line 56 of file ClusterTask.h.

Referenced by setParams(), and setTokens().

◆ L1GlobalTriggerReadoutRecordToken_

edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> ecaldqm::ClusterTask::L1GlobalTriggerReadoutRecordToken_
private

Definition at line 58 of file ClusterTask.h.

Referenced by beginEvent(), and setTokens().

◆ L1MuGMTReadoutCollectionTag_

edm::InputTag ecaldqm::ClusterTask::L1MuGMTReadoutCollectionTag_
private

Definition at line 57 of file ClusterTask.h.

Referenced by setParams(), and setTokens().

◆ L1MuGMTReadoutCollectionToken_

edm::EDGetTokenT<L1MuGMTReadoutCollection> ecaldqm::ClusterTask::L1MuGMTReadoutCollectionToken_
private

Definition at line 59 of file ClusterTask.h.

Referenced by beginEvent(), and setTokens().

◆ swissCrossMaxThreshold_

float ecaldqm::ClusterTask::swissCrossMaxThreshold_
private

Definition at line 51 of file ClusterTask.h.

Referenced by runOnSuperClusters(), and setParams().

◆ triggered_

std::bitset<nTriggerTypes> ecaldqm::ClusterTask::triggered_
private

Definition at line 53 of file ClusterTask.h.

Referenced by beginEvent(), and runOnSuperClusters().

◆ trigTypeToME_

unsigned ecaldqm::ClusterTask::trigTypeToME_[nTriggerTypes]
private

Definition at line 54 of file ClusterTask.h.

Referenced by runOnSuperClusters(), and setParams().

EcalDCCHeaderBlock::COSMICS_LOCAL
Definition: EcalDCCHeaderBlock.h:49
edm::View::begin
const_iterator begin() const
ecaldqm::getTopology
const CaloTopology * getTopology()
Definition: EcalDQMCommonUtils.cc:498
ecaldqm::ClusterTask::ebHits_
EcalRecHitCollection const * ebHits_
Definition: ClusterTask.h:45
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
L1GtPsbWord::aData
const cms_uint16_t aData(int iA) const
get/set A_DATA_CH_IA
Definition: L1GtPsbWord.cc:181
ecaldqm::ClusterTask::L1GlobalTriggerReadoutRecordToken_
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > L1GlobalTriggerReadoutRecordToken_
Definition: ClusterTask.h:58
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
ecaldqm::kEBBasicCluster
Definition: Collections.h:40
ecaldqm::kEESuperCluster
Definition: Collections.h:43
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
reco::CaloID::DET_ECAL_ENDCAP
Definition: CaloID.h:21
ecaldqm::MESet::PathReplacements
std::map< std::string, std::string > PathReplacements
Definition: MESet.h:31
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
edm::SortedCollection< EcalRecHit >
ecaldqm::ClusterTask::kRPCTrigger
Definition: ClusterTask.h:40
EcalSubdetector
EcalSubdetector
Definition: EcalSubdetector.h:10
L1GlobalTriggerReadoutRecord::gtPsbWord
const L1GtPsbWord gtPsbWord(cms_uint16_t boardIdValue, int bxInEventValue) const
get / set PSB word (record) in the GT readout record
Definition: L1GlobalTriggerReadoutRecord.cc:421
L1GtPsbWord
Definition: L1GtPsbWord.h:29
watchdog.const
const
Definition: watchdog.py:83
edm::Handle
Definition: AssociativeIterator.h:50
ecaldqm::ClusterTask::runOnBasicClusters
void runOnBasicClusters(edm::View< reco::CaloCluster > const &, Collections)
Definition: ClusterTask.cc:214
L1GlobalTriggerReadoutRecord
Definition: L1GlobalTriggerReadoutRecord.h:46
EcalBarrel
Definition: EcalSubdetector.h:10
L1GtPsbWord::bData
const cms_uint16_t bData(int iB) const
get/set B_DATA_CH_IB
Definition: L1GtPsbWord.cc:253
ecaldqm::ClusterTask::nTriggerTypes
Definition: ClusterTask.h:40
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
ecaldqm::ClusterTask::kEcalTrigger
Definition: ClusterTask.h:40
ecaldqm::MESet::fill
virtual void fill(DetId const &, double=1., double=1., double=1.)
Definition: MESet.h:46
DetId
Definition: DetId.h:17
EcalDCCHeaderBlock::PHYSICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:37
ecaldqm::ClusterTask::egTriggerAlgos_
std::vector< std::string > egTriggerAlgos_
Definition: ClusterTask.h:52
ecaldqm::DQWorkerTask::DQWorkerTask
DQWorkerTask()
Definition: DQWorkerTask.cc:8
L1GtTriggerMenuRcd
Definition: L1GtTriggerMenuRcd.h:32
ecaldqm::ClusterTask::runOnRecHits
void runOnRecHits(EcalRecHitCollection const &, Collections)
Definition: ClusterTask.cc:201
edm::ESHandle
Definition: DTSurvey.h:22
ecaldqm::ClusterTask::doExtra_
bool doExtra_
Definition: ClusterTask.h:49
ecaldqm::kEBRecHit
Definition: Collections.h:36
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
ecaldqm::getGeometry
const CaloGeometry * getGeometry()
Definition: EcalDQMCommonUtils.cc:478
Point3DBase< float, GlobalTag >
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:78
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalEndcap
Definition: EcalSubdetector.h:10
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
edm::View
Definition: CaloClusterFwd.h:14
ecaldqm::ClusterTask::L1MuGMTReadoutCollectionToken_
edm::EDGetTokenT< L1MuGMTReadoutCollection > L1MuGMTReadoutCollectionToken_
Definition: ClusterTask.h:59
ecaldqm::ClusterTask::kDTTrigger
Definition: ClusterTask.h:40
optionsL1T.menu
menu
Definition: optionsL1T.py:29
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
L1GtTriggerMenu
Definition: L1GtTriggerMenu.h:48
L1MuGMTReadoutCollection::getRecords
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
Definition: L1MuGMTReadoutCollection.h:52
cosmicPhotonAnalyzer_cfi.eMax
eMax
Definition: cosmicPhotonAnalyzer_cfi.py:10
EcalDCCHeaderBlock::PHYSICS_LOCAL
Definition: EcalDCCHeaderBlock.h:48
L1GlobalTriggerReadoutRecord::decisionWord
const DecisionWord & decisionWord(int bxInEventValue) const
Definition: L1GlobalTriggerReadoutRecord.cc:186
ecaldqm::MESetCollection::at
MESet & at(const std::string &key)
Definition: MESet.h:362
StorageManager_cfg.e1
e1
Definition: StorageManager_cfg.py:16
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
ecaldqm::ClusterTask::energyThreshold_
float energyThreshold_
Definition: ClusterTask.h:50
ecaldqm::ClusterTask::triggered_
std::bitset< nTriggerTypes > triggered_
Definition: ClusterTask.h:53
ecaldqm::MESetCollection::erase
void erase(const std::string &key)
Definition: MESet.h:353
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
ecaldqm::ClusterTask::L1GlobalTriggerReadoutRecordTag_
edm::InputTag L1GlobalTriggerReadoutRecordTag_
Definition: ClusterTask.h:56
DetId::Ecal
Definition: DetId.h:27
get
#define get
ecaldqm::ClusterTask::trigTypeToME_
unsigned trigTypeToME_[nTriggerTypes]
Definition: ClusterTask.h:54
ecaldqm::ClusterTask::swissCrossMaxThreshold_
float swissCrossMaxThreshold_
Definition: ClusterTask.h:51
DecisionWord
std::vector< bool > DecisionWord
typedefs
Definition: L1GlobalTriggerReadoutSetupFwd.h:34
EcalClusterToolsT::e3x3
static float e3x3(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:514
ecaldqm::DQWorker::Timestamp::iLumi
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
ecaldqm::ClusterTask::eeHits_
EcalRecHitCollection const * eeHits_
Definition: ClusterTask.h:46
ecaldqm::kEERecHit
Definition: Collections.h:37
L1MuGMTReadoutCollection
Definition: L1MuGMTReadoutCollection.h:39
EcalDCCHeaderBlock::COSMICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:38
ecaldqm::kEBSuperCluster
Definition: Collections.h:42
ecaldqm::ClusterTask::L1MuGMTReadoutCollectionTag_
edm::InputTag L1MuGMTReadoutCollectionTag_
Definition: ClusterTask.h:57
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
ecaldqm::ClusterTask::runOnSuperClusters
void runOnSuperClusters(reco::SuperClusterCollection const &, Collections)
Definition: ClusterTask.cc:363
EcalDCCHeaderBlock::MTCC
Definition: EcalDCCHeaderBlock.h:25
ecaldqm::DQWorker::timestamp_
Timestamp timestamp_
Definition: DQWorker.h:81
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
ecaldqm::ClusterTask::kCSCTrigger
Definition: ClusterTask.h:40
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
ecaldqm::ClusterTask::kHcalTrigger
Definition: ClusterTask.h:40
edm::InputTag
Definition: InputTag.h:15
vertexPlots.e4
e4
Definition: vertexPlots.py:64
reco::CaloID::DET_ECAL_BARREL
Definition: CaloID.h:20
ecaldqm::phi
double phi(EBDetId const &)
Definition: EcalDQMCommonUtils.cc:215
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443