test
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  // tags
69  edm::InputTag("hcalDigis"));
70  _tokHF = consumes<HFDigiCollection>(_tagHF);
71 }
72 
74  edm::Run const& r, edm::EventSetup const& es)
75 {
76  // Initialize all the Single Containers
77  for (std::vector<HcalDetId>::const_iterator it=_vDetIds.begin();
78  it!=_vDetIds.end(); ++it)
79  {
80  _vcShape.push_back(ContainerSingle1D(_name,
81  "Shape",
84  }
85 
86  DQTask::bookHistograms(ib, r, es);
87  char aux[200];
88  for (unsigned int i=0; i<_vDetIds.size(); i++)
89  {
90  sprintf(aux, "ieta%diphi%dd%d", _vDetIds[i].ieta(),
91  _vDetIds[i].iphi(), _vDetIds[i].depth());
92  _vcShape[i].book(ib, _subsystem, aux);
93  }
94 }
95 
96 /* virtual */ void RadDamTask::_process(edm::Event const &e,
97  edm::EventSetup const& es)
98 {
100  if (!e.getByToken(_tokHF, chf))
101  _logger.dqmthrow("Collection HFDigiCollection isn't avalaible"
102  + _tagHF.label() + " " + _tagHF.instance());
103 
104  for (HFDigiCollection::const_iterator it=chf->begin();
105  it!=chf->end(); ++it)
106  {
107  const HFDataFrame digi = (const HFDataFrame)(*it);
108  for (unsigned int i=0; i<_vDetIds.size(); i++)
109  if (digi.id()==_vDetIds[i])
110  {
111  for (int j=0; j<digi.size(); j++)
112  _vcShape[i].fill(j,
113  digi.sample(j).nominal_fC()-2.5);
114  }
115  }
116 }
117 
118 /* virtual */ bool RadDamTask::_isApplicable(edm::Event const &e)
119 {
120  if (_ptype==fOnline)
121  {
122  // globla-online
123  int calibType = this->_getCalibType(e);
124  return (calibType==hc_RADDAM);
125  }
126  else
127  {
128  // local, just return true as all the settings will be done in cfg
129  return true;
130  }
131 
132  return false;
133 }
134 
136 
137 
138 
virtual int _getCalibType(edm::Event const &)
Definition: DQTask.cc:174
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
Definition: RadDamTask.cc:73
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:36
tuple calibType
Definition: diJetCalib.py:20
std::vector< HFDataFrame >::const_iterator const_iterator
void bookHistograms(fwlite::EventContainer &eventCont)
edm::InputTag _tagHF
Definition: RadDamTask.h:35
virtual bool _isApplicable(edm::Event const &)
Definition: RadDamTask.cc:118
virtual void _process(edm::Event const &, edm::EventSetup const &)
Definition: RadDamTask.cc:96
ProcessingType _ptype
Definition: DQModule.h:59
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:70
std::string _name
Definition: DQModule.h:57
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:64
std::vector< HcalDetId > _vDetIds
Definition: RadDamTask.h:39
const HcalDetId & id() const
Definition: HFDataFrame.h:22
std::string const & instance() const
Definition: InputTag.h:37
std::vector< ContainerSingle1D > _vcShape
Definition: RadDamTask.h:46
Definition: Run.h:43