CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ecaldqm::EnergyTask Class Reference

#include <EnergyTask.h>

Inheritance diagram for ecaldqm::EnergyTask:
ecaldqm::DQWorkerTask ecaldqm::DQWorker

Public Member Functions

bool analyze (void const *, Collections) override
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
 EnergyTask ()
 
bool filterRunType (short const *) override
 
void runOnRecHits (EcalRecHitCollection const &)
 
 ~EnergyTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
virtual void addDependencies (DependencySet &)
 
virtual void beginEvent (edm::Event const &, edm::EventSetup const &)
 
 DQWorkerTask ()
 
virtual void endEvent (edm::Event const &, edm::EventSetup const &)
 
virtual bool filterTrigger (edm::TriggerResultsByName const &)
 
virtual void setTokens (edm::ConsumesCollector &)
 
 ~DQWorkerTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void bookMEs (DQMStore::IBooker &)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
const std::string & getName () const
 
bool onlineMode () const
 
virtual void releaseMEs ()
 
void setEventNumber (edm::EventNumber_t _e)
 
void setLumiNumber (edm::LuminosityBlockNumber_t _l)
 
void setRunNumber (edm::RunNumber_t _r)
 
void setTime (time_t _t)
 
virtual ~DQWorker () noexcept(false)
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

bool isPhysicsRun_
 

Additional Inherited Members

- Public Types inherited from ecaldqm::DQWorkerTask
typedef EcalDCCHeaderBlock::EcalDCCEventSettings EventSettings
 
- Static Public Member Functions inherited from ecaldqm::DQWorkerTask
static void fillDescriptions (edm::ParameterSetDescription &)
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void fillDescriptions (edm::ParameterSetDescription &_desc)
 
- Protected Types inherited from ecaldqm::DQWorker
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from ecaldqm::DQWorkerTask
void setME (edm::ParameterSet const &) final
 
- Protected Member Functions inherited from ecaldqm::DQWorker
void initialize (std::string const &_name, edm::ParameterSet const &)
 
void print_ (std::string const &, int=0) const
 
virtual void setSource (edm::ParameterSet const &)
 
void setVerbosity (int _verbosity)
 
- Protected Attributes inherited from ecaldqm::DQWorker
bool booked_
 
MESetCollection MEs_
 
std::string name_
 
bool onlineMode_
 
Timestamp timestamp_
 
int verbosity_
 
bool willConvertToEDM_
 

Detailed Description

Definition at line 10 of file EnergyTask.h.

Constructor & Destructor Documentation

◆ EnergyTask()

ecaldqm::EnergyTask::EnergyTask ( )

Definition at line 11 of file EnergyTask.cc.

11 : DQWorkerTask(), isPhysicsRun_(false) {}

◆ ~EnergyTask()

ecaldqm::EnergyTask::~EnergyTask ( )
inlineoverride

Definition at line 13 of file EnergyTask.h.

13 {}

Member Function Documentation

◆ analyze()

bool ecaldqm::EnergyTask::analyze ( void const *  _p,
Collections  _collection 
)
inlineoverridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 30 of file EnergyTask.h.

30  {
31  switch (_collection) {
32  case kEBRecHit:
33  case kEERecHit:
34  if (_p)
35  runOnRecHits(*static_cast<EcalRecHitCollection const*>(_p));
36  return true;
37  break;
38  default:
39  break;
40  }
41 
42  return false;
43  }

References ecaldqm::kEBRecHit, ecaldqm::kEERecHit, and runOnRecHits().

◆ beginLuminosityBlock()

void ecaldqm::EnergyTask::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 29 of file EnergyTask.cc.

29  {
30  // Reset by LS plots at beginning of every LS
31  MEs_.at("HitMapAllByLumi").reset();
32  }

References ecaldqm::DQWorker::MEs_.

◆ filterRunType()

bool ecaldqm::EnergyTask::filterRunType ( short const *  _runType)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 17 of file EnergyTask.cc.

17  {
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  }

References EcalDCCHeaderBlock::COSMIC, EcalDCCHeaderBlock::COSMICS_GLOBAL, EcalDCCHeaderBlock::COSMICS_LOCAL, EcalDCCHeaderBlock::MTCC, ecaldqm::nDCC, EcalDCCHeaderBlock::PHYSICS_GLOBAL, and EcalDCCHeaderBlock::PHYSICS_LOCAL.

◆ runOnRecHits()

void ecaldqm::EnergyTask::runOnRecHits ( EcalRecHitCollection const &  _hits)

Definition at line 34 of file EnergyTask.cc.

34  {
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  }

References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), HCALHighEnergyHPDFilter_cfi::energy, triggerObjects_cff::id, isPhysicsRun_, EcalRecHit::kGood, EcalRecHit::kOutOfTime, EcalRecHit::kPoorCalib, ecaldqm::DQWorker::MEs_, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by analyze().

◆ setParams()

void ecaldqm::EnergyTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 13 of file EnergyTask.cc.

13  {
14  isPhysicsRun_ = _params.getUntrackedParameter<bool>("isPhysicsRun");
15  }

References l1extraParticles_cfi::_params, and isPhysicsRun_.

Member Data Documentation

◆ isPhysicsRun_

bool ecaldqm::EnergyTask::isPhysicsRun_
private

Definition at line 26 of file EnergyTask.h.

Referenced by runOnRecHits(), and setParams().

EcalDCCHeaderBlock::COSMICS_LOCAL
Definition: EcalDCCHeaderBlock.h:49
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
ecaldqm::EnergyTask::isPhysicsRun_
bool isPhysicsRun_
Definition: EnergyTask.h:26
DetId
Definition: DetId.h:17
EcalDCCHeaderBlock::PHYSICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:37
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
ecaldqm::EnergyTask::runOnRecHits
void runOnRecHits(EcalRecHitCollection const &)
Definition: EnergyTask.cc:34
ecaldqm::DQWorkerTask::DQWorkerTask
DQWorkerTask()
Definition: DQWorkerTask.cc:8
ecaldqm::kEBRecHit
Definition: Collections.h:36
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
EcalDCCHeaderBlock::PHYSICS_LOCAL
Definition: EcalDCCHeaderBlock.h:48
ecaldqm::kEERecHit
Definition: Collections.h:37
EcalDCCHeaderBlock::COSMICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:38
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
EcalDCCHeaderBlock::MTCC
Definition: EcalDCCHeaderBlock.h:25
EcalRecHit::kPoorCalib
Definition: EcalRecHit.h:26
EcalDCCHeaderBlock::COSMIC
Definition: EcalDCCHeaderBlock.h:22
ecaldqm::nDCC
Definition: EcalDQMCommonUtils.h:92