CMS 3D CMS Logo

EnergyTask.cc
Go to the documentation of this file.
1 #include "../interface/EnergyTask.h"
2 
4 
7 
9 
10 namespace ecaldqm
11 {
13  DQWorkerTask(),
14  isPhysicsRun_(false)
15  {
16  }
17 
18  void
20  {
21  isPhysicsRun_ = _params.getUntrackedParameter<bool>("isPhysicsRun");
22  }
23 
24  bool
25  EnergyTask::filterRunType(short const* _runType)
26  {
27  for(unsigned iFED(0); iFED != ecaldqm::nDCC; iFED++){
28  if(_runType[iFED] == EcalDCCHeaderBlock::COSMIC ||
29  _runType[iFED] == EcalDCCHeaderBlock::MTCC ||
30  _runType[iFED] == EcalDCCHeaderBlock::COSMICS_GLOBAL ||
31  _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_GLOBAL ||
32  _runType[iFED] == EcalDCCHeaderBlock::COSMICS_LOCAL ||
33  _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_LOCAL) return true;
34  }
35 
36  return false;
37  }
38 
39  void
41  {
42  // Reset by LS plots at beginning of every LS
43  MEs_.at("HitMapAllByLumi").reset();
44  }
45 
46  void
48  {
49  MESet& meHitMap(MEs_.at("HitMap"));
50  MESet& meHitMapAll(MEs_.at("HitMapAll"));
51  MESet& meHitMapAllByLumi(MEs_.at("HitMapAllByLumi"));
52  MESet& meHit(MEs_.at("Hit"));
53  MESet& meHitAll(MEs_.at("HitAll"));
54 
55  uint32_t neitherGoodNorPoorCalib(~(0x1 << EcalRecHit::kGood |
56  0x1 << EcalRecHit::kPoorCalib));
57  uint32_t neitherGoodNorOOT(~(0x1 << EcalRecHit::kGood |
58  0x1 << EcalRecHit::kOutOfTime));
59 
60  for(EcalRecHitCollection::const_iterator hitItr(_hits.begin()); hitItr != _hits.end(); ++hitItr){
61 
62  if(isPhysicsRun_ && hitItr->checkFlagMask(neitherGoodNorPoorCalib)) continue;
63  if(!isPhysicsRun_ && hitItr->checkFlagMask(neitherGoodNorOOT)) continue;
64 
65  float energy(hitItr->energy());
66 
67  if(energy < 0.) continue;
68 
69  DetId id(hitItr->id());
70 
71  meHitMap.fill(id, energy);
72  meHitMapAll.fill(id, energy);
73  meHitMapAllByLumi.fill(id, energy);
74  meHit.fill(id, energy);
75  meHitAll.fill(id, energy);
76 
77  // look for the seeds
78 // float e3x3(energy);
79 // bool isSeed = true;
80 
81 // EcalRecHitCollection::const_iterator neighborItr;
82 // float neighborE;
83 // std::vector<DetId> window(getTopology()->getWindow(id, 3, 3));
84 // for(std::vector<DetId>::iterator idItr(window.begin()); idItr != window.end(); ++idItr){
85 // if((neighborItr = _hits.find(*idItr)) == _hits.end()) continue;
86 // if(isPhysicsRun_ && neighborItr->checkFlagMask(notGood)) continue;
87 // if(!isPhysicsRun_ && neighborItr->checkFlagMask(neitherGoodNorOOT)) continue;
88 // neighborE = isPhysicsRun_ ? neighborItr->energy() : neighborItr->outOfTimeEnergy();
89 // if(neighborE > energy){
90 // isSeed = false;
91 // break;
92 // }
93 // e3x3 += neighborE;
94 // }
95 
96 // if(!isSeed) continue;
97 
98 // if ( e3x3 >= threshS9_ )
99 // MEs_[kMiniCluster]->fill(id, e3x3);
100 
101  }
102  }
103 
105 }
106 
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_ECALDQM_WORKER(TYPE)
Definition: DQWorker.h:108
std::vector< EcalRecHit >::const_iterator const_iterator
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: EnergyTask.cc:40
void setParams(edm::ParameterSet const &) override
Definition: EnergyTask.cc:19
const_iterator end() const
Definition: DetId.h:18
void runOnRecHits(EcalRecHitCollection const &)
Definition: EnergyTask.cc:47
MESetCollection MEs_
Definition: DQWorker.h:75
bool filterRunType(short const *) override
Definition: EnergyTask.cc:25
const_iterator begin() const