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 &)
 
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

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_
 
edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcdmenuRcd
 
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)
 
- 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 22 of file ClusterTask.h.

Member Enumeration Documentation

◆ TriggerTypes

Constructor & Destructor Documentation

◆ ClusterTask()

ecaldqm::ClusterTask::ClusterTask ( )

Definition at line 18 of file ClusterTask.cc.

19  : DQWorkerTask(),
20  ebHits_(nullptr),
21  eeHits_(nullptr),
22  // ievt_(0),
23  // massCalcPrescale_(_workerParams.getUntrackedParameter<int>("massCalcPrescale")),
24  doExtra_(true),
25  energyThreshold_(0.),
28  trigTypeToME_{0, 1, 2, 3, 4},
EcalRecHitCollection const * ebHits_
Definition: ClusterTask.h:47
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > L1GlobalTriggerReadoutRecordToken_
Definition: ClusterTask.h:60
std::vector< std::string > egTriggerAlgos_
Definition: ClusterTask.h:54
float swissCrossMaxThreshold_
Definition: ClusterTask.h:53
unsigned trigTypeToME_[nTriggerTypes]
Definition: ClusterTask.h:56
EcalRecHitCollection const * eeHits_
Definition: ClusterTask.h:48
edm::EDGetTokenT< L1MuGMTReadoutCollection > L1MuGMTReadoutCollectionToken_
Definition: ClusterTask.h:61
edm::InputTag L1GlobalTriggerReadoutRecordTag_
Definition: ClusterTask.h:58
edm::InputTag L1MuGMTReadoutCollectionTag_
Definition: ClusterTask.h:59

◆ ~ClusterTask()

ecaldqm::ClusterTask::~ClusterTask ( )
inlineoverride

Definition at line 25 of file ClusterTask.h.

25 {}

Member Function Documentation

◆ addDependencies()

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

◆ analyze()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 65 of file ClusterTask.h.

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

65  {
66  switch (_collection) {
67  case kEBRecHit:
68  case kEERecHit:
69  if (_p)
70  runOnRecHits(*static_cast<EcalRecHitCollection const*>(_p), _collection);
71  return true;
72  break;
73  case kEBBasicCluster:
74  case kEEBasicCluster:
75  if (_p)
76  runOnBasicClusters(*static_cast<edm::View<reco::CaloCluster> const*>(_p), _collection);
77  return true;
78  break;
79  case kEBSuperCluster:
80  case kEESuperCluster:
81  if (_p)
82  runOnSuperClusters(*static_cast<reco::SuperClusterCollection const*>(_p), _collection);
83  return true;
84  break;
85  default:
86  break;
87  }
88 
89  return false;
90  }
void runOnBasicClusters(edm::View< reco::CaloCluster > const &, Collections)
Definition: ClusterTask.cc:210
void runOnRecHits(EcalRecHitCollection const &, Collections)
Definition: ClusterTask.cc:197
void runOnSuperClusters(reco::SuperClusterCollection const &, Collections)
Definition: ClusterTask.cc:359

◆ beginEvent()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 74 of file ClusterTask.cc.

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

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

◆ endEvent()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 178 of file ClusterTask.cc.

References ebHits_, and eeHits_.

178  {
179  // ++ievt_;
180 
181  ebHits_ = nullptr;
182  eeHits_ = nullptr;
183  }
EcalRecHitCollection const * ebHits_
Definition: ClusterTask.h:47
EcalRecHitCollection const * eeHits_
Definition: ClusterTask.h:48

◆ filterRunType()

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

◆ runOnBasicClusters()

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

Definition at line 210 of file ClusterTask.cc.

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(), hcalRecHitTable_cff::energy, EgHLTOffHistBins_cfi::et, ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetGeometry(), l1ctLayer2EG_cff::id, ecaldqm::DQWorker::Timestamp::iLumi, PixelPluginsPhase0_cfi::isBarrel, ecaldqm::kEBBasicCluster, ecaldqm::DQWorker::MEs_, ecaldqm::phi(), position, ecaldqm::DQWorker::timestamp_, and ecaldqm::zside().

Referenced by analyze().

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

◆ runOnRecHits()

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

Definition at line 197 of file ClusterTask.cc.

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

Referenced by analyze().

197  {
198  switch (_collection) {
199  case kEBRecHit:
200  ebHits_ = &_hits;
201  break;
202  case kEERecHit:
203  eeHits_ = &_hits;
204  break;
205  default:
206  break;
207  }
208  }
EcalRecHitCollection const * ebHits_
Definition: ClusterTask.h:47
EcalRecHitCollection const * eeHits_
Definition: ClusterTask.h:48

◆ runOnSuperClusters()

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

Definition at line 359 of file ClusterTask.cc.

References ecaldqm::MESetCollection::at(), doExtra_, StorageManager_cfg::e1, EcalClusterToolsT< noZS >::e3x3(), vertexPlots::e4, ebHits_, electrons_cff::eBottom, DetId::Ecal, EcalBarrel, EcalEndcap, eeHits_, electrons_cff::eLeft, cosmicPhotonAnalyzer_cfi::eMax, hcalRecHitTable_cff::energy, energyThreshold_, electrons_cff::eRight, electrons_cff::eTop, ecaldqm::MESetMulti::fill(), ecaldqm::MESet::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetGeometry(), ecaldqm::DQWorker::GetTopology(), hfClusterShapes_cfi::hits, ecaldqm::DQWorker::Timestamp::iLumi, PixelPluginsPhase0_cfi::isBarrel, ecaldqm::kEBSuperCluster, ecaldqm::DQWorker::MEs_, nTriggerTypes, ecaldqm::phi(), position, electrons_cff::rawEnergy, run3scouting_cff::seedId, swissCrossMaxThreshold_, ecaldqm::DQWorker::timestamp_, triggered_, and trigTypeToME_.

Referenced by analyze().

359  {
360  bool isBarrel(_collection == kEBSuperCluster);
362 
363  MESet& meSCE(MEs_.at("SCE"));
364  MESet& meSCELow(MEs_.at("SCELow"));
365  MESet& meSCRawE(MEs_.at("SCRawE"));
366  MESet& meSCRawELow(MEs_.at("SCRawELow"));
367  MESet& meSCNBCs(MEs_.at("SCNBCs"));
368  MESet& meSCNcrystals(MEs_.at("SCNcrystals"));
369  MESet& meTrendSCSize(MEs_.at("TrendSCSize"));
370  MESet& meSCSeedEnergy(MEs_.at("SCSeedEnergy"));
371  MESet& meSCClusterVsSeed(MEs_.at("SCClusterVsSeed"));
372  MESet& meSCSeedOccupancy(MEs_.at("SCSeedOccupancy"));
373  MESet& meSingleCrystalCluster(MEs_.at("SingleCrystalCluster"));
374  MESet& meSCR9(MEs_.at("SCR9"));
375  MESet& meSCR9Raw(MEs_.at("SCR9Raw"));
376  MESet& meSCR9Full(MEs_.at("SCR9Full"));
377  MESet& meSCR9FullRaw(MEs_.at("SCR9FullRaw"));
378 
379  MESet* meSCSizeVsEnergy(doExtra_ ? &MEs_.at("SCSizeVsEnergy") : nullptr);
380  MESet* meSCSeedOccupancyHighE(doExtra_ ? &MEs_.at("SCSeedOccupancyHighE") : nullptr);
381  MESet* meSCSeedOccupancyTrig(doExtra_ ? &MEs_.at("SCSeedOccupancyTrig") : nullptr);
382  MESet* meSCSeedTimeTrigEx(doExtra_ ? &MEs_.at("SCSeedTimeTrigEx") : nullptr);
383  MESet* meSCSeedTimeMapTrigEx(doExtra_ ? &MEs_.at("SCSeedTimeMapTrigEx") : nullptr);
384  MESet* meSCOccupancyProjEta(doExtra_ ? &MEs_.at("SCOccupancyProjEta") : nullptr);
385  MESet* meSCOccupancyProjPhi(doExtra_ ? &MEs_.at("SCOccupancyProjPhi") : nullptr);
386  MESet* meSCSwissCross(doExtra_ ? &MEs_.at("SCSwissCross") : nullptr);
387 
389 
390  // reco::SuperCluster const* leading(0);
391  // reco::SuperCluster const* subLeading(0);
392 
393  int nSC(0);
394 
395  for (reco::SuperClusterCollection::const_iterator scItr(_scs.begin()); scItr != _scs.end(); ++scItr) {
396  DetId seedId(scItr->seed()->seed());
397  if (seedId.null()) {
398  math::XYZPoint const& position(scItr->position());
399 
400  GlobalPoint gp(position.x(), position.y(), position.z());
401 
402  CaloSubdetectorGeometry const* subgeom(
403  GetGeometry()->getSubdetectorGeometry(DetId::Ecal, isBarrel ? EcalBarrel : EcalEndcap));
404 
405  seedId = subgeom->getClosestCell(gp);
406  }
407 
408  if (seedId.null() || (seedId.subdetId() != subdet))
409  continue;
410 
412  if (seedItr == hits->end())
413  continue;
414 
415  ++nSC;
416 
417  float energy(scItr->energy());
418  float rawEnergy(scItr->rawEnergy());
419  float size(scItr->size());
420 
421  meSCE.fill(getEcalDQMSetupObjects(), seedId, energy);
422  meSCELow.fill(getEcalDQMSetupObjects(), seedId, energy);
423 
424  meSCRawE.fill(getEcalDQMSetupObjects(), seedId, rawEnergy);
425  meSCRawELow.fill(getEcalDQMSetupObjects(), seedId, rawEnergy);
426 
427  meSCNBCs.fill(getEcalDQMSetupObjects(), seedId, scItr->clustersSize());
428  meSCNcrystals.fill(getEcalDQMSetupObjects(), seedId, size);
429 
430  if (doExtra_)
431  meSCSizeVsEnergy->fill(getEcalDQMSetupObjects(), subdet, energy, size);
432 
433  meTrendSCSize.fill(getEcalDQMSetupObjects(), seedId, double(timestamp_.iLumi), size);
434 
435  meSCSeedEnergy.fill(getEcalDQMSetupObjects(), seedId, seedItr->energy());
436  meSCClusterVsSeed.fill(getEcalDQMSetupObjects(), seedId, seedItr->energy(), energy);
437 
438  meSCSeedOccupancy.fill(getEcalDQMSetupObjects(), seedId);
440  meSCSeedOccupancyHighE->fill(getEcalDQMSetupObjects(), seedId);
441 
442  if (scItr->size() == 1)
443  meSingleCrystalCluster.fill(getEcalDQMSetupObjects(), seedId);
444 
445  float e3x3(EcalClusterTools::e3x3(*scItr->seed(), hits, GetTopology()));
446  float e3x3Full(noZS::EcalClusterTools::e3x3(*scItr->seed(), hits, GetTopology()));
447 
448  meSCR9.fill(getEcalDQMSetupObjects(), seedId, e3x3 / energy);
449  meSCR9Raw.fill(getEcalDQMSetupObjects(), seedId, e3x3 / rawEnergy);
450  meSCR9Full.fill(getEcalDQMSetupObjects(), seedId, e3x3Full / energy);
451  meSCR9FullRaw.fill(getEcalDQMSetupObjects(), seedId, e3x3Full / rawEnergy);
452 
453  if (doExtra_) {
454  for (unsigned iT(0); iT != nTriggerTypes; ++iT) {
455  if (!triggered_[iT])
456  continue;
457 
458  static_cast<MESetMulti*>(meSCSeedOccupancyTrig)->use(trigTypeToME_[iT]);
459  meSCSeedOccupancyTrig->fill(getEcalDQMSetupObjects(), seedId);
460 
461  // exclusive
462  if (triggered_.count() == 1) {
463  static_cast<MESetMulti*>(meSCSeedTimeTrigEx)->use(trigTypeToME_[iT]);
464  static_cast<MESetMulti*>(meSCSeedTimeMapTrigEx)->use(trigTypeToME_[iT]);
465  meSCSeedTimeTrigEx->fill(getEcalDQMSetupObjects(), subdet, seedItr->time());
466  meSCSeedTimeMapTrigEx->fill(getEcalDQMSetupObjects(), seedId, seedItr->time());
467  }
468  }
469 
470  meSCOccupancyProjEta->fill(getEcalDQMSetupObjects(), subdet, scItr->eta());
471  meSCOccupancyProjPhi->fill(getEcalDQMSetupObjects(), subdet, phi(scItr->phi()));
472 
473  if (isBarrel) {
474  float e1(EcalClusterTools::eMax(*scItr, ebHits_));
475  if (e1 > swissCrossMaxThreshold_) {
476  float e4(EcalClusterTools::eTop(*scItr, ebHits_, GetTopology()) +
480 
481  meSCSwissCross->fill(getEcalDQMSetupObjects(), 1. - e4 / e1);
482  }
483  }
484  }
485 
486  // if(ievt_ % massCalcPrescale_ != 0) continue;
487 
488  // float et(energy * sin(scItr->position().theta()));
489  // if(!leading || et > leading->energy() * sin(leading->position().theta())){
490  // subLeading = leading;
491  // leading = &(*scItr);
492  // }
493  // else if(!subLeading || et > subLeading->energy() * sin(subLeading->position().theta())){
494  // subLeading = &(*scItr);
495  // }
496  }
497 
498  MEs_.at("SCNum").fill(getEcalDQMSetupObjects(), subdet, nSC);
499  MEs_.at("TrendNSC").fill(getEcalDQMSetupObjects(), subdet, double(timestamp_.iLumi), nSC);
500 
501  // if(ievt_ % massCalcPrescale_ != 0) return;
502 
503  // // implement isolation & cuts
504  // if(!leading || !subLeading) return;
505  // float e(leading->energy() + subLeading->energy());
506  // float px(leading->energy() * sin(leading->position().theta()) * cos(leading->phi()) + subLeading->energy() * sin(subLeading->position().theta()) * cos(subLeading->phi()));
507  // float py(leading->energy() * sin(leading->position().theta()) * sin(leading->phi()) + subLeading->energy() * sin(subLeading->position().theta()) * sin(subLeading->phi()));
508  // float pz(leading->energy() * cos(leading->position().theta()) + subLeading->energy() * cos(subLeading->position().theta()));
509  // float m2(e * e - px * px - py * py - pz * pz);
510  // if(m2 < 0.) return;
511  // float mass(sqrt(m2));
512  // MEs_[kZ]->fill(mass);
513  // MEs_[kHighMass]->fill(mass);
514  }
size
Write out results.
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:48
MESet & at(const std::string &key)
Definition: MESet.h:399
EcalRecHitCollection const * ebHits_
Definition: ClusterTask.h:47
std::vector< EcalRecHit >::const_iterator const_iterator
CaloTopology const * GetTopology()
Definition: DQWorker.cc:165
CaloGeometry const * GetGeometry()
Definition: DQWorker.cc:160
float swissCrossMaxThreshold_
Definition: ClusterTask.h:53
virtual void fill(EcalDQMSetupObjects const, DetId const &, double=1., double=1., double=1.)
Definition: MESet.h:74
unsigned trigTypeToME_[nTriggerTypes]
Definition: ClusterTask.h:56
EcalRecHitCollection const * eeHits_
Definition: ClusterTask.h:48
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
Definition: DetId.h:17
Timestamp timestamp_
Definition: DQWorker.h:134
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
MESetCollection MEs_
Definition: DQWorker.h:131
static int position[264][3]
Definition: ReadPGInfo.cc:289
static float e3x3(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
std::bitset< nTriggerTypes > triggered_
Definition: ClusterTask.h:55
EcalSubdetector
double phi(EBDetId const &)

◆ setParams()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 34 of file ClusterTask.cc.

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_.

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

◆ setTokens()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 516 of file ClusterTask.cc.

References edm::ConsumesCollector::consumes(), edm::ConsumesCollector::esConsumes(), L1GlobalTriggerReadoutRecordTag_, L1GlobalTriggerReadoutRecordToken_, L1MuGMTReadoutCollectionTag_, L1MuGMTReadoutCollectionToken_, and menuRcd.

516  {
520  menuRcd = _collector.esConsumes();
521  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > L1GlobalTriggerReadoutRecordToken_
Definition: ClusterTask.h:60
edm::EDGetTokenT< L1MuGMTReadoutCollection > L1MuGMTReadoutCollectionToken_
Definition: ClusterTask.h:61
edm::InputTag L1GlobalTriggerReadoutRecordTag_
Definition: ClusterTask.h:58
edm::InputTag L1MuGMTReadoutCollectionTag_
Definition: ClusterTask.h:59
edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > menuRcd
Definition: ClusterTask.h:62

Member Data Documentation

◆ doExtra_

bool ecaldqm::ClusterTask::doExtra_
private

Definition at line 51 of file ClusterTask.h.

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

◆ ebHits_

EcalRecHitCollection const* ecaldqm::ClusterTask::ebHits_
private

Definition at line 47 of file ClusterTask.h.

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

◆ eeHits_

EcalRecHitCollection const* ecaldqm::ClusterTask::eeHits_
private

Definition at line 48 of file ClusterTask.h.

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

◆ egTriggerAlgos_

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

Definition at line 54 of file ClusterTask.h.

Referenced by beginEvent(), and setParams().

◆ energyThreshold_

float ecaldqm::ClusterTask::energyThreshold_
private

Definition at line 52 of file ClusterTask.h.

Referenced by runOnSuperClusters(), and setParams().

◆ L1GlobalTriggerReadoutRecordTag_

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

Definition at line 58 of file ClusterTask.h.

Referenced by setParams(), and setTokens().

◆ L1GlobalTriggerReadoutRecordToken_

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

Definition at line 60 of file ClusterTask.h.

Referenced by beginEvent(), and setTokens().

◆ L1MuGMTReadoutCollectionTag_

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

Definition at line 59 of file ClusterTask.h.

Referenced by setParams(), and setTokens().

◆ L1MuGMTReadoutCollectionToken_

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

Definition at line 61 of file ClusterTask.h.

Referenced by beginEvent(), and setTokens().

◆ menuRcd

edm::ESGetToken<L1GtTriggerMenu, L1GtTriggerMenuRcd> ecaldqm::ClusterTask::menuRcd
private

Definition at line 62 of file ClusterTask.h.

Referenced by beginEvent(), and setTokens().

◆ swissCrossMaxThreshold_

float ecaldqm::ClusterTask::swissCrossMaxThreshold_
private

Definition at line 53 of file ClusterTask.h.

Referenced by runOnSuperClusters(), and setParams().

◆ triggered_

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

Definition at line 55 of file ClusterTask.h.

Referenced by beginEvent(), and runOnSuperClusters().

◆ trigTypeToME_

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

Definition at line 56 of file ClusterTask.h.

Referenced by runOnSuperClusters(), and setParams().