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

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
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
edm::EDGetTokenT< CrossingFrame< T > > signalToken_
template<typename T >
edm::PreMixingCrossingFrameWorker< T >::~PreMixingCrossingFrameWorker ( )
overridedefault

Member Function Documentation

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, PileUpEventPrincipal::getByLabel(), edm::PreMixingCrossingFrameWorker< T >::merged_, and edm::PreMixingCrossingFrameWorker< T >::pileupTag_.

Referenced by edm::PreMixingCrossingFrameWorker< T >::initializeEvent().

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_
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, edm::Event::getByToken(), edm::PreMixingCrossingFrameWorker< T >::merged_, and edm::PreMixingCrossingFrameWorker< T >::signalToken_.

Referenced by edm::PreMixingCrossingFrameWorker< T >::initializeEvent().

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_
template<typename T >
void edm::PreMixingCrossingFrameWorker< T >::initializeEvent ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
inlineoverridevirtual
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 l1GtPatternGenerator_cfi::bx, edm::PreMixingCrossingFrameWorker< T >::collectionDM_, edm::PreMixingCrossingFrameWorker< T >::merged_, eostools::move(), and edm::Event::put().

Referenced by edm::PreMixingCrossingFrameWorker< T >::initializeEvent().

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  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
std::unique_ptr< PCrossingFrame< T > > merged_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

template<typename T >
std::string edm::PreMixingCrossingFrameWorker< T >::collectionDM_
private
template<typename T >
std::unique_ptr<PCrossingFrame<T> > edm::PreMixingCrossingFrameWorker< T >::merged_
private
template<typename T >
edm::InputTag edm::PreMixingCrossingFrameWorker< T >::pileupTag_
private
template<typename T >
edm::EDGetTokenT<CrossingFrame<T> > edm::PreMixingCrossingFrameWorker< T >::signalToken_
private