CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
cms::PileupVertexAccumulator Class Reference

#include <PileupVertexAccumulator.h>

Inheritance diagram for cms::PileupVertexAccumulator:
DigiAccumulatorMixMod

Public Member Functions

virtual void accumulate (edm::Event const &e, edm::EventSetup const &c) override
 
virtual void accumulate (PileUpEventPrincipal const &e, edm::EventSetup const &c, edm::StreamID const &) override
 
virtual void beginJob ()
 
virtual void finalizeEvent (edm::Event &e, edm::EventSetup const &c) override
 
virtual void initializeEvent (edm::Event const &e, edm::EventSetup const &c) override
 
 PileupVertexAccumulator (const edm::ParameterSet &conf, edm::one::EDProducerBase &mixMod, edm::ConsumesCollector &iC)
 
virtual ~PileupVertexAccumulator ()
 
- Public Member Functions inherited from DigiAccumulatorMixMod
virtual void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
virtual void beginRun (edm::Run const &run, edm::EventSetup const &setup)
 
 DigiAccumulatorMixMod ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
virtual void endRun (edm::Run const &run, edm::EventSetup const &setup)
 
virtual void finalizeBunchCrossing (edm::Event &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual PileupMixingContentgetEventPileupInfo ()
 
virtual void initializeBunchCrossing (edm::Event const &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual void StorePileupInformation (std::vector< int > &numInteractionList, std::vector< int > &bunchCrossingList, std::vector< float > &TrueInteractionList, std::vector< edm::EventID > &eventList, int bunchSpace)
 
virtual ~DigiAccumulatorMixMod ()
 

Private Attributes

std::vector< float > pT_Hats_
 
std::vector< float > z_posns_
 

Detailed Description

Definition at line 39 of file PileupVertexAccumulator.h.

Constructor & Destructor Documentation

PileupVertexAccumulator::PileupVertexAccumulator ( const edm::ParameterSet conf,
edm::one::EDProducerBase mixMod,
edm::ConsumesCollector iC 
)
explicit

Definition at line 70 of file PileupVertexAccumulator.cc.

References edm::ConsumesCollector::consumes(), and AlCaHLTBitMon_QueryRunRegistry::string.

71  {
72  edm::LogInfo ("PixelDigitizer ") <<"Enter the Pixel Digitizer";
73 
74  const std::string alias ("PileupVertexAccum");
75 
76  mixMod.produces<PileupVertexContent>().setBranchAlias(alias);
77 
78  const edm::InputTag Mtag("generator");
79 
80  iC.consumes<edm::HepMCProduct>(Mtag);
81  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
PileupVertexAccumulator::~PileupVertexAccumulator ( )
virtual

Definition at line 83 of file PileupVertexAccumulator.cc.

83  {
84  }

Member Function Documentation

void PileupVertexAccumulator::accumulate ( edm::Event const &  e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 100 of file PileupVertexAccumulator.cc.

References edm::Event::getByLabel().

100  {
102  const edm::InputTag Mtag("generator");
103  iEvent.getByLabel(Mtag, MCevt);
104 
105 
106 
107  // don't do anything for hard-scatter signal events
108  }
int iEvent
Definition: GenABIO.cc:230
void PileupVertexAccumulator::accumulate ( PileUpEventPrincipal const &  e,
edm::EventSetup const &  c,
edm::StreamID const &  streamID 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 111 of file PileupVertexAccumulator.cc.

References PileUpEventPrincipal::getByLabel(), pT_Hats_, findQualityFiles::v, vbegin, vend, and z_posns_.

111  {
112 
114  const edm::InputTag Mtag("generator");
115  iEvent.getByLabel(Mtag, MCevt);
116 
117  HepMC::GenEvent * myGenEvent = new HepMC::GenEvent(*(MCevt->GetEvent()));
118 
119  double pthat = myGenEvent->event_scale();
120  float pt_hat = float(pthat);
121 
122  pT_Hats_.push_back(pt_hat);
123 
124  HepMC::GenEvent::vertex_const_iterator viter;
125  HepMC::GenEvent::vertex_const_iterator vbegin = myGenEvent->vertices_begin();
126  HepMC::GenEvent::vertex_const_iterator vend = myGenEvent->vertices_end();
127 
128  // for production point, pick first vertex
129  viter=vbegin;
130 
131  if(viter!=vend){
132  // The origin vertex (turn it to cm's from GenEvent mm's)
133  HepMC::GenVertex* v = *viter;
134  float zpos = v->position().z()/10.;
135 
136  z_posns_.push_back(zpos);
137  }
138 
139  delete myGenEvent;
140 
141  }
#define vend()
Definition: vmac.h:41
int iEvent
Definition: GenABIO.cc:230
#define vbegin()
Definition: vmac.h:34
virtual void cms::PileupVertexAccumulator::beginJob ( void  )
inlinevirtual

Definition at line 51 of file PileupVertexAccumulator.h.

51 {}
void PileupVertexAccumulator::finalizeEvent ( edm::Event e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 145 of file PileupVertexAccumulator.cc.

References pT_Hats_, edm::Event::put(), and z_posns_.

145  {
146 
147  std::auto_ptr<PileupVertexContent> PUVtxC(new PileupVertexContent(pT_Hats_, z_posns_));
148 
149  // write output to event
150  iEvent.put(PUVtxC);
151  }
int iEvent
Definition: GenABIO.cc:230
void PileupVertexAccumulator::initializeEvent ( edm::Event const &  e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 92 of file PileupVertexAccumulator.cc.

References pT_Hats_, and z_posns_.

92  {
93  // Make sure that the first crossing processed starts indexing the minbias events from zero.
94 
95  pT_Hats_.clear();
96  z_posns_.clear();
97  }

Member Data Documentation

std::vector<float> cms::PileupVertexAccumulator::pT_Hats_
private

Definition at line 54 of file PileupVertexAccumulator.h.

Referenced by accumulate(), finalizeEvent(), and initializeEvent().

std::vector<float> cms::PileupVertexAccumulator::z_posns_
private

Definition at line 55 of file PileupVertexAccumulator.h.

Referenced by accumulate(), finalizeEvent(), and initializeEvent().