CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IntegrityTask.cc
Go to the documentation of this file.
1 #include "../interface/IntegrityTask.h"
2 
5 
6 namespace ecaldqm
7 {
10  {
11  }
12 
13  void
15  {
16  MEs_.at("ByLumi").reset();
17  }
18 
19  template<typename IDCollection>
20  void
21  IntegrityTask::runOnDetIdCollection(IDCollection const& _ids, Collections _collection)
22  {
23  if(_ids.size() == 0) return;
24 
25  MESet* set(0);
26  switch(_collection){
27  case kEBGainErrors:
28  case kEEGainErrors:
29  set = &MEs_.at("Gain");
30  break;
31  case kEBChIdErrors:
32  case kEEChIdErrors:
33  set = &MEs_.at("ChId");
34  break;
37  set = &MEs_.at("GainSwitch");
38  break;
39  default:
40  return;
41  }
42 
43  MESet& meByLumi(MEs_.at("ByLumi"));
44  MESet& meTotal(MEs_.at("Total"));
45  MESet& meTrendNErrors(MEs_.at("TrendNErrors"));
46 
47  std::for_each(_ids.begin(), _ids.end(),
48  [&](typename IDCollection::value_type const& id){
49  set->fill(id);
50  int dccid(dccId(id));
51  meByLumi.fill(dccid);
52  meTotal.fill(dccid);
53 
54  meTrendNErrors.fill(double(timestamp_.iLumi), 1.);
55  });
56  }
57 
58  void
60  {
61  if(_ids.size() == 0) return;
62 
63  MESet* set(0);
64  switch(_collection){
65  case kTowerIdErrors:
66  set = &MEs_.at("TowerId");
67  break;
68  case kBlockSizeErrors:
69  set = &MEs_.at("BlockSize");
70  break;
71  default:
72  return;
73  }
74 
75  MESet& meByLumi(MEs_.at("ByLumi"));
76  MESet& meTotal(MEs_.at("Total"));
77  MESet& meTrendNErrors(MEs_.at("TrendNErrors"));
78 
79  std::for_each(_ids.begin(), _ids.end(),
81  set->fill(id);
82  int dccid(id.dccId());
83  double nCrystals(0.);
84  if(dccid <= kEEmHigh + 1 || dccid >= kEEpLow + 1)
85  nCrystals = getElectronicsMap()->dccTowerConstituents(dccid, id.towerId()).size();
86  else
87  nCrystals = 25.;
88  meByLumi.fill(dccid, nCrystals);
89  meTotal.fill(dccid, nCrystals);
90 
91  meTrendNErrors.fill(double(timestamp_.iLumi), nCrystals);
92  });
93  }
94 
96 }
97 
98 
size_type size() const
Definition: EDCollection.h:97
#define DEFINE_ECALDQM_WORKER(TYPE)
Definition: DQWorker.h:108
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
void runOnDetIdCollection(C const &, Collections)
void runOnElectronicsIdCollection(EcalElectronicsIdCollection const &, Collections)
const_iterator end() const
Definition: EDCollection.h:153
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 &)
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Timestamp timestamp_
Definition: DQWorker.h:78
const_iterator begin() const
Definition: EDCollection.h:146
virtual void fill(DetId const &, double=1., double=1., double=1.)
Definition: MESet.h:46
MESetCollection MEs_
Definition: DQWorker.h:75
unsigned dccId(DetId const &)
std::vector< DetId > dccTowerConstituents(int dccId, int tower) const
Get the constituent detids for this dccId.