CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PreMixingDigiSimLinkWorker< DigiSimLinkCollection > Class Template Reference

#include <PreMixingDigiSimLinkWorker.h>

Inheritance diagram for PreMixingDigiSimLinkWorker< DigiSimLinkCollection >:
PreMixingWorker

Public Member Functions

template<>
void addPileups (PileUpEventPrincipal const &pep, edm::EventSetup const &iSetup)
 
void addPileups (PileUpEventPrincipal const &pep, edm::EventSetup const &iSetup) override
 
void addSignals (edm::Event const &iEvent, edm::EventSetup const &iSetup) override
 
void initializeEvent (edm::Event const &iEvent, edm::EventSetup const &iSetup) override
 
 PreMixingDigiSimLinkWorker (const edm::ParameterSet &ps, edm::ProducesCollector, edm::ConsumesCollector &&iC)
 
void put (edm::Event &iEvent, edm::EventSetup const &iSetup, std::vector< PileupSummaryInfo > const &ps, int bunchSpacing) override
 
 ~PreMixingDigiSimLinkWorker () override=default
 
- Public Member Functions inherited from PreMixingWorker
virtual void beginLuminosityBlock (edm::LuminosityBlock const &iLumi, edm::EventSetup const &iSetup)
 
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 Attributes

std::string collectionDM_
 
std::unique_ptr< DigiSimLinkCollection > merged_
 
edm::InputTag pileupTag_
 
edm::EDGetTokenT< DigiSimLinkCollection > signalToken_
 

Detailed Description

template<typename DigiSimLinkCollection>
class PreMixingDigiSimLinkWorker< DigiSimLinkCollection >

Definition at line 16 of file PreMixingDigiSimLinkWorker.h.

Constructor & Destructor Documentation

◆ PreMixingDigiSimLinkWorker()

template<typename DigiSimLinkCollection >
PreMixingDigiSimLinkWorker< DigiSimLinkCollection >::PreMixingDigiSimLinkWorker ( const edm::ParameterSet ps,
edm::ProducesCollector  producesCollector,
edm::ConsumesCollector &&  iC 
)

Definition at line 38 of file PreMixingDigiSimLinkWorker.h.

41  : signalToken_(iC.consumes<DigiSimLinkCollection>(ps.getParameter<edm::InputTag>("labelSig"))),
42  pileupTag_(ps.getParameter<edm::InputTag>("pileInputTag")),
43  collectionDM_(ps.getParameter<std::string>("collectionDM")) {
44  producesCollector.produces<DigiSimLinkCollection>(collectionDM_);
45 }

References PreMixingDigiSimLinkWorker< DigiSimLinkCollection >::collectionDM_, and edm::ProducesCollector::produces().

◆ ~PreMixingDigiSimLinkWorker()

template<typename DigiSimLinkCollection >
PreMixingDigiSimLinkWorker< DigiSimLinkCollection >::~PreMixingDigiSimLinkWorker ( )
overridedefault

Member Function Documentation

◆ addPileups() [1/2]

template<>
void PreMixingDigiSimLinkWorker< DTDigiSimLinkCollection >::addPileups ( PileUpEventPrincipal const &  pep,
edm::EventSetup const &  iSetup 
)
virtual

Implements PreMixingWorker.

Definition at line 7 of file PreMixingDTDigiSimLinkWorker.cc.

8  {
10  pep.getByLabel(pileupTag_, digis);
11  if (digis.isValid()) {
12  for (const auto &elem : *digis) {
13  merged_->put(elem.second, elem.first);
14  }
15  }
16 }

References PileUpEventPrincipal::getByLabel(), and edm::HandleBase::isValid().

◆ addPileups() [2/2]

template<typename DigiSimLinkCollection >
void PreMixingDigiSimLinkWorker< DigiSimLinkCollection >::addPileups ( PileUpEventPrincipal const &  pep,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements PreMixingWorker.

Definition at line 61 of file PreMixingDigiSimLinkWorker.h.

62  {
64  pep.getByLabel(pileupTag_, digis);
65  if (digis.isValid()) {
66  for (const auto& detsetSource : *digis) {
67  auto& detsetTarget = merged_->find_or_insert(detsetSource.detId());
68  std::copy(detsetSource.begin(), detsetSource.end(), std::back_inserter(detsetTarget));
69  }
70  }
71 }

References filterCSVwithJSON::copy, PileUpEventPrincipal::getByLabel(), and edm::HandleBase::isValid().

◆ addSignals()

template<typename DigiSimLinkCollection >
void PreMixingDigiSimLinkWorker< DigiSimLinkCollection >::addSignals ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements PreMixingWorker.

Definition at line 48 of file PreMixingDigiSimLinkWorker.h.

49  {
51  iEvent.getByToken(signalToken_, digis);
52 
53  if (digis.isValid()) {
54  merged_ = std::make_unique<DigiSimLinkCollection>(*digis); // for signal we can just copy
55  } else {
56  merged_ = std::make_unique<DigiSimLinkCollection>();
57  }
58 }

References iEvent, and edm::HandleBase::isValid().

◆ initializeEvent()

template<typename DigiSimLinkCollection >
void PreMixingDigiSimLinkWorker< DigiSimLinkCollection >::initializeEvent ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
inlineoverridevirtual

Implements PreMixingWorker.

Definition at line 21 of file PreMixingDigiSimLinkWorker.h.

21 {}

◆ put()

template<typename DigiSimLinkCollection >
void PreMixingDigiSimLinkWorker< DigiSimLinkCollection >::put ( edm::Event iEvent,
edm::EventSetup const &  iSetup,
std::vector< PileupSummaryInfo > const &  ps,
int  bunchSpacing 
)
overridevirtual

Implements PreMixingWorker.

Definition at line 74 of file PreMixingDigiSimLinkWorker.h.

77  {
79 }

References iEvent, and eostools::move().

Member Data Documentation

◆ collectionDM_

template<typename DigiSimLinkCollection >
std::string PreMixingDigiSimLinkWorker< DigiSimLinkCollection >::collectionDM_
private

◆ merged_

template<typename DigiSimLinkCollection >
std::unique_ptr<DigiSimLinkCollection> PreMixingDigiSimLinkWorker< DigiSimLinkCollection >::merged_
private

Definition at line 34 of file PreMixingDigiSimLinkWorker.h.

◆ pileupTag_

template<typename DigiSimLinkCollection >
edm::InputTag PreMixingDigiSimLinkWorker< DigiSimLinkCollection >::pileupTag_
private

Definition at line 31 of file PreMixingDigiSimLinkWorker.h.

◆ signalToken_

template<typename DigiSimLinkCollection >
edm::EDGetTokenT<DigiSimLinkCollection> PreMixingDigiSimLinkWorker< DigiSimLinkCollection >::signalToken_
private

Definition at line 30 of file PreMixingDigiSimLinkWorker.h.

filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
PreMixingDigiSimLinkWorker::signalToken_
edm::EDGetTokenT< DigiSimLinkCollection > signalToken_
Definition: PreMixingDigiSimLinkWorker.h:30
edm::Handle
Definition: AssociativeIterator.h:50
PreMixingDigiSimLinkWorker::pileupTag_
edm::InputTag pileupTag_
Definition: PreMixingDigiSimLinkWorker.h:31
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PreMixingDigiSimLinkWorker::merged_
std::unique_ptr< DigiSimLinkCollection > merged_
Definition: PreMixingDigiSimLinkWorker.h:34
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::ProducesCollector::produces
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
Definition: ProducesCollector.h:52
PreMixingDigiSimLinkWorker::collectionDM_
std::string collectionDM_
Definition: PreMixingDigiSimLinkWorker.h:32
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15