CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::PreMixingCrossingFrameWorker< T > Class Template Reference
Inheritance diagram for edm::PreMixingCrossingFrameWorker< T >:
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
 
 PreMixingCrossingFrameWorker (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
 
 ~PreMixingCrossingFrameWorker () 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< PCrossingFrame< T > > merged_
 
edm::InputTag pileupTag_
 
edm::EDGetTokenT< CrossingFrame< T > > signalToken_
 

Detailed Description

template<typename T>
class edm::PreMixingCrossingFrameWorker< T >

Definition at line 16 of file PreMixingCrossingFrameWorker.cc.

Constructor & Destructor Documentation

◆ PreMixingCrossingFrameWorker()

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

Definition at line 38 of file PreMixingCrossingFrameWorker.cc.

References edm::PreMixingCrossingFrameWorker< T >::collectionDM_, and edm::ProducesCollector::produces().

42  pileupTag_(ps.getParameter<edm::InputTag>("pileInputTag")),
43  collectionDM_(ps.getParameter<std::string>("collectionDM")) {
44  producesCollector.produces<PCrossingFrame<T> >(
45  collectionDM_); // TODO: this is needed only to store the pointed-to objects, do we really need it?
46  producesCollector.produces<CrossingFrame<T> >(collectionDM_);
47  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
edm::EDGetTokenT< CrossingFrame< T > > signalToken_

◆ ~PreMixingCrossingFrameWorker()

template<typename T >
edm::PreMixingCrossingFrameWorker< T >::~PreMixingCrossingFrameWorker ( )
overridedefault

Member Function Documentation

◆ addPileups()

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

Implements PreMixingWorker.

Definition at line 63 of file PreMixingCrossingFrameWorker.cc.

References Exception, and PileUpEventPrincipal::getByLabel().

63  {
65  pep.getByLabel(pileupTag_, hcf);
66 
67  const auto& cf = *hcf;
68  if (!cf.getSignals().empty()) {
69  throw cms::Exception("LogicError") << "Got PCrossingFrame from pileup with signal content?";
70  }
71 
72  merged_->setAllExceptSignalFrom(cf);
73  }
std::unique_ptr< PCrossingFrame< T > > merged_

◆ addSignals()

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

Implements PreMixingWorker.

Definition at line 50 of file PreMixingCrossingFrameWorker.cc.

References Exception, and iEvent.

50  {
52  iEvent.getByToken(signalToken_, hcf);
53 
54  const auto& cf = *hcf;
55  if (!cf.getPileups().empty()) {
56  throw cms::Exception("LogicError") << "Got CrossingFrame from signal with pileup content?";
57  }
58 
59  merged_ = std::make_unique<PCrossingFrame<T> >(cf); // for signal we just copy
60  }
std::unique_ptr< PCrossingFrame< T > > merged_
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< CrossingFrame< T > > signalToken_

◆ initializeEvent()

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

Implements PreMixingWorker.

Definition at line 21 of file PreMixingCrossingFrameWorker.cc.

21 {}

◆ put()

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

Implements PreMixingWorker.

Definition at line 76 of file PreMixingCrossingFrameWorker.cc.

References nano_mu_digi_cff::bx, iEvent, and eostools::move().

79  {
80  auto orphanHandle = iEvent.put(std::move(merged_), collectionDM_);
81  const auto& pcf = *orphanHandle;
82 
83  const auto bx = pcf.getBunchRange();
84  auto cf = std::make_unique<CrossingFrame<T> >(
85  bx.first, bx.second, pcf.getBunchSpace(), pcf.getSubDet(), pcf.getMaxNbSources());
86  cf->addSignals(&(pcf.getSignals()), pcf.getEventID());
87  cf->setPileups(pcf.getPileups());
88  iEvent.put(std::move(cf), collectionDM_);
89  }
std::unique_ptr< PCrossingFrame< T > > merged_
int iEvent
Definition: GenABIO.cc:224
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ collectionDM_

template<typename T >
std::string edm::PreMixingCrossingFrameWorker< T >::collectionDM_
private

◆ merged_

template<typename T >
std::unique_ptr<PCrossingFrame<T> > edm::PreMixingCrossingFrameWorker< T >::merged_
private

Definition at line 34 of file PreMixingCrossingFrameWorker.cc.

◆ pileupTag_

template<typename T >
edm::InputTag edm::PreMixingCrossingFrameWorker< T >::pileupTag_
private

Definition at line 31 of file PreMixingCrossingFrameWorker.cc.

◆ signalToken_

template<typename T >
edm::EDGetTokenT<CrossingFrame<T> > edm::PreMixingCrossingFrameWorker< T >::signalToken_
private

Definition at line 30 of file PreMixingCrossingFrameWorker.cc.