CMS 3D CMS Logo

HFRaddamTask.cc
Go to the documentation of this file.
1 
3 
4 using namespace hcaldqm;
5 using namespace hcaldqm::constants;
6 using namespace hcaldqm::filter;
7 
9  DQTask(ps)
10 {
11  // List all the DetIds
12  _vDetIds.push_back(HcalDetId(HcalForward, -30, 35, 1));
13  _vDetIds.push_back(HcalDetId(HcalForward, -30, 71, 1));
14  _vDetIds.push_back(HcalDetId(HcalForward, -32, 15, 1));
15  _vDetIds.push_back(HcalDetId(HcalForward, -32, 51, 1));
16  _vDetIds.push_back(HcalDetId(HcalForward, -34, 35, 1));
17  _vDetIds.push_back(HcalDetId(HcalForward, -34, 71, 1));
18  _vDetIds.push_back(HcalDetId(HcalForward, -36, 15, 1));
19  _vDetIds.push_back(HcalDetId(HcalForward, -36, 51, 1));
20  _vDetIds.push_back(HcalDetId(HcalForward, -38, 35, 1));
21  _vDetIds.push_back(HcalDetId(HcalForward, -38, 71, 1));
22  _vDetIds.push_back(HcalDetId(HcalForward, -40, 15, 1));
23  _vDetIds.push_back(HcalDetId(HcalForward, -40, 51, 1));
24  _vDetIds.push_back(HcalDetId(HcalForward, -41, 35, 1));
25  _vDetIds.push_back(HcalDetId(HcalForward, -41, 71, 1));
26  _vDetIds.push_back(HcalDetId(HcalForward, -30, 15, 2));
27  _vDetIds.push_back(HcalDetId(HcalForward, -30, 51, 2));
28  _vDetIds.push_back(HcalDetId(HcalForward, -32, 35, 2));
29  _vDetIds.push_back(HcalDetId(HcalForward, -32, 71, 2));
30  _vDetIds.push_back(HcalDetId(HcalForward, -34, 15, 2));
31  _vDetIds.push_back(HcalDetId(HcalForward, -34, 51, 2));
32  _vDetIds.push_back(HcalDetId(HcalForward, -36, 35, 2));
33  _vDetIds.push_back(HcalDetId(HcalForward, -36, 71, 2));
34  _vDetIds.push_back(HcalDetId(HcalForward, -38, 15, 2));
35  _vDetIds.push_back(HcalDetId(HcalForward, -38, 51, 2));
36  _vDetIds.push_back(HcalDetId(HcalForward, -40, 35, 2));
37  _vDetIds.push_back(HcalDetId(HcalForward, -40, 71, 2));
38  _vDetIds.push_back(HcalDetId(HcalForward, -41, 15, 2));
39  _vDetIds.push_back(HcalDetId(HcalForward, -41, 51, 2));
40 
41  _vDetIds.push_back(HcalDetId(HcalForward, 30, 21, 1));
42  _vDetIds.push_back(HcalDetId(HcalForward, 30, 57, 1));
43  _vDetIds.push_back(HcalDetId(HcalForward, 32, 1, 1));
44  _vDetIds.push_back(HcalDetId(HcalForward, 32, 37, 1));
45  _vDetIds.push_back(HcalDetId(HcalForward, 34, 21, 1));
46  _vDetIds.push_back(HcalDetId(HcalForward, 34, 57, 1));
47  _vDetIds.push_back(HcalDetId(HcalForward, 36, 1, 1));
48  _vDetIds.push_back(HcalDetId(HcalForward, 36, 37, 1));
49  _vDetIds.push_back(HcalDetId(HcalForward, 38, 21, 1));
50  _vDetIds.push_back(HcalDetId(HcalForward, 38, 57, 1));
51  _vDetIds.push_back(HcalDetId(HcalForward, 40, 35, 1));
52  _vDetIds.push_back(HcalDetId(HcalForward, 40, 71, 1));
53  _vDetIds.push_back(HcalDetId(HcalForward, 41, 19, 1));
54  _vDetIds.push_back(HcalDetId(HcalForward, 41, 55, 1));
55  _vDetIds.push_back(HcalDetId(HcalForward, 30, 1, 2));
56  _vDetIds.push_back(HcalDetId(HcalForward, 30, 37, 2));
57  _vDetIds.push_back(HcalDetId(HcalForward, 32, 21, 2));
58  _vDetIds.push_back(HcalDetId(HcalForward, 32, 57, 2));
59  _vDetIds.push_back(HcalDetId(HcalForward, 34, 1, 2));
60  _vDetIds.push_back(HcalDetId(HcalForward, 34, 37, 2));
61  _vDetIds.push_back(HcalDetId(HcalForward, 36, 21, 2));
62  _vDetIds.push_back(HcalDetId(HcalForward, 36, 57, 2));
63  _vDetIds.push_back(HcalDetId(HcalForward, 38, 1, 2));
64  _vDetIds.push_back(HcalDetId(HcalForward, 38, 37, 2));
65  _vDetIds.push_back(HcalDetId(HcalForward, 40, 19, 2));
66  _vDetIds.push_back(HcalDetId(HcalForward, 40, 55, 2));
67  _vDetIds.push_back(HcalDetId(HcalForward, 41, 35, 2));
68  _vDetIds.push_back(HcalDetId(HcalForward, 41, 71, 2));
69 
70  // tags
72  edm::InputTag("hcalDigis"));
74  edm::InputTag("hcalDigis"));
75  _tokHF = consumes<HFDigiCollection>(_tagHF);
76  _tokuMN = consumes<HcalUMNioDigi>(_taguMN);
77 }
78 
80  edm::Run const& r, edm::EventSetup const& es)
81 {
82  // Initialize all the Single Containers
83  for (std::vector<HcalDetId>::const_iterator it=_vDetIds.begin();
84  it!=_vDetIds.end(); ++it)
85  {
86  _vcShape.push_back(ContainerSingle1D(_name,
87  "Shape",
90  }
91 
92  DQTask::bookHistograms(ib, r, es);
93  char aux[200];
94  for (unsigned int i=0; i<_vDetIds.size(); i++)
95  {
96  sprintf(aux, "ieta%diphi%dd%d", _vDetIds[i].ieta(),
97  _vDetIds[i].iphi(), _vDetIds[i].depth());
98  _vcShape[i].book(ib, _subsystem, aux);
99  }
100 }
101 
102 /* virtual */ void HFRaddamTask::_process(edm::Event const &e,
103  edm::EventSetup const& es)
104 {
106  if (!e.getByToken(_tokHF, chf))
107  _logger.dqmthrow("Collection HFDigiCollection isn't avalaible"
108  + _tagHF.label() + " " + _tagHF.instance());
109 
110  for (HFDigiCollection::const_iterator it=chf->begin();
111  it!=chf->end(); ++it)
112  {
113  const HFDataFrame digi = (const HFDataFrame)(*it);
114  for (unsigned int i=0; i<_vDetIds.size(); i++)
115  if (digi.id()==_vDetIds[i])
116  {
117  for (int j=0; j<digi.size(); j++)
118  _vcShape[i].fill(j,
119  digi.sample(j).nominal_fC()-2.5);
120  }
121  }
122 }
123 
124 /* virtual */ bool HFRaddamTask::_isApplicable(edm::Event const &e)
125 {
126  if (_ptype==fOnline)
127  {
129  if (!e.getByToken(_tokuMN, cumn))
130  return false;
131 
132  // event type check first
133  uint8_t eventType = cumn->eventType();
134  if (eventType!=constants::EVENTTYPE_LASER)
135  return false;
136 
137  // check if this analysis task is of the right laser type
138  uint32_t laserType = cumn->valueUserWord(0);
139  if (laserType==constants::tHFRaddam) return true;
140  }
141  else
142  {
143  // local, just return true as all the settings will be done in cfg
144  return true;
145  }
146 
147  return false;
148 }
149 
T getUntrackedParameter(std::string const &, T const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< HFDataFrame >::const_iterator const_iterator
std::vector< hcaldqm::ContainerSingle1D > _vcShape
Definition: HFRaddamTask.h:47
edm::InputTag _taguMN
Definition: HFRaddamTask.h:35
ProcessingType _ptype
Definition: DQModule.h:59
void _process(edm::Event const &, edm::EventSetup const &) override
void dqmthrow(std::string const &msg) const
Definition: Logger.h:15
uint32_t valueUserWord(int iword) const
virtual example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
const HcalQIESample & sample(int i) const
access a sample
Definition: HFDataFrame.h:39
uint8_t eventType() const
edm::EDGetTokenT< HcalUMNioDigi > _tokuMN
Definition: HFRaddamTask.h:37
Logger _logger
Definition: DQModule.h:70
std::string _name
Definition: DQModule.h:57
const_iterator end() const
edm::InputTag _tagHF
Definition: HFRaddamTask.h:34
int size() const
total number of samples in the digi
Definition: HFDataFrame.h:26
uint8_t const EVENTTYPE_LASER
Definition: Constants.h:325
double nominal_fC() const
get the nominal FC (no calibrations applied)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: HFRaddamTask.cc:79
edm::EDGetTokenT< HFDigiCollection > _tokHF
Definition: HFRaddamTask.h:36
std::string const & label() const
Definition: InputTag.h:36
HFRaddamTask(edm::ParameterSet const &)
Definition: HFRaddamTask.cc:8
bool _isApplicable(edm::Event const &) override
std::string _subsystem
Definition: DQModule.h:64
const HcalDetId & id() const
Definition: HFDataFrame.h:22
std::string const & instance() const
Definition: InputTag.h:37
std::vector< HcalDetId > _vDetIds
Definition: HFRaddamTask.h:40
const_iterator begin() const
Definition: Run.h:43
ib
Definition: cuy.py:660