CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
PreMixingPhase2TrackerWorker Class Reference
Inheritance diagram for PreMixingPhase2TrackerWorker:
PreMixingWorker

Public Member Functions

void addPileups (PileUpEventPrincipal const &pep, edm::EventSetup const &es) override
 
void addSignals (edm::Event const &e, edm::EventSetup const &es) override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &es) override
 
void initializeEvent (edm::Event const &e, edm::EventSetup const &es) override
 
 PreMixingPhase2TrackerWorker (const edm::ParameterSet &ps, edm::ProducesCollector, edm::ConsumesCollector &&iC)
 
void put (edm::Event &e, edm::EventSetup const &iSetup, std::vector< PileupSummaryInfo > const &ps, int bs) override
 
 ~PreMixingPhase2TrackerWorker () override=default
 
- Public Member Functions inherited from PreMixingWorker
virtual void beginRun (edm::Run const &iRun, edm::EventSetup const &iSetup)
 
virtual void endRun ()
 
virtual void finalizeBunchCrossing (edm::Event &iEvent, edm::EventSetup const &iSetup, int bunchCrossing)
 
virtual void initializeBunchCrossing (edm::Event const &iEvent, edm::EventSetup const &iSetup, int bunchCrossing)
 
 PreMixingWorker ()=default
 
virtual ~PreMixingWorker ()=default
 

Private Types

using SignalMap = std::map< unsigned int, std::map< int, float >>
 

Private Member Functions

void accumulate (const edm::DetSetVector< PixelDigi > &digis)
 

Private Attributes

SignalMap accumulator_
 
cms::Phase2TrackerDigitizer digitizer_
 
float electronPerAdc_
 
edm::InputTag pixelPileupLabel_
 
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > pixelSignalToken_
 
edm::InputTag trackerPileupLabel_
 
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > trackerSignalToken_
 

Detailed Description

Definition at line 21 of file PreMixingPhase2TrackerWorker.cc.

Member Typedef Documentation

using PreMixingPhase2TrackerWorker::SignalMap = std::map<unsigned int, std::map<int, float>>
private

Definition at line 46 of file PreMixingPhase2TrackerWorker.cc.

Constructor & Destructor Documentation

PreMixingPhase2TrackerWorker::PreMixingPhase2TrackerWorker ( const edm::ParameterSet ps,
edm::ProducesCollector  producesCollector,
edm::ConsumesCollector &&  iC 
)

Definition at line 50 of file PreMixingPhase2TrackerWorker.cc.

53  : digitizer_(ps, producesCollector, iC),
56  pixelPileupLabel_(ps.getParameter<edm::InputTag>("pixelPileInputTag")),
57  trackerPileupLabel_(ps.getParameter<edm::InputTag>("trackerPileInputTag")),
58  electronPerAdc_(ps.getParameter<double>("premixStage1ElectronPerAdc")) {}
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
cms::Phase2TrackerDigitizer digitizer_
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > pixelSignalToken_
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > trackerSignalToken_
PreMixingPhase2TrackerWorker::~PreMixingPhase2TrackerWorker ( )
overridedefault

Member Function Documentation

void PreMixingPhase2TrackerWorker::accumulate ( const edm::DetSetVector< PixelDigi > &  digis)
private

Definition at line 86 of file PreMixingPhase2TrackerWorker.cc.

References accumulator_, and electronPerAdc_.

Referenced by addPileups(), and addSignals().

86  {
87  for (const auto& detset : digis) {
88  auto& accDet = accumulator_[detset.detId()];
89  for (const auto& digi : detset) {
90  // note: according to C++ standard operator[] does
91  // value-initializiation, which for float means initial value of 0
92  auto& acc = accDet[digi.channel()];
93  acc += digi.adc() * electronPerAdc_;
94  }
95  }
96 }
void PreMixingPhase2TrackerWorker::addPileups ( PileUpEventPrincipal const &  pep,
edm::EventSetup const &  es 
)
overridevirtual

Implements PreMixingWorker.

Definition at line 77 of file PreMixingPhase2TrackerWorker.cc.

References accumulate(), PileUpEventPrincipal::getByLabel(), pixelPileupLabel_, and trackerPileupLabel_.

77  {
79  pep.getByLabel(pixelPileupLabel_, hdigis);
80  accumulate(*hdigis);
81 
82  pep.getByLabel(trackerPileupLabel_, hdigis);
83  accumulate(*hdigis);
84 }
void accumulate(const edm::DetSetVector< PixelDigi > &digis)
void PreMixingPhase2TrackerWorker::addSignals ( edm::Event const &  e,
edm::EventSetup const &  es 
)
overridevirtual

Implements PreMixingWorker.

Definition at line 68 of file PreMixingPhase2TrackerWorker.cc.

References accumulate(), edm::Event::getByToken(), pixelSignalToken_, and trackerSignalToken_.

68  {
70  e.getByToken(pixelSignalToken_, hdigis);
71  accumulate(*hdigis);
72 
73  e.getByToken(trackerSignalToken_, hdigis);
74  accumulate(*hdigis);
75 }
void accumulate(const edm::DetSetVector< PixelDigi > &digis)
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > pixelSignalToken_
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > trackerSignalToken_
void PreMixingPhase2TrackerWorker::beginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  es 
)
overridevirtual

Reimplemented from PreMixingWorker.

Definition at line 60 of file PreMixingPhase2TrackerWorker.cc.

References cms::Phase2TrackerDigitizer::beginLuminosityBlock(), and digitizer_.

60  {
62 }
void beginLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &iSetup) override
cms::Phase2TrackerDigitizer digitizer_
void PreMixingPhase2TrackerWorker::initializeEvent ( edm::Event const &  e,
edm::EventSetup const &  es 
)
overridevirtual

Implements PreMixingWorker.

Definition at line 64 of file PreMixingPhase2TrackerWorker.cc.

References digitizer_, and cms::Phase2TrackerDigitizer::initializeEvent().

64  {
66 }
void initializeEvent(edm::Event const &e, edm::EventSetup const &c) override
cms::Phase2TrackerDigitizer digitizer_
void PreMixingPhase2TrackerWorker::put ( edm::Event e,
edm::EventSetup const &  iSetup,
std::vector< PileupSummaryInfo > const &  ps,
int  bs 
)
overridevirtual

Implements PreMixingWorker.

Definition at line 98 of file PreMixingPhase2TrackerWorker.cc.

References accumulator_, DEFINE_PREMIXING_WORKER, digitizer_, cms::Phase2TrackerDigitizer::finalizeEvent(), and cms::Phase2TrackerDigitizer::loadAccumulator().

101  {
103  digitizer_.finalizeEvent(e, iSetup);
104  decltype(accumulator_){}.swap(accumulator_); // release memory
105 }
void finalizeEvent(edm::Event &e, edm::EventSetup const &c) override
void loadAccumulator(const std::map< unsigned int, std::map< int, float > > &accumulator)
cms::Phase2TrackerDigitizer digitizer_

Member Data Documentation

SignalMap PreMixingPhase2TrackerWorker::accumulator_
private

Definition at line 47 of file PreMixingPhase2TrackerWorker.cc.

Referenced by accumulate(), and put().

cms::Phase2TrackerDigitizer PreMixingPhase2TrackerWorker::digitizer_
private

Definition at line 36 of file PreMixingPhase2TrackerWorker.cc.

Referenced by beginLuminosityBlock(), initializeEvent(), and put().

float PreMixingPhase2TrackerWorker::electronPerAdc_
private

Definition at line 42 of file PreMixingPhase2TrackerWorker.cc.

Referenced by accumulate().

edm::InputTag PreMixingPhase2TrackerWorker::pixelPileupLabel_
private

Definition at line 40 of file PreMixingPhase2TrackerWorker.cc.

Referenced by addPileups().

edm::EDGetTokenT<edm::DetSetVector<PixelDigi> > PreMixingPhase2TrackerWorker::pixelSignalToken_
private

Definition at line 38 of file PreMixingPhase2TrackerWorker.cc.

Referenced by addSignals().

edm::InputTag PreMixingPhase2TrackerWorker::trackerPileupLabel_
private

Definition at line 41 of file PreMixingPhase2TrackerWorker.cc.

Referenced by addPileups().

edm::EDGetTokenT<edm::DetSetVector<PixelDigi> > PreMixingPhase2TrackerWorker::trackerSignalToken_
private

Definition at line 39 of file PreMixingPhase2TrackerWorker.cc.

Referenced by addSignals().