CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
ecaldqm::IntegrityTask Class Reference

#include <IntegrityTask.h>

Inheritance diagram for ecaldqm::IntegrityTask:
ecaldqm::DQWorkerTask ecaldqm::DQWorker

Public Member Functions

bool analyze (void const *, Collections) override
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
 IntegrityTask ()
 
template<class C >
void runOnDetIdCollection (C const &, Collections)
 
template<typename IDCollection >
void runOnDetIdCollection (IDCollection const &_ids, Collections _collection)
 
void runOnElectronicsIdCollection (EcalElectronicsIdCollection const &, Collections)
 
 ~IntegrityTask ()
 
- 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 filterRunType (short 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 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 ()
 

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 setParams (edm::ParameterSet 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 14 of file IntegrityTask.h.

Constructor & Destructor Documentation

ecaldqm::IntegrityTask::IntegrityTask ( )

Definition at line 8 of file IntegrityTask.cc.

8  :
10  {
11  }
ecaldqm::IntegrityTask::~IntegrityTask ( )
inline

Definition at line 17 of file IntegrityTask.h.

17 {}

Member Function Documentation

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 27 of file IntegrityTask.h.

References ecaldqm::kBlockSizeErrors, ecaldqm::kEBChIdErrors, ecaldqm::kEBGainErrors, ecaldqm::kEBGainSwitchErrors, ecaldqm::kEEChIdErrors, ecaldqm::kEEGainErrors, ecaldqm::kEEGainSwitchErrors, ecaldqm::kTowerIdErrors, runOnDetIdCollection(), and runOnElectronicsIdCollection().

27  {
28  switch(_collection){
29  case kEBGainErrors:
30  case kEBChIdErrors:
32  if(_p) runOnDetIdCollection(*static_cast<EBDetIdCollection const*>(_p), _collection);
33  return true;
34  case kEEGainErrors:
35  case kEEChIdErrors:
37  if(_p) runOnDetIdCollection(*static_cast<EEDetIdCollection const*>(_p), _collection);
38  return true;
39  break;
40  case kTowerIdErrors:
41  case kBlockSizeErrors:
42  if(_p) runOnElectronicsIdCollection(*static_cast<EcalElectronicsIdCollection const*>(_p), _collection);
43  return true;
44  break;
45  default:
46  break;
47  }
48 
49  return false;
50  }
void runOnDetIdCollection(C const &, Collections)
void runOnElectronicsIdCollection(EcalElectronicsIdCollection const &, Collections)
void ecaldqm::IntegrityTask::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 14 of file IntegrityTask.cc.

References ecaldqm::DQWorker::MEs_.

15  {
16  // Reset by LS plots at beginning of every LS
17  MEs_.at("MapByLumi").reset();
18  MEs_.at("ByLumi").reset();
19  }
MESetCollection MEs_
Definition: DQWorker.h:75
template<typename IDCollection >
void ecaldqm::IntegrityTask::runOnDetIdCollection ( IDCollection const &  _ids,
Collections  _collection 
)

Definition at line 23 of file IntegrityTask.cc.

References ecaldqm::dccId(), ecaldqm::MESet::fill(), ecaldqm::DQWorker::Timestamp::iLumi, ecaldqm::kEBChIdErrors, ecaldqm::kEBGainErrors, ecaldqm::kEBGainSwitchErrors, ecaldqm::kEEChIdErrors, ecaldqm::kEEGainErrors, ecaldqm::kEEGainSwitchErrors, ecaldqm::DQWorker::MEs_, and ecaldqm::DQWorker::timestamp_.

24  {
25  // Collection is empty if there are no errors
26  if(_ids.size() == 0) return;
27 
28  MESet* set(0);
29  switch(_collection){
30  case kEBGainErrors:
31  case kEEGainErrors:
32  set = &MEs_.at("Gain");
33  break;
34  case kEBChIdErrors:
35  case kEEChIdErrors:
36  set = &MEs_.at("ChId");
37  break;
40  set = &MEs_.at("GainSwitch");
41  break;
42  default:
43  return;
44  }
45 
46  MESet& meMapByLumi(MEs_.at("MapByLumi"));
47  MESet& meByLumi(MEs_.at("ByLumi"));
48  MESet& meTotal(MEs_.at("Total"));
49  MESet& meTrendNErrors(MEs_.at("TrendNErrors"));
50 
51  std::for_each(_ids.begin(), _ids.end(),
52  [&](typename IDCollection::value_type const& id){
53  set->fill(id);
54  int dccid(dccId(id));
55  meByLumi.fill(dccid);
56  meTotal.fill(dccid);
57  // Fill Integrity Errors Map with channel errors for this lumi
58  meMapByLumi.fill(id);
59 
60  meTrendNErrors.fill(double(timestamp_.iLumi), 1.);
61  });
62  }
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
Timestamp timestamp_
Definition: DQWorker.h:78
MESetCollection MEs_
Definition: DQWorker.h:75
unsigned dccId(DetId const &)
template<class C >
void ecaldqm::IntegrityTask::runOnDetIdCollection ( C const &  ,
Collections   
)

Referenced by analyze().

void ecaldqm::IntegrityTask::runOnElectronicsIdCollection ( EcalElectronicsIdCollection const &  _ids,
Collections  _collection 
)

Definition at line 65 of file IntegrityTask.cc.

References edm::EDCollection< T >::begin(), ecaldqm::dccId(), edm::EDCollection< T >::end(), ecaldqm::MESet::fill(), ecaldqm::getElectronicsMap(), ecaldqm::DQWorker::Timestamp::iLumi, ecaldqm::kBlockSizeErrors, ecaldqm::kEEpLow, ecaldqm::kTowerIdErrors, ecaldqm::DQWorker::MEs_, ecaldqm::nCrystals(), edm::EDCollection< T >::size(), ecaldqm::DQWorker::timestamp_, and ecaldqm::towerId().

Referenced by analyze().

66  {
67  // Collection is empty if there are no errors
68  if(_ids.size() == 0) return;
69 
70  MESet* set(0);
71  switch(_collection){
72  case kTowerIdErrors:
73  set = &MEs_.at("TowerId");
74  break;
75  case kBlockSizeErrors:
76  set = &MEs_.at("BlockSize");
77  break;
78  default:
79  return;
80  }
81 
82  MESet& meMapByLumi(MEs_.at("MapByLumi"));
83  MESet& meByLumi(MEs_.at("ByLumi"));
84  MESet& meTotal(MEs_.at("Total"));
85  MESet& meTrendNErrors(MEs_.at("TrendNErrors"));
86 
87  std::for_each(_ids.begin(), _ids.end(),
89  set->fill(id);
90  int dccid(id.dccId());
91  double nCrystals(0.);
92  std::vector<DetId> chIds( getElectronicsMap()->dccTowerConstituents(dccid, id.towerId()) );
93  if(dccid <= kEEmHigh + 1 || dccid >= kEEpLow + 1)
94  nCrystals = chIds.size();
95  else
96  nCrystals = 25.;
97  meByLumi.fill(dccid, nCrystals);
98  meTotal.fill(dccid, nCrystals);
99  // Fill Integrity Errors Map with tower errors for this lumi
100  // Since binned by crystal for compatibility with channel errors,
101  // fill with constituent channels of tower
102  for(std::vector<DetId>::iterator chItr(chIds.begin()); chItr != chIds.end(); ++chItr)
103  meMapByLumi.fill(*chItr);
104 
105  meTrendNErrors.fill(double(timestamp_.iLumi), nCrystals);
106  });
107  }
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
EcalElectronicsMapping const * getElectronicsMap()
unsigned nCrystals(unsigned)
unsigned towerId(DetId const &)
Timestamp timestamp_
Definition: DQWorker.h:78
MESetCollection MEs_
Definition: DQWorker.h:75
unsigned dccId(DetId const &)