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 Options::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:217
void runOnRecHits(EcalRecHitCollection const &, Collections)
Definition: ClusterTask.cc:204
void runOnSuperClusters(reco::SuperClusterCollection const &, Collections)
Definition: ClusterTask.cc:366

◆ 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, edm::HandleBase::isValid(), kCSCTrigger, kDTTrigger, kEcalTrigger, kHcalTrigger, kRPCTrigger, L1GlobalTriggerReadoutRecordToken_, L1MuGMTReadoutCollectionToken_, relval_steps::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 
85  if (!l1GTHndl.isValid()) {
86  edm::LogError("L1GlobalTriggerReadoutRecord")
87  << "Failed to retrieve L1GlobalTriggerReadoutRecord from the Event!";
88  return; // Exit the function early if the handle is invalid
89  }
90 
91  DecisionWord const& dWord(l1GTHndl->decisionWord());
92 
93  //Ecal
94 
95  L1GtTriggerMenu const* menu(&_es.getData(menuRcd));
96 
97  if (!dWord.empty()) { //protect against no L1GT in run
98  for (unsigned iT(0); iT != egTriggerAlgos_.size(); ++iT) {
99  if (menu->gtAlgorithmResult(egTriggerAlgos_[iT], dWord)) {
101  break;
102  }
103  }
104  }
105 
106  //Hcal
107  bool hcal_top = false;
108  bool hcal_bot = false;
109  const L1GtPsbWord psb = l1GTHndl->gtPsbWord(0xbb0d, 0);
110  std::vector<int> valid_phi;
111  if ((psb.aData(4) & 0x3f) >= 1) {
112  valid_phi.push_back((psb.aData(4) >> 10) & 0x1f);
113  }
114  if ((psb.bData(4) & 0x3f) >= 1) {
115  valid_phi.push_back((psb.bData(4) >> 10) & 0x1f);
116  }
117  if ((psb.aData(5) & 0x3f) >= 1) {
118  valid_phi.push_back((psb.aData(5) >> 10) & 0x1f);
119  }
120  if ((psb.bData(5) & 0x3f) >= 1) {
121  valid_phi.push_back((psb.bData(5) >> 10) & 0x1f);
122  }
123  std::vector<int>::const_iterator iphi;
124  for (iphi = valid_phi.begin(); iphi != valid_phi.end(); iphi++) {
125  if (*iphi < 9)
126  hcal_top = true;
127  if (*iphi > 8)
128  hcal_bot = true;
129  }
130  if (hcal_top && hcal_bot)
132 
133  //Muons
135  if (!_evt.getByToken(L1MuGMTReadoutCollectionToken_, l1MuHndl))
136  return;
137  std::vector<L1MuGMTReadoutRecord> const& records(l1MuHndl->getRecords());
138 
139  for (unsigned iR(0); iR != records.size(); ++iR) {
140  if (records[iR].getBxInEvent() != 0)
141  continue;
142 
143  unsigned iC(0);
144 
145  //DT triggers
146  std::vector<L1MuRegionalCand> dtBXCands(records[iR].getDTBXCands());
147  for (iC = 0; iC != dtBXCands.size(); ++iC)
148  if (!dtBXCands[iC].empty())
149  break;
150  if (iC != dtBXCands.size())
151  triggered_.set(kDTTrigger);
152 
153  //RPC triggers
154  std::vector<L1MuRegionalCand> brlRPCCands(records[iR].getBrlRPCCands());
155  for (iC = 0; iC != brlRPCCands.size(); ++iC)
156  if (!brlRPCCands[iC].empty())
157  break;
158  if (iC != brlRPCCands.size())
159  triggered_.set(kRPCTrigger);
160 
161  //CSC Triggers
162  std::vector<L1MuRegionalCand> cscCands(records[iR].getCSCCands());
163  for (iC = 0; iC != cscCands.size(); ++iC)
164  if (!cscCands[iC].empty())
165  break;
166  if (iC != cscCands.size())
167  triggered_.set(kCSCTrigger);
168  }
169 
170  if (triggered_.none())
171  return;
172 
173  MESet& meTriggers(MEs_.at("Triggers"));
174  MESet& meExclusiveTriggers(MEs_.at("ExclusiveTriggers"));
175 
176  for (unsigned iT(0); iT != nTriggerTypes; ++iT) {
177  if (!triggered_[iT])
178  continue;
179  meTriggers.fill(getEcalDQMSetupObjects(), iT + 0.5);
180  if (triggered_.count() == 1)
181  meExclusiveTriggers.fill(getEcalDQMSetupObjects(), iT + 0.5);
182  }
183  }
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:401
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > L1GlobalTriggerReadoutRecordToken_
Definition: ClusterTask.h:60
const DecisionWord & decisionWord(int bxInEventValue) const
Log< level::Error, false > LogError
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
bool isValid() const
Definition: HandleBase.h:70
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 185 of file ClusterTask.cc.

References ebHits_, and eeHits_.

185  {
186  // ++ievt_;
187 
188  ebHits_ = nullptr;
189  eeHits_ = nullptr;
190  }
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 217 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(), HBHEDarkening_cff::energy, l1tnanotables_cff::et, ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetGeometry(), EcalPhiSymFlatTableProducers_cfi::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().

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

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

Referenced by analyze().

204  {
205  switch (_collection) {
206  case kEBRecHit:
207  ebHits_ = &_hits;
208  break;
209  case kEERecHit:
210  eeHits_ = &_hits;
211  break;
212  default:
213  break;
214  }
215  }
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 366 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, HBHEDarkening_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, egamma_custom_cff::rawEnergy, run3scouting_cff::seedId, suppress, swissCrossMaxThreshold_, ecaldqm::DQWorker::timestamp_, triggered_, and trigTypeToME_.

Referenced by analyze().

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

◆ setTokens()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 525 of file ClusterTask.cc.

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

525  {
529  menuRcd = _collector.esConsumes();
530  }
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().