CMS 3D CMS Logo

UMNioTask.cc
Go to the documentation of this file.
1 
3 
4 using namespace hcaldqm;
5 using namespace hcaldqm::constants;
7  _tagHBHE = ps.getUntrackedParameter<edm::InputTag>("tagHBHE", edm::InputTag("hcalDigis"));
8  _tagHO = ps.getUntrackedParameter<edm::InputTag>("tagHO", edm::InputTag("hcalDigis"));
9  _tagHF = ps.getUntrackedParameter<edm::InputTag>("tagHF", edm::InputTag("hcalDigis"));
10  _taguMN = ps.getUntrackedParameter<edm::InputTag>("taguMN", edm::InputTag("hcalDigis"));
11 
12  _tokHBHE = consumes<HBHEDigiCollection>(_tagHBHE);
13  _tokHO = consumes<HODigiCollection>(_tagHO);
14  _tokHF = consumes<HFDigiCollection>(_tagHF);
15  _tokuMN = consumes<HcalUMNioDigi>(_taguMN);
16 
17  _lowHBHE = ps.getUntrackedParameter<double>("lowHBHE", 20);
18  _lowHO = ps.getUntrackedParameter<double>("lowHO", 20);
19  _lowHF = ps.getUntrackedParameter<double>("lowHF", 20);
20 
21  // push all the event types to monitor - whole range basically
22  // This corresponds to all enum values in hcaldqm::constants::OrbitGapType
23  for (uint32_t type = constants::tNull; type < constants::nOrbitGapType; type++) {
24  _eventtypes.push_back(type);
25  }
26 }
27 
28 /* virtual */ void UMNioTask::bookHistograms(DQMStore::IBooker& ib, edm::Run const& r, edm::EventSetup const& es) {
29  if (_ptype == fLocal)
30  if (r.runAuxiliary().run() == 1)
31  return;
32 
34 
36  es.get<HcalDbRecord>().get(dbService);
37  _emap = dbService->getHcalMapping();
38 
40  "EventType",
44  0);
46  "TotalCharge",
50  0);
52  "TotalChargeProfile",
56  0);
60 }
61 
63  constants::OrbitGapType orbitGapType;
65  orbitGapType = tPedestal;
66  } else if (eventType == constants::EVENTTYPE_LED) {
67  orbitGapType = tLED;
68  } else if (eventType == constants::EVENTTYPE_LASER) {
69  switch (laserType) {
70  //case tNull : return "Null";
71  //case tHFRaddam : return "HFRaddam";
72  case 3:
73  return tHBHEHPD;
74  case 4:
75  return tHO;
76  case 5:
77  return tHF;
78  //case tZDC : return "ZDC";
79  case 7:
80  return tHEPMega;
81  case 8:
82  return tHEMMega;
83  case 9:
84  return tHBPMega;
85  case 10:
86  return tHBMMega;
87  //case tCRF : return "CRF";
88  //case tCalib : return "Calib";
89  //case tSafe : return "Safe";
90  default:
91  return tUnknown;
92  }
93  }
94  return (int)(std::find(_eventtypes.begin(), _eventtypes.end(), orbitGapType) - _eventtypes.begin());
95 }
96 
97 /* virtual */ void UMNioTask::_process(edm::Event const& e, edm::EventSetup const& es) {
99  if (!e.getByToken(_tokuMN, cumn))
100  return;
101 
102  uint8_t eventType = cumn->eventType();
103  uint32_t laserType = cumn->valueUserWord(0);
105 
106  // Compute the Total Charge in the Detector...
110 
111  if (!e.getByToken(_tokHBHE, chbhe))
112  _logger.dqmthrow("Collection HBHEDigiCollection isn't available " + _tagHBHE.label() + " " + _tagHBHE.instance());
113  if (!e.getByToken(_tokHO, cho))
114  _logger.dqmthrow("Collection HODigiCollection isn't available " + _tagHO.label() + " " + _tagHO.instance());
115  if (!e.getByToken(_tokHF, chf))
116  _logger.dqmthrow("Collection HFDigiCollection isn't available " + _tagHF.label() + " " + _tagHF.instance());
117 
118  for (HBHEDigiCollection::const_iterator it = chbhe->begin(); it != chbhe->end(); ++it) {
119  double sumQ = hcaldqm::utilities::sumQ<HBHEDataFrame>(*it, 2.5, 0, it->size() - 1);
120  _cTotalCharge.fill(it->id(), _currentLS, sumQ);
122  }
123  for (HODigiCollection::const_iterator it = cho->begin(); it != cho->end(); ++it) {
124  double sumQ = hcaldqm::utilities::sumQ<HODataFrame>(*it, 8.5, 0, it->size() - 1);
125  _cTotalCharge.fill(it->id(), _currentLS, sumQ);
127  }
128  for (HFDigiCollection::const_iterator it = chf->begin(); it != chf->end(); ++it) {
129  double sumQ = hcaldqm::utilities::sumQ<HFDataFrame>(*it, 2.5, 0, it->size() - 1);
130  _cTotalCharge.fill(it->id(), _currentLS, sumQ);
132  }
133 }
135  DQTask::globalEndLuminosityBlock(lb, es);
136 }
137 
UMNioTask::_lowHO
double _lowHO
Definition: UMNioTask.h:57
UMNioTask::_lowHF
double _lowHF
Definition: UMNioTask.h:57
hcaldqm::constants::tHF
Definition: Constants.h:299
hcaldqm::constants::tHEPMega
Definition: Constants.h:301
hcaldqm::quantity::fSubdetPM
Definition: DetectorQuantity.h:18
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
hcaldqm::constants::tNull
Definition: Constants.h:293
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
hcaldqm::constants::tUnknown
Definition: Constants.h:309
UMNioTask::_tokHBHE
edm::EDGetTokenT< HBHEDigiCollection > _tokHBHE
Definition: UMNioTask.h:51
edm::Run
Definition: Run.h:45
UMNioTask::globalEndLuminosityBlock
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: UMNioTask.cc:134
hcaldqm::quantity::ValueQuantity
Definition: ValueQuantity.h:309
UMNioTask::_process
void _process(edm::Event const &, edm::EventSetup const &) override
Definition: UMNioTask.cc:97
hcaldqm
Definition: Constants.h:8
hcaldqm::quantity::ffC_10000
Definition: ValueQuantity.h:18
hcaldqm::fLocal
Definition: DQModule.h:26
UMNioTask::_tokHF
edm::EDGetTokenT< HFDigiCollection > _tokHF
Definition: UMNioTask.h:53
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
hcaldqm::DQModule::_ptype
ProcessingType _ptype
Definition: DQModule.h:43
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
UMNioTask::getOrbitGapIndex
int getOrbitGapIndex(uint8_t eventType, uint32_t laserType)
Definition: UMNioTask.cc:62
edm::Handle
Definition: AssociativeIterator.h:50
hcaldqm::utilities::sumQ
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:126
HcalDbService::getHcalMapping
const HcalElectronicsMap * getHcalMapping() const
Definition: HcalDbService.cc:343
UMNioTask::_tagHBHE
edm::InputTag _tagHBHE
Definition: UMNioTask.h:48
hcaldqm::quantity::EventType
Definition: ValueQuantity.h:488
hcaldqm::ContainerSingle2D::fill
virtual void fill(int, int)
Definition: ContainerSingle2D.cc:105
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
hcaldqm::constants::tLED
Definition: Constants.h:295
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
UMNioTask::_cTotalChargeProfile
hcaldqm::ContainerSingleProf2D _cTotalChargeProfile
Definition: UMNioTask.h:67
hcaldqm::DQModule::_currentLS
int _currentLS
Definition: DQModule.h:52
hcaldqm::constants::OrbitGapType
OrbitGapType
Definition: Constants.h:292
hcaldqm::constants::tHBPMega
Definition: Constants.h:303
UMNioTask::_lowHBHE
double _lowHBHE
Definition: UMNioTask.h:57
edm::ESHandle< HcalDbService >
hcaldqm::DQModule::_name
std::string _name
Definition: DQModule.h:41
UMNioTask::_tagHF
edm::InputTag _tagHF
Definition: UMNioTask.h:50
HcalUMNioDigi::valueUserWord
uint32_t valueUserWord(int iword) const
Definition: HcalUMNioDigi.cc:62
hcaldqm::constants::tHO
Definition: Constants.h:298
hcaldqm::quantity::DetectorQuantity
Definition: DetectorQuantity.h:59
UMNioTask::_tokHO
edm::EDGetTokenT< HODigiCollection > _tokHO
Definition: UMNioTask.h:52
hcaldqm::quantity::fN
Definition: ValueQuantity.h:11
hcaldqm::constants::tHBHEHPD
Definition: Constants.h:297
hcaldqm::constants::EVENTTYPE_LASER
const uint8_t EVENTTYPE_LASER
Definition: Constants.h:290
Logger::dqmthrow
void dqmthrow(std::string const &msg) const
Definition: Logger.h:12
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
UMNioTask.h
hcaldqm::constants::tPedestal
Definition: Constants.h:294
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
hcaldqm::DQModule::_logger
Logger _logger
Definition: DQModule.h:54
UMNioTask::UMNioTask
UMNioTask(edm::ParameterSet const &)
Definition: UMNioTask.cc:6
cuy.ib
ib
Definition: cuy.py:662
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
hcaldqm::constants::tHEMMega
Definition: Constants.h:302
hcalcalib_dqm_sourceclient-live_cfg.eventType
eventType
Definition: hcalcalib_dqm_sourceclient-live_cfg.py:205
hcaldqm::ContainerSingleProf2D::book
void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="") override
Definition: ContainerSingleProf2D.cc:35
hcaldqm::DQModule::_subsystem
std::string _subsystem
Definition: DQModule.h:48
alignCSCRings.r
r
Definition: alignCSCRings.py:93
UMNioTask::_cEventType
hcaldqm::ContainerSingle2D _cEventType
Definition: UMNioTask.h:65
hcaldqm::DQModule::_maxLS
int _maxLS
Definition: DQModule.h:53
UMNioTask::_eventtypes
std::vector< uint32_t > _eventtypes
Definition: UMNioTask.h:44
type
type
Definition: HCALResponse.h:21
UMNioTask
Definition: UMNioTask.py:1
UMNioTask::_taguMN
edm::InputTag _taguMN
Definition: UMNioTask.h:47
hcaldqm::ContainerSingleProf2D::initialize
void initialize(std::string const &folder, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fN), int debug=0) override
Definition: ContainerSingleProf2D.cc:19
hcaldqm::constants::tHBMMega
Definition: Constants.h:304
hcaldqm::DQTask::_emap
const HcalElectronicsMap * _emap
Definition: DQTask.h:80
hcaldqm::ContainerSingle2D::book
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
Definition: ContainerSingle2D.cc:68
UMNioTask::_tagHO
edm::InputTag _tagHO
Definition: UMNioTask.h:49
hcaldqm::constants::nOrbitGapType
Definition: Constants.h:310
UMNioTask::_tokuMN
edm::EDGetTokenT< HcalUMNioDigi > _tokuMN
Definition: UMNioTask.h:54
hcaldqm::DQTask
Definition: DQTask.h:33
HcalDbRecord
Definition: HcalDbRecord.h:30
hcaldqm::ContainerSingle2D::initialize
virtual void initialize(std::string const &folder, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fN), int debug=0)
Definition: ContainerSingle2D.cc:46
edm::Event
Definition: Event.h:73
hcaldqm::ContainerSingleProf2D::fill
void fill(int, int) override
Definition: ContainerSingleProf2D.cc:50
edm::InputTag
Definition: InputTag.h:15
UMNioTask::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: UMNioTask.cc:28
hcaldqm::constants::EVENTTYPE_PEDESTAL
const uint8_t EVENTTYPE_PEDESTAL
Definition: Constants.h:289
UMNioTask::_cTotalCharge
hcaldqm::ContainerSingle2D _cTotalCharge
Definition: UMNioTask.h:66
hcaldqm::constants::EVENTTYPE_LED
const uint8_t EVENTTYPE_LED
Definition: Constants.h:291
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
hcaldqm::quantity::LumiSection
Definition: ValueQuantity.h:390