CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
 EnergyTask ()
 
bool filterRunType (short const *) override
 
void runOnRecHits (EcalRecHitCollection const &)
 
 ~EnergyTask ()
 
- 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 &)
 
void recoverStats ()
 
virtual void setTokens (edm::ConsumesCollector &)
 
void softReset ()
 
virtual ~DQWorkerTask ()
 
- 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 &)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
std::string const & 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 ()
 

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 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::DQWorkerTask
std::set< std::string > resettable_
 
- 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

ecaldqm::EnergyTask::EnergyTask ( )

Definition at line 12 of file EnergyTask.cc.

12  :
13  DQWorkerTask(),
14  isPhysicsRun_(false)
15  {
16  }
ecaldqm::EnergyTask::~EnergyTask ( )
inline

Definition at line 13 of file EnergyTask.h.

13 {}

Member Function Documentation

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 28 of file EnergyTask.h.

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

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

Definition at line 40 of file EnergyTask.cc.

References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), relval_parameters_module::energy, isPhysicsRun_, EcalRecHit::kGood, EcalRecHit::kOutOfTime, and ecaldqm::DQWorker::MEs_.

Referenced by analyze().

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  }
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: DetId.h:18
MESetCollection MEs_
Definition: DQWorker.h:75
void ecaldqm::EnergyTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 19 of file EnergyTask.cc.

References edm::ParameterSet::getUntrackedParameter(), and isPhysicsRun_.

20  {
21  isPhysicsRun_ = _params.getUntrackedParameter<bool>("isPhysicsRun");
22  }

Member Data Documentation

bool ecaldqm::EnergyTask::isPhysicsRun_
private

Definition at line 24 of file EnergyTask.h.

Referenced by runOnRecHits(), and setParams().