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 &) 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 ()
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
 DQWorkerTask ()
 
virtual bool filterTrigger (edm::TriggerResultsByName const &)
 
void recoverStats ()
 
void softReset ()
 
virtual ~DQWorkerTask ()
 
- 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 &)
 
std::string const & 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 ()(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 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::DQWorkerTask
std::set< std::string > resettable_
 
- 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 21 of file ClusterTask.h.

Member Enumeration Documentation

Enumerator
kEcalTrigger 
kHcalTrigger 
kCSCTrigger 
kDTTrigger 
kRPCTrigger 
nTriggerTypes 

Definition at line 41 of file ClusterTask.h.

Constructor & Destructor Documentation

ecaldqm::ClusterTask::ClusterTask ( )

Definition at line 22 of file ClusterTask.cc.

References L1GlobalTriggerReadoutRecordTag_, L1GlobalTriggerReadoutRecordToken_, L1MuGMTReadoutCollectionTag_, and L1MuGMTReadoutCollectionToken_.

22  :
23  DQWorkerTask(),
24  ebHits_(nullptr),
25  eeHits_(nullptr),
26  // ievt_(0),
27  // massCalcPrescale_(_workerParams.getUntrackedParameter<int>("massCalcPrescale")),
28  doExtra_(true),
29  energyThreshold_(0.),
32  trigTypeToME_{0, 1, 2, 3, 4},
37  {
38  }
EcalRecHitCollection const * ebHits_
Definition: ClusterTask.h:53
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > L1GlobalTriggerReadoutRecordToken_
Definition: ClusterTask.h:66
std::vector< std::string > egTriggerAlgos_
Definition: ClusterTask.h:60
float swissCrossMaxThreshold_
Definition: ClusterTask.h:59
unsigned trigTypeToME_[nTriggerTypes]
Definition: ClusterTask.h:62
EcalRecHitCollection const * eeHits_
Definition: ClusterTask.h:54
edm::EDGetTokenT< L1MuGMTReadoutCollection > L1MuGMTReadoutCollectionToken_
Definition: ClusterTask.h:67
edm::InputTag L1GlobalTriggerReadoutRecordTag_
Definition: ClusterTask.h:64
edm::InputTag L1MuGMTReadoutCollectionTag_
Definition: ClusterTask.h:65
ecaldqm::ClusterTask::~ClusterTask ( )
inline

Member Function Documentation

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 84 of file ClusterTask.cc.

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

Referenced by ~ClusterTask().

85  {
86  _dependencies.push_back(Dependency(kEBSuperCluster, kEBRecHit));
87  _dependencies.push_back(Dependency(kEESuperCluster, kEERecHit));
88  }
bool ecaldqm::ClusterTask::analyze ( void const *  _p,
Collections  _collection 
)
inlineoverridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 70 of file ClusterTask.h.

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

Referenced by ~ClusterTask().

70  {
71  switch(_collection){
72  case kEBRecHit:
73  case kEERecHit:
74  if(_p) runOnRecHits(*static_cast<EcalRecHitCollection const*>(_p), _collection);
75  return true;
76  break;
77  case kEBBasicCluster:
78  case kEEBasicCluster:
79  if(_p) runOnBasicClusters(*static_cast<edm::View<reco::CaloCluster> const*>(_p), _collection);
80  return true;
81  break;
82  case kEBSuperCluster:
83  case kEESuperCluster:
84  if(_p) runOnSuperClusters(*static_cast<reco::SuperClusterCollection const*>(_p), _collection);
85  return true;
86  break;
87  default:
88  break;
89  }
90 
91  return false;
92  }
void runOnBasicClusters(edm::View< reco::CaloCluster > const &, Collections)
Definition: ClusterTask.cc:215
void runOnRecHits(EcalRecHitCollection const &, Collections)
Definition: ClusterTask.cc:200
void runOnSuperClusters(reco::SuperClusterCollection const &, Collections)
Definition: ClusterTask.cc:361
void ecaldqm::ClusterTask::beginEvent ( edm::Event const &  _evt,
edm::EventSetup const &  _es 
)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 91 of file ClusterTask.cc.

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

Referenced by ~ClusterTask().

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 176 of file ClusterTask.cc.

References ebHits_, and eeHits_.

Referenced by ~ClusterTask().

177  {
178  // ++ievt_;
179 
180  ebHits_ = nullptr;
181  eeHits_ = nullptr;
182  }
EcalRecHitCollection const * ebHits_
Definition: ClusterTask.h:53
EcalRecHitCollection const * eeHits_
Definition: ClusterTask.h:54
bool ecaldqm::ClusterTask::filterRunType ( short const *  _runType)
overridevirtual
void ecaldqm::ClusterTask::runOnBasicClusters ( edm::View< reco::CaloCluster > const &  _bcs,
Collections  _collection 
)

Definition at line 215 of file ClusterTask.cc.

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

Referenced by analyze(), and ~ClusterTask().

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

Definition at line 200 of file ClusterTask.cc.

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

Referenced by analyze(), and ~ClusterTask().

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  }
EcalRecHitCollection const * ebHits_
Definition: ClusterTask.h:53
EcalRecHitCollection const * eeHits_
Definition: ClusterTask.h:54
void ecaldqm::ClusterTask::runOnSuperClusters ( reco::SuperClusterCollection const &  _scs,
Collections  _collection 
)

Definition at line 361 of file ClusterTask.cc.

References doExtra_, reco::e1, vertexPlots::e4, ebHits_, DetId::Ecal, EcalBarrel, EcalEndcap, eeHits_, photonPostprocessing_cfi::eMax, energyThreshold_, ecaldqm::MESetMulti::fill(), ecaldqm::getGeometry(), ecaldqm::getTopology(), runTauDisplay::gp, hfClusterShapes_cfi::hits, ecaldqm::DQWorker::Timestamp::iLumi, gedGsfElectrons_cfi::isBarrel, ecaldqm::kEBSuperCluster, ecaldqm::DQWorker::MEs_, nTriggerTypes, ecaldqm::phi(), position, findQualityFiles::size, swissCrossMaxThreshold_, ecaldqm::DQWorker::timestamp_, triggered_, and trigTypeToME_.

Referenced by analyze(), and ~ClusterTask().

362  {
363  bool isBarrel(_collection == kEBSuperCluster);
365 
366  MESet& meSCE(MEs_.at("SCE"));
367  MESet& meSCELow(MEs_.at("SCELow"));
368  MESet& meSCNBCs(MEs_.at("SCNBCs"));
369  MESet& meSCNcrystals(MEs_.at("SCNcrystals"));
370  MESet& meTrendSCSize(MEs_.at("TrendSCSize"));
371  MESet& meSCSeedEnergy(MEs_.at("SCSeedEnergy"));
372  MESet& meSCClusterVsSeed(MEs_.at("SCClusterVsSeed"));
373  MESet& meSCSeedOccupancy(MEs_.at("SCSeedOccupancy"));
374  MESet& meSingleCrystalCluster(MEs_.at("SingleCrystalCluster"));
375  MESet& meSCR9(MEs_.at("SCR9"));
376 
377  MESet* meSCSizeVsEnergy(doExtra_ ? &MEs_.at("SCSizeVsEnergy") : nullptr);
378  MESet* meSCSeedOccupancyHighE(doExtra_ ? &MEs_.at("SCSeedOccupancyHighE") : nullptr);
379  MESet* meSCSeedOccupancyTrig(doExtra_ ? &MEs_.at("SCSeedOccupancyTrig") : nullptr);
380  MESet* meSCSeedTimeTrigEx(doExtra_ ? &MEs_.at("SCSeedTimeTrigEx") : nullptr);
381  MESet* meSCSeedTimeMapTrigEx(doExtra_ ? &MEs_.at("SCSeedTimeMapTrigEx") : nullptr);
382  MESet* meSCOccupancyProjEta(doExtra_ ? &MEs_.at("SCOccupancyProjEta") : nullptr);
383  MESet* meSCOccupancyProjPhi(doExtra_ ? &MEs_.at("SCOccupancyProjPhi") : nullptr);
384  MESet* meSCSwissCross(doExtra_ ? &MEs_.at("SCSwissCross") : nullptr);
385 
387 
388  // reco::SuperCluster const* leading(0);
389  // reco::SuperCluster const* subLeading(0);
390 
391  int nSC(0);
392 
393  for(reco::SuperClusterCollection::const_iterator scItr(_scs.begin()); scItr != _scs.end(); ++scItr){
394  DetId seedId(scItr->seed()->seed());
395  if(seedId.null()){
396  math::XYZPoint const& position(scItr->position());
397 
398  GlobalPoint gp(position.x(), position.y(), position.z());
399 
400  CaloSubdetectorGeometry const* subgeom(getGeometry()->getSubdetectorGeometry(DetId::Ecal, isBarrel ? EcalBarrel : EcalEndcap));
401 
402  seedId = subgeom->getClosestCell(gp);
403  }
404 
405  if(seedId.null() || (seedId.subdetId() != subdet)) continue;
406 
407  EcalRecHitCollection::const_iterator seedItr(hits->find(seedId));
408  if(seedItr == hits->end()) continue;
409 
410  ++nSC;
411 
412  float energy(scItr->energy());
413  float size(scItr->size());
414 
415  meSCE.fill(seedId, energy);
416  meSCELow.fill(seedId, energy);
417 
418  meSCNBCs.fill(seedId, scItr->clustersSize());
419  meSCNcrystals.fill(seedId, size);
420 
421  if(doExtra_) meSCSizeVsEnergy->fill(subdet, energy, size);
422 
423  meTrendSCSize.fill(seedId, double(timestamp_.iLumi), size);
424 
425  meSCSeedEnergy.fill(seedId, seedItr->energy());
426  meSCClusterVsSeed.fill(seedId, seedItr->energy(), energy);
427 
428  meSCSeedOccupancy.fill(seedId);
429  if(doExtra_ && energy > energyThreshold_) meSCSeedOccupancyHighE->fill(seedId);
430 
431  if(scItr->size() == 1) meSingleCrystalCluster.fill(seedId);
432 
433  float e3x3(EcalClusterTools::e3x3(*scItr->seed(), hits, getTopology()));
434  meSCR9.fill(seedId, e3x3 / energy);
435 
436  if(doExtra_){
437  for(unsigned iT(0); iT != nTriggerTypes; ++iT){
438  if(!triggered_[iT]) continue;
439 
440  static_cast<MESetMulti*>(meSCSeedOccupancyTrig)->use(trigTypeToME_[iT]);
441  meSCSeedOccupancyTrig->fill(seedId);
442 
443  // exclusive
444  if(triggered_.count() == 1){
445  static_cast<MESetMulti*>(meSCSeedTimeTrigEx)->use(trigTypeToME_[iT]);
446  static_cast<MESetMulti*>(meSCSeedTimeMapTrigEx)->use(trigTypeToME_[iT]);
447  meSCSeedTimeTrigEx->fill(subdet, seedItr->time());
448  meSCSeedTimeMapTrigEx->fill(seedId, seedItr->time());
449  }
450  }
451 
452  meSCOccupancyProjEta->fill(subdet, scItr->eta());
453  meSCOccupancyProjPhi->fill(subdet, phi(scItr->phi()));
454 
455  if(isBarrel){
456  float e1(EcalClusterTools::eMax(*scItr, ebHits_));
458  float e4(EcalClusterTools::eTop(*scItr, ebHits_, getTopology()) +
459  EcalClusterTools::eRight(*scItr, ebHits_, getTopology()) +
460  EcalClusterTools::eBottom(*scItr, ebHits_, getTopology()) +
461  EcalClusterTools::eLeft(*scItr, ebHits_, getTopology()));
462 
463  meSCSwissCross->fill(1. - e4 / e1);
464  }
465  }
466  }
467 
468  // if(ievt_ % massCalcPrescale_ != 0) continue;
469 
470  // float et(energy * sin(scItr->position().theta()));
471  // if(!leading || et > leading->energy() * sin(leading->position().theta())){
472  // subLeading = leading;
473  // leading = &(*scItr);
474  // }
475  // else if(!subLeading || et > subLeading->energy() * sin(subLeading->position().theta())){
476  // subLeading = &(*scItr);
477  // }
478  }
479 
480  MEs_.at("SCNum").fill(subdet, nSC);
481  MEs_.at("TrendNSC").fill(subdet, double(timestamp_.iLumi), nSC);
482 
483  // if(ievt_ % massCalcPrescale_ != 0) return;
484 
485  // // implement isolation & cuts
486  // if(!leading || !subLeading) return;
487  // float e(leading->energy() + subLeading->energy());
488  // float px(leading->energy() * sin(leading->position().theta()) * cos(leading->phi()) + subLeading->energy() * sin(subLeading->position().theta()) * cos(subLeading->phi()));
489  // float py(leading->energy() * sin(leading->position().theta()) * sin(leading->phi()) + subLeading->energy() * sin(subLeading->position().theta()) * sin(subLeading->phi()));
490  // float pz(leading->energy() * cos(leading->position().theta()) + subLeading->energy() * cos(subLeading->position().theta()));
491  // float m2(e * e - px * px - py * py - pz * pz);
492  // if(m2 < 0.) return;
493  // float mass(sqrt(m2));
494  // MEs_[kZ]->fill(mass);
495  // MEs_[kHighMass]->fill(mass);
496 
497  }
size
Write out results.
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
EcalRecHitCollection const * ebHits_
Definition: ClusterTask.h:53
std::vector< EcalRecHit >::const_iterator const_iterator
CaloGeometry const * getGeometry()
CaloTopology const * getTopology()
float swissCrossMaxThreshold_
Definition: ClusterTask.h:59
unsigned trigTypeToME_[nTriggerTypes]
Definition: ClusterTask.h:62
EcalRecHitCollection const * eeHits_
Definition: ClusterTask.h:54
Float e1
Definition: deltaR.h:20
Definition: DetId.h:18
Timestamp timestamp_
Definition: DQWorker.h:78
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
MESetCollection MEs_
Definition: DQWorker.h:75
static int position[264][3]
Definition: ReadPGInfo.cc:509
std::bitset< nTriggerTypes > triggered_
Definition: ClusterTask.h:61
EcalSubdetector
double phi(EBDetId const &)
void ecaldqm::ClusterTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 41 of file ClusterTask.cc.

References doExtra_, egTriggerAlgos_, energyThreshold_, ecaldqm::MESetMulti::getIndex(), edm::ParameterSet::getUntrackedParameter(), L1GlobalTriggerReadoutRecordTag_, L1MuGMTReadoutCollectionTag_, ecaldqm::DQWorker::MEs_, nTriggerTypes, AlCaHLTBitMon_QueryRunRegistry::string, swissCrossMaxThreshold_, and trigTypeToME_.

42  {
43  doExtra_ = _params.getUntrackedParameter<bool>("doExtra");
44 
45  if(!doExtra_){
46  MEs_.erase(std::string("SCSizeVsEnergy"));
47  MEs_.erase(std::string("SCSeedOccupancyHighE"));
48  MEs_.erase(std::string("SCSeedOccupancyTrig"));
49  MEs_.erase(std::string("SCSeedTimeTrigEx"));
50  MEs_.erase(std::string("SCSeedTimeMapTrigEx"));
51  MEs_.erase(std::string("SCOccupancyProjEta"));
52  MEs_.erase(std::string("SCOccupancyProjPhi"));
53  MEs_.erase(std::string("SCSwissCross"));
54  MEs_.erase(std::string("Triggers"));
55  MEs_.erase(std::string("ExclusiveTriggers"));
56 
57  return;
58  }
59 
60  energyThreshold_ = _params.getUntrackedParameter<double>("energyThreshold");
61  swissCrossMaxThreshold_ = _params.getUntrackedParameter<double>("swissCrossMaxThreshold");
62  egTriggerAlgos_ = _params.getUntrackedParameter<std::vector<std::string> >("egTriggerAlgos");
63  L1GlobalTriggerReadoutRecordTag_ = _params.getUntrackedParameter<edm::InputTag>("L1GlobalTriggerReadoutRecordTag");
64  L1MuGMTReadoutCollectionTag_ = _params.getUntrackedParameter<edm::InputTag>("L1MuGMTReadoutCollectionTag");
65 
67 
68  std::string triggerTypeNames[nTriggerTypes] = {
69  "ECAL",
70  "HCAL",
71  "CSC",
72  "DT",
73  "RPC"
74  };
75 
76  MESetMulti& occupancy(static_cast<MESetMulti&>(MEs_.at("SCSeedOccupancyTrig")));
77  for(unsigned iT(0); iT != nTriggerTypes; ++iT){
78  repl["trig"] = triggerTypeNames[iT];
79  trigTypeToME_[iT] = occupancy.getIndex(repl);
80  }
81  }
std::vector< std::string > egTriggerAlgos_
Definition: ClusterTask.h:60
float swissCrossMaxThreshold_
Definition: ClusterTask.h:59
unsigned trigTypeToME_[nTriggerTypes]
Definition: ClusterTask.h:62
MESetCollection MEs_
Definition: DQWorker.h:75
edm::InputTag L1GlobalTriggerReadoutRecordTag_
Definition: ClusterTask.h:64
edm::InputTag L1MuGMTReadoutCollectionTag_
Definition: ClusterTask.h:65
std::map< std::string, std::string > PathReplacements
Definition: MESet.h:31
void ecaldqm::ClusterTask::setTokens ( edm::ConsumesCollector _collector)
overridevirtual

Member Data Documentation

bool ecaldqm::ClusterTask::doExtra_
private

Definition at line 57 of file ClusterTask.h.

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

EcalRecHitCollection const* ecaldqm::ClusterTask::ebHits_
private

Definition at line 53 of file ClusterTask.h.

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

EcalRecHitCollection const* ecaldqm::ClusterTask::eeHits_
private

Definition at line 54 of file ClusterTask.h.

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

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

Definition at line 60 of file ClusterTask.h.

Referenced by beginEvent(), and setParams().

float ecaldqm::ClusterTask::energyThreshold_
private

Definition at line 58 of file ClusterTask.h.

Referenced by runOnSuperClusters(), and setParams().

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

Definition at line 64 of file ClusterTask.h.

Referenced by ClusterTask(), setParams(), and setTokens().

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

Definition at line 66 of file ClusterTask.h.

Referenced by beginEvent(), ClusterTask(), and setTokens().

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

Definition at line 65 of file ClusterTask.h.

Referenced by ClusterTask(), setParams(), and setTokens().

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

Definition at line 67 of file ClusterTask.h.

Referenced by beginEvent(), ClusterTask(), and setTokens().

float ecaldqm::ClusterTask::swissCrossMaxThreshold_
private

Definition at line 59 of file ClusterTask.h.

Referenced by runOnSuperClusters(), and setParams().

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

Definition at line 61 of file ClusterTask.h.

Referenced by beginEvent(), and runOnSuperClusters().

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

Definition at line 62 of file ClusterTask.h.

Referenced by runOnSuperClusters(), and setParams().