CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RadDamTask.cc
Go to the documentation of this file.
1 
3 
4 using namespace hcaldqm;
6  DQTask(ps)
7 {
8  // List all the DetIds
9  _vDetIds.push_back(HcalDetId(HcalForward, -30, 35, 1));
10  _vDetIds.push_back(HcalDetId(HcalForward, -30, 71, 1));
11  _vDetIds.push_back(HcalDetId(HcalForward, -32, 15, 1));
12  _vDetIds.push_back(HcalDetId(HcalForward, -32, 51, 1));
13  _vDetIds.push_back(HcalDetId(HcalForward, -34, 35, 1));
14  _vDetIds.push_back(HcalDetId(HcalForward, -34, 71, 1));
15  _vDetIds.push_back(HcalDetId(HcalForward, -36, 15, 1));
16  _vDetIds.push_back(HcalDetId(HcalForward, -36, 51, 1));
17  _vDetIds.push_back(HcalDetId(HcalForward, -38, 35, 1));
18  _vDetIds.push_back(HcalDetId(HcalForward, -38, 71, 1));
19  _vDetIds.push_back(HcalDetId(HcalForward, -40, 15, 1));
20  _vDetIds.push_back(HcalDetId(HcalForward, -40, 51, 1));
21  _vDetIds.push_back(HcalDetId(HcalForward, -41, 35, 1));
22  _vDetIds.push_back(HcalDetId(HcalForward, -41, 71, 1));
23  _vDetIds.push_back(HcalDetId(HcalForward, -30, 15, 2));
24  _vDetIds.push_back(HcalDetId(HcalForward, -30, 51, 2));
25  _vDetIds.push_back(HcalDetId(HcalForward, -32, 35, 2));
26  _vDetIds.push_back(HcalDetId(HcalForward, -32, 71, 2));
27  _vDetIds.push_back(HcalDetId(HcalForward, -34, 15, 2));
28  _vDetIds.push_back(HcalDetId(HcalForward, -34, 51, 2));
29  _vDetIds.push_back(HcalDetId(HcalForward, -36, 35, 2));
30  _vDetIds.push_back(HcalDetId(HcalForward, -36, 71, 2));
31  _vDetIds.push_back(HcalDetId(HcalForward, -38, 15, 2));
32  _vDetIds.push_back(HcalDetId(HcalForward, -38, 51, 2));
33  _vDetIds.push_back(HcalDetId(HcalForward, -40, 35, 2));
34  _vDetIds.push_back(HcalDetId(HcalForward, -40, 71, 2));
35  _vDetIds.push_back(HcalDetId(HcalForward, -41, 15, 2));
36  _vDetIds.push_back(HcalDetId(HcalForward, -41, 51, 2));
37 
38  _vDetIds.push_back(HcalDetId(HcalForward, 30, 21, 1));
39  _vDetIds.push_back(HcalDetId(HcalForward, 30, 57, 1));
40  _vDetIds.push_back(HcalDetId(HcalForward, 32, 1, 1));
41  _vDetIds.push_back(HcalDetId(HcalForward, 32, 37, 1));
42  _vDetIds.push_back(HcalDetId(HcalForward, 34, 21, 1));
43  _vDetIds.push_back(HcalDetId(HcalForward, 34, 57, 1));
44  _vDetIds.push_back(HcalDetId(HcalForward, 36, 1, 1));
45  _vDetIds.push_back(HcalDetId(HcalForward, 36, 37, 1));
46  _vDetIds.push_back(HcalDetId(HcalForward, 38, 21, 1));
47  _vDetIds.push_back(HcalDetId(HcalForward, 38, 57, 1));
48  _vDetIds.push_back(HcalDetId(HcalForward, 40, 35, 1));
49  _vDetIds.push_back(HcalDetId(HcalForward, 40, 71, 1));
50  _vDetIds.push_back(HcalDetId(HcalForward, 41, 19, 1));
51  _vDetIds.push_back(HcalDetId(HcalForward, 41, 55, 1));
52  _vDetIds.push_back(HcalDetId(HcalForward, 30, 1, 2));
53  _vDetIds.push_back(HcalDetId(HcalForward, 30, 37, 2));
54  _vDetIds.push_back(HcalDetId(HcalForward, 32, 21, 2));
55  _vDetIds.push_back(HcalDetId(HcalForward, 32, 57, 2));
56  _vDetIds.push_back(HcalDetId(HcalForward, 34, 1, 2));
57  _vDetIds.push_back(HcalDetId(HcalForward, 34, 37, 2));
58  _vDetIds.push_back(HcalDetId(HcalForward, 36, 21, 2));
59  _vDetIds.push_back(HcalDetId(HcalForward, 36, 57, 2));
60  _vDetIds.push_back(HcalDetId(HcalForward, 38, 1, 2));
61  _vDetIds.push_back(HcalDetId(HcalForward, 38, 37, 2));
62  _vDetIds.push_back(HcalDetId(HcalForward, 40, 19, 2));
63  _vDetIds.push_back(HcalDetId(HcalForward, 40, 55, 2));
64  _vDetIds.push_back(HcalDetId(HcalForward, 41, 35, 2));
65  _vDetIds.push_back(HcalDetId(HcalForward, 41, 71, 2));
66 
67  // Initialize all the Single Containers
68  char aux[200];
69  for (std::vector<HcalDetId>::const_iterator it=_vDetIds.begin();
70  it!=_vDetIds.end(); ++it)
71  {
72  sprintf(aux, "_ieta%diphi%dd%d", it->ieta(), it->iphi(), it->depth());
73  _vcShape.push_back(ContainerSingle1D(_name+"/Shape",
74  "Shape"+std::string(aux),
77  }
78 
79  // tags
81  edm::InputTag("hcalDigis"));
82  _tokHF = consumes<HFDigiCollection>(_tagHF);
83 }
84 
86  edm::Run const& r, edm::EventSetup const& es)
87 {
88  DQTask::bookHistograms(ib, r, es);
89  for (unsigned int i=0; i<_vDetIds.size(); i++)
90  _vcShape[i].book(ib, _subsystem);
91 }
92 
93 /* virtual */ void RadDamTask::_process(edm::Event const &e,
94  edm::EventSetup const& es)
95 {
97  if (!e.getByToken(_tokHF, chf))
98  _logger.dqmthrow("Collection HFDigiCollection isn't avalaible"
99  + _tagHF.label() + " " + _tagHF.instance());
100 
101  for (HFDigiCollection::const_iterator it=chf->begin();
102  it!=chf->end(); ++it)
103  {
104  const HFDataFrame digi = (const HFDataFrame)(*it);
105  for (unsigned int i=0; i<_vDetIds.size(); i++)
106  if (digi.id()==_vDetIds[i])
107  {
108  for (int j=0; j<digi.size(); j++)
109  _vcShape[i].fill(j,
110  digi.sample(j).nominal_fC()-2.5);
111  }
112  }
113 }
114 
115 /* virtual */ bool RadDamTask::_isApplicable(edm::Event const &e)
116 {
117  if (_ptype==fOnline)
118  {
119  // globla-online
120  int calibType = this->_getCalibType(e);
121  return (calibType==hc_RADDAM);
122  }
123  else
124  {
125  // local, just return true as all the settings will be done in cfg
126  return true;
127  }
128 
129  return false;
130 }
131 
133 
134 
135 
virtual int _getCalibType(edm::Event const &)
Definition: DQTask.cc:124
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
Definition: RadDamTask.cc:85
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
string fill
Definition: lumiContext.py:319
int ib
Definition: cuy.py:660
RadDamTask(edm::ParameterSet const &)
Definition: RadDamTask.cc:5
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
edm::EDGetTokenT< HFDigiCollection > _tokHF
Definition: RadDamTask.h:37
tuple calibType
Definition: diJetCalib.py:20
std::vector< HFDataFrame >::const_iterator const_iterator
void bookHistograms(fwlite::EventContainer &eventCont)
edm::InputTag _tagHF
Definition: RadDamTask.h:36
virtual bool _isApplicable(edm::Event const &)
Definition: RadDamTask.cc:115
virtual void _process(edm::Event const &, edm::EventSetup const &)
Definition: RadDamTask.cc:93
ProcessingType _ptype
Definition: DQModule.h:52
void dqmthrow(std::string const &msg) const
Definition: Logger.h:15
const HcalQIESample & sample(int i) const
access a sample
Definition: HFDataFrame.h:39
int j
Definition: DBlmapReader.cc:9
Logger _logger
Definition: DQModule.h:62
std::string _name
Definition: DQModule.h:50
int size() const
total number of samples in the digi
Definition: HFDataFrame.h:26
double nominal_fC() const
get the nominal FC (no calibrations applied)
std::string const & label() const
Definition: InputTag.h:36
std::string _subsystem
Definition: DQModule.h:57
std::vector< HcalDetId > _vDetIds
Definition: RadDamTask.h:40
const HcalDetId & id() const
Definition: HFDataFrame.h:22
std::string const & instance() const
Definition: InputTag.h:37
std::vector< ContainerSingle1D > _vcShape
Definition: RadDamTask.h:47
Definition: Run.h:43