CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
92  for (HBHEDigiCollection::const_iterator it=chbhe->begin();
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  }
99  for (HODigiCollection::const_iterator it=cho->begin();
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  }
106  for (HFDigiCollection::const_iterator it=chf->begin();
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:50
edm::EDGetTokenT< HFDigiCollection > _tokHF
Definition: UMNioTask.h:55
type
Definition: HCALResponse.h:21
T getUntrackedParameter(std::string const &, T const &) const
std::vector< uint32_t > _eventtypes
Definition: UMNioTask.h:46
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: UMNioTask.cc:114
int ib
Definition: cuy.py:660
edm::EDGetTokenT< HODigiCollection > _tokHO
Definition: UMNioTask.h:54
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< HcalUMNioDigi > _tokuMN
Definition: UMNioTask.h:56
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< HBHEDataFrame >::const_iterator const_iterator
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
edm::InputTag _tagHF
Definition: UMNioTask.h:52
hcaldqm::ContainerSingleProf2D _cTotalChargeProfile
Definition: UMNioTask.h:70
void bookHistograms(fwlite::EventContainer &eventCont)
double _lowHO
Definition: UMNioTask.h:59
virtual void _process(edm::Event const &, edm::EventSetup const &)
Definition: UMNioTask.cc:65
virtual void initialize(std::string const &folder, Quantity *, Quantity *, Quantity *qz=new ValueQuantity(quantity::fN), int debug=0)
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
edm::InputTag _taguMN
Definition: UMNioTask.h:49
Logger _logger
Definition: DQModule.h:70
std::string _name
Definition: DQModule.h:57
edm::InputTag _tagHO
Definition: UMNioTask.h:51
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:56
double _lowHBHE
Definition: UMNioTask.h:59
RunAuxiliary const & runAuxiliary() const
Definition: Run.h:60
std::string const & label() const
Definition: InputTag.h:36
uint8_t const EVENTTYPE_PEDESTAL
Definition: Constants.h:273
edm::EDGetTokenT< HBHEDigiCollection > _tokHBHE
Definition: UMNioTask.h:53
std::string _subsystem
Definition: DQModule.h:64
hcaldqm::ContainerSingle2D _cTotalCharge
Definition: UMNioTask.h:69
HcalElectronicsMap const * _emap
Definition: UMNioTask.h:62
double _lowHF
Definition: UMNioTask.h:59
virtual void fill(int, int)
hcaldqm::ContainerSingle2D _cEventType
Definition: UMNioTask.h:68
std::string const & instance() const
Definition: InputTag.h:37
RunNumber_t run() const
Definition: RunAuxiliary.h:41
Definition: Run.h:43
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
Definition: UMNioTask.cc:35
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:79