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
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:34
ecaldqm
Definition: DQWorker.h:24
ESHandle.h
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
ecaldqm::EnergyTask::isPhysicsRun_
bool isPhysicsRun_
Definition: EnergyTask.h:26
edm::SortedCollection< EcalRecHit >
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::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:34
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:78
EcalRecHit::kOutOfTime
Definition: EcalRecHit.h:23
edm::ParameterSet
Definition: ParameterSet.h:36
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
EcalDCCHeaderBlock::PHYSICS_LOCAL
Definition: EcalDCCHeaderBlock.h:48
ecaldqm::EnergyTask::beginLuminosityBlock
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: EnergyTask.cc:29
EcalDCCHeaderBlock.h
edm::EventSetup
Definition: EventSetup.h:57
EcalDCCHeaderBlock::COSMICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:38
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
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:92
DEFINE_ECALDQM_WORKER
#define DEFINE_ECALDQM_WORKER(TYPE)
Definition: DQWorker.h:112
ParameterSet.h
EnergyTask.h
ecaldqm::EnergyTask::EnergyTask
EnergyTask()
Definition: EnergyTask.cc:11
EcalDQMCommonUtils.h
ecaldqm::MESet
Definition: MESet.h:27