test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  MESet& meHitMap(MEs_.at("HitMap"));
43  MESet& meHitMapAll(MEs_.at("HitMapAll"));
44  MESet& meHit(MEs_.at("Hit"));
45  MESet& meHitAll(MEs_.at("HitAll"));
46 
47  uint32_t notGood(~(0x1 << EcalRecHit::kGood));
48  uint32_t neitherGoodNorOOT(~(0x1 << EcalRecHit::kGood |
49  0x1 << EcalRecHit::kOutOfTime));
50 
51  for(EcalRecHitCollection::const_iterator hitItr(_hits.begin()); hitItr != _hits.end(); ++hitItr){
52 
53  if(isPhysicsRun_ && hitItr->checkFlagMask(notGood)) continue;
54  if(!isPhysicsRun_ && hitItr->checkFlagMask(neitherGoodNorOOT)) continue;
55 
56  float energy(hitItr->energy());
57 
58  if(energy < 0.) continue;
59 
60  DetId id(hitItr->id());
61 
62  meHitMap.fill(id, energy);
63  meHitMapAll.fill(id, energy);
64  meHit.fill(id, energy);
65  meHitAll.fill(id, energy);
66 
67  // look for the seeds
68 // float e3x3(energy);
69 // bool isSeed = true;
70 
71 // EcalRecHitCollection::const_iterator neighborItr;
72 // float neighborE;
73 // std::vector<DetId> window(getTopology()->getWindow(id, 3, 3));
74 // for(std::vector<DetId>::iterator idItr(window.begin()); idItr != window.end(); ++idItr){
75 // if((neighborItr = _hits.find(*idItr)) == _hits.end()) continue;
76 // if(isPhysicsRun_ && neighborItr->checkFlagMask(notGood)) continue;
77 // if(!isPhysicsRun_ && neighborItr->checkFlagMask(neitherGoodNorOOT)) continue;
78 // neighborE = isPhysicsRun_ ? neighborItr->energy() : neighborItr->outOfTimeEnergy();
79 // if(neighborE > energy){
80 // isSeed = false;
81 // break;
82 // }
83 // e3x3 += neighborE;
84 // }
85 
86 // if(!isSeed) continue;
87 
88 // if ( e3x3 >= threshS9_ )
89 // MEs_[kMiniCluster]->fill(id, e3x3);
90 
91  }
92  }
93 
95 }
96 
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 setParams(edm::ParameterSet const &) override
Definition: EnergyTask.cc:19
const_iterator end() const
Definition: DetId.h:18
void runOnRecHits(EcalRecHitCollection const &)
Definition: EnergyTask.cc:40
MESetCollection MEs_
Definition: DQWorker.h:75
volatile std::atomic< bool > shutdown_flag false
bool filterRunType(short const *) override
Definition: EnergyTask.cc:25
const_iterator begin() const