CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 

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
< L1GlobalTriggerReadoutRecord
L1GlobalTriggerReadoutRecordToken_
 
edm::InputTag L1MuGMTReadoutCollectionTag_
 
edm::EDGetTokenT
< L1MuGMTReadoutCollection
L1MuGMTReadoutCollectionToken_
 
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.

22  :
23  DQWorkerTask(),
24  ebHits_(0),
25  eeHits_(0),
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

Definition at line 24 of file ClusterTask.h.

24 {}

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().

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 compareJSON::const, ecaldqm::kEBBasicCluster, ecaldqm::kEBRecHit, ecaldqm::kEBSuperCluster, ecaldqm::kEEBasicCluster, ecaldqm::kEERecHit, ecaldqm::kEESuperCluster, runOnBasicClusters(), runOnRecHits(), and runOnSuperClusters().

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:213
void runOnRecHits(EcalRecHitCollection const &, Collections)
Definition: ClusterTask.cc:198
void runOnSuperClusters(reco::SuperClusterCollection const &, Collections)
Definition: ClusterTask.cc:359
string const
Definition: compareJSON.py:14
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(), doExtra_, egTriggerAlgos_, relativeConstraints::empty, ecaldqm::MESet::fill(), edm::EventSetup::get(), edm::Event::getByToken(), kCSCTrigger, kDTTrigger, kEcalTrigger, kHcalTrigger, kRPCTrigger, L1GlobalTriggerReadoutRecordToken_, L1MuGMTReadoutCollectionToken_, relval_steps::menu, ecaldqm::DQWorker::MEs_, nTriggerTypes, and triggered_.

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  for(unsigned iT(0); iT != egTriggerAlgos_.size(); ++iT){
109  if(menu->gtAlgorithmResult(egTriggerAlgos_[iT], dWord)){
111  break;
112  }
113  }
114 
115  //Hcal
116  bool hcal_top = false;
117  bool hcal_bot = false;
118  const L1GtPsbWord psb = l1GTHndl->gtPsbWord(0xbb0d, 0);
119  std::vector<int> valid_phi;
120  if((psb.aData(4)&0x3f) >= 1) {valid_phi.push_back( (psb.aData(4)>>10)&0x1f ); }
121  if((psb.bData(4)&0x3f) >= 1) {valid_phi.push_back( (psb.bData(4)>>10)&0x1f ); }
122  if((psb.aData(5)&0x3f) >= 1) {valid_phi.push_back( (psb.aData(5)>>10)&0x1f ); }
123  if((psb.bData(5)&0x3f) >= 1) {valid_phi.push_back( (psb.bData(5)>>10)&0x1f ); }
124  std::vector<int>::const_iterator iphi;
125  for(iphi=valid_phi.begin(); iphi!=valid_phi.end(); iphi++) {
126  if(*iphi<9) hcal_top=true;
127  if(*iphi>8) hcal_bot=true;
128  }
129  if(hcal_top && hcal_bot) triggered_.set(kHcalTrigger);
130 
131  //Muons
133  if(!_evt.getByToken(L1MuGMTReadoutCollectionToken_, l1MuHndl)) return;
134  std::vector<L1MuGMTReadoutRecord> const& records(l1MuHndl->getRecords());
135 
136  for(unsigned iR(0); iR != records.size(); ++iR){
137  if(records[iR].getBxInEvent() != 0) continue;
138 
139  unsigned iC(0);
140 
141  //DT triggers
142  std::vector<L1MuRegionalCand> dtBXCands(records[iR].getDTBXCands());
143  for(iC = 0; iC != dtBXCands.size(); ++iC)
144  if(!dtBXCands[iC].empty()) break;
145  if(iC != dtBXCands.size()) triggered_.set(kDTTrigger);
146 
147  //RPC triggers
148  std::vector<L1MuRegionalCand> brlRPCCands(records[iR].getBrlRPCCands());
149  for(iC = 0; iC != brlRPCCands.size(); ++iC)
150  if(!brlRPCCands[iC].empty()) break;
151  if(iC != brlRPCCands.size()) triggered_.set(kRPCTrigger);
152 
153  //CSC Triggers
154  std::vector<L1MuRegionalCand> cscCands(records[iR].getCSCCands());
155  for(iC = 0; iC != cscCands.size(); ++iC)
156  if(!cscCands[iC].empty()) break;
157  if(iC != cscCands.size()) triggered_.set(kCSCTrigger);
158  }
159 
160  if(triggered_.none()) return;
161 
162  MESet& meTriggers(MEs_.at("Triggers"));
163  MESet& meExclusiveTriggers(MEs_.at("ExclusiveTriggers"));
164 
165  for(unsigned iT(0); iT != nTriggerTypes; ++iT){
166  if(!triggered_[iT]) continue;
167  meTriggers.fill(iT + 0.5);
168  if(triggered_.count() == 1)
169  meExclusiveTriggers.fill(iT + 0.5);
170  }
171  }
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
edm::EDGetTokenT< L1MuGMTReadoutCollection > L1MuGMTReadoutCollectionToken_
Definition: ClusterTask.h:67
MESetCollection MEs_
Definition: DQWorker.h:75
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 174 of file ClusterTask.cc.

References ebHits_, and eeHits_.

175  {
176  // ++ievt_;
177 
178  ebHits_ = 0;
179  eeHits_ = 0;
180  }
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 213 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(), relval_parameters_module::energy, ecaldqm::getGeometry(), ecaldqm::DQWorker::Timestamp::iLumi, GeomDetEnumerators::isBarrel(), ecaldqm::kEBBasicCluster, ecaldqm::DQWorker::MEs_, ecaldqm::phi(), position, findQualityFiles::size, ecaldqm::DQWorker::timestamp_, and ecaldqm::zside().

Referenced by analyze().

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

Definition at line 198 of file ClusterTask.cc.

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

Referenced by analyze().

199  {
200  switch(_collection){
201  case kEBRecHit:
202  ebHits_ = &_hits;
203  break;
204  case kEERecHit:
205  eeHits_ = &_hits;
206  break;
207  default:
208  break;
209  }
210  }
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 359 of file ClusterTask.cc.

References doExtra_, ebHits_, DetId::Ecal, EcalBarrel, EcalEndcap, eeHits_, relval_parameters_module::energy, energyThreshold_, ecaldqm::MESetMulti::fill(), ecaldqm::getGeometry(), ecaldqm::getTopology(), ecaldqm::DQWorker::Timestamp::iLumi, GeomDetEnumerators::isBarrel(), ecaldqm::kEBSuperCluster, ecaldqm::DQWorker::MEs_, nTriggerTypes, ecaldqm::phi(), position, findQualityFiles::size, swissCrossMaxThreshold_, ecaldqm::DQWorker::timestamp_, triggered_, and trigTypeToME_.

Referenced by analyze().

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

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

Definition at line 66 of file ClusterTask.h.

Referenced by beginEvent(), and setTokens().

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

Definition at line 65 of file ClusterTask.h.

Referenced by setParams(), and setTokens().

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

Definition at line 67 of file ClusterTask.h.

Referenced by beginEvent(), 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().