CMS 3D CMS Logo

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

Public Member Functions

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
 
 PreMixingMtdTruthWorker (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
 
 ~PreMixingMtdTruthWorker () 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 Member Functions

void add (const MtdSimLayerClusterCollection &clusters)
 

Private Attributes

edm::InputTag clusterPileInputTag_
 
std::string mtdSimLCCollectionDM_
 
std::unique_ptr< MtdSimLayerClusterCollectionnewClusters_
 
edm::EDGetTokenT< MtdSimLayerClusterCollectionsigClusterToken_
 

Detailed Description

Definition at line 15 of file PreMixingMtdTruthWorker.cc.

Constructor & Destructor Documentation

◆ PreMixingMtdTruthWorker()

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

Definition at line 39 of file PreMixingMtdTruthWorker.cc.

References mtdSimLCCollectionDM_, and edm::ProducesCollector::produces().

43  clusterPileInputTag_(ps.getParameter<edm::InputTag>("pileInputTag")),
44  mtdSimLCCollectionDM_(ps.getParameter<std::string>("collectionDM")) {
46 }
std::vector< MtdSimLayerCluster > MtdSimLayerClusterCollection
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
edm::EDGetTokenT< MtdSimLayerClusterCollection > sigClusterToken_

◆ ~PreMixingMtdTruthWorker()

PreMixingMtdTruthWorker::~PreMixingMtdTruthWorker ( )
overridedefault

Member Function Documentation

◆ add()

void PreMixingMtdTruthWorker::add ( const MtdSimLayerClusterCollection clusters)
private

Definition at line 70 of file PreMixingMtdTruthWorker.cc.

References bsc_activity_cfg::clusters, filterCSVwithJSON::copy, and newClusters_.

Referenced by addPileups(), addSignals(), and counter.Counter::register().

70  {
71  // Copy MtdSimLayerClusters
72  newClusters_->reserve(newClusters_->size() + clusters.size());
73  std::copy(clusters.begin(), clusters.end(), std::back_inserter(*newClusters_));
74 }
std::unique_ptr< MtdSimLayerClusterCollection > newClusters_

◆ addPileups()

void PreMixingMtdTruthWorker::addPileups ( PileUpEventPrincipal const &  pep,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements PreMixingWorker.

Definition at line 61 of file PreMixingMtdTruthWorker.cc.

References add(), clusterPileInputTag_, bsc_activity_cfg::clusters, and PileUpEventPrincipal::getByLabel().

61  {
63  pep.getByLabel(clusterPileInputTag_, clusters);
64 
65  if (clusters.isValid()) {
66  add(*clusters);
67  }
68 }
void add(const MtdSimLayerClusterCollection &clusters)

◆ addSignals()

void PreMixingMtdTruthWorker::addSignals ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements PreMixingWorker.

Definition at line 52 of file PreMixingMtdTruthWorker.cc.

References add(), bsc_activity_cfg::clusters, iEvent, and sigClusterToken_.

52  {
54  iEvent.getByToken(sigClusterToken_, clusters);
55 
56  if (clusters.isValid()) {
57  add(*clusters);
58  }
59 }
void add(const MtdSimLayerClusterCollection &clusters)
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< MtdSimLayerClusterCollection > sigClusterToken_

◆ initializeEvent()

void PreMixingMtdTruthWorker::initializeEvent ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements PreMixingWorker.

Definition at line 48 of file PreMixingMtdTruthWorker.cc.

References newClusters_.

48  {
49  newClusters_ = std::make_unique<MtdSimLayerClusterCollection>();
50 }
std::unique_ptr< MtdSimLayerClusterCollection > newClusters_

◆ put()

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

Implements PreMixingWorker.

Definition at line 76 of file PreMixingMtdTruthWorker.cc.

References iEvent, eostools::move(), mtdSimLCCollectionDM_, and newClusters_.

79  {
81 }
int iEvent
Definition: GenABIO.cc:224
std::unique_ptr< MtdSimLayerClusterCollection > newClusters_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ clusterPileInputTag_

edm::InputTag PreMixingMtdTruthWorker::clusterPileInputTag_
private

Definition at line 33 of file PreMixingMtdTruthWorker.cc.

Referenced by addPileups().

◆ mtdSimLCCollectionDM_

std::string PreMixingMtdTruthWorker::mtdSimLCCollectionDM_
private

Definition at line 34 of file PreMixingMtdTruthWorker.cc.

Referenced by PreMixingMtdTruthWorker(), and put().

◆ newClusters_

std::unique_ptr<MtdSimLayerClusterCollection> PreMixingMtdTruthWorker::newClusters_
private

Definition at line 36 of file PreMixingMtdTruthWorker.cc.

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

◆ sigClusterToken_

edm::EDGetTokenT<MtdSimLayerClusterCollection> PreMixingMtdTruthWorker::sigClusterToken_
private

Definition at line 31 of file PreMixingMtdTruthWorker.cc.

Referenced by addSignals().