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::ProducerBase &producer, 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

Definition at line 35 of file PreMixingCrossingFrameWorker.cc.

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

35  :
37  pileupTag_(ps.getParameter<edm::InputTag>("pileInputTag")),
38  collectionDM_(ps.getParameter<std::string>("collectionDM"))
39  {
40  producer.produces<PCrossingFrame<T> >(collectionDM_); // TODO: this is needed only to store the pointed-to objects, do we really need it?
42  }
BranchAliasSetterT< ProductType > produces()
declare what type of product will make and with which optional label
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
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 58 of file PreMixingCrossingFrameWorker.cc.

References Exception, PileUpEventPrincipal::getByLabel(), edm::PreMixingCrossingFrameWorker< T >::merged_, and edm::PreMixingCrossingFrameWorker< T >::pileupTag_.

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

58  {
60  pep.getByLabel(pileupTag_, hcf);
61 
62  const auto& cf = *hcf;
63  if(!cf.getSignals().empty()) {
64  throw cms::Exception("LogicError") << "Got PCrossingFrame from pileup with signal content?";
65  }
66 
67  merged_->setAllExceptSignalFrom(cf);
68  }
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 45 of file PreMixingCrossingFrameWorker.cc.

References Exception, edm::Event::getByToken(), edm::PreMixingCrossingFrameWorker< T >::merged_, and edm::PreMixingCrossingFrameWorker< T >::signalToken_.

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

45  {
47  iEvent.getByToken(signalToken_, hcf);
48 
49  const auto& cf = *hcf;
50  if(!cf.getPileups().empty()) {
51  throw cms::Exception("LogicError") << "Got CrossingFrame from signal with pileup content?";
52  }
53 
54  merged_ = std::make_unique<PCrossingFrame<T> >(cf); // for signal we just copy
55  }
std::unique_ptr< PCrossingFrame< T > > merged_
int iEvent
Definition: GenABIO.cc:230
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 71 of file PreMixingCrossingFrameWorker.cc.

References edm::PreMixingCrossingFrameWorker< T >::collectionDM_, edm::PreMixingCrossingFrameWorker< T >::merged_, eostools::move(), and edm::Event::put().

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

71  {
72  auto orphanHandle = iEvent.put(std::move(merged_), collectionDM_);
73  const auto& pcf = *orphanHandle;
74 
75  const auto bx = pcf.getBunchRange();
76  auto cf = std::make_unique<CrossingFrame<T> >(bx.first, bx.second, pcf.getBunchSpace(), pcf.getSubDet(), pcf.getMaxNbSources());
77  cf->addSignals(&(pcf.getSignals()), pcf.getEventID());
78  cf->setPileups(pcf.getPileups());
79  iEvent.put(std::move(cf), collectionDM_);
80  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
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