CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LEDTask.cc
Go to the documentation of this file.
1 
3 
4 using namespace hcaldqm;
6  DQTask(ps)
7 {
8 
9  // Containers
10  _cSignalMeans_SubDet.initialize(_name+"/SignalMeans/SubDet", "SignalMeans",
13  _cSignalRMSs_SubDet.initialize(_name+"/SignalRMSs/SubDet", "SignalRMSs",
16  _cTimingMeans_SubDet.initialize(_name+"/TimingMeans/SubDet", "TimingMeans",
19  _cTimingRMSs_SubDet.initialize(_name+"/TimingRMSs/SubDet", "TimingRMSs",
22  _cShapeCut_SubDetPM_iphi.initialize(_name+"/Shape/SubDetPM_iphi", "Shape",
26  _cSignalMeans_depth.initialize(_name+"/SignalMeans/depth", "SignalMeans",
31  _cSignalRMSs_depth.initialize(_name+"/SignalRMSs/depth", "SignalRMSs",
36  _cTimingMeans_depth.initialize(_name+"/TimingMeans/depth", "TimingMeans",
41  _cTimingRMSs_depth.initialize(_name+"/TimingRMSs/depth", "TimingRMSs",
46 
47  // tags
49  edm::InputTag("hcalDigis"));
51  edm::InputTag("hcalDigis"));
53  edm::InputTag("hcalDigis"));
55  edm::InputTag("tbunpacker"));
56  _tokHBHE = consumes<HBHEDigiCollection>(_tagHBHE);
57  _tokHO = consumes<HODigiCollection>(_tagHO);
58  _tokHF = consumes<HFDigiCollection>(_tagHF);
59  _tokTrigger = consumes<HcalTBTriggerData>(_tagTrigger);
60 
61  // constants
62  _lowHBHE = ps.getUntrackedParameter<double>("lowHBHE",
63  20);
64  _lowHO = ps.getUntrackedParameter<double>("lowHO",
65  20);
66  _lowHF = ps.getUntrackedParameter<double>("lowHF",
67  20);
68 }
69 
71  edm::Run const& r, edm::EventSetup const& es)
72 {
73  char cutstr[20];
74  sprintf(cutstr, "_sumQHBHE%dHO%dHF%d", int(_lowHBHE),
75  int(_lowHO), int(_lowHF));
76 
77  DQTask::bookHistograms(ib, r, es);
87 }
88 
89 /* virtual */ void LEDTask::_resetMonitors(UpdateFreq uf)
90 {
91  DQTask::_resetMonitors(uf);
92 }
93 
94 /* virtual */ void LEDTask::_dump()
95 {
112 }
113 
114 /* virtual */ void LEDTask::_process(edm::Event const& e,
115  edm::EventSetup const& es)
116 {
120 
121  if (!e.getByToken(_tokHBHE, chbhe))
122  _logger.dqmthrow("Collection HBHEDigiCollection isn't available "
123  + _tagHBHE.label() + " " + _tagHBHE.instance());
124  if (!e.getByToken(_tokHO, cho))
125  _logger.dqmthrow("Collection HODigiCollection isn't available "
126  + _tagHO.label() + " " + _tagHO.instance());
127  if (!e.getByToken(_tokHF, chf))
128  _logger.dqmthrow("Collection HFDigiCollection isn't available "
129  + _tagHF.label() + " " + _tagHF.instance());
130 
131  for (HBHEDigiCollection::const_iterator it=chbhe->begin();
132  it!=chbhe->end(); ++it)
133  {
134  const HBHEDataFrame digi = (const HBHEDataFrame)(*it);
135  double sumQ = utilities::sumQ<HBHEDataFrame>(digi, 2.5, 0,
136  digi.size()-1);
137  if (sumQ<_lowHBHE)
138  continue;
139 
140  double aveTS = utilities::aveTS<HBHEDataFrame>(digi, 2.5, 0,
141  digi.size()-1);
142  _cSignals.fill(digi.id(), sumQ>0 ? sumQ : GARBAGE_VALUE);
143  _cTiming.fill(digi.id(), sumQ>0 ? aveTS : GARBAGE_VALUE);
144 
145  for (int i=0; i<digi.size(); i++)
146  _cShapeCut_SubDetPM_iphi.fill(digi.id(), i,
147  digi.sample(i).nominal_fC()-2.5);
148  }
149  for (HODigiCollection::const_iterator it=cho->begin();
150  it!=cho->end(); ++it)
151  {
152  const HODataFrame digi = (const HODataFrame)(*it);
153  double sumQ = utilities::sumQ<HODataFrame>(digi, 8.5, 0,
154  digi.size()-1);
155  if (sumQ<_lowHO)
156  continue;
157 
158  double aveTS = utilities::aveTS<HODataFrame>(digi, 8.5, 0,
159  digi.size()-1);
160  _cSignals.fill(digi.id(), sumQ>0 ? sumQ : GARBAGE_VALUE);
161  _cTiming.fill(digi.id(), sumQ>0 ? aveTS : GARBAGE_VALUE);
162 
163  for (int i=0; i<digi.size(); i++)
164  _cShapeCut_SubDetPM_iphi.fill(digi.id(), i,
165  digi.sample(i).nominal_fC()-8.5);
166  }
167  for (HFDigiCollection::const_iterator it=chf->begin();
168  it!=chf->end(); ++it)
169  {
170  const HFDataFrame digi = (const HFDataFrame)(*it);
171  double sumQ = utilities::sumQ<HFDataFrame>(digi, 2.5, 0,
172  digi.size()-1);
173  if (sumQ<_lowHF)
174  continue;
175 
176  double aveTS = utilities::aveTS<HFDataFrame>(digi, 2.5, 0,
177  digi.size()-1);
178  _cSignals.fill(digi.id(), sumQ>0 ? sumQ : GARBAGE_VALUE);
179  _cTiming.fill(digi.id(), sumQ>0 ? aveTS : GARBAGE_VALUE);
180 
181  for (int i=0; i<digi.size(); i++)
182  _cShapeCut_SubDetPM_iphi.fill(digi.id(), i,
183  digi.sample(i).nominal_fC()-2.5);
184  }
185 
186  if (_ptype==fOnline && _evsTotal>0 &&
188  this->_dump();
189 }
190 
191 /* virtual */ bool LEDTask::_isApplicable(edm::Event const& e)
192 {
193  if (_ptype!=fOnline)
194  {
195  // local
197  if (!e.getByToken(_tokTrigger, ctrigger))
198  _logger.dqmthrow("Collection HcalTBTriggerData isn't available "
199  + _tagTrigger.label() + " " + _tagTrigger.instance());
200  return ctrigger->wasLEDTrigger();
201  }
202 
203  return false;
204 }
205 
207 
208 
virtual void initialize(std::string const &folder, std::string const &nametitle, mapper::MapperType mt, axis::Axis *xaxis, axis::Axis *yaxis=new axis::ValueAxis(axis::fYaxis, axis::fEntries), int debug=0)
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
LEDTask(edm::ParameterSet const &)
Definition: LEDTask.cc:5
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
double sumQ(DIGI digi, double ped, int i=0, int j=3)
Definition: Utilities.h:52
double _lowHBHE
Definition: LEDTask.h:49
int ib
Definition: cuy.py:660
virtual void _resetMonitors(UpdateFreq)
Definition: LEDTask.cc:89
ContainerCompact _cSignals
Definition: LEDTask.h:54
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
Definition: Container1D.cc:198
edm::EDGetTokenT< HcalTBTriggerData > _tokTrigger
Definition: LEDTask.h:46
Container1D _cSignalMeans_SubDet
Definition: LEDTask.h:58
Container1D _cSignalRMSs_SubDet
Definition: LEDTask.h:59
virtual bool _isApplicable(edm::Event const &)
Definition: LEDTask.cc:191
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
double _lowHF
Definition: LEDTask.h:51
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
edm::EDGetTokenT< HBHEDigiCollection > _tokHBHE
Definition: LEDTask.h:43
int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:26
Container2D _cTimingMeans_depth
Definition: LEDTask.h:69
UpdateFreq
Definition: DQTask.h:16
std::vector< HBHEDataFrame >::const_iterator const_iterator
ContainerProf1D _cShapeCut_SubDetPM_iphi
Definition: LEDTask.h:64
edm::InputTag _tagHO
Definition: LEDTask.h:40
edm::InputTag _tagHF
Definition: LEDTask.h:41
Container1D _cTimingRMSs_SubDet
Definition: LEDTask.h:61
double aveTS(DIGI digi, double ped=0, int i=0, int j=3)
Definition: Utilities.h:38
void bookHistograms(fwlite::EventContainer &eventCont)
int const GARBAGE_VALUE
Definition: Constants.h:168
Container1D _cTimingMeans_SubDet
Definition: LEDTask.h:60
ProcessingType _ptype
Definition: DQModule.h:52
virtual void reset()
Definition: Container1D.cc:230
double _lowHO
Definition: LEDTask.h:50
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
void dqmthrow(std::string const &msg) const
Definition: Logger.h:15
virtual void fill(double)
Definition: Container1D.h:53
virtual void _process(edm::Event const &, edm::EventSetup const &)
Definition: LEDTask.cc:114
int size() const
total number of samples in the digi
Definition: HODataFrame.h:27
Logger _logger
Definition: DQModule.h:62
edm::InputTag _tagTrigger
Definition: LEDTask.h:42
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
ContainerCompact _cTiming
Definition: LEDTask.h:55
edm::InputTag _tagHBHE
Definition: LEDTask.h:39
Container2D _cSignalMeans_depth
Definition: LEDTask.h:67
int const CALIBEVENTS_MIN
Definition: Constants.h:167
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
Definition: LEDTask.cc:70
int size() const
total number of samples in the digi
Definition: HFDataFrame.h:26
edm::EDGetTokenT< HODigiCollection > _tokHO
Definition: LEDTask.h:44
virtual void fill(HcalDetId const &, double)
virtual void dump(Container1D *, bool)
std::string const & label() const
Definition: InputTag.h:36
virtual void _dump()
Definition: LEDTask.cc:94
std::string _subsystem
Definition: DQModule.h:57
edm::EDGetTokenT< HFDigiCollection > _tokHF
Definition: LEDTask.h:45
std::string const & instance() const
Definition: InputTag.h:37
Container2D _cSignalRMSs_depth
Definition: LEDTask.h:68
Definition: Run.h:43
Container2D _cTimingRMSs_depth
Definition: LEDTask.h:70