CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PedestalTask.cc
Go to the documentation of this file.
1 
3 
4 using namespace hcaldqm;
6  DQTask(ps)
7 {
8  // Containers
9  _cPedestalMeans_SubDet.initialize(_name+"/Means/SubDet",
10  "PedestalMeans",
14  _cPedestalRMSs_SubDet.initialize(_name+"/PedestalRMSs/SubDet",
15  "PedestalRMSs",
19  _cPedestalMeans_depth.initialize(_name+"/PedestalMeans/depth",
20  "PedestalMeans",
24  _cPedestalRMSs_depth.initialize(_name+"/PedestalRMSs/depth", "PedestalRMSs",
28 
29  // tags
31  edm::InputTag("hcalDigis"));
33  edm::InputTag("hcalDigis"));
35  edm::InputTag("hcalDigis"));
37  edm::InputTag("tbunpacker"));
38  _tokHBHE = consumes<HBHEDigiCollection>(_tagHBHE);
39  _tokHO = consumes<HODigiCollection>(_tagHO);
40  _tokHF = consumes<HFDigiCollection>(_tagHF);
41  _tokTrigger = consumes<HcalTBTriggerData>(_tagTrigger);
42 }
43 
45  edm::Run const& r, edm::EventSetup const& es)
46 {
47  DQTask::bookHistograms(ib, r, es);
52 }
53 
55 {
56  DQTask::_resetMonitors(uf);
57 }
58 
59 /* virtual */ void PedestalTask::_dump()
60 {
69 }
70 
71 /* virtual */ void PedestalTask::_process(edm::Event const& e,
72  edm::EventSetup const& es)
73 {
77 
78  if (!e.getByToken(_tokHBHE, chbhe))
79  _logger.dqmthrow("Collection HBHEDigiCollection isn't available"
80  + _tagHBHE.label() + " " + _tagHBHE.instance());
81  if (!e.getByToken(_tokHO, cho))
82  _logger.dqmthrow("Collection HODigiCollection isn't available"
83  + _tagHO.label() + " " + _tagHO.instance());
84  if (!e.getByToken(_tokHF, chf))
85  _logger.dqmthrow("Collection HFDigiCollection isn't available"
86  + _tagHF.label() + " " + _tagHF.instance());
87 
88  for (HBHEDigiCollection::const_iterator it=chbhe->begin();
89  it!=chbhe->end(); ++it)
90  {
91  const HBHEDataFrame digi = (const HBHEDataFrame)(*it);
92  int digiSizeToUse = floor(digi.size()/constants::CAPS_NUM)*
94  for (int i=0; i<digiSizeToUse; i++)
95  _cPedestals.fill(digi.id(), it->sample(i).adc());
96  }
97  for (HODigiCollection::const_iterator it=cho->begin();
98  it!=cho->end(); ++it)
99  {
100  const HODataFrame digi = (const HODataFrame)(*it);
101  int digiSizeToUse = floor(digi.size()/constants::CAPS_NUM)*
103  for (int i=0; i<digiSizeToUse; i++)
104  _cPedestals.fill(digi.id(), it->sample(i).adc());
105  }
106  for (HFDigiCollection::const_iterator it=chf->begin();
107  it!=chf->end(); ++it)
108  {
109  const HFDataFrame digi = (const HFDataFrame)(*it);
110  int digiSizeToUse = floor(digi.size()/constants::CAPS_NUM)*
112  for (int i=0; i<digiSizeToUse; i++)
113  _cPedestals.fill(digi.id(), it->sample(i).adc());
114  }
115 
116  if (_ptype==fOnline && _evsTotal>0 &&
118  this->_dump();
119 }
120 
121 /* virtual */ bool PedestalTask::_isApplicable(edm::Event const& e)
122 {
123  if (_ptype==fOnline)
124  {
125  // online-global
126  return this->_getCalibType(e)==hc_Pedestal;
127  }
128  else
129  {
130  // local
132  if (!e.getByToken(_tokTrigger, ctrigger))
133  _logger.dqmthrow("Collection HcalTBTriggerData isn't available"
134  + _tagTrigger.label() + " " + _tagTrigger.instance());
135  return ctrigger->wasSpillIgnorantPedestalTrigger();
136  }
137 
138  return false;
139 }
140 
142 
143 
virtual int _getCalibType(edm::Event const &)
Definition: DQTask.cc:107
Container1D _cPedestalRMSs_SubDet
Definition: PedestalTask.h:52
edm::InputTag _tagHF
Definition: PedestalTask.h:41
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
Definition: Container2D.cc:233
virtual void _process(edm::Event const &, edm::EventSetup const &)
Definition: PedestalTask.cc:71
virtual void initialize(std::string const &folder, std::string nametitle, mapper::MapperType mt, axis::Axis *xaxis, axis::Axis *yaxis=new axis::CoordinateAxis(axis::fYaxis, axis::fiphi), axis::Axis *zaxis=new axis::ValueAxis(axis::fZaxis, axis::fEntries), int debug=0)
Definition: Container2D.cc:30
int ib
Definition: cuy.py:660
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
Definition: Container1D.cc:198
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
ContainerCompact _cPedestals
Definition: PedestalTask.h:48
int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:26
UpdateFreq
Definition: DQTask.h:16
edm::InputTag _tagHBHE
Definition: PedestalTask.h:39
std::vector< HBHEDataFrame >::const_iterator const_iterator
Container1D _cPedestalMeans_SubDet
Definition: PedestalTask.h:51
edm::InputTag _tagHO
Definition: PedestalTask.h:40
void bookHistograms(fwlite::EventContainer &eventCont)
const HcalDetId & id() const
Definition: HODataFrame.h:23
edm::EDGetTokenT< HcalTBTriggerData > _tokTrigger
Definition: PedestalTask.h:46
edm::EDGetTokenT< HFDigiCollection > _tokHF
Definition: PedestalTask.h:45
ProcessingType _ptype
Definition: DQModule.h:52
virtual void reset()
Definition: Container1D.cc:230
int const CAPS_NUM
Definition: Constants.h:131
void dqmthrow(std::string const &msg) const
Definition: Logger.h:15
virtual void _resetMonitors(UpdateFreq)
Definition: PedestalTask.cc:54
int size() const
total number of samples in the digi
Definition: HODataFrame.h:27
edm::EDGetTokenT< HBHEDigiCollection > _tokHBHE
Definition: PedestalTask.h:43
Logger _logger
Definition: DQModule.h:62
virtual void initialize(std::string const &folder, std::string const &nametitle, mapper::MapperType mt, axis::Axis *xaxis, axis::Axis *yaxis=new ValueAxis(fYaxis, fEntries), int debug=0)
Definition: Container1D.cc:28
std::string _name
Definition: DQModule.h:50
PedestalTask(edm::ParameterSet const &)
Definition: PedestalTask.cc:5
int const CALIBEVENTS_MIN
Definition: Constants.h:167
int size() const
total number of samples in the digi
Definition: HFDataFrame.h:26
virtual void fill(HcalDetId const &, double)
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
Definition: PedestalTask.cc:44
virtual void dump(Container1D *, bool)
Container2D _cPedestalMeans_depth
Definition: PedestalTask.h:55
edm::InputTag _tagTrigger
Definition: PedestalTask.h:42
std::string const & label() const
Definition: InputTag.h:36
edm::EDGetTokenT< HODigiCollection > _tokHO
Definition: PedestalTask.h:44
virtual bool _isApplicable(edm::Event const &)
Container2D _cPedestalRMSs_depth
Definition: PedestalTask.h:56
virtual void _dump()
Definition: PedestalTask.cc:59
std::string _subsystem
Definition: DQModule.h:57
const HcalDetId & id() const
Definition: HBHEDataFrame.h:22
const HcalDetId & id() const
Definition: HFDataFrame.h:22
std::string const & instance() const
Definition: InputTag.h:37
Definition: Run.h:43