test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HBHEPhase1Reconstructor (const edm::ParameterSet &)
 
 ~HBHEPhase1Reconstructor ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector
< edm::ProductResolverIndex >
const & 
indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector
< ProductResolverIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void beginRun (edm::Run const &, edm::EventSetup const &) override
 
virtual 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)
 
virtual 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
< HBHEStatusBitSetter
hbheFlagSetterQIE11_
 
std::unique_ptr
< HBHEStatusBitSetter
hbheFlagSetterQIE8_
 
std::unique_ptr
< HBHEPulseShapeFlagSetter
hbhePulseShapeFlagSetterQIE11_
 
std::unique_ptr
< HBHEPulseShapeFlagSetter
hbhePulseShapeFlagSetterQIE8_
 
bool makeRecHits_
 
const HBHENegativeEFilternegEFilter_
 
std::unique_ptr< HcalRecoParamsparamTS_
 
bool processQIE11_
 
bool processQIE8_
 
std::unique_ptr
< AbsHBHEPhase1Algo
reco_
 
std::unique_ptr< AbsHcalAlgoDatarecoConfig_
 
bool recoParamsFromDB_
 
bool saveDroppedInfos_
 
bool saveInfos_
 
bool setNegativeFlags_
 
bool setNoiseFlagsQIE11_
 
bool setNoiseFlagsQIE8_
 
bool setPulseShapeFlagsQIE11_
 
bool setPulseShapeFlagsQIE8_
 
edm::EDGetTokenT
< QIE11DigiCollection
tok_qie11_
 
edm::EDGetTokenT
< HBHEDigiCollection
tok_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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: Phase 1 reconstruction module for HB/HE

Implementation: [Notes on implementation]

Definition at line 264 of file HBHEPhase1Reconstructor.cc.

Constructor & Destructor Documentation

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

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

338  : algoConfigClass_(conf.getParameter<std::string>("algoConfigClass")),
339  processQIE8_(conf.getParameter<bool>("processQIE8")),
340  processQIE11_(conf.getParameter<bool>("processQIE11")),
341  saveInfos_(conf.getParameter<bool>("saveInfos")),
342  saveDroppedInfos_(conf.getParameter<bool>("saveDroppedInfos")),
343  makeRecHits_(conf.getParameter<bool>("makeRecHits")),
344  dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed")),
345  tsFromDB_(conf.getParameter<bool>("tsFromDB")),
346  recoParamsFromDB_(conf.getParameter<bool>("recoParamsFromDB")),
347  setNegativeFlags_(conf.getParameter<bool>("setNegativeFlags")),
348  setNoiseFlagsQIE8_(conf.getParameter<bool>("setNoiseFlagsQIE8")),
349  setNoiseFlagsQIE11_(conf.getParameter<bool>("setNoiseFlagsQIE11")),
350  setPulseShapeFlagsQIE8_(conf.getParameter<bool>("setPulseShapeFlagsQIE8")),
351  setPulseShapeFlagsQIE11_(conf.getParameter<bool>("setPulseShapeFlagsQIE11")),
353  negEFilter_(nullptr)
354 {
355  // Check that the reco algorithm has been successfully configured
356  if (!reco_.get())
357  throw cms::Exception("HBHEPhase1BadConfig")
358  << "Invalid HBHEPhase1Algo algorithm configuration"
359  << std::endl;
360 
361  // Configure the status bit setters that have been turned on
362  if (setNoiseFlagsQIE8_)
363  hbheFlagSetterQIE8_ = parse_HBHEStatusBitSetter(
364  conf.getParameter<edm::ParameterSet>("flagParametersQIE8"));
365 
367  hbheFlagSetterQIE11_ = parse_HBHEStatusBitSetter(
368  conf.getParameter<edm::ParameterSet>("flagParametersQIE11"));
369 
371  hbhePulseShapeFlagSetterQIE8_ = parse_HBHEPulseShapeFlagSetter(
372  conf.getParameter<edm::ParameterSet>("pulseShapeParametersQIE8"),
373  conf.getParameter<bool>("setLegacyFlagsQIE8"));
374 
376  hbhePulseShapeFlagSetterQIE11_ = parse_HBHEPulseShapeFlagSetter(
377  conf.getParameter<edm::ParameterSet>("pulseShapeParametersQIE11"),
378  conf.getParameter<bool>("setLegacyFlagsQIE11"));
379 
380  // Consumes and produces statements
381  if (processQIE8_)
382  tok_qie8_ = consumes<HBHEDigiCollection>(
383  conf.getParameter<edm::InputTag>("digiLabelQIE8"));
384 
385  if (processQIE11_)
386  tok_qie11_ = consumes<QIE11DigiCollection>(
387  conf.getParameter<edm::InputTag>("digiLabelQIE11"));
388 
389  if (saveInfos_)
390  produces<HBHEChannelInfoCollection>();
391 
392  if (makeRecHits_)
393  produces<HBHERecHitCollection>();
394 }
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 ( )

Definition at line 397 of file HBHEPhase1Reconstructor.cc.

398 {
399  // do anything here that needs to be done at destruction time
400  // (e.g. close files, deallocate resources etc.)
401 }

Member Function Documentation

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

Reimplemented from edm::stream::EDProducerBase.

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< class >::product(), reco_, recoConfig_, setNoiseFlagsQIE11_, and setNoiseFlagsQIE8_.

660 {
662  es.get<HcalRecoParamsRcd>().get(p);
663  paramTS_ = std::make_unique<HcalRecoParams>(*p.product());
664 
665  if (reco_->isConfigurable())
666  {
668  if (!recoConfig_.get())
669  throw cms::Exception("HBHEPhase1BadConfig")
670  << "Invalid HBHEPhase1Reconstructor \"algoConfigClass\" parameter value \""
671  << algoConfigClass_ << '"' << std::endl;
672  if (!reco_->configure(recoConfig_.get()))
673  throw cms::Exception("HBHEPhase1BadConfig")
674  << "Failed to configure HBHEPhase1Algo algorithm from EventSetup"
675  << std::endl;
676  }
677 
679  {
681  es.get<HcalFrontEndMapRcd>().get(hfemap);
682  if (hfemap.isValid())
683  {
684  if (setNoiseFlagsQIE8_)
685  hbheFlagSetterQIE8_->SetFrontEndMap(hfemap.product());
687  hbheFlagSetterQIE11_->SetFrontEndMap(hfemap.product());
688  }
689  else
690  edm::LogWarning("EventSetup") <<
691  "HBHEPhase1Reconstructor failed to get HcalFrontEndMap!" << std::endl;
692  }
693 
694  reco_->beginRun(r, es);
695 }
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_
T const * product() const
Definition: ESHandle.h:86
std::unique_ptr< AbsHcalAlgoData > recoConfig_
bool isValid() const
Definition: ESHandle.h:47
void HBHEPhase1Reconstructor::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 698 of file HBHEPhase1Reconstructor.cc.

References reco_.

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

Definition at line 710 of file HBHEPhase1Reconstructor.cc.

References edm::ParameterSetDescription::add(), add_param_set, edm::ConfigurationDescriptions::addDefault(), HLT_25ns10e33_v2_cff::algorithm, and AlCaHLTBitMon_QueryRunRegistry::string.

711 {
713 
714  desc.add<edm::InputTag>("digiLabelQIE8");
715  desc.add<edm::InputTag>("digiLabelQIE11");
716  desc.add<std::string>("algoConfigClass");
717  desc.add<bool>("processQIE8");
718  desc.add<bool>("processQIE11");
719  desc.add<bool>("saveInfos");
720  desc.add<bool>("saveDroppedInfos");
721  desc.add<bool>("makeRecHits");
722  desc.add<bool>("dropZSmarkedPassed");
723  desc.add<bool>("tsFromDB");
724  desc.add<bool>("recoParamsFromDB");
725  desc.add<bool>("setNegativeFlags");
726  desc.add<bool>("setNoiseFlagsQIE8");
727  desc.add<bool>("setNoiseFlagsQIE11");
728  desc.add<bool>("setPulseShapeFlagsQIE8");
729  desc.add<bool>("setPulseShapeFlagsQIE11");
730  desc.add<bool>("setLegacyFlagsQIE8");
731  desc.add<bool>("setLegacyFlagsQIE11");
732 
734  add_param_set(flagParametersQIE8);
735  add_param_set(flagParametersQIE11);
736  add_param_set(pulseShapeParametersQIE8);
737  add_param_set(pulseShapeParametersQIE11);
738 
739  descriptions.addDefault(desc);
740 }
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 408 of file HBHEPhase1Reconstructor.cc.

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

416 {
417  // If "saveDroppedInfos_" flag is set, fill the info with something
418  // meaningful even if the database tells us to drop this channel.
419  // Note that this flag affects only "infos", the rechits are still
420  // not going to be constructed from such channels.
421  const bool skipDroppedChannels = !(infos && saveDroppedInfos_);
422 
423  // Iterate over the input collection
424  for (typename Collection::const_iterator it = coll.begin();
425  it != coll.end(); ++it)
426  {
427  const DFrame& frame(*it);
428  const HcalDetId cell(frame.id());
429  const HcalRecoParam* param_ts = paramTS_->getValues(cell.rawId());
430 
431  // Check if the database tells us to drop this channel
432  const HcalChannelStatus* mydigistatus = qual.getValues(cell.rawId());
433  const bool taggedBadByDb = severity.dropChannel(mydigistatus->getValue());
434  if (taggedBadByDb && skipDroppedChannels)
435  continue;
436 
437  // Check if the channel is zero suppressed
438  bool dropByZS = false;
440  if (frame.zsMarkAndPass())
441  dropByZS = true;
442  if (dropByZS && skipDroppedChannels)
443  continue;
444 
445  // Basic ADC decoding tools
446  const HcalCalibrations& calib = cond.getHcalCalibrations(cell);
447  const HcalCalibrationWidths& calibWidth = cond.getHcalCalibrationWidths(cell);
448  const HcalQIECoder* channelCoder = cond.getHcalCoder(cell);
449  const HcalQIEShape* shape = cond.getHcalShape(channelCoder);
450  const HcalCoderDb coder(*channelCoder, *shape);
451  const RawChargeFromSample<DFrame> rcfs(cond, cell);
452 
453  // needed for the dark current in the M2
454  const HcalSiPMParameter& siPMParameter(*cond.getHcalSiPMParameter(cell));
455  const double darkCurrent = siPMParameter.getDarkCurrent();
456  const double fcByPE = siPMParameter.getFCByPE();
457  const double lambda = cond.getHcalSiPMCharacteristics()->getCrossTalk(siPMParameter.getType());
458 
459  // ADC to fC conversion
460  CaloSamples cs;
461  coder.adc2fC(frame, cs);
462 
463  // Prepare to iterate over time slices
464  const int nRead = cs.size();
465  const int maxTS = std::min(nRead, static_cast<int>(HBHEChannelInfo::MAXSAMPLES));
466  const int soi = tsFromDB_ ? param_ts->firstSample() : frame.presamples();
467  int soiCapid = 4;
468 
469  // Go over time slices and fill the samples
470  for (int ts = 0; ts < maxTS; ++ts)
471  {
472  auto s(frame[ts]);
473  const uint8_t adc = s.adc();
474  const int capid = s.capid();
475  const double pedestal = calib.pedestal(capid);
476  const double pedestalWidth = calibWidth.pedestal(capid);
477  const double gain = calib.respcorrgain(capid);
478  const double gainWidth = calibWidth.gain(capid);
479  const double rawCharge = rcfs.getRawCharge(cs[ts], pedestal);
480  const float t = getTDCTimeFromSample(s);
481  const float dfc = getDifferentialChargeGain(*channelCoder, *shape, adc,
482  capid, channelInfo->hasTimeInfo());
483  channelInfo->setSample(ts, adc, dfc, rawCharge,
484  pedestal, pedestalWidth,
485  gain, gainWidth, t);
486  if (ts == soi)
487  soiCapid = capid;
488  }
489 
490  // Fill the overall channel info items
491  const int pulseShapeID = param_ts->pulseShapeID();
492  const std::pair<bool,bool> hwerr = findHWErrors(frame, maxTS);
493  channelInfo->setChannelInfo(cell, pulseShapeID, maxTS, soi, soiCapid,
494  darkCurrent, fcByPE, lambda,
495  hwerr.first, hwerr.second,
496  taggedBadByDb || dropByZS);
497 
498  // If needed, add the channel info to the output collection
499  const bool makeThisRechit = !channelInfo->isDropped();
500  if (infos && (saveDroppedInfos_ || makeThisRechit))
501  infos->push_back(*channelInfo);
502 
503  // Reconstruct the rechit
504  if (rechits && makeThisRechit)
505  {
506  const HcalRecoParam* pptr = nullptr;
507  if (recoParamsFromDB_)
508  pptr = param_ts;
509  HBHERecHit rh = reco_->reconstruct(*channelInfo, pptr, calib, isRealData);
510  if (rh.id().rawId())
511  {
512  setAsicSpecificBits(frame, coder, *channelInfo, calib, &rh);
513  setCommonStatusBits(*channelInfo, calib, &rh);
514  rechits->push_back(rh);
515  }
516  }
517  }
518 }
int adc(sample_type sample)
get the ADC sample (12 bits)
double gain(int fCapId) const
get gain width for capid=0..3
double respcorrgain(int fCapId) const
get response corrected gain for capid=0..3
auto_ptr< ClusterSequence > cs
int maxTS(DIGI const &digi, double ped=0)
Definition: Utilities.h:51
void setCommonStatusBits(const HBHEChannelInfo &info, const HcalCalibrations &calib, HBHERecHit *rh)
HcalDetId id() const
get the id
Definition: HBHERecHit.h:23
void push_back(T const &t)
double pedestal(int fCapId) const
get pedestal for capid=0..3
const Item * getValues(DetId fId, bool throwOnFail=true) const
float getCrossTalk(int type) const
get cross talk
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
std::unique_ptr< HcalRecoParams > paramTS_
MVATrainerComputer * calib
Definition: MVATrainer.cc:64
static const unsigned MAXSAMPLES
double pedestal(int fCapId) const
get pedestal width for capid=0..3
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
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
void HBHEPhase1Reconstructor::produce ( edm::Event e,
const edm::EventSetup eventSetup 
)
overrideprivatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 566 of file HBHEPhase1Reconstructor.cc.

References edm::EventSetup::get(), edm::Event::getByToken(), hbheFlagSetterQIE11_, hbheFlagSetterQIE8_, benchmark_cfg::infos, edm::EventBase::isRealData(), makeRecHits_, eostools::move(), negEFilter_, GenerateHcalLaserBadRunList::out, AlCaHLTBitMon_ParallelJobs::p, paramTS_, processQIE11_, processQIE8_, edm::Event::put(), saveInfos_, setNegativeFlags_, setNoiseFlagsQIE11_, setNoiseFlagsQIE8_, tok_qie11_, and tok_qie8_.

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

Definition at line 552 of file HBHEPhase1Reconstructor.cc.

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

Referenced by setCommonStatusBits().

554 {
555  double ts[HBHEChannelInfo::MAXSAMPLES];
556  const unsigned nRead = info.nSamples();
557  for (unsigned i=0; i<nRead; ++i)
558  ts[i] = info.tsCharge(i);
559  const bool passes = negEFilter_->checkPassFilter(info.id(), &ts[0], nRead);
560  if (!passes)
562 }
const HBHENegativeEFilter * negEFilter_
int i
Definition: DBlmapReader.cc:9
void setFlagField(uint32_t value, int base, int width=1)
Definition: CaloRecHit.cc:20
HcalDetId id() const
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 528 of file HBHEPhase1Reconstructor.cc.

References hbheFlagSetterQIE8_, hbhePulseShapeFlagSetterQIE8_, setNoiseFlagsQIE8_, and setPulseShapeFlagsQIE8_.

Referenced by processData().

532 {
533  if (setNoiseFlagsQIE8_)
534  hbheFlagSetterQIE8_->rememberHit(*rh);
535 
537  hbhePulseShapeFlagSetterQIE8_->SetPulseShapeFlags(*rh, frame, coder, calib);
538 }
std::unique_ptr< HBHEPulseShapeFlagSetter > hbhePulseShapeFlagSetterQIE8_
std::unique_ptr< HBHEStatusBitSetter > hbheFlagSetterQIE8_
void HBHEPhase1Reconstructor::setAsicSpecificBits ( const QIE11DataFrame frame,
const HcalCoder coder,
const HBHEChannelInfo info,
const HcalCalibrations calib,
HBHERecHit rh 
)
private

Definition at line 540 of file HBHEPhase1Reconstructor.cc.

References hbheFlagSetterQIE11_, hbhePulseShapeFlagSetterQIE11_, setNoiseFlagsQIE11_, and setPulseShapeFlagsQIE11_.

544 {
546  hbheFlagSetterQIE11_->rememberHit(*rh);
547 
549  hbhePulseShapeFlagSetterQIE11_->SetPulseShapeFlags(*rh, frame, coder, calib);
550 }
std::unique_ptr< HBHEStatusBitSetter > hbheFlagSetterQIE11_
std::unique_ptr< HBHEPulseShapeFlagSetter > hbhePulseShapeFlagSetterQIE11_
void HBHEPhase1Reconstructor::setCommonStatusBits ( const HBHEChannelInfo info,
const HcalCalibrations calib,
HBHERecHit rh 
)
private

Definition at line 520 of file HBHEPhase1Reconstructor.cc.

References runHBHENegativeEFilter(), and setNegativeFlags_.

Referenced by processData().

523 {
524  if (setNegativeFlags_)
525  runHBHENegativeEFilter(info, rh);
526 }
void runHBHENegativeEFilter(const HBHEChannelInfo &info, HBHERecHit *rh)

Member Data Documentation

std::string HBHEPhase1Reconstructor::algoConfigClass_
private

Definition at line 278 of file HBHEPhase1Reconstructor.cc.

Referenced by beginRun().

bool HBHEPhase1Reconstructor::dropZSmarkedPassed_
private

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

Referenced by HBHEPhase1Reconstructor(), and setAsicSpecificBits().

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

Definition at line 306 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and setAsicSpecificBits().

bool HBHEPhase1Reconstructor::makeRecHits_
private

Definition at line 283 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

const HBHENegativeEFilter* HBHEPhase1Reconstructor::negEFilter_
private

Definition at line 303 of file HBHEPhase1Reconstructor.cc.

Referenced by produce(), and runHBHENegativeEFilter().

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

Definition at line 300 of file HBHEPhase1Reconstructor.cc.

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

bool HBHEPhase1Reconstructor::processQIE11_
private

Definition at line 280 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

bool HBHEPhase1Reconstructor::processQIE8_
private

Definition at line 279 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

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

Definition at line 298 of file HBHEPhase1Reconstructor.cc.

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

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

Definition at line 299 of file HBHEPhase1Reconstructor.cc.

Referenced by beginRun().

bool HBHEPhase1Reconstructor::recoParamsFromDB_
private

Definition at line 286 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

bool HBHEPhase1Reconstructor::saveDroppedInfos_
private

Definition at line 282 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().

bool HBHEPhase1Reconstructor::saveInfos_
private

Definition at line 281 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

bool HBHEPhase1Reconstructor::setNegativeFlags_
private

Definition at line 289 of file HBHEPhase1Reconstructor.cc.

Referenced by produce(), and setCommonStatusBits().

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

Definition at line 293 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and setAsicSpecificBits().

bool HBHEPhase1Reconstructor::setPulseShapeFlagsQIE8_
private

Definition at line 292 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and setAsicSpecificBits().

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

Definition at line 297 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

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

Definition at line 296 of file HBHEPhase1Reconstructor.cc.

Referenced by HBHEPhase1Reconstructor(), and produce().

bool HBHEPhase1Reconstructor::tsFromDB_
private

Definition at line 285 of file HBHEPhase1Reconstructor.cc.

Referenced by processData().