CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QIE11Task.cc
Go to the documentation of this file.
1 
3 
4 using namespace hcaldqm;
5 using namespace hcaldqm::constants;
7  DQTask(ps)
8 {
9 
10  // tags
12  edm::InputTag("hcalDigis"));
13  _tokQIE11 = consumes<QIE11DigiCollection>(_tagQIE11);
14 
16  edm::InputTag("hcalDigis"));
17  _tokuMN = consumes<HcalUMNioDigi>(_taguMN);
18 
19  // cuts
20  _cut = ps.getUntrackedParameter<double>("cut", 50.0);
21  _ped = ps.getUntrackedParameter<int>("ped", 4);
22  _laserType = ps.getUntrackedParameter<int32_t>("laserType", -1);
23  _eventType = ps.getUntrackedParameter<int32_t>("eventType", -1);
24 }
26  edm::Run const& r, edm::EventSetup const& es)
27 {
28  if (_ptype==fLocal)
29  if (r.runAuxiliary().run()==1)
30  return;
31 
32  DQTask::bookHistograms(ib, r, es);
33 
34  // GET WHAT YOU NEED
36  es.get<HcalDbRecord>().get(dbs);
37  _emap = dbs->getHcalMapping();
38  std::vector<uint32_t> vhashC36;
39  vhashC36.push_back(HcalElectronicsId(36, 4,
40  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
42  vhashC36);
43 
44  // INITIALIZE what you need
50  "ShapeCut",
53  _cTDCvsADC.initialize(_name, "TDCvsADC",
57  _cTDC.initialize(_name, "TDC",
60  _cADC.initialize(_name, "ADC",
63  for (unsigned int j=0; j<10; j++)
64  {
78  }
79 
83  _cTDC.book(ib, _subsystem);
84  _cADC.book(ib, _subsystem);
85  for (unsigned int i=0; i<10; i++)
86  {
87  char aux[10];
88  sprintf(aux, "TS%d", i);
92  }
93 
95 }
96 
98  edm::EventSetup const& es)
99 {
100 
101  // finish
102  DQTask::endLuminosityBlock(lb, es);
103 }
104 
105 /* virtual */ void QIE11Task::_process(edm::Event const& e,
106  edm::EventSetup const&)
107 {
109  if (!e.getByToken(_tokQIE11, cqie10))
110  return;
111 
112  for (uint32_t i=0; i<cqie10->size(); i++)
113  {
114  QIE11DataFrame frame = static_cast<QIE11DataFrame>((*cqie10)[i]);
115  DetId did = frame.detid();
117 
118  // compute the signal, ped subracted
119 // double q = hcaldqm::utilities::aveTS_v10<QIE11DataFrame>(frame,
120 // constants::adc2fC[_ped], 0, frame.samples()-1);
121 
122 
123  // iterate thru all TS and fill
124  for (int j=0; j<frame.samples(); j++)
125  {
126  // shapes are after the cut
127  _cShapeCut_EChannel.fill(eid, j, adc2fC[frame[j].adc()]);
128  _cShapeCut.fill(eid, j, adc2fC[frame[j].adc()]);
129 
130 
131  // w/o a cut
132  _cTDCvsADC_EChannel[j].fill(eid, frame[j].adc(),
133  frame[j].tdc());
134  _cTDCvsADC.fill(frame[j].adc(), frame[j].tdc());
135  _cTDC_EChannel[j].fill(eid, frame[j].tdc());
136  _cTDC.fill(eid, frame[j].tdc());
137  _cADC_EChannel[j].fill(eid, frame[j].adc());
138  _cADC.fill(eid, frame[j].adc());
139 
140  }
141  }
142 }
143 
144 
145 /* virtual */ bool QIE11Task::_isApplicable(edm::Event const& e)
146 {
147  if (_ptype!=fOnline || (_laserType < 0 && _eventType < 0))
148  return true;
149  else
150  {
151  // fOnline mode
153  if (!e.getByToken(_tokuMN, cumn))
154  return false;
155 
156  // event type check first
157  int eventType = cumn->eventType();
158  if (eventType==_eventType)
159  return true;
160 
161  // check if this analysis task is of the right laser type
162  int laserType = cumn->valueUserWord(0);
163  if (laserType==_laserType)
164  return true;
165  }
166 
167  return false;
168 }
169 
170 
172 {
173 }
174 
int adc(sample_type sample)
get the ADC sample (12 bits)
hcaldqm::Container2D _cTDCvsADC_EChannel[10]
Definition: QIE11Task.h:64
DetId detid() const
Get the detector id.
edm::EDGetTokenT< QIE11DigiCollection > _tokQIE11
Definition: QIE11Task.h:41
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
virtual void initialize(std::string const &folder, hashfunctions::HashType, Quantity *, Quantity *qy=new ValueQuantity(quantity::fN), int debug=0)
Definition: Container1D.cc:40
virtual void initialize(std::string const &folder, Quantity *, Quantity *qy=new ValueQuantity(quantity::fN), int debug=0)
int ib
Definition: cuy.py:660
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
hcaldqm::ContainerProf1D _cShapeCut_EChannel
Definition: QIE11Task.h:63
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
virtual void initialize(std::string const &folder, Quantity *, Quantity *qy=new ValueQuantity(quantity::fN), int debug=0)
void initialize(HcalElectronicsMap const *, ElectronicsMapType etype=fHcalElectronicsMap)
int _eventType
Definition: QIE11Task.h:52
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
Definition: QIE11Task.cc:25
UpdateFreq
Definition: DQTask.h:17
hcaldqm::ContainerSingleProf1D _cShapeCut
Definition: QIE11Task.h:70
int _ped
Definition: QIE11Task.h:50
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: QIE11Task.cc:97
void bookHistograms(fwlite::EventContainer &eventCont)
int const FIBERCH_MIN
Definition: Constants.h:100
hcaldqm::ContainerSingle2D _cTDCvsADC
Definition: QIE11Task.h:71
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
virtual void fill(HcalDetId const &)
Definition: Container2D.cc:59
ProcessingType _ptype
Definition: DQModule.h:59
virtual void fill(uint32_t)
Definition: Container1D.cc:82
HcalElectronicsMap const * _emap
Definition: QIE11Task.h:59
virtual void initialize(std::string const &folder, hashfunctions::HashType, Quantity *, Quantity *, int debug=0)
QIE11Task(edm::ParameterSet const &)
Definition: QIE11Task.cc:6
virtual void _resetMonitors(hcaldqm::UpdateFreq)
Definition: QIE11Task.cc:171
hcaldqm::Container1D _cTDC_EChannel[10]
Definition: QIE11Task.h:65
hcaldqm::electronicsmap::ElectronicsMap _ehashmap
Definition: QIE11Task.h:60
int j
Definition: DBlmapReader.cc:9
virtual void initialize(std::string const &folder, hashfunctions::HashType, Quantity *, Quantity *, Quantity *qz=new ValueQuantity(quantity::fN), int debug=0)
Definition: Container2D.cc:32
int const FIBER_uTCA_MIN1
Definition: Constants.h:93
edm::InputTag _tagQIE11
Definition: QIE11Task.h:40
std::string _name
Definition: DQModule.h:57
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
double _cut
Definition: QIE11Task.h:49
hcaldqm::ContainerSingle1D _cADC
Definition: QIE11Task.h:73
edm::EDGetTokenT< HcalUMNioDigi > _tokuMN
Definition: QIE11Task.h:44
hcaldqm::filter::HashFilter _filter_C36
Definition: QIE11Task.h:56
Definition: DetId.h:18
hcaldqm::ContainerSingle1D _cTDC
Definition: QIE11Task.h:72
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
Definition: Container2D.cc:895
virtual void initialize(std::string const &folder, Quantity *, Quantity *, Quantity *qz=new ValueQuantity(quantity::fN), int debug=0)
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
Definition: Container1D.cc:957
const T & get() const
Definition: EventSetup.h:56
int _laserType
Definition: QIE11Task.h:51
virtual void _process(edm::Event const &, edm::EventSetup const &)
Definition: QIE11Task.cc:105
hcaldqm::Container1D _cADC_EChannel[10]
Definition: QIE11Task.h:66
RunAuxiliary const & runAuxiliary() const
Definition: Run.h:60
virtual bool _isApplicable(edm::Event const &)
Definition: QIE11Task.cc:145
edm::InputTag _taguMN
Definition: QIE11Task.h:43
std::string _subsystem
Definition: DQModule.h:64
virtual void fill(int, int)
virtual void initialize(FilterType ftype, HashType htype, std::vector< uint32_t > const &)
Definition: HashFilter.cc:26
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
int samples() const
total number of samples in the digi
Readout chain identification for Hcal.
RunNumber_t run() const
Definition: RunAuxiliary.h:41
Definition: Run.h:43
float adc2fC[128]