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 
4 
5 namespace ecaldqm {
6 
8  DQWorkerTask(_params, _paths, "IntegrityTask"),
9  hltTaskMode_(0),
10  hltTaskFolder_("")
11  {
13  (0x1 << kLumiSection) |
14  (0x1 << kGainErrors) |
15  (0x1 << kChIdErrors) |
16  (0x1 << kGainSwitchErrors) |
17  (0x1 << kTowerIdErrors) |
18  (0x1 << kBlockSizeErrors);
19 
20  edm::ParameterSet const& commonParams(_params.getUntrackedParameterSet("Common"));
21 
22  hltTaskMode_ = commonParams.getUntrackedParameter<int>("hltTaskMode");
23  hltTaskFolder_ = commonParams.getUntrackedParameter<std::string>("hltTaskFolder");
24 
25  if(hltTaskMode_ != 0 && hltTaskFolder_.size() == 0)
26  throw cms::Exception("InvalidConfiguration") << "HLTTask mode needs a folder name";
27 
28  if(hltTaskMode_ != 0){
29  std::string path;
30  std::map<std::string, std::string> replacements;
31  replacements["hlttask"] = hltTaskFolder_;
32 
33  MEs_[kFEDNonFatal]->name(replacements);
34  }
35  }
36 
38  {
39  }
40 
41  void
43  {
44  if(hltTaskMode_ != 1){
45  for(unsigned iME(kByLumi); iME < kFEDNonFatal; iME++)
46  MEs_[iME]->book();
47  }
48  if(hltTaskMode_ != 0)
49  MEs_[kFEDNonFatal]->book();
50  }
51 
52  void
54  {
55  if(MEs_[kByLumi]->isActive()) MEs_[kByLumi]->reset();
56  }
57 
58  void
60  {
62  switch(_collection){
63  case kGainErrors:
64  set = kGain;
65  break;
66  case kChIdErrors:
67  set = kChId;
68  break;
69  case kGainSwitchErrors:
70  set = kGainSwitch;
71  break;
72  default:
73  return;
74  }
75 
76  for(DetIdCollection::const_iterator idItr(_ids.begin()); idItr != _ids.end(); ++idItr){
77  if(MEs_[set]->isActive()) MEs_[set]->fill(*idItr);
78  if(MEs_[kFEDNonFatal]->isActive()) MEs_[kFEDNonFatal]->fill(*idItr);
79  if(MEs_[kByLumi]->isActive()) MEs_[kByLumi]->fill(*idItr);
80  if(MEs_[kTotal]->isActive()) MEs_[kTotal]->fill(*idItr);
81  }
82  }
83 
84  void
86  {
88 
89  switch(_collection){
90  case kTowerIdErrors:
91  set = kTowerId;
92  break;
93  case kBlockSizeErrors:
94  set = kBlockSize;
95  break;
96  default:
97  return;
98  }
99 
100  // 25 is not correct
101 
102  for(EcalElectronicsIdCollection::const_iterator idItr(_ids.begin()); idItr != _ids.end(); ++idItr){
103  if(MEs_[set]->isActive()) MEs_[set]->fill(*idItr, 25.);
104  if(MEs_[kFEDNonFatal]->isActive()) MEs_[kFEDNonFatal]->fill(*idItr, 25.);
105  if(MEs_[kByLumi]->isActive()) MEs_[kByLumi]->fill(*idItr, 25.);
106  if(MEs_[kTotal]->isActive()) MEs_[kTotal]->fill(*idItr, 25.);
107  }
108  }
109 
110  /*static*/
111  void
112  IntegrityTask::setMEData(std::vector<MEData>& _data)
113  {
122  }
123 
125 }
126 
127 
string fill
Definition: lumiContext.py:319
const_iterator end() const
Definition: EDCollection.h:154
static void setMEData(std::vector< MEData > &)
list path
Definition: scaleCards.py:51
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
ParameterSet const & getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
IntegrityTask(const edm::ParameterSet &, const edm::ParameterSet &)
Definition: IntegrityTask.cc:7
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
const_iterator begin() const
Definition: EDCollection.h:147
DEFINE_ECALDQM_WORKER(CertificationClient)
std::string hltTaskFolder_
Definition: IntegrityTask.h:41
void runOnErrors(const DetIdCollection &, Collections)
std::vector< DetId >::const_iterator const_iterator
Definition: EDCollection.h:20
void set(const std::string &name, int value)
set the flag, with a run-time name