CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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.

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  }

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

◆ ~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.

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  }

References Exception, and PileUpEventPrincipal::getByLabel().

◆ 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.

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  }

References Exception, and iEvent.

◆ 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.

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  }

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

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.

PCrossingFrame
Definition: CrossingFrame.h:28
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
edm::Handle
Definition: AssociativeIterator.h:50
CrossingFrame
Definition: CrossingFrame.h:38
edm::PreMixingCrossingFrameWorker::merged_
std::unique_ptr< PCrossingFrame< T > > merged_
Definition: PreMixingCrossingFrameWorker.cc:34
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::PreMixingCrossingFrameWorker::signalToken_
edm::EDGetTokenT< CrossingFrame< T > > signalToken_
Definition: PreMixingCrossingFrameWorker.cc:30
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::ProducesCollector::produces
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
Definition: ProducesCollector.h:52
edm::PreMixingCrossingFrameWorker::collectionDM_
std::string collectionDM_
Definition: PreMixingCrossingFrameWorker.cc:32
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
Exception
Definition: hltDiff.cc:246
edm::PreMixingCrossingFrameWorker::pileupTag_
edm::InputTag pileupTag_
Definition: PreMixingCrossingFrameWorker.cc:31
edm::InputTag
Definition: InputTag.h:15