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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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)
 
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_
 

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 280 of file HBHEPhase1Reconstructor.cc.

Constructor & Destructor Documentation

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

Definition at line 357 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_.

358  : algoConfigClass_(conf.getParameter<std::string>("algoConfigClass")),
359  processQIE8_(conf.getParameter<bool>("processQIE8")),
360  processQIE11_(conf.getParameter<bool>("processQIE11")),
361  saveInfos_(conf.getParameter<bool>("saveInfos")),
362  saveDroppedInfos_(conf.getParameter<bool>("saveDroppedInfos")),
363  makeRecHits_(conf.getParameter<bool>("makeRecHits")),
364  dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed")),
365  tsFromDB_(conf.getParameter<bool>("tsFromDB")),
366  recoParamsFromDB_(conf.getParameter<bool>("recoParamsFromDB")),
367  saveEffectivePedestal_(conf.getParameter<bool>("saveEffectivePedestal")),
368  sipmQTSShift_(conf.getParameter<int>("sipmQTSShift")),
369  sipmQNTStoSum_(conf.getParameter<int>("sipmQNTStoSum")),
370  setNegativeFlagsQIE8_(conf.getParameter<bool>("setNegativeFlagsQIE8")),
371  setNegativeFlagsQIE11_(conf.getParameter<bool>("setNegativeFlagsQIE11")),
372  setNoiseFlagsQIE8_(conf.getParameter<bool>("setNoiseFlagsQIE8")),
373  setNoiseFlagsQIE11_(conf.getParameter<bool>("setNoiseFlagsQIE11")),
374  setPulseShapeFlagsQIE8_(conf.getParameter<bool>("setPulseShapeFlagsQIE8")),
375  setPulseShapeFlagsQIE11_(conf.getParameter<bool>("setPulseShapeFlagsQIE11")),
377  negEFilter_(nullptr)
378 {
379  // Check that the reco algorithm has been successfully configured
380  if (!reco_.get())
381  throw cms::Exception("HBHEPhase1BadConfig")
382  << "Invalid HBHEPhase1Algo algorithm configuration"
383  << std::endl;
384 
385  // Configure the status bit setters that have been turned on
386  if (setNoiseFlagsQIE8_)
387  hbheFlagSetterQIE8_ = parse_HBHEStatusBitSetter(
388  conf.getParameter<edm::ParameterSet>("flagParametersQIE8"));
389 
391  hbheFlagSetterQIE11_ = parse_HBHEStatusBitSetter(
392  conf.getParameter<edm::ParameterSet>("flagParametersQIE11"));
393 
395  hbhePulseShapeFlagSetterQIE8_ = parse_HBHEPulseShapeFlagSetter(
396  conf.getParameter<edm::ParameterSet>("pulseShapeParametersQIE8"),
397  conf.getParameter<bool>("setLegacyFlagsQIE8"));
398 
400  hbhePulseShapeFlagSetterQIE11_ = parse_HBHEPulseShapeFlagSetter(
401  conf.getParameter<edm::ParameterSet>("pulseShapeParametersQIE11"),
402  conf.getParameter<bool>("setLegacyFlagsQIE11"));
403 
404  // Consumes and produces statements
405  if (processQIE8_)
406  tok_qie8_ = consumes<HBHEDigiCollection>(
407  conf.getParameter<edm::InputTag>("digiLabelQIE8"));
408 
409  if (processQIE11_)
410  tok_qie11_ = consumes<QIE11DigiCollection>(
411  conf.getParameter<edm::InputTag>("digiLabelQIE11"));
412 
413  if (saveInfos_)
414  produces<HBHEChannelInfoCollection>();
415 
416  if (makeRecHits_)
417  produces<HBHERecHitCollection>();
418 }
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 421 of file HBHEPhase1Reconstructor.cc.

422 {
423  // do anything here that needs to be done at destruction time
424  // (e.g. close files, deallocate resources etc.)
425 }

Member Function Documentation

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

Definition at line 701 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_.

702 {
704  es.get<HcalRecoParamsRcd>().get(p);
705  paramTS_ = std::make_unique<HcalRecoParams>(*p.product());
706 
707  if (reco_->isConfigurable())
708  {
710  if (!recoConfig_.get())
711  throw cms::Exception("HBHEPhase1BadConfig")
712  << "Invalid HBHEPhase1Reconstructor \"algoConfigClass\" parameter value \""
713  << algoConfigClass_ << '"' << std::endl;
714  if (!reco_->configure(recoConfig_.get()))
715  throw cms::Exception("HBHEPhase1BadConfig")
716  << "Failed to configure HBHEPhase1Algo algorithm from EventSetup"
717  << std::endl;
718  }
719 
721  {
723  es.get<HcalFrontEndMapRcd>().get(hfemap);
724  if (hfemap.isValid())
725  {
726  if (setNoiseFlagsQIE8_)
727  hbheFlagSetterQIE8_->SetFrontEndMap(hfemap.product());
729  hbheFlagSetterQIE11_->SetFrontEndMap(hfemap.product());
730  }
731  else
732  edm::LogWarning("EventSetup") <<
733  "HBHEPhase1Reconstructor failed to get HcalFrontEndMap!" << std::endl;
734  }
735 
736  reco_->beginRun(r, es);
737 }
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:47
T const * product() const
Definition: ESHandle.h:86
void HBHEPhase1Reconstructor::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivate

Definition at line 740 of file HBHEPhase1Reconstructor.cc.

References reco_.

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

Definition at line 752 of file HBHEPhase1Reconstructor.cc.

References edm::ParameterSetDescription::add(), add_param_set, edm::ConfigurationDescriptions::addDefault(), electronCleaner_cfi::algorithm, DEFINE_FWK_MODULE, HBHEPhase1Reconstructor_cfi::flagParametersQIE11, HBHEPhase1Reconstructor_cfi::flagParametersQIE8, HBHEPhase1Reconstructor_cfi::pulseShapeParametersQIE11, hcalLocalReco_cff::pulseShapeParametersQIE8, and AlCaHLTBitMon_QueryRunRegistry::string.

753 {
755 
756  desc.add<edm::InputTag>("digiLabelQIE8");
757  desc.add<edm::InputTag>("digiLabelQIE11");
758  desc.add<std::string>("algoConfigClass");
759  desc.add<bool>("processQIE8");
760  desc.add<bool>("processQIE11");
761  desc.add<bool>("saveInfos");
762  desc.add<bool>("saveDroppedInfos");
763  desc.add<bool>("makeRecHits");
764  desc.add<bool>("dropZSmarkedPassed");
765  desc.add<bool>("tsFromDB");
766  desc.add<bool>("recoParamsFromDB");
767  desc.add<bool>("saveEffectivePedestal", false);
768  desc.add<int>("sipmQTSShift", 0);
769  desc.add<int>("sipmQNTStoSum", 3);
770  desc.add<bool>("setNegativeFlagsQIE8");
771  desc.add<bool>("setNegativeFlagsQIE11");
772  desc.add<bool>("setNoiseFlagsQIE8");
773  desc.add<bool>("setNoiseFlagsQIE11");
774  desc.add<bool>("setPulseShapeFlagsQIE8");
775  desc.add<bool>("setPulseShapeFlagsQIE11");
776  desc.add<bool>("setLegacyFlagsQIE8");
777  desc.add<bool>("setLegacyFlagsQIE11");
778 
784 
785  descriptions.addDefault(desc);
786 }
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
#define add_param_set(name)
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 
)
private

Definition at line 432 of file HBHEPhase1Reconstructor.cc.

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

440 {
441  // If "saveDroppedInfos_" flag is set, fill the info with something
442  // meaningful even if the database tells us to drop this channel.
443  // Note that this flag affects only "infos", the rechits are still
444  // not going to be constructed from such channels.
445  const bool skipDroppedChannels = !(infos && saveDroppedInfos_);
446 
447  // Iterate over the input collection
448  for (typename Collection::const_iterator it = coll.begin();
449  it != coll.end(); ++it)
450  {
451  const DFrame& frame(*it);
452  const HcalDetId cell(frame.id());
453 
454  // Protection against calibration channels which are not
455  // in the database but can still come in the QIE11DataFrame
456  // in the laser calibs, etc.
457  const HcalSubdetector subdet = cell.subdet();
458  if (!(subdet == HcalSubdetector::HcalBarrel ||
459  subdet == HcalSubdetector::HcalEndcap ||
460  subdet == HcalSubdetector::HcalOuter))
461  continue;
462 
463  // Check if the database tells us to drop this channel
464  const HcalChannelStatus* mydigistatus = qual.getValues(cell.rawId());
465  const bool taggedBadByDb = severity.dropChannel(mydigistatus->getValue());
466  if (taggedBadByDb && skipDroppedChannels)
467  continue;
468 
469  // Check if the channel is zero suppressed
470  bool dropByZS = false;
472  if (frame.zsMarkAndPass())
473  dropByZS = true;
474  if (dropByZS && skipDroppedChannels)
475  continue;
476 
477  // Basic ADC decoding tools
478  const HcalRecoParam* param_ts = paramTS_->getValues(cell.rawId());
479  const HcalCalibrations& calib = cond.getHcalCalibrations(cell);
480  const HcalCalibrationWidths& calibWidth = cond.getHcalCalibrationWidths(cell);
481  const HcalQIECoder* channelCoder = cond.getHcalCoder(cell);
482  const HcalQIEShape* shape = cond.getHcalShape(channelCoder);
483  const HcalCoderDb coder(*channelCoder, *shape);
484 
485  // needed for the dark current in the M2
486  const HcalSiPMParameter& siPMParameter(*cond.getHcalSiPMParameter(cell));
487  const double darkCurrent = siPMParameter.getDarkCurrent();
488  const double fcByPE = siPMParameter.getFCByPE();
489  const double lambda = cond.getHcalSiPMCharacteristics()->getCrossTalk(siPMParameter.getType());
490 
491  // ADC to fC conversion
492  CaloSamples cs;
493  coder.adc2fC(frame, cs);
494 
495  // Prepare to iterate over time slices
496  const bool saveEffectivePeds = channelInfo->hasEffectivePedestals();
497  const int nRead = cs.size();
498  const int maxTS = std::min(nRead, static_cast<int>(HBHEChannelInfo::MAXSAMPLES));
499  const int soi = tsFromDB_ ? param_ts->firstSample() : frame.presamples();
500  const RawChargeFromSample<DFrame> rcfs(sipmQTSShift_, sipmQNTStoSum_,
501  cond, cell, cs, soi, frame, maxTS);
502  int soiCapid = 4;
503 
504  // Go over time slices and fill the samples
505  for (int ts = 0; ts < maxTS; ++ts)
506  {
507  auto s(frame[ts]);
508  const uint8_t adc = s.adc();
509  const int capid = s.capid();
510  //optionally store "effective" pedestal (measured with bias voltage on)
511  // = QIE contribution + SiPM contribution (from dark current + crosstalk)
512  const double pedestal = saveEffectivePeds ? calib.effpedestal(capid) : calib.pedestal(capid);
513  const double pedestalWidth = saveEffectivePeds ? calibWidth.effpedestal(capid) : calibWidth.pedestal(capid);
514  const double gain = calib.respcorrgain(capid);
515  const double gainWidth = calibWidth.gain(capid);
516  //always use QIE-only pedestal for this computation
517  const double rawCharge = rcfs.getRawCharge(cs[ts], calib.pedestal(capid));
518  const float t = getTDCTimeFromSample(s);
519  const float dfc = getDifferentialChargeGain(*channelCoder, *shape, adc,
520  capid, channelInfo->hasTimeInfo());
521  channelInfo->setSample(ts, adc, dfc, rawCharge,
522  pedestal, pedestalWidth,
523  gain, gainWidth, t);
524  if (ts == soi)
525  soiCapid = capid;
526  }
527 
528  // Fill the overall channel info items
529  const int pulseShapeID = param_ts->pulseShapeID();
530  const std::pair<bool,bool> hwerr = findHWErrors(frame, maxTS);
531  channelInfo->setChannelInfo(cell, pulseShapeID, maxTS, soi, soiCapid,
532  darkCurrent, fcByPE, lambda,
533  hwerr.first, hwerr.second,
534  taggedBadByDb || dropByZS);
535 
536  // If needed, add the channel info to the output collection
537  const bool makeThisRechit = !channelInfo->isDropped();
538  if (infos && (saveDroppedInfos_ || makeThisRechit))
539  infos->push_back(*channelInfo);
540 
541  // Reconstruct the rechit
542  if (rechits && makeThisRechit)
543  {
544  const HcalRecoParam* pptr = nullptr;
545  if (recoParamsFromDB_)
546  pptr = param_ts;
547  HBHERecHit rh = reco_->reconstruct(*channelInfo, pptr, calib, isRealData);
548  if (rh.id().rawId())
549  {
550  setAsicSpecificBits(frame, coder, *channelInfo, calib, &rh);
551  setCommonStatusBits(*channelInfo, calib, &rh);
552  rechits->push_back(rh);
553  }
554  }
555  }
556 }
int adc(sample_type sample)
get the ADC sample (12 bits)
constexpr unsigned int pulseShapeID() const
Definition: HcalRecoParam.h:34
double gain(int fCapId) const
get gain width for capid=0..3
auto_ptr< ClusterSequence > cs
int maxTS(DIGI const &digi, double ped=0)
Definition: Utilities.h:93
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:142
void setCommonStatusBits(const HBHEChannelInfo &info, const HcalCalibrations &calib, HBHERecHit *rh)
HcalDetId id() const
get the id
Definition: HBHERecHit.h:42
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
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
float getDarkCurrent() const
get dark current
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
constexpr unsigned int firstSample() const
Definition: HcalRecoParam.h:32
void HBHEPhase1Reconstructor::produce ( edm::Event e,
const edm::EventSetup eventSetup 
)
overrideprivate

Definition at line 608 of file HBHEPhase1Reconstructor.cc.

References edm::EventSetup::get(), edm::Event::getByToken(), hbheFlagSetterQIE11_, hbheFlagSetterQIE8_, benchmark_cfg::infos, 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_, and tok_qie8_.

609 {
610  using namespace edm;
611 
612  // Get the Hcal topology
614  eventSetup.get<HcalRecNumberingRecord>().get(htopo);
615  paramTS_->setTopo(htopo.product());
616 
617  // Fetch the calibrations
618  ESHandle<HcalDbService> conditions;
619  eventSetup.get<HcalDbRecord>().get(conditions);
620 
622  eventSetup.get<HcalChannelQualityRcd>().get("withTopo", p);
623 
625  eventSetup.get<HcalSeverityLevelComputerRcd>().get(mycomputer);
626 
627  // Configure the negative energy filter
630  {
631  eventSetup.get<HBHENegativeEFilterRcd>().get(negEHandle);
632  negEFilter_ = negEHandle.product();
633  }
634 
635  // Find the input data
636  unsigned maxOutputSize = 0;
638  if (processQIE8_)
639  {
640  e.getByToken(tok_qie8_, hbDigis);
641  maxOutputSize += hbDigis->size();
642  }
643 
645  if (processQIE11_)
646  {
647  e.getByToken(tok_qie11_, heDigis);
648  maxOutputSize += heDigis->size();
649  }
650 
651  // Create new output collections
652  std::unique_ptr<HBHEChannelInfoCollection> infos;
653  if (saveInfos_)
654  {
655  infos = std::make_unique<HBHEChannelInfoCollection>();
656  infos->reserve(maxOutputSize);
657  }
658 
659  std::unique_ptr<HBHERecHitCollection> out;
660  if (makeRecHits_)
661  {
662  out = std::make_unique<HBHERecHitCollection>();
663  out->reserve(maxOutputSize);
664  }
665 
666  // Process the input collections, filling the output ones
667  const bool isData = e.isRealData();
668  if (processQIE8_)
669  {
670  if (setNoiseFlagsQIE8_)
671  hbheFlagSetterQIE8_->Clear();
672 
673  HBHEChannelInfo channelInfo(false,false);
674  processData<HBHEDataFrame>(*hbDigis, *conditions, *p, *mycomputer,
675  isData, &channelInfo, infos.get(), out.get());
676  if (setNoiseFlagsQIE8_)
677  hbheFlagSetterQIE8_->SetFlagsFromRecHits(*out);
678  }
679 
680  if (processQIE11_)
681  {
683  hbheFlagSetterQIE11_->Clear();
684 
685  HBHEChannelInfo channelInfo(true,saveEffectivePedestal_);
686  processData<QIE11DataFrame>(*heDigis, *conditions, *p, *mycomputer,
687  isData, &channelInfo, infos.get(), out.get());
689  hbheFlagSetterQIE11_->SetFlagsFromRecHits(*out);
690  }
691 
692  // Add the output collections to the event record
693  if (saveInfos_)
694  e.put(std::move(infos));
695  if (makeRecHits_)
696  e.put(std::move(out));
697 }
const HBHENegativeEFilter * negEFilter_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
std::unique_ptr< HBHEStatusBitSetter > hbheFlagSetterQIE11_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
std::unique_ptr< HBHEStatusBitSetter > hbheFlagSetterQIE8_
bool isRealData() const
Definition: EventBase.h:64
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:63
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:510
void HBHEPhase1Reconstructor::runHBHENegativeEFilter ( const HBHEChannelInfo info,
HBHERecHit rh 
)
private

Definition at line 594 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().

596 {
597  double ts[HBHEChannelInfo::MAXSAMPLES];
598  const unsigned nRead = info.nSamples();
599  for (unsigned i=0; i<nRead; ++i)
600  ts[i] = info.tsCharge(i);
601  const bool passes = negEFilter_->checkPassFilter(info.id(), &ts[0], nRead);
602  if (!passes)
604 }
const HBHENegativeEFilter * negEFilter_
HcalDetId id() const
constexpr void setFlagField(uint32_t value, int base, int width=1)
Definition: CaloRecHit.h:38
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 564 of file HBHEPhase1Reconstructor.cc.

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

Referenced by processData().

568 {
569  if (setNoiseFlagsQIE8_)
570  hbheFlagSetterQIE8_->rememberHit(*rh);
571 
573  hbhePulseShapeFlagSetterQIE8_->SetPulseShapeFlags(*rh, frame, coder, calib);
574 
576  runHBHENegativeEFilter(info, rh);
577 }
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 579 of file HBHEPhase1Reconstructor.cc.

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

583 {
585  hbheFlagSetterQIE11_->rememberHit(*rh);
586 
588  hbhePulseShapeFlagSetterQIE11_->SetPulseShapeFlags(*rh, frame, coder, calib);
589 
591  runHBHENegativeEFilter(info, rh);
592 }
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 558 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

561 {
562 }

Member Data Documentation

std::string HBHEPhase1Reconstructor::algoConfigClass_
private

Definition at line 294 of file HBHEPhase1Reconstructor.cc.

Referenced by beginRun().

bool HBHEPhase1Reconstructor::dropZSmarkedPassed_
private

Definition at line 300 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 327 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and setAsicSpecificBits().

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

Definition at line 326 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and setAsicSpecificBits().

bool HBHEPhase1Reconstructor::makeRecHits_
private

Definition at line 299 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

const HBHENegativeEFilter* HBHEPhase1Reconstructor::negEFilter_
private

Definition at line 323 of file HBHEPhase1Reconstructor.cc.

Referenced by produce(), and runHBHENegativeEFilter().

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

Definition at line 320 of file HBHEPhase1Reconstructor.cc.

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

bool HBHEPhase1Reconstructor::processQIE11_
private

Definition at line 296 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

bool HBHEPhase1Reconstructor::processQIE8_
private

Definition at line 295 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

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

Definition at line 318 of file HBHEPhase1Reconstructor.cc.

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

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

Definition at line 319 of file HBHEPhase1Reconstructor.cc.

Referenced by beginRun().

bool HBHEPhase1Reconstructor::recoParamsFromDB_
private

Definition at line 302 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

bool HBHEPhase1Reconstructor::saveDroppedInfos_
private

Definition at line 298 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

bool HBHEPhase1Reconstructor::saveEffectivePedestal_
private

Definition at line 303 of file HBHEPhase1Reconstructor.cc.

Referenced by produce().

bool HBHEPhase1Reconstructor::saveInfos_
private

Definition at line 297 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

bool HBHEPhase1Reconstructor::setNegativeFlagsQIE11_
private

Definition at line 309 of file HBHEPhase1Reconstructor.cc.

Referenced by produce(), and setAsicSpecificBits().

bool HBHEPhase1Reconstructor::setNegativeFlagsQIE8_
private

Definition at line 308 of file HBHEPhase1Reconstructor.cc.

Referenced by produce(), and setAsicSpecificBits().

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

Definition at line 313 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and setAsicSpecificBits().

bool HBHEPhase1Reconstructor::setPulseShapeFlagsQIE8_
private

Definition at line 312 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and setAsicSpecificBits().

int HBHEPhase1Reconstructor::sipmQNTStoSum_
private

Definition at line 305 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

int HBHEPhase1Reconstructor::sipmQTSShift_
private

Definition at line 304 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

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

Definition at line 317 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

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

Definition at line 316 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

bool HBHEPhase1Reconstructor::tsFromDB_
private

Definition at line 301 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().