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  // List all the DetIds
10  _vDetIds.push_back(HcalDetId(HcalForward, -30, 35, 1));
11  _vDetIds.push_back(HcalDetId(HcalForward, -30, 71, 1));
12  _vDetIds.push_back(HcalDetId(HcalForward, -32, 15, 1));
13  _vDetIds.push_back(HcalDetId(HcalForward, -32, 51, 1));
14  _vDetIds.push_back(HcalDetId(HcalForward, -34, 35, 1));
15  _vDetIds.push_back(HcalDetId(HcalForward, -34, 71, 1));
16  _vDetIds.push_back(HcalDetId(HcalForward, -36, 15, 1));
17  _vDetIds.push_back(HcalDetId(HcalForward, -36, 51, 1));
18  _vDetIds.push_back(HcalDetId(HcalForward, -38, 35, 1));
19  _vDetIds.push_back(HcalDetId(HcalForward, -38, 71, 1));
20  _vDetIds.push_back(HcalDetId(HcalForward, -40, 15, 1));
21  _vDetIds.push_back(HcalDetId(HcalForward, -40, 51, 1));
22  _vDetIds.push_back(HcalDetId(HcalForward, -41, 35, 1));
23  _vDetIds.push_back(HcalDetId(HcalForward, -41, 71, 1));
24  _vDetIds.push_back(HcalDetId(HcalForward, -30, 15, 2));
25  _vDetIds.push_back(HcalDetId(HcalForward, -30, 51, 2));
26  _vDetIds.push_back(HcalDetId(HcalForward, -32, 35, 2));
27  _vDetIds.push_back(HcalDetId(HcalForward, -32, 71, 2));
28  _vDetIds.push_back(HcalDetId(HcalForward, -34, 15, 2));
29  _vDetIds.push_back(HcalDetId(HcalForward, -34, 51, 2));
30  _vDetIds.push_back(HcalDetId(HcalForward, -36, 35, 2));
31  _vDetIds.push_back(HcalDetId(HcalForward, -36, 71, 2));
32  _vDetIds.push_back(HcalDetId(HcalForward, -38, 15, 2));
33  _vDetIds.push_back(HcalDetId(HcalForward, -38, 51, 2));
34  _vDetIds.push_back(HcalDetId(HcalForward, -40, 35, 2));
35  _vDetIds.push_back(HcalDetId(HcalForward, -40, 71, 2));
36  _vDetIds.push_back(HcalDetId(HcalForward, -41, 15, 2));
37  _vDetIds.push_back(HcalDetId(HcalForward, -41, 51, 2));
38 
39  _vDetIds.push_back(HcalDetId(HcalForward, 30, 21, 1));
40  _vDetIds.push_back(HcalDetId(HcalForward, 30, 57, 1));
41  _vDetIds.push_back(HcalDetId(HcalForward, 32, 1, 1));
42  _vDetIds.push_back(HcalDetId(HcalForward, 32, 37, 1));
43  _vDetIds.push_back(HcalDetId(HcalForward, 34, 21, 1));
44  _vDetIds.push_back(HcalDetId(HcalForward, 34, 57, 1));
45  _vDetIds.push_back(HcalDetId(HcalForward, 36, 1, 1));
46  _vDetIds.push_back(HcalDetId(HcalForward, 36, 37, 1));
47  _vDetIds.push_back(HcalDetId(HcalForward, 38, 21, 1));
48  _vDetIds.push_back(HcalDetId(HcalForward, 38, 57, 1));
49  _vDetIds.push_back(HcalDetId(HcalForward, 40, 35, 1));
50  _vDetIds.push_back(HcalDetId(HcalForward, 40, 71, 1));
51  _vDetIds.push_back(HcalDetId(HcalForward, 41, 19, 1));
52  _vDetIds.push_back(HcalDetId(HcalForward, 41, 55, 1));
53  _vDetIds.push_back(HcalDetId(HcalForward, 30, 1, 2));
54  _vDetIds.push_back(HcalDetId(HcalForward, 30, 37, 2));
55  _vDetIds.push_back(HcalDetId(HcalForward, 32, 21, 2));
56  _vDetIds.push_back(HcalDetId(HcalForward, 32, 57, 2));
57  _vDetIds.push_back(HcalDetId(HcalForward, 34, 1, 2));
58  _vDetIds.push_back(HcalDetId(HcalForward, 34, 37, 2));
59  _vDetIds.push_back(HcalDetId(HcalForward, 36, 21, 2));
60  _vDetIds.push_back(HcalDetId(HcalForward, 36, 57, 2));
61  _vDetIds.push_back(HcalDetId(HcalForward, 38, 1, 2));
62  _vDetIds.push_back(HcalDetId(HcalForward, 38, 37, 2));
63  _vDetIds.push_back(HcalDetId(HcalForward, 40, 19, 2));
64  _vDetIds.push_back(HcalDetId(HcalForward, 40, 55, 2));
65  _vDetIds.push_back(HcalDetId(HcalForward, 41, 35, 2));
66  _vDetIds.push_back(HcalDetId(HcalForward, 41, 71, 2));
67 
68  // tags
69  _tagHF = ps.getUntrackedParameter<edm::InputTag>("tagHF", edm::InputTag("hcalDigis"));
70  _taguMN = ps.getUntrackedParameter<edm::InputTag>("taguMN", edm::InputTag("hcalDigis"));
71  _tokHF = consumes<HFDigiCollection>(_tagHF);
72  _tokuMN = consumes<HcalUMNioDigi>(_taguMN);
73 }
74 
75 /* virtual */ void HFRaddamTask::bookHistograms(DQMStore::IBooker& ib, edm::Run const& r, edm::EventSetup const& es) {
76  // Initialize all the Single Containers
77  for (std::vector<HcalDetId>::const_iterator it = _vDetIds.begin(); it != _vDetIds.end(); ++it) {
79  "Shape",
82  }
83 
85  char aux[200];
86  for (unsigned int i = 0; i < _vDetIds.size(); i++) {
87  sprintf(aux, "ieta%diphi%dd%d", _vDetIds[i].ieta(), _vDetIds[i].iphi(), _vDetIds[i].depth());
88  _vcShape[i].book(ib, _subsystem, aux);
89  }
90 }
91 
92 /* virtual */ void HFRaddamTask::_process(edm::Event const& e, edm::EventSetup const& es) {
94  if (!e.getByToken(_tokHF, chf))
95  _logger.dqmthrow("Collection HFDigiCollection isn't avalaible" + _tagHF.label() + " " + _tagHF.instance());
96 
97  for (HFDigiCollection::const_iterator it = chf->begin(); it != chf->end(); ++it) {
98  const HFDataFrame digi = (const HFDataFrame)(*it);
99  for (unsigned int i = 0; i < _vDetIds.size(); i++)
100  if (digi.id() == _vDetIds[i]) {
101  for (int j = 0; j < digi.size(); j++)
102  _vcShape[i].fill(j, digi.sample(j).nominal_fC() - 2.5);
103  }
104  }
105 }
106 
107 /* virtual */ bool HFRaddamTask::_isApplicable(edm::Event const& e) {
108  if (_ptype == fOnline) {
110  if (!e.getByToken(_tokuMN, cumn))
111  return false;
112 
113  // event type check first
114  uint8_t eventType = cumn->eventType();
116  return false;
117 
118  // check if this analysis task is of the right laser type
119  uint32_t laserType = cumn->valueUserWord(0);
121  return true;
122  } else {
123  // local, just return true as all the settings will be done in cfg
124  return true;
125  }
126 
127  return false;
128 }
129 
HFRaddamTask::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: HFRaddamTask.cc:75
HFRaddamTask::HFRaddamTask
HFRaddamTask(edm::ParameterSet const &)
Definition: HFRaddamTask.cc:8
HFRaddamTask::_isApplicable
bool _isApplicable(edm::Event const &) override
Definition: HFRaddamTask.cc:107
HcalQIESample::nominal_fC
constexpr double nominal_fC() const
get the nominal FC (no calibrations applied)
Definition: HcalQIESample.h:45
mps_fire.i
i
Definition: mps_fire.py:355
hcaldqm::constants
Definition: Constants.h:9
hcalcalib_dqm_sourceclient-live_cfg.laserType
laserType
Definition: hcalcalib_dqm_sourceclient-live_cfg.py:145
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
bookHistograms
example_stream void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
HcalUMNioDigi::eventType
uint8_t eventType() const
Definition: HcalUMNioDigi.cc:35
edm::InputTag::instance
std::string const & instance() const
Definition: InputTag.h:37
HFDataFrame::id
constexpr HcalDetId const & id() const
Definition: HFDataFrame.h:23
edm::Run
Definition: Run.h:45
hcaldqm::quantity::ValueQuantity
Definition: ValueQuantity.h:309
hcaldqm
Definition: Constants.h:8
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
HFDataFrame::sample
constexpr HcalQIESample const & sample(int i) const
access a sample
Definition: HFDataFrame.h:40
hcaldqm::DQModule::_ptype
ProcessingType _ptype
Definition: DQModule.h:43
edm::Handle
Definition: AssociativeIterator.h:50
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
hcaldqm::quantity::ffC_3000
Definition: ValueQuantity.h:20
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
HFRaddamTask::_vcShape
std::vector< hcaldqm::ContainerSingle1D > _vcShape
Definition: HFRaddamTask.h:44
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
hcaldqm::constants::tHFRaddam
Definition: Constants.h:296
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
hcaldqm::DQModule::_name
std::string _name
Definition: DQModule.h:41
HcalUMNioDigi::valueUserWord
uint32_t valueUserWord(int iword) const
Definition: HcalUMNioDigi.cc:62
HFRaddamTask.h
HFRaddamTask::_taguMN
edm::InputTag _taguMN
Definition: HFRaddamTask.h:32
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
hcaldqm::constants::EVENTTYPE_LASER
const uint8_t EVENTTYPE_LASER
Definition: Constants.h:290
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
Logger::dqmthrow
void dqmthrow(std::string const &msg) const
Definition: Logger.h:12
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
HFDataFrame::size
constexpr int size() const
total number of samples in the digi
Definition: HFDataFrame.h:27
HFRaddamTask::_tagHF
edm::InputTag _tagHF
Definition: HFRaddamTask.h:31
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
HFRaddamTask::_tokHF
edm::EDGetTokenT< HFDigiCollection > _tokHF
Definition: HFRaddamTask.h:33
hcaldqm::DQModule::_logger
Logger _logger
Definition: DQModule.h:54
HFRaddamTask::_process
void _process(edm::Event const &, edm::EventSetup const &) override
Definition: HFRaddamTask.cc:92
printConversionInfo.aux
aux
Definition: printConversionInfo.py:19
HcalDetId
Definition: HcalDetId.h:12
HFDataFrame
Definition: HFDataFrame.h:14
HFRaddamTask::_tokuMN
edm::EDGetTokenT< HcalUMNioDigi > _tokuMN
Definition: HFRaddamTask.h:34
cuy.ib
ib
Definition: cuy.py:662
edm::EventSetup
Definition: EventSetup.h:57
hcalcalib_dqm_sourceclient-live_cfg.eventType
eventType
Definition: hcalcalib_dqm_sourceclient-live_cfg.py:205
hcaldqm::DQModule::_subsystem
std::string _subsystem
Definition: DQModule.h:48
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HcalForward
Definition: HcalAssistant.h:36
HFRaddamTask::_vDetIds
std::vector< HcalDetId > _vDetIds
Definition: HFRaddamTask.h:37
HFRaddamTask
Definition: HFRaddamTask.py:1
hcaldqm::DQTask
Definition: DQTask.h:33
hcaldqm::ContainerSingle1D
Definition: ContainerSingle1D.h:19
hcaldqm::fOnline
Definition: DQModule.h:26
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::Event
Definition: Event.h:73
hcaldqm::quantity::fTiming_TS
Definition: ValueQuantity.h:21
edm::InputTag
Definition: InputTag.h:15
hcaldqm::filter
Definition: HashFilter.h:18
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37