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

Constructor & Destructor Documentation

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

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

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

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

Member Function Documentation

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

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

713 {
715  es.get<HcalRecoParamsRcd>().get(p);
716  paramTS_ = std::make_unique<HcalRecoParams>(*p.product());
717 
718  if (reco_->isConfigurable())
719  {
721  if (!recoConfig_.get())
722  throw cms::Exception("HBHEPhase1BadConfig")
723  << "Invalid HBHEPhase1Reconstructor \"algoConfigClass\" parameter value \""
724  << algoConfigClass_ << '"' << std::endl;
725  if (!reco_->configure(recoConfig_.get()))
726  throw cms::Exception("HBHEPhase1BadConfig")
727  << "Failed to configure HBHEPhase1Algo algorithm from EventSetup"
728  << std::endl;
729  }
730 
732  {
734  es.get<HcalFrontEndMapRcd>().get(hfemap);
735  if (hfemap.isValid())
736  {
737  if (setNoiseFlagsQIE8_)
738  hbheFlagSetterQIE8_->SetFrontEndMap(hfemap.product());
740  hbheFlagSetterQIE11_->SetFrontEndMap(hfemap.product());
741  }
742  else
743  edm::LogWarning("EventSetup") <<
744  "HBHEPhase1Reconstructor failed to get HcalFrontEndMap!" << std::endl;
745  }
746 
747  reco_->beginRun(r, es);
748 }
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 751 of file HBHEPhase1Reconstructor.cc.

References reco_.

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

Definition at line 763 of file HBHEPhase1Reconstructor.cc.

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

764 {
766 
767  desc.add<edm::InputTag>("digiLabelQIE8");
768  desc.add<edm::InputTag>("digiLabelQIE11");
769  desc.add<std::string>("algoConfigClass");
770  desc.add<bool>("processQIE8");
771  desc.add<bool>("processQIE11");
772  desc.add<bool>("saveInfos");
773  desc.add<bool>("saveDroppedInfos");
774  desc.add<bool>("makeRecHits");
775  desc.add<bool>("dropZSmarkedPassed");
776  desc.add<bool>("tsFromDB");
777  desc.add<bool>("recoParamsFromDB");
778  desc.add<bool>("saveEffectivePedestal", false);
779  desc.add<bool>("use8ts", false);
780  desc.add<int>("sipmQTSShift", 0);
781  desc.add<int>("sipmQNTStoSum", 3);
782  desc.add<bool>("setNegativeFlagsQIE8");
783  desc.add<bool>("setNegativeFlagsQIE11");
784  desc.add<bool>("setNoiseFlagsQIE8");
785  desc.add<bool>("setNoiseFlagsQIE11");
786  desc.add<bool>("setPulseShapeFlagsQIE8");
787  desc.add<bool>("setPulseShapeFlagsQIE11");
788  desc.add<bool>("setLegacyFlagsQIE8");
789  desc.add<bool>("setLegacyFlagsQIE11");
790 
796 
797  descriptions.addDefault(desc);
798 }
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 435 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, 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(), protons_cff::t, and tsFromDB_.

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

620 {
621  using namespace edm;
622 
623  // Get the Hcal topology
625  eventSetup.get<HcalRecNumberingRecord>().get(htopo);
626  paramTS_->setTopo(htopo.product());
627 
628  // Fetch the calibrations
629  ESHandle<HcalDbService> conditions;
630  eventSetup.get<HcalDbRecord>().get(conditions);
631 
633  eventSetup.get<HcalChannelQualityRcd>().get("withTopo", p);
634 
636  eventSetup.get<HcalSeverityLevelComputerRcd>().get(mycomputer);
637 
638  // Configure the negative energy filter
641  {
642  eventSetup.get<HBHENegativeEFilterRcd>().get(negEHandle);
643  negEFilter_ = negEHandle.product();
644  }
645 
646  // Find the input data
647  unsigned maxOutputSize = 0;
649  if (processQIE8_)
650  {
651  e.getByToken(tok_qie8_, hbDigis);
652  maxOutputSize += hbDigis->size();
653  }
654 
656  if (processQIE11_)
657  {
658  e.getByToken(tok_qie11_, heDigis);
659  maxOutputSize += heDigis->size();
660  }
661 
662  // Create new output collections
663  std::unique_ptr<HBHEChannelInfoCollection> infos;
664  if (saveInfos_)
665  {
666  infos = std::make_unique<HBHEChannelInfoCollection>();
667  infos->reserve(maxOutputSize);
668  }
669 
670  std::unique_ptr<HBHERecHitCollection> out;
671  if (makeRecHits_)
672  {
673  out = std::make_unique<HBHERecHitCollection>();
674  out->reserve(maxOutputSize);
675  }
676 
677  // Process the input collections, filling the output ones
678  const bool isData = e.isRealData();
679  if (processQIE8_)
680  {
681  if (setNoiseFlagsQIE8_)
682  hbheFlagSetterQIE8_->Clear();
683 
684  HBHEChannelInfo channelInfo(false,false);
685  processData<HBHEDataFrame>(*hbDigis, *conditions, *p, *mycomputer,
686  isData, &channelInfo, infos.get(), out.get(), use8ts_);
687  if (setNoiseFlagsQIE8_)
688  hbheFlagSetterQIE8_->SetFlagsFromRecHits(*out);
689  }
690 
691  if (processQIE11_)
692  {
694  hbheFlagSetterQIE11_->Clear();
695 
696  HBHEChannelInfo channelInfo(true,saveEffectivePedestal_);
697  processData<QIE11DataFrame>(*heDigis, *conditions, *p, *mycomputer,
698  isData, &channelInfo, infos.get(), out.get(), use8ts_);
700  hbheFlagSetterQIE11_->SetFlagsFromRecHits(*out);
701  }
702 
703  // Add the output collections to the event record
704  if (saveInfos_)
705  e.put(std::move(infos));
706  if (makeRecHits_)
707  e.put(std::move(out));
708 }
const HBHENegativeEFilter * negEFilter_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
std::unique_ptr< HBHEStatusBitSetter > hbheFlagSetterQIE11_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
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:71
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 605 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().

607 {
608  double ts[HBHEChannelInfo::MAXSAMPLES];
609  const unsigned nRead = info.nSamples();
610  for (unsigned i=0; i<nRead; ++i)
611  ts[i] = info.tsCharge(i);
612  const bool passes = negEFilter_->checkPassFilter(info.id(), &ts[0], nRead);
613  if (!passes)
615 }
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 575 of file HBHEPhase1Reconstructor.cc.

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

Referenced by processData().

579 {
580  if (setNoiseFlagsQIE8_)
581  hbheFlagSetterQIE8_->rememberHit(*rh);
582 
584  hbhePulseShapeFlagSetterQIE8_->SetPulseShapeFlags(*rh, frame, coder, calib);
585 
587  runHBHENegativeEFilter(info, rh);
588 }
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 590 of file HBHEPhase1Reconstructor.cc.

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

594 {
596  hbheFlagSetterQIE11_->rememberHit(*rh);
597 
599  hbhePulseShapeFlagSetterQIE11_->SetPulseShapeFlags(*rh, frame, coder, calib);
600 
602  runHBHENegativeEFilter(info, rh);
603 }
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 569 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

572 {
573 }

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

Referenced by HBHEPhase1Reconstructor(), and setAsicSpecificBits().

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

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

Referenced by produce(), and runHBHENegativeEFilter().

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

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

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

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

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

Referenced by produce(), and setAsicSpecificBits().

bool HBHEPhase1Reconstructor::setNegativeFlagsQIE8_
private

Definition at line 309 of file HBHEPhase1Reconstructor.cc.

Referenced by produce(), and setAsicSpecificBits().

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

Definition at line 314 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and setAsicSpecificBits().

bool HBHEPhase1Reconstructor::setPulseShapeFlagsQIE8_
private

Definition at line 313 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and setAsicSpecificBits().

int HBHEPhase1Reconstructor::sipmQNTStoSum_
private

Definition at line 306 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

int HBHEPhase1Reconstructor::sipmQTSShift_
private

Definition at line 305 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

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

Definition at line 318 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

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

Definition at line 317 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

bool HBHEPhase1Reconstructor::tsFromDB_
private

Definition at line 301 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

bool HBHEPhase1Reconstructor::use8ts_
private

Definition at line 304 of file HBHEPhase1Reconstructor.cc.

Referenced by produce().