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  DQTask(ps)
8 {
10  edm::InputTag("hcalDigis"));
12  edm::InputTag("hcalDigis"));
14  edm::InputTag("hcalDigis"));
16  edm::InputTag("hcalDigis"));
17 
18  _tokHBHE = consumes<HBHEDigiCollection>(_tagHBHE);
19  _tokHO = consumes<HODigiCollection>(_tagHO);
20  _tokHF = consumes<HFDigiCollection>(_tagHF);
21  _tokuMN = consumes<HcalUMNioDigi>(_taguMN);
22 
23  _lowHBHE = ps.getUntrackedParameter<double>("lowHBHE",
24  20);
25  _lowHO = ps.getUntrackedParameter<double>("lowHO",
26  20);
27  _lowHF = ps.getUntrackedParameter<double>("lowHF",
28  20);
29 
30  // push all the event types to monitor - whole range basically
32  _eventtypes.push_back(type);
33 }
34 
36  edm::Run const& r, edm::EventSetup const& es)
37 {
38  if (_ptype==fLocal)
39  if (r.runAuxiliary().run()==1)
40  return;
41 
42  DQTask::bookHistograms(ib, r, es);
43 
45  es.get<HcalDbRecord>().get(dbService);
46  _emap = dbService->getHcalMapping();
47 
48  _cEventType.initialize(_name, "EventType",
52  _cTotalCharge.initialize(_name, "TotalCharge",
56  _cTotalChargeProfile.initialize(_name, "TotalChargeProfile",
63 }
64 
65 /* virtual */ void UMNioTask::_process(edm::Event const& e,
66  edm::EventSetup const& es)
67 {
69  if (!e.getByToken(_tokuMN, cumn))
70  return;
71 
72  uint8_t eventType = cumn->eventType();
73  uint32_t laserType = cumn->valueUserWord(0);
75  (int)eventType : (int)laserType);
76 
77  // Compute the Total Charge in the Detector...
81 
82  if (!e.getByToken(_tokHBHE, chbhe))
83  _logger.dqmthrow("Collection HBHEDigiCollection isn't available "
84  + _tagHBHE.label() + " " + _tagHBHE.instance());
85  if (!e.getByToken(_tokHO, cho))
86  _logger.dqmthrow("Collection HODigiCollection isn't available "
87  + _tagHO.label() + " " + _tagHO.instance());
88  if (!e.getByToken(_tokHF, chf))
89  _logger.dqmthrow("Collection HFDigiCollection isn't available "
90  + _tagHF.label() + " " + _tagHF.instance());
91 
93  it!=chbhe->end(); ++it)
94  {
95  double sumQ = hcaldqm::utilities::sumQ<HBHEDataFrame>(*it, 2.5, 0, it->size()-1);
96  _cTotalCharge.fill(it->id(), _currentLS, sumQ);
98  }
100  it!=cho->end(); ++it)
101  {
102  double sumQ = hcaldqm::utilities::sumQ<HODataFrame>(*it, 8.5, 0, it->size()-1);
103  _cTotalCharge.fill(it->id(), _currentLS, sumQ);
105  }
107  it!=chf->end(); ++it)
108  {
109  double sumQ = hcaldqm::utilities::sumQ<HFDataFrame>(*it, 2.5, 0, it->size()-1);
110  _cTotalCharge.fill(it->id(), _currentLS, sumQ);
112  }
113 }
115  edm::EventSetup const& es)
116 {
117  DQTask::endLuminosityBlock(lb, es);
118 }
119 
edm::InputTag _tagHBHE
Definition: UMNioTask.h:51
edm::EDGetTokenT< HFDigiCollection > _tokHF
Definition: UMNioTask.h:56
type
Definition: HCALResponse.h:21
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: UMNioTask.cc:114
T getUntrackedParameter(std::string const &, T const &) const
std::vector< uint32_t > _eventtypes
Definition: UMNioTask.h:47
edm::EDGetTokenT< HODigiCollection > _tokHO
Definition: UMNioTask.h:55
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
edm::EDGetTokenT< HcalUMNioDigi > _tokuMN
Definition: UMNioTask.h:57
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< HBHEDataFrame >::const_iterator const_iterator
edm::InputTag _tagHF
Definition: UMNioTask.h:53
hcaldqm::ContainerSingleProf2D _cTotalChargeProfile
Definition: UMNioTask.h:70
double _lowHO
Definition: UMNioTask.h:60
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
UMNioTask(edm::ParameterSet const &)
Definition: UMNioTask.cc:6
ProcessingType _ptype
Definition: DQModule.h:59
void dqmthrow(std::string const &msg) const
Definition: Logger.h:15
uint32_t valueUserWord(int iword) const
void initialize(std::string const &folder, Quantity *, Quantity *, Quantity *qz=new ValueQuantity(quantity::fN), int debug=0) override
virtual example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
uint8_t eventType() const
edm::InputTag _taguMN
Definition: UMNioTask.h:50
Logger _logger
Definition: DQModule.h:70
RunAuxiliary const & runAuxiliary() const override
Definition: Run.h:62
std::string _name
Definition: DQModule.h:57
HcalElectronicsMap const * _emap
Definition: DQTask.h:73
edm::InputTag _tagHO
Definition: UMNioTask.h:52
const_iterator end() const
virtual void initialize(std::string const &folder, Quantity *, Quantity *, Quantity *qz=new ValueQuantity(quantity::fN), int debug=0)
const T & get() const
Definition: EventSetup.h:59
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: UMNioTask.cc:35
double _lowHBHE
Definition: UMNioTask.h:60
std::string const & label() const
Definition: InputTag.h:36
uint8_t const EVENTTYPE_PEDESTAL
Definition: Constants.h:324
edm::EDGetTokenT< HBHEDigiCollection > _tokHBHE
Definition: UMNioTask.h:54
const HcalElectronicsMap * getHcalMapping() const
std::string _subsystem
Definition: DQModule.h:64
hcaldqm::ContainerSingle2D _cTotalCharge
Definition: UMNioTask.h:69
double _lowHF
Definition: UMNioTask.h:60
virtual void fill(int, int)
void _process(edm::Event const &, edm::EventSetup const &) override
Definition: UMNioTask.cc:65
void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="") override
hcaldqm::ContainerSingle2D _cEventType
Definition: UMNioTask.h:68
std::string const & instance() const
Definition: InputTag.h:37
RunNumber_t run() const
Definition: RunAuxiliary.h:41
const_iterator begin() const
Definition: Run.h:43
ib
Definition: cuy.py:660
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:122