CMS 3D CMS Logo

QIE10Task.cc
Go to the documentation of this file.
1 
4 #include <map>
5 
6 using namespace hcaldqm;
7 using namespace hcaldqm::constants;
9  // tags
10  _tagQIE10 = ps.getUntrackedParameter<edm::InputTag>("tagQIE10", edm::InputTag("hcalDigis"));
11  _tagHF = ps.getUntrackedParameter<edm::InputTag>("tagHF", edm::InputTag("hcalDigis"));
12  _tokQIE10 = consumes<QIE10DigiCollection>(_tagQIE10);
13  _tokHF = consumes<HFDigiCollection>(_tagHF);
14 
15  // cuts
16  _cut = ps.getUntrackedParameter<double>("cut", 50.0);
17  _ped = ps.getUntrackedParameter<int>("ped", 4);
18 }
19 /* virtual */ void QIE10Task::bookHistograms(DQMStore::IBooker& ib, edm::Run const& r, edm::EventSetup const& es) {
20  if (_ptype == fLocal)
21  if (r.runAuxiliary().run() == 1)
22  return;
23 
25 
26  // GET WHAT YOU NEED
28  es.get<HcalDbRecord>().get(dbs);
29  _emap = dbs->getHcalMapping();
30 
31  unsigned int nTS = _ptype == fLocal ? 10 : 6;
32 
33  // create a slot filter and initialize what you need
34  unsigned int itr = 0;
35  for (auto& crate : constants::crateListHF) {
36  for (unsigned int slot = SLOT_uTCA_MIN; slot <= SLOT_uTCA_MAX; ++slot) {
37  std::vector<uint32_t> vhashSlot;
38  vhashSlot.push_back(HcalElectronicsId(crate, slot, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
40 
42  "ShapeCut",
47  "LETDCTime",
52  "TDCvsTS",
57 
58  for (unsigned int j = 0; j < nTS; j++) {
60  "LETDCvsADC",
66  "ADC",
71  "LETDC",
75  }
76  ++itr;
77  }
78  }
79 
81  "ShapeCut",
85  "LETDCvsADC",
90  "LETDCTimevsADC",
95  "LETDC",
99  "ADC",
102 
103  //OCCUPANCY PER CRATE/SLOT
105  "Occupancy",
111  "Occupancy",
116 
117  // OCCUPANCY IN DETECTOR COORDINATES
119  "Occupancy",
124 
125  itr = 0;
126  for (auto& crate : constants::crateListHF) {
127  for (unsigned int slot = SLOT_uTCA_MIN; slot <= SLOT_uTCA_MAX; ++slot) {
128  char aux[100];
129  sprintf(aux, "/Crate%d_Slot%d", crate, slot);
133  for (unsigned int i = 0; i < nTS; i++) {
134  char aux2[100];
135  sprintf(aux2, "/Crate%d_Slot%d/TS%d", crate, slot, i);
139  }
140  ++itr;
141  }
142  }
143 
149 
153 
155 }
156 
158  // finish
159  DQTask::globalEndLuminosityBlock(lb, es);
160 }
161 
162 /* virtual */ void QIE10Task::_process(edm::Event const& e, edm::EventSetup const&) {
165  if (!e.getByToken(_tokQIE10, cqie10))
166  return;
167  if (!e.getByToken(_tokHF, chf))
168  _logger.dqmthrow("Collection HFDigiCollection isn't available" + _tagHF.label() + " " + _tagHF.instance());
169 
170  std::map<uint32_t, QIE10DataFrame> mqie10;
171  for (uint32_t i = 0; i < cqie10->size(); i++) {
172  QIE10DataFrame frame = static_cast<QIE10DataFrame>((*cqie10)[i]);
173  HcalDetId did = frame.detid();
175  if (did.subdet() != HcalForward) {
176  continue;
177  }
178 
179  // Compute index for EChannel plots
180  int fakecrate = -1;
181  if (eid.crateId() == 22) {
182  fakecrate = 0;
183  } else if (eid.crateId() == 29) {
184  fakecrate = 1;
185  } else if (eid.crateId() == 32) {
186  fakecrate = 2;
187  } else {
188  // Unknown crate, skip digi
189  continue;
190  }
191  int index = fakecrate * 12 + eid.slot() - 1;
192 
193  // compute the signal, ped subracted
194  CaloSamples digi_fC = hcaldqm::utilities::loadADC2fCDB<QIE10DataFrame>(_dbService, did, frame);
195  double sumQ = hcaldqm::utilities::sumQDB<QIE10DataFrame>(_dbService, digi_fC, did, frame, 0, frame.samples() - 1);
196  // double sumQ = hcaldqm::utilities::sumQ_v10<QIE10DataFrame>(frame, constants::adc2fC[_ped], 0, frame.samples()-1);
197 
200  _cOccupancy_depth.fill(did);
201 
202  // iterate thru all TS and fill
203  for (int j = 0; j < frame.samples(); j++) {
204  // shapes are after the cut
205  if (sumQ > _cut) {
206  double q = hcaldqm::utilities::adc2fCDBMinusPedestal<QIE10DataFrame>(_dbService, digi_fC, did, frame, j);
208  _cShapeCut.fill(j, q);
209  }
210  // w/o a cut
211  _cLETDCvsADC_EChannel[j][index].fill(eid, frame[j].adc(), frame[j].le_tdc());
212  _cLETDCvsADC.fill(frame[j].adc(), frame[j].le_tdc());
213  _cLETDC_EChannel[j][index].fill(eid, frame[j].le_tdc());
214  _cLETDC.fill(frame[j].le_tdc());
216  _cADC.fill(frame[j].adc());
217  _cLETDCvsTS_EChannel[index].fill(eid, j, frame[j].le_tdc());
218 
219  // TDC conversion to time
220  if (frame[j].le_tdc() < 50) {
221  // Each TDC count is 0.5 ns.
222  // tdc == 62 or 63 means value was below or above threshold for whole time slice.
223  double time = j * 25. + (frame[j].le_tdc() / 2.);
226  }
227  }
228 
229  mqie10[did.rawId()] = frame;
230  }
231 }
232 
234 
QIE10Task::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: QIE10Task.cc:19
QIE10Task::_cLETDCvsTS_EChannel
hcaldqm::Container2D _cLETDCvsTS_EChannel[36]
Definition: QIE10Task.h:53
ecalMGPA::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalMGPASample.h:11
mps_fire.i
i
Definition: mps_fire.py:355
hcaldqm::constants
Definition: Constants.h:9
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
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
hcaldqm::hashfunctions::fEChannel
Definition: HashFunctions.h:146
edm::InputTag::instance
std::string const & instance() const
Definition: InputTag.h:37
hcaldqm::quantity::fSlotuTCA
Definition: ElectronicsQuantity.h:21
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
hcaldqm::quantity::ValueQuantity
Definition: ValueQuantity.h:309
hcaldqm
Definition: Constants.h:8
hcaldqm::quantity::fFiberCh
Definition: ElectronicsQuantity.h:26
QIE10Task::_cLETDCTime_EChannel
hcaldqm::Container1D _cLETDCTime_EChannel[36]
Definition: QIE10Task.h:56
hcaldqm::electronicsmap::ElectronicsMap::initialize
void initialize(HcalElectronicsMap const *, ElectronicsMapType etype=fHcalElectronicsMap)
Definition: ElectronicsMap.cc:6
data-class-funcs.q
q
Definition: data-class-funcs.py:169
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::SLOT_uTCA_MIN
const int SLOT_uTCA_MIN
Definition: Constants.h:105
hcaldqm::constants::FIBER_uTCA_MIN1
const int FIBER_uTCA_MIN1
Definition: Constants.h:126
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
QIE10Task::_cLETDC_EChannel
hcaldqm::Container1D _cLETDC_EChannel[10][36]
Definition: QIE10Task.h:54
hcaldqm::DQModule::_ptype
ProcessingType _ptype
Definition: DQModule.h:43
hcaldqm::quantity::fFiberuTCA
Definition: ElectronicsQuantity.h:24
edm::Handle
Definition: AssociativeIterator.h:50
QIE10Task::_tagHF
edm::InputTag _tagHF
Definition: QIE10Task.h:36
hcaldqm::hashfunctions::fdepth
Definition: HashFunctions.h:131
QIE10Task
Definition: QIE10Task.py:1
QIE10Task::_cLETDC
hcaldqm::ContainerSingle1D _cLETDC
Definition: QIE10Task.h:62
hcaldqm::utilities::sumQ
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:126
QIE10Task.h
QIE10Task::_resetMonitors
void _resetMonitors(hcaldqm::UpdateFreq) override
Definition: QIE10Task.cc:233
HcalDbService::getHcalMapping
const HcalElectronicsMap * getHcalMapping() const
Definition: HcalDbService.cc:343
hcaldqm::hashfunctions::fCrateSlot
Definition: HashFunctions.h:141
hcaldqm::ContainerSingle2D::fill
virtual void fill(int, int)
Definition: ContainerSingle2D.cc:105
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
hcaldqm::quantity::fieta
Definition: DetectorQuantity.h:15
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
hcaldqm::quantity::fQIE10TDC_64
Definition: ValueQuantity.h:35
QIE10Task::_cShapeCut_EChannel
hcaldqm::ContainerProf1D _cShapeCut_EChannel[36]
Definition: QIE10Task.h:51
QIE10Task::_cADC_EChannel
hcaldqm::Container1D _cADC_EChannel[10][36]
Definition: QIE10Task.h:55
hcaldqm::quantity::fiphi
Definition: DetectorQuantity.h:14
QIE10Task::_cLETDCTimevsADC
hcaldqm::ContainerSingle2D _cLETDCTimevsADC
Definition: QIE10Task.h:60
hcaldqm::filter::HashFilter::initialize
virtual void initialize(FilterType ftype, hashfunctions::HashType htype, std::vector< uint32_t > const &)
Definition: HashFilter.cc:17
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
hcaldqm::constants::SLOT_uTCA_MAX
const int SLOT_uTCA_MAX
Definition: Constants.h:106
hcaldqm::constants::FIBERCH_MIN
const int FIBERCH_MIN
Definition: Constants.h:132
hcaldqm::quantity::DetectorQuantity
Definition: DetectorQuantity.h:59
hcaldqm::quantity::fCrate
Definition: ElectronicsQuantity.h:18
hcaldqm::quantity::fN
Definition: ValueQuantity.h:11
QIE10Task::globalEndLuminosityBlock
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: QIE10Task.cc:157
Logger::dqmthrow
void dqmthrow(std::string const &msg) const
Definition: Logger.h:12
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
hcaldqm::quantity::fQIE10fC_400000
Definition: ValueQuantity.h:48
edm::ParameterSet
Definition: ParameterSet.h:36
hcaldqm::Container2D::book
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
Definition: Container2D.cc:558
QIE10Task::_tokQIE10
edm::EDGetTokenT< QIE10DigiCollection > _tokQIE10
Definition: QIE10Task.h:37
QIE10Task::_cut
double _cut
Definition: QIE10Task.h:41
hcaldqm::Container2D::fill
void fill(HcalDetId const &) override
Definition: Container2D.cc:52
hcaldqm::Container1D::fill
virtual void fill(uint32_t)
Definition: Container1D.cc:73
QIE10Task::_tokHF
edm::EDGetTokenT< HFDigiCollection > _tokHF
Definition: QIE10Task.h:38
hcaldqm::DQModule::_logger
Logger _logger
Definition: DQModule.h:54
QIE10Task::_cADC
hcaldqm::ContainerSingle1D _cADC
Definition: QIE10Task.h:63
HcalDetId::subdet
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
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:57
CaloSamples
Definition: CaloSamples.h:14
QIE10Task::QIE10Task
QIE10Task(edm::ParameterSet const &)
Definition: QIE10Task.cc:8
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:28
get
#define get
QIE10Task::_ped
int _ped
Definition: QIE10Task.h:42
hcaldqm::DQModule::_subsystem
std::string _subsystem
Definition: DQModule.h:48
alignCSCRings.r
r
Definition: alignCSCRings.py:93
QIE10Task::_cOccupancy_Crate
hcaldqm::Container2D _cOccupancy_Crate
Definition: QIE10Task.h:66
hcaldqm::constants::crateListHF
const std::vector< unsigned int > crateListHF
Definition: Constants.h:74
QIE10Task::_cLETDCvsADC
hcaldqm::ContainerSingle2D _cLETDCvsADC
Definition: QIE10Task.h:61
HcalForward
Definition: HcalAssistant.h:36
QIE10Task::_filter_slot
hcaldqm::filter::HashFilter _filter_slot[36]
Definition: QIE10Task.h:45
hcaldqm::quantity::ElectronicsQuantity
Definition: ElectronicsQuantity.h:333
hcaldqm::ContainerProf1D::initialize
void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *, int debug=0) override
Definition: ContainerProf1D.cc:22
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
QIE10Task::_cOccupancy_CrateSlot
hcaldqm::Container2D _cOccupancy_CrateSlot
Definition: QIE10Task.h:67
hcaldqm::electronicsmap::fD2EHashMap
Definition: ElectronicsMap.h:25
QIE10Task::_process
void _process(edm::Event const &, edm::EventSetup const &) override
Definition: QIE10Task.cc:162
QIE10DataFrame
Definition: QIE10DataFrame.h:11
hcaldqm::quantity::fFiberuTCAFiberCh
Definition: ElectronicsQuantity.h:31
QIE10Task::_tagQIE10
edm::InputTag _tagQIE10
Definition: QIE10Task.h:35
amptDefault_cfi.frame
frame
Definition: amptDefault_cfi.py:12
QIE10Task::_cOccupancy_depth
hcaldqm::Container2D _cOccupancy_depth
Definition: QIE10Task.h:70
QIE10Task::_ehashmap
hcaldqm::electronicsmap::ElectronicsMap _ehashmap
Definition: QIE10Task.h:48
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
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
QIE10Task::_cShapeCut
hcaldqm::ContainerSingleProf1D _cShapeCut
Definition: QIE10Task.h:59
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
hcaldqm::ContainerProf1D::book
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
Definition: ContainerProf1D.cc:40
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
ntuplemaker.time
time
Definition: ntuplemaker.py:310
edm::Event
Definition: Event.h:73
hcaldqm::quantity::fTiming_TS
Definition: ValueQuantity.h:21
edm::InputTag
Definition: InputTag.h:15
QIE10Task::_cLETDCvsADC_EChannel
hcaldqm::Container2D _cLETDCvsADC_EChannel[10][36]
Definition: QIE10Task.h:52
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
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37