test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PNDiodeTask.cc
Go to the documentation of this file.
1 #include "../interface/PNDiodeTask.h"
2 
4 
5 namespace ecaldqm {
6 
9  {
10  std::fill_n(enable_, nDCC, false);
11  }
12 
13  bool
14  PNDiodeTask::filterRunType(short const* _runType)
15  {
16  bool enable(false);
17 
18  for(int iDCC(0); iDCC < 54; iDCC++){
19  if(_runType[iDCC] == EcalDCCHeaderBlock::LASER_STD ||
20  _runType[iDCC] == EcalDCCHeaderBlock::LASER_GAP ||
21  _runType[iDCC] == EcalDCCHeaderBlock::LED_STD ||
22  _runType[iDCC] == EcalDCCHeaderBlock::LED_GAP ||
23  _runType[iDCC] == EcalDCCHeaderBlock::TESTPULSE_MGPA ||
24  _runType[iDCC] == EcalDCCHeaderBlock::TESTPULSE_GAP ||
25  _runType[iDCC] == EcalDCCHeaderBlock::PEDESTAL_STD ||
26  _runType[iDCC] == EcalDCCHeaderBlock::PEDESTAL_GAP){
27  enable = true;
28  enable_[iDCC] = true;
29  }
30  else
31  enable_[iDCC] = false;
32  }
33 
34  return enable;
35  }
36 
37  void
39  {
40  if(_ids.size() == 0) return;
41 
42  MESet* set(0);
43 
44  switch(_collection){
45  case kMEMTowerIdErrors:
46  set = &MEs_.at("MEMTowerId");
47  break;
49  set = &MEs_.at("MEMBlockSize");
50  break;
51  case kMEMChIdErrors:
52  set = &MEs_.at("MEMChId");
53  break;
54  case kMEMGainErrors:
55  set = &MEs_.at("MEMGain");
56  break;
57  default:
58  return;
59  }
60 
61  std::for_each(_ids.begin(), _ids.end(), [&](EcalElectronicsIdCollection::value_type const& id){
62  set->fill(EcalElectronicsId(id.dccId(), id.towerId(), 1, id.xtalId()));
63  });
64  }
65 
66  void
68  {
69  MESet& meOccupancy(MEs_.at("Occupancy"));
70  MESet& meOccupancySummary(MEs_.at("OccupancySummary"));
71  MESet& mePedestal(MEs_.at("Pedestal"));
72 
73  std::for_each(_digis.begin(), _digis.end(), [&](EcalPnDiodeDigiCollection::value_type const& digi){
74  const EcalPnDiodeDetId& id(digi.id());
75 
76  if(!enable_[dccId(id) - 1]) return;
77 
78  meOccupancy.fill(id);
79  meOccupancySummary.fill(id);
80 
81  for(int iSample(0); iSample < 4; iSample++){
82  if(digi.sample(iSample).gainId() != 1) break;
83  mePedestal.fill(id, double(digi.sample(iSample).adc()));
84  }
85  });
86  }
87 
89 }
90 
91 
size_type size() const
Definition: EDCollection.h:97
void runOnErrors(EcalElectronicsIdCollection const &, Collections)
Definition: PNDiodeTask.cc:38
bool enable_[ecaldqm::nDCC]
Definition: PNDiodeTask.h:26
#define DEFINE_ECALDQM_WORKER(TYPE)
Definition: DQWorker.h:108
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 [...
bool filterRunType(short const *) override
Definition: PNDiodeTask.cc:14
void runOnPnDigis(EcalPnDiodeDigiCollection const &)
Definition: PNDiodeTask.cc:67
unsigned towerId(DetId const &)
const_iterator end() const
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 &)
const_iterator begin() const