CMS 3D CMS Logo

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