CMS 3D CMS Logo

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