CMS 3D CMS Logo

QIE11Task.cc
Go to the documentation of this file.
3 
4 using namespace hcaldqm;
5 using namespace hcaldqm::constants;
7  // tags
8  _tagQIE11 = ps.getUntrackedParameter<edm::InputTag>("tagQIE11", edm::InputTag("hcalDigis"));
9  _tokQIE11 = consumes<QIE11DigiCollection>(_tagQIE11);
10 
11  _taguMN = ps.getUntrackedParameter<edm::InputTag>("taguMN", edm::InputTag("hcalDigis"));
12  _tokuMN = consumes<HcalUMNioDigi>(_taguMN);
13 
14  // cuts
15  _cut = ps.getUntrackedParameter<double>("cut", 50.0);
16  _ped = ps.getUntrackedParameter<int>("ped", 4);
17  _laserType = ps.getUntrackedParameter<int32_t>("laserType", -1);
18  _eventType = ps.getUntrackedParameter<int32_t>("eventType", -1);
19 }
20 /* virtual */ void QIE11Task::bookHistograms(DQMStore::IBooker& ib, edm::Run const& r, edm::EventSetup const& es) {
21  if (_ptype == fLocal)
22  if (r.runAuxiliary().run() == 1)
23  return;
24 
26 
27  // GET WHAT YOU NEED
29  es.get<HcalDbRecord>().get(dbs);
30  _emap = dbs->getHcalMapping();
31  std::vector<uint32_t> vhashC34;
32  vhashC34.push_back(HcalElectronicsId(34, 11, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
33  vhashC34.push_back(HcalElectronicsId(34, 12, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
35 
36  std::vector<std::pair<int, int> > timingChannels;
37  timingChannels.push_back(std::pair<int, int>(28, 63));
38  timingChannels.push_back(std::pair<int, int>(28, 65));
39  timingChannels.push_back(std::pair<int, int>(20, 63));
40  timingChannels.push_back(std::pair<int, int>(20, 65));
41  for (int iChan = 0; iChan < 4; ++iChan) {
42  std::vector<uint32_t> vhashTimingChannel;
43  for (int depth = 1; depth <= 7; ++depth) {
44  vhashTimingChannel.push_back(
45  HcalDetId(HcalEndcap, timingChannels[iChan].first, timingChannels[iChan].second, depth));
46  }
48  }
49 
50  // INITIALIZE what you need
51 
52  // EChannel plots, online+local only
53  if (_ptype != fOffline) {
54  unsigned int itr = 0;
55  for (unsigned int crate = 34; crate <= 34; ++crate) {
56  for (unsigned int slot = 11; slot <= 12; ++slot) {
57  std::vector<uint32_t> vhashSlot;
58  vhashSlot.push_back(HcalElectronicsId(crate, slot, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
61  "ShapeCut",
66  "LETDCvsTS",
71  0);
73  "LETDCTime",
77  0);
78  for (unsigned int j = 0; j < 10; j++) {
80  _name,
81  "LETDCvsADC",
86  0);
88  "ADC",
92  0);
94  "LETDC",
98  0);
99  }
100  ++itr;
101  }
102  }
103  }
105  "ShapeCut",
109  "LETDCvsADC",
113  0);
115  "LETDCTimevsADC",
119  0);
121  "LETDC",
124  0);
126  "ADC",
129  0);
130 
131  if (_ptype != fOffline) {
132  unsigned int itr = 0;
133  std::map<std::pair<unsigned int, unsigned int>, unsigned int> itr_map;
134  for (unsigned int crate = 34; crate <= 34; ++crate) {
135  for (unsigned int slot = 11; slot <= 12; ++slot) {
136  char aux[100];
137  sprintf(aux, "/Crate%d_Slot%d", crate, slot);
141  for (unsigned int j = 0; j < 10; j++) {
142  char aux2[100];
143  sprintf(aux2, "/Crate%d_Slot%d/TS%d", crate, slot, j);
145  _cLETDC_EChannel[j][itr].book(ib, _emap, _filter_slot[itr], _subsystem, aux2);
146  _cADC_EChannel[j][itr].book(ib, _emap, _filter_slot[itr], _subsystem, aux2);
147  }
148  itr_map[std::make_pair(crate, slot)] = itr;
149  ++itr;
150  }
151  }
152  }
158 
160 }
161 
163  // finish
164  DQTask::globalEndLuminosityBlock(lb, es);
165 }
166 
167 /* virtual */ void QIE11Task::_process(edm::Event const& e, edm::EventSetup const&) {
169  if (!e.getByToken(_tokQIE11, cqie11))
170  return;
171 
172  for (uint32_t i = 0; i < cqie11->size(); i++) {
173  QIE11DataFrame frame = static_cast<QIE11DataFrame>((*cqie11)[i]);
174  DetId did = frame.detid();
175  if (HcalDetId(frame.detid()).subdet() != HcalEndcap) {
176  continue;
177  }
178 
180  if (!eid.rawId()) {
181  continue;
182  }
183  int fakecrate = -1;
184  if (eid.crateId() == 34)
185  fakecrate = 0;
186  int index = fakecrate * 12 + (eid.slot() - 10) - 1;
187 
188  // compute the signal, ped subracted
189  CaloSamples digi_fC = hcaldqm::utilities::loadADC2fCDB<QIE11DataFrame>(_dbService, did, frame);
190  // double q = hcaldqm::utilities::aveTS_v10<QIE11DataFrame>(frame,
191  // constants::adc2fC[_ped], 0, frame.samples()-1);
192 
193  // iterate thru all TS and fill
194  for (int j = 0; j < frame.samples(); j++) {
195  double q_pedsub = hcaldqm::utilities::adc2fCDBMinusPedestal<QIE11DataFrame>(_dbService, digi_fC, did, frame, j);
196  if (_ptype != fOffline) {
197  if (index == 0 || index == 1) {
198  // shapes are after the cut
199  _cShapeCut_EChannel[index].fill(eid, j, q_pedsub);
201 
202  // w/o a cut
204  _cLETDC_EChannel[j][index].fill(eid, frame[j].tdc());
205  if (frame[j].tdc() < 50) {
206  // Each TDC count is 0.5 ns.
207  // tdc == 62 or 63 means value was below or above threshold for whole time slice.
208  _cLETDCTime_EChannel[index].fill(eid, j * 25. + (frame[j].tdc() / 2.));
209  }
211  }
212  }
213  _cShapeCut.fill(eid, j, q_pedsub);
214 
215  _cLETDCvsADC.fill(frame[j].adc(), frame[j].tdc());
216  if (frame[j].tdc() < 50) {
217  _cLETDCTimevsADC.fill(frame[j].adc(), j * 25. + (frame[j].tdc() / 2.));
218  }
219  _cLETDC.fill(eid, frame[j].tdc());
220 
221  _cADC.fill(eid, frame[j].adc());
222  }
223  }
224 }
225 
226 /* virtual */ bool QIE11Task::_isApplicable(edm::Event const& e) {
227  if (_ptype != fOnline || (_laserType < 0 && _eventType < 0))
228  return true;
229  else {
230  // fOnline mode
232  if (!e.getByToken(_tokuMN, cumn))
233  return false;
234 
235  // event type check first
236  int eventType = cumn->eventType();
237  if (eventType == _eventType)
238  return true;
239 
240  // check if this analysis task is of the right laser type
241  int laserType = cumn->valueUserWord(0);
242  if (laserType == _laserType)
243  return true;
244  }
245 
246  return false;
247 }
248 
250 
QIE11Task::_filter_slot
hcaldqm::filter::HashFilter _filter_slot[2]
Definition: QIE11Task.h:50
QIE11Task::_cLETDC
hcaldqm::ContainerSingle1D _cLETDC
Definition: QIE11Task.h:69
QIE11Task::_resetMonitors
void _resetMonitors(hcaldqm::UpdateFreq) override
Definition: QIE11Task.cc:249
mps_fire.i
i
Definition: mps_fire.py:428
QIE11Task::_filter_timingChannels
hcaldqm::filter::HashFilter _filter_timingChannels[4]
Definition: QIE11Task.h:51
hcaldqm::constants
Definition: Constants.h:9
QIE11Task
Definition: QIE11Task.py:1
hcaldqm::Container2D::initialize
virtual void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fN), int debug=0)
Definition: Container2D.cc:25
hcaldqm::UpdateFreq
UpdateFreq
Definition: DQTask.h:32
QIE11Task::_ehashmap
hcaldqm::electronicsmap::ElectronicsMap _ehashmap
Definition: QIE11Task.h:54
hcaldqm::electronicsmap::ElectronicsMap::lookup
uint32_t lookup(DetId const &)
Definition: ElectronicsMap.cc:122
bookHistograms
example_stream void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
HcalUMNioDigi::eventType
uint8_t eventType() const
Definition: HcalUMNioDigi.cc:35
hcaldqm::hashfunctions::fEChannel
Definition: HashFunctions.h:146
QIE11Task::_cut
double _cut
Definition: QIE11Task.h:43
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
hcaldqm::quantity::ValueQuantity
Definition: ValueQuantity.h:309
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition: gpuClusterChargeCut.h:20
hcaldqm
Definition: Constants.h:8
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
hcaldqm::electronicsmap::ElectronicsMap::initialize
void initialize(HcalElectronicsMap const *, ElectronicsMapType etype=fHcalElectronicsMap)
Definition: ElectronicsMap.cc:6
QIE11Task::_cLETDCvsTS_EChannel
hcaldqm::Container2D _cLETDCvsTS_EChannel[2]
Definition: QIE11Task.h:59
hcaldqm::filter::fPreserver
Definition: HashFilter.h:19
hcaldqm::fLocal
Definition: DQModule.h:26
hcaldqm::ContainerSingleProf1D::initialize
void initialize(std::string const &folder, quantity::Quantity *, quantity::Quantity *qy=new quantity::ValueQuantity(quantity::fN), int debug=0) override
Definition: ContainerSingleProf1D.cc:17
hcaldqm::constants::FIBER_uTCA_MIN1
const int FIBER_uTCA_MIN1
Definition: Constants.h:126
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
hcaldqm::DQModule::_ptype
ProcessingType _ptype
Definition: DQModule.h:43
QIE11Task::_laserType
int _laserType
Definition: QIE11Task.h:45
edm::Handle
Definition: AssociativeIterator.h:50
HcalDbService::getHcalMapping
const HcalElectronicsMap * getHcalMapping() const
Definition: HcalDbService.cc:343
QIE11Task::_cShapeCut
hcaldqm::ContainerSingleProf1D _cShapeCut
Definition: QIE11Task.h:66
QIE11Task::_taguMN
edm::InputTag _taguMN
Definition: QIE11Task.h:39
hcaldqm::hashfunctions::fCrateSlot
Definition: HashFunctions.h:141
hcaldqm::ContainerSingle2D::fill
virtual void fill(int, int)
Definition: ContainerSingle2D.cc:105
DetId
Definition: DetId.h:17
QIE11Task::_cADC
hcaldqm::ContainerSingle1D _cADC
Definition: QIE11Task.h:70
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
QIE11Task::QIE11Task
QIE11Task(edm::ParameterSet const &)
Definition: QIE11Task.cc:6
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
hcaldqm::quantity::fQIE10TDC_64
Definition: ValueQuantity.h:35
hcaldqm::filter::HashFilter::initialize
virtual void initialize(FilterType ftype, hashfunctions::HashType htype, std::vector< uint32_t > const &)
Definition: HashFilter.cc:17
QIE11Task::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: QIE11Task.cc:20
Run.h
edm::ESHandle< HcalDbService >
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
hcaldqm::DQModule::_name
std::string _name
Definition: DQModule.h:41
HcalUMNioDigi::valueUserWord
uint32_t valueUserWord(int iword) const
Definition: HcalUMNioDigi.cc:62
hcaldqm::constants::FIBERCH_MIN
const int FIBERCH_MIN
Definition: Constants.h:132
QIE11Task::_isApplicable
bool _isApplicable(edm::Event const &) override
Definition: QIE11Task.cc:226
QIE11Task::_tagQIE11
edm::InputTag _tagQIE11
Definition: QIE11Task.h:36
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
hcaldqm::quantity::fN
Definition: ValueQuantity.h:11
QIE11Task::_tokuMN
edm::EDGetTokenT< HcalUMNioDigi > _tokuMN
Definition: QIE11Task.h:40
QIE11Task::_cLETDCTime_EChannel
hcaldqm::Container1D _cLETDCTime_EChannel[2]
Definition: QIE11Task.h:61
hcaldqm::quantity::fQIE10fC_400000
Definition: ValueQuantity.h:48
edm::ParameterSet
Definition: ParameterSet.h:47
hcaldqm::Container2D::book
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
Definition: Container2D.cc:558
QIE11Task::_cLETDCTimevsADC
hcaldqm::ContainerSingle2D _cLETDCTimevsADC
Definition: QIE11Task.h:68
hcaldqm::Container2D::fill
void fill(HcalDetId const &) override
Definition: Container2D.cc:52
QIE11Task::_ped
int _ped
Definition: QIE11Task.h:44
hcaldqm::hashfunctions::fDChannel
Definition: HashFunctions.h:134
hcaldqm::Container1D::fill
virtual void fill(uint32_t)
Definition: Container1D.cc:73
QIE11Task.eventType
eventType
Definition: QIE11Task.py:22
QIE11Task::_filter_C34
hcaldqm::filter::HashFilter _filter_C34
Definition: QIE11Task.h:49
QIE11Task::_eventType
int _eventType
Definition: QIE11Task.h:46
printConversionInfo.aux
aux
Definition: printConversionInfo.py:19
HcalDetId
Definition: HcalDetId.h:12
hcaldqm::quantity::fQIE10ADC_256
Definition: ValueQuantity.h:34
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
hcaldqm::DQTask::_dbService
edm::ESHandle< HcalDbService > _dbService
Definition: DQTask.h:79
hcaldqm::ContainerSingle1D::fill
virtual void fill(int)
Definition: ContainerSingle1D.cc:80
cuy.ib
ib
Definition: cuy.py:662
hcaldqm::ContainerSingle1D::book
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
Definition: ContainerSingle1D.cc:57
edm::EventSetup
Definition: EventSetup.h:58
CaloSamples
Definition: CaloSamples.h:14
QIE11Task::_cShapeCut_EChannel
hcaldqm::ContainerProf1D _cShapeCut_EChannel[2]
Definition: QIE11Task.h:57
get
#define get
QIE11Task::globalEndLuminosityBlock
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: QIE11Task.cc:162
QIE11Task::_cADC_EChannel
hcaldqm::Container1D _cADC_EChannel[10][2]
Definition: QIE11Task.h:62
hcaldqm::DQModule::_subsystem
std::string _subsystem
Definition: DQModule.h:48
alignCSCRings.r
r
Definition: alignCSCRings.py:93
QIE11Task.laserType
laserType
Definition: QIE11Task.py:21
hcaldqm::ContainerProf1D::initialize
void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *, int debug=0) override
Definition: ContainerProf1D.cc:22
QIE11Task::_process
void _process(edm::Event const &, edm::EventSetup const &) override
Definition: QIE11Task.cc:167
hcaldqm::electronicsmap::fD2EHashMap
Definition: ElectronicsMap.h:25
HcalEndcap
Definition: HcalAssistant.h:34
amptDefault_cfi.frame
frame
Definition: amptDefault_cfi.py:12
QIE11DataFrame
Definition: QIE11DataFrame.h:11
hcaldqm::DQTask::_emap
const HcalElectronicsMap * _emap
Definition: DQTask.h:80
hcaldqm::ContainerSingle2D::book
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
Definition: ContainerSingle2D.cc:68
QIE11Task.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
hcaldqm::ContainerSingle1D::initialize
virtual void initialize(std::string const &folder, quantity::Quantity *, quantity::Quantity *qy=new quantity::ValueQuantity(quantity::fN), int debug=0)
Definition: ContainerSingle1D.cc:37
hcaldqm::DQTask
Definition: DQTask.h:33
HcalDbRecord
Definition: HcalDbRecord.h:30
hcaldqm::ContainerSingle2D::initialize
virtual void initialize(std::string const &folder, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fN), int debug=0)
Definition: ContainerSingle2D.cc:46
hcaldqm::Container1D::initialize
virtual void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *qy=new quantity::ValueQuantity(quantity::fN), int debug=0)
Definition: Container1D.cc:33
QIE11Task::_tokQIE11
edm::EDGetTokenT< QIE11DigiCollection > _tokQIE11
Definition: QIE11Task.h:37
hcaldqm::ContainerProf1D::book
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
Definition: ContainerProf1D.cc:40
hcaldqm::fOnline
Definition: DQModule.h:26
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::Event
Definition: Event.h:73
hcaldqm::quantity::fTiming_TS
Definition: ValueQuantity.h:21
edm::InputTag
Definition: InputTag.h:15
QIE11Task::_cLETDCvsADC
hcaldqm::ContainerSingle2D _cLETDCvsADC
Definition: QIE11Task.h:67
QIE11Task::_cLETDCvsADC_EChannel
hcaldqm::Container2D _cLETDCvsADC_EChannel[10][2]
Definition: QIE11Task.h:58
hcaldqm::Container1D::book
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
Definition: Container1D.cc:592
hcaldqm::quantity::fTime_ns_250
Definition: ValueQuantity.h:53
edm::DataFrameContainer::size
size_type size() const
Definition: DataFrameContainer.h:162
hcaldqm::ContainerSingleProf1D::book
void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="") override
Definition: ContainerSingleProf1D.cc:33
hcaldqm::fOffline
Definition: DQModule.h:26
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
QIE11Task::_cLETDC_EChannel
hcaldqm::Container1D _cLETDC_EChannel[10][2]
Definition: QIE11Task.h:60