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 beginEvent (edm::Event const &, edm::EventSetup const &, bool const &, bool &) override
 
 EnergyTask ()
 
bool filterRunType (short const *) override
 
void runOnRecHits (EcalRecHitCollection const &)
 
 ~EnergyTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
virtual void addDependencies (DependencySet &)
 
 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 beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void bookMEs (DQMStore::IBooker &)
 
bool checkElectronicsMap (bool=true)
 
bool checkGeometry (bool=true)
 
bool checkTopology (bool=true)
 
bool checkTrigTowerMap (bool=true)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
EcalDQMSetupObjects const getEcalDQMSetupObjects ()
 
EcalElectronicsMapping const * GetElectronicsMap ()
 
CaloGeometry const * GetGeometry ()
 
std::string const & getName () const
 
CaloTopology const * GetTopology ()
 
EcalTrigTowerConstituentsMap const * GetTrigTowerMap ()
 
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 setSetupObjects (edm::EventSetup const &)
 
void setSetupObjectsEndLumi (edm::EventSetup const &)
 
void setTime (time_t _t)
 
void setTokens (edm::ConsumesCollector &)
 
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)
 
- Public Attributes inherited from ecaldqm::DQWorker
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandle
 
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandleEndLumi
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandle
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandleEndLumi
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandle
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandleEndLumi
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandle
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandleEndLumi
 
- 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.

◆ ~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 29 of file EnergyTask.h.

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

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

◆ beginEvent()

void ecaldqm::EnergyTask::beginEvent ( edm::Event const &  _evt,
edm::EventSetup const &  _es,
bool const &  ByLumiResetSwitch,
bool &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 29 of file EnergyTask.cc.

References ecaldqm::MESetCollection::at(), ecaldqm::DQWorker::GetElectronicsMap(), ecaldqm::DQWorker::MEs_, and ecaldqm::MESet::reset().

29  {
30  if (ByLumiResetSwitch) {
31  MEs_.at("HitMapAllByLumi").reset(GetElectronicsMap());
32  }
33  }
MESet & at(const std::string &key)
Definition: MESet.h:399
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
MESetCollection MEs_
Definition: DQWorker.h:131
virtual void reset(EcalElectronicsMapping const *, double=0., double=0., double=0.)
Definition: MESet.cc:98

◆ filterRunType()

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

◆ runOnRecHits()

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

Definition at line 35 of file EnergyTask.cc.

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

Referenced by analyze().

35  {
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  }
MESet & at(const std::string &key)
Definition: MESet.h:399
std::vector< EcalRecHit >::const_iterator const_iterator
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
Definition: DetId.h:17
MESetCollection MEs_
Definition: DQWorker.h:131

◆ setParams()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 13 of file EnergyTask.cc.

References l1extraParticles_cfi::_params, and isPhysicsRun_.

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

Member Data Documentation

◆ isPhysicsRun_

bool ecaldqm::EnergyTask::isPhysicsRun_
private

Definition at line 25 of file EnergyTask.h.

Referenced by runOnRecHits(), and setParams().