CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
HBHEPhase1Reconstructor Class Reference

#include <RecoLocalCalo/HcalRecProducers/plugins/HBHEPhase1Reconstructor.cc>

Inheritance diagram for HBHEPhase1Reconstructor:
edm::stream::EDProducer<>

Public Member Functions

 HBHEPhase1Reconstructor (const edm::ParameterSet &)
 
 ~HBHEPhase1Reconstructor () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
template<class DataFrame , class Collection >
void processData (const Collection &coll, const HcalDbService &cond, const HcalChannelQuality &qual, const HcalSeverityLevelComputer &severity, const bool isRealData, HBHEChannelInfo *info, HBHEChannelInfoCollection *infoColl, HBHERecHitCollection *rechits, const bool use8ts)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
void runHBHENegativeEFilter (const HBHEChannelInfo &info, HBHERecHit *rh)
 
void setAsicSpecificBits (const HBHEDataFrame &frame, const HcalCoder &coder, const HBHEChannelInfo &info, const HcalCalibrations &calib, HBHERecHit *rh)
 
void setAsicSpecificBits (const QIE11DataFrame &frame, const HcalCoder &coder, const HBHEChannelInfo &info, const HcalCalibrations &calib, HBHERecHit *rh)
 
void setCommonStatusBits (const HBHEChannelInfo &info, const HcalCalibrations &calib, HBHERecHit *rh)
 

Private Attributes

std::string algoConfigClass_
 
bool dropZSmarkedPassed_
 
std::unique_ptr< HBHEStatusBitSetterhbheFlagSetterQIE11_
 
std::unique_ptr< HBHEStatusBitSetterhbheFlagSetterQIE8_
 
std::unique_ptr< HBHEPulseShapeFlagSetterhbhePulseShapeFlagSetterQIE11_
 
std::unique_ptr< HBHEPulseShapeFlagSetterhbhePulseShapeFlagSetterQIE8_
 
bool makeRecHits_
 
const HBHENegativeEFilternegEFilter_
 
std::unique_ptr< HcalRecoParamsparamTS_
 
bool processQIE11_
 
bool processQIE8_
 
std::unique_ptr< AbsHBHEPhase1Algoreco_
 
std::unique_ptr< AbsHcalAlgoDatarecoConfig_
 
bool recoParamsFromDB_
 
bool saveDroppedInfos_
 
bool saveEffectivePedestal_
 
bool saveInfos_
 
bool setNegativeFlagsQIE11_
 
bool setNegativeFlagsQIE8_
 
bool setNoiseFlagsQIE11_
 
bool setNoiseFlagsQIE8_
 
bool setPulseShapeFlagsQIE11_
 
bool setPulseShapeFlagsQIE8_
 
int sipmQNTStoSum_
 
int sipmQTSShift_
 
edm::EDGetTokenT< QIE11DigiCollectiontok_qie11_
 
edm::EDGetTokenT< HBHEDigiCollectiontok_qie8_
 
bool tsFromDB_
 
bool use8ts_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Description: Phase 1 reconstruction module for HB/HE

Implementation: [Notes on implementation]

Definition at line 250 of file HBHEPhase1Reconstructor.cc.

Constructor & Destructor Documentation

HBHEPhase1Reconstructor::HBHEPhase1Reconstructor ( const edm::ParameterSet conf)
explicit

Definition at line 331 of file HBHEPhase1Reconstructor.cc.

References edm::ParameterSet::getParameter(), hbheFlagSetterQIE11_, hbheFlagSetterQIE8_, hbhePulseShapeFlagSetterQIE11_, hbhePulseShapeFlagSetterQIE8_, makeRecHits_, processQIE11_, processQIE8_, reco_, saveInfos_, setNoiseFlagsQIE11_, setNoiseFlagsQIE8_, setPulseShapeFlagsQIE11_, setPulseShapeFlagsQIE8_, tok_qie11_, and tok_qie8_.

332  : algoConfigClass_(conf.getParameter<std::string>("algoConfigClass")),
333  processQIE8_(conf.getParameter<bool>("processQIE8")),
334  processQIE11_(conf.getParameter<bool>("processQIE11")),
335  saveInfos_(conf.getParameter<bool>("saveInfos")),
336  saveDroppedInfos_(conf.getParameter<bool>("saveDroppedInfos")),
337  makeRecHits_(conf.getParameter<bool>("makeRecHits")),
338  dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed")),
339  tsFromDB_(conf.getParameter<bool>("tsFromDB")),
340  recoParamsFromDB_(conf.getParameter<bool>("recoParamsFromDB")),
341  saveEffectivePedestal_(conf.getParameter<bool>("saveEffectivePedestal")),
342  use8ts_(conf.getParameter<bool>("use8ts")),
343  sipmQTSShift_(conf.getParameter<int>("sipmQTSShift")),
344  sipmQNTStoSum_(conf.getParameter<int>("sipmQNTStoSum")),
345  setNegativeFlagsQIE8_(conf.getParameter<bool>("setNegativeFlagsQIE8")),
346  setNegativeFlagsQIE11_(conf.getParameter<bool>("setNegativeFlagsQIE11")),
347  setNoiseFlagsQIE8_(conf.getParameter<bool>("setNoiseFlagsQIE8")),
348  setNoiseFlagsQIE11_(conf.getParameter<bool>("setNoiseFlagsQIE11")),
349  setPulseShapeFlagsQIE8_(conf.getParameter<bool>("setPulseShapeFlagsQIE8")),
350  setPulseShapeFlagsQIE11_(conf.getParameter<bool>("setPulseShapeFlagsQIE11")),
352  negEFilter_(nullptr) {
353  // Check that the reco algorithm has been successfully configured
354  if (!reco_.get())
355  throw cms::Exception("HBHEPhase1BadConfig") << "Invalid HBHEPhase1Algo algorithm configuration" << std::endl;
356 
357  // Configure the status bit setters that have been turned on
358  if (setNoiseFlagsQIE8_)
359  hbheFlagSetterQIE8_ = parse_HBHEStatusBitSetter(conf.getParameter<edm::ParameterSet>("flagParametersQIE8"));
360 
362  hbheFlagSetterQIE11_ = parse_HBHEStatusBitSetter(conf.getParameter<edm::ParameterSet>("flagParametersQIE11"));
363 
366  parse_HBHEPulseShapeFlagSetter(conf.getParameter<edm::ParameterSet>("pulseShapeParametersQIE8"),
367  conf.getParameter<bool>("setLegacyFlagsQIE8"));
368 
371  parse_HBHEPulseShapeFlagSetter(conf.getParameter<edm::ParameterSet>("pulseShapeParametersQIE11"),
372  conf.getParameter<bool>("setLegacyFlagsQIE11"));
373 
374  // Consumes and produces statements
375  if (processQIE8_)
376  tok_qie8_ = consumes<HBHEDigiCollection>(conf.getParameter<edm::InputTag>("digiLabelQIE8"));
377 
378  if (processQIE11_)
379  tok_qie11_ = consumes<QIE11DigiCollection>(conf.getParameter<edm::InputTag>("digiLabelQIE11"));
380 
381  if (saveInfos_)
382  produces<HBHEChannelInfoCollection>();
383 
384  if (makeRecHits_)
385  produces<HBHERecHitCollection>();
386 }
std::unique_ptr< HBHEPulseShapeFlagSetter > hbhePulseShapeFlagSetterQIE8_
T getParameter(std::string const &) const
const HBHENegativeEFilter * negEFilter_
std::unique_ptr< HBHEStatusBitSetter > hbheFlagSetterQIE11_
std::unique_ptr< HBHEStatusBitSetter > hbheFlagSetterQIE8_
edm::EDGetTokenT< QIE11DigiCollection > tok_qie11_
edm::EDGetTokenT< HBHEDigiCollection > tok_qie8_
std::unique_ptr< AbsHBHEPhase1Algo > parseHBHEPhase1AlgoDescription(const edm::ParameterSet &ps)
std::unique_ptr< AbsHBHEPhase1Algo > reco_
std::unique_ptr< HBHEPulseShapeFlagSetter > hbhePulseShapeFlagSetterQIE11_
HBHEPhase1Reconstructor::~HBHEPhase1Reconstructor ( )
override

Definition at line 388 of file HBHEPhase1Reconstructor.cc.

388  {
389  // do anything here that needs to be done at destruction time
390  // (e.g. close files, deallocate resources etc.)
391 }

Member Function Documentation

void HBHEPhase1Reconstructor::beginRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
overrideprivate

Definition at line 659 of file HBHEPhase1Reconstructor.cc.

References algoConfigClass_, Exception, fetchHcalAlgoData(), edm::EventSetup::get(), hbheFlagSetterQIE11_, hbheFlagSetterQIE8_, edm::ESHandleBase::isValid(), AlCaHLTBitMon_ParallelJobs::p, paramTS_, edm::ESHandle< T >::product(), reco_, recoConfig_, setNoiseFlagsQIE11_, and setNoiseFlagsQIE8_.

659  {
661  es.get<HcalRecoParamsRcd>().get(p);
662  paramTS_ = std::make_unique<HcalRecoParams>(*p.product());
663 
664  if (reco_->isConfigurable()) {
666  if (!recoConfig_.get())
667  throw cms::Exception("HBHEPhase1BadConfig")
668  << "Invalid HBHEPhase1Reconstructor \"algoConfigClass\" parameter value \"" << algoConfigClass_ << '"'
669  << std::endl;
670  if (!reco_->configure(recoConfig_.get()))
671  throw cms::Exception("HBHEPhase1BadConfig")
672  << "Failed to configure HBHEPhase1Algo algorithm from EventSetup" << std::endl;
673  }
674 
677  es.get<HcalFrontEndMapRcd>().get(hfemap);
678  if (hfemap.isValid()) {
679  if (setNoiseFlagsQIE8_)
680  hbheFlagSetterQIE8_->SetFrontEndMap(hfemap.product());
682  hbheFlagSetterQIE11_->SetFrontEndMap(hfemap.product());
683  } else
684  edm::LogWarning("EventSetup") << "HBHEPhase1Reconstructor failed to get HcalFrontEndMap!" << std::endl;
685  }
686 
687  reco_->beginRun(r, es);
688 }
std::unique_ptr< HBHEStatusBitSetter > hbheFlagSetterQIE11_
std::unique_ptr< HBHEStatusBitSetter > hbheFlagSetterQIE8_
std::unique_ptr< AbsHcalAlgoData > fetchHcalAlgoData(const std::string &className, const edm::EventSetup &es)
std::unique_ptr< HcalRecoParams > paramTS_
std::unique_ptr< AbsHBHEPhase1Algo > reco_
std::unique_ptr< AbsHcalAlgoData > recoConfig_
bool isValid() const
Definition: ESHandle.h:44
T const * product() const
Definition: ESHandle.h:86
void HBHEPhase1Reconstructor::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivate

Definition at line 690 of file HBHEPhase1Reconstructor.cc.

References reco_.

690 { reco_->endRun(); }
std::unique_ptr< AbsHBHEPhase1Algo > reco_
void HBHEPhase1Reconstructor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 698 of file HBHEPhase1Reconstructor.cc.

References edm::ParameterSetDescription::add(), add_param_set, edm::ConfigurationDescriptions::addDefault(), DEFINE_FWK_MODULE, fillDescriptionForParseHBHEPhase1Algo(), HLT_2018_cff::flagParametersQIE11, HLT_2018_cff::flagParametersQIE8, HLT_2018_cff::pulseShapeParametersQIE11, HLT_2018_cff::pulseShapeParametersQIE8, and AlCaHLTBitMon_QueryRunRegistry::string.

698  {
700 
701  desc.add<edm::InputTag>("digiLabelQIE8");
702  desc.add<edm::InputTag>("digiLabelQIE11");
703  desc.add<std::string>("algoConfigClass");
704  desc.add<bool>("processQIE8");
705  desc.add<bool>("processQIE11");
706  desc.add<bool>("saveInfos");
707  desc.add<bool>("saveDroppedInfos");
708  desc.add<bool>("makeRecHits");
709  desc.add<bool>("dropZSmarkedPassed");
710  desc.add<bool>("tsFromDB");
711  desc.add<bool>("recoParamsFromDB");
712  desc.add<bool>("saveEffectivePedestal", false);
713  desc.add<bool>("use8ts", false);
714  desc.add<int>("sipmQTSShift", 0);
715  desc.add<int>("sipmQNTStoSum", 3);
716  desc.add<bool>("setNegativeFlagsQIE8");
717  desc.add<bool>("setNegativeFlagsQIE11");
718  desc.add<bool>("setNoiseFlagsQIE8");
719  desc.add<bool>("setNoiseFlagsQIE11");
720  desc.add<bool>("setPulseShapeFlagsQIE8");
721  desc.add<bool>("setPulseShapeFlagsQIE11");
722  desc.add<bool>("setLegacyFlagsQIE8");
723  desc.add<bool>("setLegacyFlagsQIE11");
724 
730 
731  descriptions.addDefault(desc);
732 }
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
#define add_param_set(name)
edm::ParameterSetDescription fillDescriptionForParseHBHEPhase1Algo()
template<class DFrame , class Collection >
void HBHEPhase1Reconstructor::processData ( const Collection &  coll,
const HcalDbService cond,
const HcalChannelQuality qual,
const HcalSeverityLevelComputer severity,
const bool  isRealData,
HBHEChannelInfo info,
HBHEChannelInfoCollection infoColl,
HBHERecHitCollection rechits,
const bool  use8ts 
)
private

Definition at line 397 of file HBHEPhase1Reconstructor.cc.

References QIE11DataFrame::Sample::adc(), HcalCoderDb::adc2fC(), QIE11DataFrame::Sample::capid(), fwrapper::cs, HcalSeverityLevelComputer::dropChannel(), dropZSmarkedPassed_, HcalCalibrationWidths::effpedestal(), HcalCalibrations::effpedestal(), HcalRecoParam::firstSample(), amptDefault_cfi::frame, HcalCalibrationWidths::gain(), PedestalClient_cfi::gain, HcalSiPMCharacteristics::getCrossTalk(), HcalSiPMParameter::getFCByPE(), HcalDbService::getHcalCalibrations(), HcalDbService::getHcalCalibrationWidths(), HcalDbService::getHcalCoder(), HcalDbService::getHcalShape(), HcalDbService::getHcalSiPMCharacteristics(), HcalDbService::getHcalSiPMParameter(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), HBHEChannelInfo::hasEffectivePedestals(), HBHEChannelInfo::hasTimeInfo(), HcalBarrel, HcalEndcap, HBHERecHit::id(), HBHEChannelInfo::isDropped(), HBHEChannelInfo::MAXSAMPLES, min(), paramTS_, HcalCalibrationWidths::pedestal(), HcalCalibrations::pedestal(), HcalRecoParam::pulseShapeID(), edm::SortedCollection< T, SORT >::push_back(), DetId::rawId(), reco_, recoParamsFromDB_, HcalCalibrations::respcorrgain(), alignCSCRings::s, saveDroppedInfos_, saveInfos_, setAsicSpecificBits(), HBHEChannelInfo::setChannelInfo(), setCommonStatusBits(), HBHEChannelInfo::setSample(), sipmQNTStoSum_, sipmQTSShift_, CaloSamples::size(), HcalDetId::subdet(), OrderedSet::t, and tsFromDB_.

405  {
406  // If "saveDroppedInfos_" flag is set, fill the info with something
407  // meaningful even if the database tells us to drop this channel.
408  // Note that this flag affects only "infos", the rechits are still
409  // not going to be constructed from such channels.
410  const bool skipDroppedChannels = !(infos && saveDroppedInfos_);
411 
412  // Iterate over the input collection
413  for (typename Collection::const_iterator it = coll.begin(); it != coll.end(); ++it) {
414  const DFrame& frame(*it);
415  const HcalDetId cell(frame.id());
416 
417  // Protection against calibration channels which are not
418  // in the database but can still come in the QIE11DataFrame
419  // in the laser calibs, etc.
420  const HcalSubdetector subdet = cell.subdet();
421  if (!(subdet == HcalSubdetector::HcalBarrel || subdet == HcalSubdetector::HcalEndcap))
422  continue;
423 
424  // Check if the database tells us to drop this channel
425  const HcalChannelStatus* mydigistatus = qual.getValues(cell.rawId());
426  const bool taggedBadByDb = severity.dropChannel(mydigistatus->getValue());
427  if (taggedBadByDb && skipDroppedChannels)
428  continue;
429 
430  // Check if the channel is zero suppressed
431  bool dropByZS = false;
433  if (frame.zsMarkAndPass())
434  dropByZS = true;
435  if (dropByZS && skipDroppedChannels)
436  continue;
437 
438  // Basic ADC decoding tools
439  const HcalRecoParam* param_ts = paramTS_->getValues(cell.rawId());
440  const HcalCalibrations& calib = cond.getHcalCalibrations(cell);
441  const HcalCalibrationWidths& calibWidth = cond.getHcalCalibrationWidths(cell);
442  const HcalQIECoder* channelCoder = cond.getHcalCoder(cell);
443  const HcalQIEShape* shape = cond.getHcalShape(channelCoder);
444  const HcalCoderDb coder(*channelCoder, *shape);
445 
446  const bool saveEffectivePeds = channelInfo->hasEffectivePedestals();
447  const HcalSiPMParameter& siPMParameter(*cond.getHcalSiPMParameter(cell));
448  const double fcByPE = siPMParameter.getFCByPE();
449  double darkCurrent = 0.;
450  double lambda = 0.;
451  if (!saveEffectivePeds || saveInfos_) {
452  // needed for the dark current in the M2 in alternative of the effectivePed
453  darkCurrent = siPMParameter.getDarkCurrent();
454  lambda = cond.getHcalSiPMCharacteristics()->getCrossTalk(siPMParameter.getType());
455  }
456 
457  // ADC to fC conversion
458  CaloSamples cs;
459  coder.adc2fC(frame, cs);
460 
461  // Prepare to iterate over time slices
462  const int nRead = cs.size();
463  const int maxTS = std::min(nRead, static_cast<int>(HBHEChannelInfo::MAXSAMPLES));
464  const int soi = tsFromDB_ ? param_ts->firstSample() : frame.presamples();
465  const RawChargeFromSample<DFrame> rcfs(sipmQTSShift_, sipmQNTStoSum_, cond, cell, cs, soi, frame, maxTS);
466  int soiCapid = 4;
467 
468  // Use only 8 TSs when there are 10 TSs
469  const int shiftOneTS = use8ts_ && maxTS == static_cast<int>(HBHEChannelInfo::MAXSAMPLES) ? 1 : 0;
470  const int nCycles = maxTS - shiftOneTS;
471 
472  // Go over time slices and fill the samples
473  for (int inputTS = shiftOneTS; inputTS < nCycles; ++inputTS) {
474  auto s(frame[inputTS]);
475  const uint8_t adc = s.adc();
476  const int capid = s.capid();
477  //optionally store "effective" pedestal (measured with bias voltage on)
478  // = QIE contribution + SiPM contribution (from dark current + crosstalk)
479  const double pedestal = saveEffectivePeds ? calib.effpedestal(capid) : calib.pedestal(capid);
480  const double pedestalWidth = saveEffectivePeds ? calibWidth.effpedestal(capid) : calibWidth.pedestal(capid);
481  const double gain = calib.respcorrgain(capid);
482  const double gainWidth = calibWidth.gain(capid);
483  //always use QIE-only pedestal for this computation
484  const double rawCharge = rcfs.getRawCharge(cs[inputTS], calib.pedestal(capid));
485  const float t = getTDCTimeFromSample(s);
486  const float dfc = getDifferentialChargeGain(*channelCoder, *shape, adc, capid, channelInfo->hasTimeInfo());
487  const int fitTS = inputTS - shiftOneTS;
488  channelInfo->setSample(fitTS, adc, dfc, rawCharge, pedestal, pedestalWidth, gain, gainWidth, t);
489  if (inputTS == soi)
490  soiCapid = capid;
491  }
492 
493  // Fill the overall channel info items
494  const int maxFitTS = maxTS - 2 * shiftOneTS;
495  const int fitSoi = soi - shiftOneTS;
496  const int pulseShapeID = param_ts->pulseShapeID();
497  const std::pair<bool, bool> hwerr = findHWErrors(frame, maxTS);
498  channelInfo->setChannelInfo(cell,
499  pulseShapeID,
500  maxFitTS,
501  fitSoi,
502  soiCapid,
503  darkCurrent,
504  fcByPE,
505  lambda,
506  hwerr.first,
507  hwerr.second,
508  taggedBadByDb || dropByZS);
509 
510  // If needed, add the channel info to the output collection
511  const bool makeThisRechit = !channelInfo->isDropped();
512  if (infos && (saveDroppedInfos_ || makeThisRechit))
513  infos->push_back(*channelInfo);
514 
515  // Reconstruct the rechit
516  if (rechits && makeThisRechit) {
517  const HcalRecoParam* pptr = nullptr;
518  if (recoParamsFromDB_)
519  pptr = param_ts;
520  HBHERecHit rh = reco_->reconstruct(*channelInfo, pptr, calib, isRealData);
521  if (rh.id().rawId()) {
522  setAsicSpecificBits(frame, coder, *channelInfo, calib, &rh);
523  setCommonStatusBits(*channelInfo, calib, &rh);
524  rechits->push_back(rh);
525  }
526  }
527  }
528 }
constexpr unsigned int pulseShapeID() const
Definition: HcalRecoParam.h:33
double gain(int fCapId) const
get gain width for capid=0..3
int maxTS(DIGI const &digi, double ped=0)
Definition: Utilities.h:102
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
void setCommonStatusBits(const HBHEChannelInfo &info, const HcalCalibrations &calib, HBHERecHit *rh)
unique_ptr< ClusterSequence > cs
HcalDetId id() const
get the id
Definition: HBHERecHit.h:39
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
void push_back(T const &t)
double effpedestal(int fCapId) const
get effective pedestal width for capid=0..3
const Item * getValues(DetId fId, bool throwOnFail=true) const
float getCrossTalk(int type) const
get cross talk
std::unique_ptr< HcalRecoParams > paramTS_
static const unsigned MAXSAMPLES
double pedestal(int fCapId) const
get pedestal width for capid=0..3
constexpr double effpedestal(int fCapId) const
get effective pedestal for capid=0..3
HcalSubdetector
Definition: HcalAssistant.h:31
bool dropChannel(const uint32_t &mystatus) const
std::unique_ptr< AbsHBHEPhase1Algo > reco_
T min(T a, T b)
Definition: MathUtil.h:58
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
const HcalCalibrationWidths & getHcalCalibrationWidths(const HcalGenericDetId &fId) const
constexpr double pedestal(int fCapId) const
get pedestal for capid=0..3
JetCorrectorParametersCollection coll
Definition: classes.h:10
int size() const
get the size
Definition: CaloSamples.h:24
const HcalSiPMCharacteristics * getHcalSiPMCharacteristics() const
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
void setAsicSpecificBits(const HBHEDataFrame &frame, const HcalCoder &coder, const HBHEChannelInfo &info, const HcalCalibrations &calib, HBHERecHit *rh)
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
uint32_t getValue() const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const
constexpr double respcorrgain(int fCapId) const
get response corrected gain for capid=0..3
float getFCByPE() const
get fcByPE
constexpr unsigned int firstSample() const
Definition: HcalRecoParam.h:31
void HBHEPhase1Reconstructor::produce ( edm::Event e,
const edm::EventSetup eventSetup 
)
overrideprivate

Definition at line 575 of file HBHEPhase1Reconstructor.cc.

References edm::EventSetup::get(), edm::Event::getByToken(), hbheFlagSetterQIE11_, hbheFlagSetterQIE8_, MessageLogger_cfi::infos, HLTBitAnalyser_cfi::isData, edm::EventBase::isRealData(), makeRecHits_, eostools::move(), negEFilter_, MillePedeFileConverter_cfg::out, AlCaHLTBitMon_ParallelJobs::p, paramTS_, processQIE11_, processQIE8_, edm::ESHandle< T >::product(), edm::Event::put(), saveEffectivePedestal_, saveInfos_, setNegativeFlagsQIE11_, setNegativeFlagsQIE8_, setNoiseFlagsQIE11_, setNoiseFlagsQIE8_, edm::SortedCollection< T, SORT >::size(), edm::DataFrameContainer::size(), tok_qie11_, tok_qie8_, and use8ts_.

575  {
576  using namespace edm;
577 
578  // Get the Hcal topology
580  eventSetup.get<HcalRecNumberingRecord>().get(htopo);
581  paramTS_->setTopo(htopo.product());
582 
583  // Fetch the calibrations
584  ESHandle<HcalDbService> conditions;
585  eventSetup.get<HcalDbRecord>().get(conditions);
586 
588  eventSetup.get<HcalChannelQualityRcd>().get("withTopo", p);
589 
591  eventSetup.get<HcalSeverityLevelComputerRcd>().get(mycomputer);
592 
593  // Configure the negative energy filter
596  eventSetup.get<HBHENegativeEFilterRcd>().get(negEHandle);
597  negEFilter_ = negEHandle.product();
598  }
599 
600  // Find the input data
601  unsigned maxOutputSize = 0;
603  if (processQIE8_) {
604  e.getByToken(tok_qie8_, hbDigis);
605  maxOutputSize += hbDigis->size();
606  }
607 
609  if (processQIE11_) {
610  e.getByToken(tok_qie11_, heDigis);
611  maxOutputSize += heDigis->size();
612  }
613 
614  // Create new output collections
615  std::unique_ptr<HBHEChannelInfoCollection> infos;
616  if (saveInfos_) {
617  infos = std::make_unique<HBHEChannelInfoCollection>();
618  infos->reserve(maxOutputSize);
619  }
620 
621  std::unique_ptr<HBHERecHitCollection> out;
622  if (makeRecHits_) {
623  out = std::make_unique<HBHERecHitCollection>();
624  out->reserve(maxOutputSize);
625  }
626 
627  // Process the input collections, filling the output ones
628  const bool isData = e.isRealData();
629  if (processQIE8_) {
630  if (setNoiseFlagsQIE8_)
631  hbheFlagSetterQIE8_->Clear();
632 
633  HBHEChannelInfo channelInfo(false, false);
634  processData<HBHEDataFrame>(
635  *hbDigis, *conditions, *p, *mycomputer, isData, &channelInfo, infos.get(), out.get(), use8ts_);
636  if (setNoiseFlagsQIE8_)
637  hbheFlagSetterQIE8_->SetFlagsFromRecHits(*out);
638  }
639 
640  if (processQIE11_) {
642  hbheFlagSetterQIE11_->Clear();
643 
644  HBHEChannelInfo channelInfo(true, saveEffectivePedestal_);
645  processData<QIE11DataFrame>(
646  *heDigis, *conditions, *p, *mycomputer, isData, &channelInfo, infos.get(), out.get(), use8ts_);
648  hbheFlagSetterQIE11_->SetFlagsFromRecHits(*out);
649  }
650 
651  // Add the output collections to the event record
652  if (saveInfos_)
653  e.put(std::move(infos));
654  if (makeRecHits_)
655  e.put(std::move(out));
656 }
const HBHENegativeEFilter * negEFilter_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
std::unique_ptr< HBHEStatusBitSetter > hbheFlagSetterQIE11_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
std::unique_ptr< HBHEStatusBitSetter > hbheFlagSetterQIE8_
bool isRealData() const
Definition: EventBase.h:62
std::unique_ptr< HcalRecoParams > paramTS_
edm::EDGetTokenT< QIE11DigiCollection > tok_qie11_
edm::EDGetTokenT< HBHEDigiCollection > tok_qie8_
HLT enums.
size_type size() const
T get() const
Definition: EventSetup.h:73
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511
void HBHEPhase1Reconstructor::runHBHENegativeEFilter ( const HBHEChannelInfo info,
HBHERecHit rh 
)
private

Definition at line 564 of file HBHEPhase1Reconstructor.cc.

References HBHENegativeEFilter::checkPassFilter(), HcalPhase1FlagLabels::HBHENegativeNoise, mps_fire::i, HBHEChannelInfo::id(), HBHEChannelInfo::MAXSAMPLES, negEFilter_, HBHEChannelInfo::nSamples(), CaloRecHit::setFlagField(), and HBHEChannelInfo::tsCharge().

Referenced by setAsicSpecificBits().

564  {
565  double ts[HBHEChannelInfo::MAXSAMPLES];
566  const unsigned nRead = info.nSamples();
567  for (unsigned i = 0; i < nRead; ++i)
568  ts[i] = info.tsCharge(i);
569  const bool passes = negEFilter_->checkPassFilter(info.id(), &ts[0], nRead);
570  if (!passes)
572 }
const HBHENegativeEFilter * negEFilter_
HcalDetId id() const
constexpr void setFlagField(uint32_t value, int base, int width=1)
Definition: CaloRecHit.h:36
bool checkPassFilter(const HcalDetId &id, const double *ts, unsigned lenTS) const
static const unsigned MAXSAMPLES
double tsCharge(const unsigned ts) const
unsigned nSamples() const
void HBHEPhase1Reconstructor::setAsicSpecificBits ( const HBHEDataFrame frame,
const HcalCoder coder,
const HBHEChannelInfo info,
const HcalCalibrations calib,
HBHERecHit rh 
)
private

Definition at line 534 of file HBHEPhase1Reconstructor.cc.

References hbheFlagSetterQIE8_, hbhePulseShapeFlagSetterQIE8_, runHBHENegativeEFilter(), setNegativeFlagsQIE8_, setNoiseFlagsQIE8_, and setPulseShapeFlagsQIE8_.

Referenced by processData().

538  {
539  if (setNoiseFlagsQIE8_)
540  hbheFlagSetterQIE8_->rememberHit(*rh);
541 
543  hbhePulseShapeFlagSetterQIE8_->SetPulseShapeFlags(*rh, frame, coder, calib);
544 
546  runHBHENegativeEFilter(info, rh);
547 }
std::unique_ptr< HBHEPulseShapeFlagSetter > hbhePulseShapeFlagSetterQIE8_
std::unique_ptr< HBHEStatusBitSetter > hbheFlagSetterQIE8_
void runHBHENegativeEFilter(const HBHEChannelInfo &info, HBHERecHit *rh)
void HBHEPhase1Reconstructor::setAsicSpecificBits ( const QIE11DataFrame frame,
const HcalCoder coder,
const HBHEChannelInfo info,
const HcalCalibrations calib,
HBHERecHit rh 
)
private

Definition at line 549 of file HBHEPhase1Reconstructor.cc.

References hbheFlagSetterQIE11_, hbhePulseShapeFlagSetterQIE11_, runHBHENegativeEFilter(), setNegativeFlagsQIE11_, setNoiseFlagsQIE11_, and setPulseShapeFlagsQIE11_.

553  {
555  hbheFlagSetterQIE11_->rememberHit(*rh);
556 
558  hbhePulseShapeFlagSetterQIE11_->SetPulseShapeFlags(*rh, frame, coder, calib);
559 
561  runHBHENegativeEFilter(info, rh);
562 }
std::unique_ptr< HBHEStatusBitSetter > hbheFlagSetterQIE11_
void runHBHENegativeEFilter(const HBHEChannelInfo &info, HBHERecHit *rh)
std::unique_ptr< HBHEPulseShapeFlagSetter > hbhePulseShapeFlagSetterQIE11_
void HBHEPhase1Reconstructor::setCommonStatusBits ( const HBHEChannelInfo info,
const HcalCalibrations calib,
HBHERecHit rh 
)
private

Definition at line 530 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

532  {}

Member Data Documentation

std::string HBHEPhase1Reconstructor::algoConfigClass_
private

Definition at line 263 of file HBHEPhase1Reconstructor.cc.

Referenced by beginRun().

bool HBHEPhase1Reconstructor::dropZSmarkedPassed_
private

Definition at line 269 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

std::unique_ptr<HBHEStatusBitSetter> HBHEPhase1Reconstructor::hbheFlagSetterQIE11_
private
std::unique_ptr<HBHEStatusBitSetter> HBHEPhase1Reconstructor::hbheFlagSetterQIE8_
private
std::unique_ptr<HBHEPulseShapeFlagSetter> HBHEPhase1Reconstructor::hbhePulseShapeFlagSetterQIE11_
private

Definition at line 297 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and setAsicSpecificBits().

std::unique_ptr<HBHEPulseShapeFlagSetter> HBHEPhase1Reconstructor::hbhePulseShapeFlagSetterQIE8_
private

Definition at line 296 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and setAsicSpecificBits().

bool HBHEPhase1Reconstructor::makeRecHits_
private

Definition at line 268 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

const HBHENegativeEFilter* HBHEPhase1Reconstructor::negEFilter_
private

Definition at line 293 of file HBHEPhase1Reconstructor.cc.

Referenced by produce(), and runHBHENegativeEFilter().

std::unique_ptr<HcalRecoParams> HBHEPhase1Reconstructor::paramTS_
private

Definition at line 290 of file HBHEPhase1Reconstructor.cc.

Referenced by beginRun(), processData(), and produce().

bool HBHEPhase1Reconstructor::processQIE11_
private

Definition at line 265 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

bool HBHEPhase1Reconstructor::processQIE8_
private

Definition at line 264 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

std::unique_ptr<AbsHBHEPhase1Algo> HBHEPhase1Reconstructor::reco_
private

Definition at line 288 of file HBHEPhase1Reconstructor.cc.

Referenced by beginRun(), endRun(), HBHEPhase1Reconstructor(), and processData().

std::unique_ptr<AbsHcalAlgoData> HBHEPhase1Reconstructor::recoConfig_
private

Definition at line 289 of file HBHEPhase1Reconstructor.cc.

Referenced by beginRun().

bool HBHEPhase1Reconstructor::recoParamsFromDB_
private

Definition at line 271 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

bool HBHEPhase1Reconstructor::saveDroppedInfos_
private

Definition at line 267 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

bool HBHEPhase1Reconstructor::saveEffectivePedestal_
private

Definition at line 272 of file HBHEPhase1Reconstructor.cc.

Referenced by produce().

bool HBHEPhase1Reconstructor::saveInfos_
private

Definition at line 266 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), processData(), and produce().

bool HBHEPhase1Reconstructor::setNegativeFlagsQIE11_
private

Definition at line 279 of file HBHEPhase1Reconstructor.cc.

Referenced by produce(), and setAsicSpecificBits().

bool HBHEPhase1Reconstructor::setNegativeFlagsQIE8_
private

Definition at line 278 of file HBHEPhase1Reconstructor.cc.

Referenced by produce(), and setAsicSpecificBits().

bool HBHEPhase1Reconstructor::setNoiseFlagsQIE11_
private
bool HBHEPhase1Reconstructor::setNoiseFlagsQIE8_
private
bool HBHEPhase1Reconstructor::setPulseShapeFlagsQIE11_
private

Definition at line 283 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and setAsicSpecificBits().

bool HBHEPhase1Reconstructor::setPulseShapeFlagsQIE8_
private

Definition at line 282 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and setAsicSpecificBits().

int HBHEPhase1Reconstructor::sipmQNTStoSum_
private

Definition at line 275 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

int HBHEPhase1Reconstructor::sipmQTSShift_
private

Definition at line 274 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

edm::EDGetTokenT<QIE11DigiCollection> HBHEPhase1Reconstructor::tok_qie11_
private

Definition at line 287 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

edm::EDGetTokenT<HBHEDigiCollection> HBHEPhase1Reconstructor::tok_qie8_
private

Definition at line 286 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

bool HBHEPhase1Reconstructor::tsFromDB_
private

Definition at line 270 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

bool HBHEPhase1Reconstructor::use8ts_
private

Definition at line 273 of file HBHEPhase1Reconstructor.cc.

Referenced by produce().