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 
29  void EnergyTask::beginEvent(edm::Event const& _evt, edm::EventSetup const& _es, bool const& ByLumiResetSwitch, bool&) {
30  if (ByLumiResetSwitch) {
31  MEs_.at("HitMapAllByLumi").reset(GetElectronicsMap());
32  }
33  }
34 
36  MESet& meHitMap(MEs_.at("HitMap"));
37  MESet& meHitMapAll(MEs_.at("HitMapAll"));
38  MESet& meHitMapAllByLumi(MEs_.at("HitMapAllByLumi"));
39  MESet& meHit(MEs_.at("Hit"));
40  MESet& meHitAll(MEs_.at("HitAll"));
41 
42  uint32_t neitherGoodNorPoorCalib(~(0x1 << EcalRecHit::kGood | 0x1 << EcalRecHit::kPoorCalib));
43  uint32_t neitherGoodNorOOT(~(0x1 << EcalRecHit::kGood | 0x1 << EcalRecHit::kOutOfTime));
44 
45  for (EcalRecHitCollection::const_iterator hitItr(_hits.begin()); hitItr != _hits.end(); ++hitItr) {
46  if (isPhysicsRun_ && hitItr->checkFlagMask(neitherGoodNorPoorCalib))
47  continue;
48  if (!isPhysicsRun_ && hitItr->checkFlagMask(neitherGoodNorOOT))
49  continue;
50 
51  float energy(hitItr->energy());
52 
53  if (energy < 0.)
54  continue;
55 
56  DetId id(hitItr->id());
57 
58  meHitMap.fill(getEcalDQMSetupObjects(), id, energy);
59  meHitMapAll.fill(getEcalDQMSetupObjects(), id, energy);
60  meHitMapAllByLumi.fill(getEcalDQMSetupObjects(), id, energy);
61  meHit.fill(getEcalDQMSetupObjects(), id, energy);
62  meHitAll.fill(getEcalDQMSetupObjects(), id, energy);
63 
64  // look for the seeds
65  // float e3x3(energy);
66  // bool isSeed = true;
67 
68  // EcalRecHitCollection::const_iterator neighborItr;
69  // float neighborE;
70  // std::vector<DetId> window(GetTopology()->getWindow(id, 3, 3));
71  // for(std::vector<DetId>::iterator idItr(window.begin()); idItr != window.end(); ++idItr){
72  // if((neighborItr = _hits.find(*idItr)) == _hits.end()) continue;
73  // if(isPhysicsRun_ && neighborItr->checkFlagMask(notGood)) continue;
74  // if(!isPhysicsRun_ && neighborItr->checkFlagMask(neitherGoodNorOOT)) continue;
75  // neighborE = isPhysicsRun_ ? neighborItr->energy() : neighborItr->outOfTimeEnergy();
76  // if(neighborE > energy){
77  // isSeed = false;
78  // break;
79  // }
80  // e3x3 += neighborE;
81  // }
82 
83  // if(!isSeed) continue;
84 
85  // if ( e3x3 >= threshS9_ )
86  // MEs_[kMiniCluster]->fill(id, e3x3);
87  }
88  }
89 
91 } // namespace ecaldqm
EcalDCCHeaderBlock::COSMICS_LOCAL
Definition: EcalDCCHeaderBlock.h:49
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
funct::false
false
Definition: Factorize.h:29
ecaldqm
Definition: DQWorker.h:37
ESHandle.h
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
ecaldqm::EnergyTask::isPhysicsRun_
bool isPhysicsRun_
Definition: EnergyTask.h:25
edm::SortedCollection< EcalRecHit >
ecaldqm::EnergyTask::beginEvent
void beginEvent(edm::Event const &, edm::EventSetup const &, bool const &, bool &) override
Definition: EnergyTask.cc:29
ecaldqm::DQWorker::GetElectronicsMap
const EcalElectronicsMapping * GetElectronicsMap()
Definition: DQWorker.cc:118
DetId
Definition: DetId.h:17
EcalDCCHeaderBlock::PHYSICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:37
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
ecaldqm::DQWorkerTask
Definition: DQWorkerTask.h:71
ecaldqm::MESet::reset
virtual void reset(EcalElectronicsMapping const *, double=0., double=0., double=0.)
Definition: MESet.cc:98
ecaldqm::EnergyTask
Definition: EnergyTask.h:10
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
ecaldqm::EnergyTask::runOnRecHits
void runOnRecHits(EcalRecHitCollection const &)
Definition: EnergyTask.cc:35
ecaldqm::EnergyTask::filterRunType
bool filterRunType(short const *) override
Definition: EnergyTask.cc:17
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
EcalRecHit::kGood
Definition: EcalRecHit.h:21
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:125
EcalRecHit::kOutOfTime
Definition: EcalRecHit.h:23
edm::ParameterSet
Definition: ParameterSet.h:47
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
EcalDCCHeaderBlock::PHYSICS_LOCAL
Definition: EcalDCCHeaderBlock.h:48
ecaldqm::MESetCollection::at
MESet & at(const std::string &key)
Definition: MESet.h:399
EcalDCCHeaderBlock.h
edm::EventSetup
Definition: EventSetup.h:58
ecaldqm::DQWorker::getEcalDQMSetupObjects
const EcalDQMSetupObjects getEcalDQMSetupObjects()
Definition: DQWorker.cc:142
EcalDCCHeaderBlock::COSMICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:38
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
ecaldqm::EnergyTask::setParams
void setParams(edm::ParameterSet const &) override
Definition: EnergyTask.cc:13
EcalDCCHeaderBlock::MTCC
Definition: EcalDCCHeaderBlock.h:25
EcalRecHit::kPoorCalib
Definition: EcalRecHit.h:26
EcalDCCHeaderBlock::COSMIC
Definition: EcalDCCHeaderBlock.h:22
ecaldqm::nDCC
Definition: EcalDQMCommonUtils.h:91
DEFINE_ECALDQM_WORKER
#define DEFINE_ECALDQM_WORKER(TYPE)
Definition: DQWorker.h:162
ParameterSet.h
EnergyTask.h
edm::Event
Definition: Event.h:73
ecaldqm::EnergyTask::EnergyTask
EnergyTask()
Definition: EnergyTask.cc:11
EcalDQMCommonUtils.h
ecaldqm::MESet
Definition: MESet.h:42