CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OccupancyTask.cc
Go to the documentation of this file.
1 #include "../interface/OccupancyTask.h"
2 
4 
5 namespace ecaldqm {
6 
8  DQWorkerTask(_params, _paths, "OccupancyTask"),
9  recHitThreshold_(0.),
10  tpThreshold_(0.)
11  {
13  (0x1 << kEBDigi) |
14  (0x1 << kEEDigi) |
15  (0x1 << kTrigPrimDigi) |
16  (0x1 << kEBRecHit) |
17  (0x1 << kEERecHit);
18 
19  edm::ParameterSet const& taskParams(_params.getUntrackedParameterSet(name_));
20 
21  recHitThreshold_ = taskParams.getUntrackedParameter<double>("recHitThreshold");
22  tpThreshold_ = taskParams.getUntrackedParameter<double>("tpThreshold", 1.0);
23  }
24 
26  {
27  }
28 
29  bool
30  OccupancyTask::filterRunType(const std::vector<short>& _runType)
31  {
32  for(int iFED(0); iFED < 54; iFED++){
33  if(_runType[iFED] == EcalDCCHeaderBlock::COSMIC ||
34  _runType[iFED] == EcalDCCHeaderBlock::MTCC ||
35  _runType[iFED] == EcalDCCHeaderBlock::COSMICS_GLOBAL ||
36  _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_GLOBAL ||
37  _runType[iFED] == EcalDCCHeaderBlock::COSMICS_LOCAL ||
38  _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_LOCAL) return true;
39  }
40 
41  return false;
42  }
43 
44  void
46  {
47  for(EcalDigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr){
48  DetId id(digiItr->id());
49  MEs_[kDigi]->fill(id);
50  MEs_[kDigiProjEta]->fill(id);
51  MEs_[kDigiProjPhi]->fill(id);
52  MEs_[kDigiAll]->fill(id);
53  MEs_[kDigiDCC]->fill(id);
54  }
55  }
56 
57  void
59  {
60  for(EcalTrigPrimDigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr){
61  EcalTrigTowerDetId const& id(digiItr->id());
62 
63  MEs_[kTPDigi]->fill(id);
64  MEs_[kTPDigiProjEta]->fill(id);
65  MEs_[kTPDigiProjPhi]->fill(id);
66 
67  if(digiItr->compressedEt() > tpThreshold_){
68  MEs_[kTPDigiThr]->fill(id);
69  MEs_[kTPDigiThrProjEta]->fill(id);
70  MEs_[kTPDigiThrProjPhi]->fill(id);
71  MEs_[kTPDigiThrAll]->fill(id);
72  }
73  }
74  }
75 
76  void
78  {
79  uint32_t mask(~(0x1 << EcalRecHit::kGood));
80 
81  for(EcalRecHitCollection::const_iterator hitItr(_hits.begin()); hitItr != _hits.end(); ++hitItr){
82  DetId id(hitItr->id());
83 
84 // MEs_[kRecHit]->fill(id);
85 // MEs_[kRecHitProjEta]->fill(id);
86 // MEs_[kRecHitProjPhi]->fill(id);
87 
88  if(!hitItr->checkFlagMask(mask) && hitItr->energy() > recHitThreshold_){
89  MEs_[kRecHitThr]->fill(id);
90  MEs_[kRecHitThrProjEta]->fill(id);
91  MEs_[kRecHitThrProjPhi]->fill(id);
92  MEs_[kRecHitThrAll]->fill(id);
93  }
94  }
95 
96  if(_collection == kEBRecHit)
97  MEs_[kRecHit1D]->fill((unsigned)BinService::kEB + 1, float(_hits.size()));
98  else
99  MEs_[kRecHit1D]->fill((unsigned)BinService::kEE + 1, float(_hits.size()));
100  }
101 
102  /*static*/
103  void
104  OccupancyTask::setMEData(std::vector<MEData>& _data)
105  {
107 
113 
114  axis.nbins = 100;
115  axis.low = 0.;
116  axis.high = 6000.;
129  }
130 
132 }
133 
static void setMEData(std::vector< MEData > &)
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
std::vector< EcalTriggerPrimitiveDigi >::const_iterator const_iterator
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
const_iterator begin() const
OccupancyTask(const edm::ParameterSet &, const edm::ParameterSet &)
Definition: OccupancyTask.cc:7
void runOnDigis(const EcalDigiCollection &)
void runOnTPDigis(const EcalTrigPrimDigiCollection &)
bool filterRunType(const std::vector< short > &) override
const_iterator end() const
Definition: DetId.h:18
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
const_iterator end() const
size_type size() const
DEFINE_ECALDQM_WORKER(CertificationClient)
void runOnRecHits(const EcalRecHitCollection &, Collections)
std::string name_
Definition: DQWorker.h:55
const_iterator begin() const