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

edm::InputTag Mtag_
 
std::vector< float > pT_Hats_
 
std::vector< float > z_posns_
 

Detailed Description

Definition at line 40 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 HLT_25ns14e33_v1_cff::alias, edm::ConsumesCollector::consumes(), HLT_25ns14e33_v1_cff::InputTag, Mtag_, 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  Mtag_=edm::InputTag("generator");
80  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
PileupVertexAccumulator::~PileupVertexAccumulator ( )
virtual

Definition at line 82 of file PileupVertexAccumulator.cc.

82  {
83  }

Member Function Documentation

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

Implements DigiAccumulatorMixMod.

Definition at line 99 of file PileupVertexAccumulator.cc.

99  {
100  // don't do anything for hard-scatter signal events
101  }
void PileupVertexAccumulator::accumulate ( PileUpEventPrincipal const &  e,
edm::EventSetup const &  c,
edm::StreamID const &  streamID 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 104 of file PileupVertexAccumulator.cc.

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

104  {
105 
107  iEvent.getByLabel(Mtag_, MCevt);
108 
109  const HepMC::GenEvent *myGenEvent = MCevt->GetEvent();
110 
111  double pthat = myGenEvent->event_scale();
112  float pt_hat = float(pthat);
113 
114  pT_Hats_.push_back(pt_hat);
115 
116  HepMC::GenEvent::vertex_const_iterator viter;
117  HepMC::GenEvent::vertex_const_iterator vbegin = myGenEvent->vertices_begin();
118  HepMC::GenEvent::vertex_const_iterator vend = myGenEvent->vertices_end();
119 
120  // for production point, pick first vertex
121  viter=vbegin;
122 
123  if(viter!=vend){
124  // The origin vertex (turn it to cm's from GenEvent mm's)
125  HepMC::GenVertex* v = *viter;
126  float zpos = v->position().z()*0.1;
127 
128  z_posns_.push_back(zpos);
129  }
130 
131  // delete myGenEvent;
132 
133  }
#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 52 of file PileupVertexAccumulator.h.

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

Implements DigiAccumulatorMixMod.

Definition at line 137 of file PileupVertexAccumulator.cc.

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

137  {
138 
139  std::auto_ptr<PileupVertexContent> PUVtxC(new PileupVertexContent(pT_Hats_, z_posns_));
140 
141  // write output to event
142  iEvent.put(PUVtxC);
143  }
int iEvent
Definition: GenABIO.cc:230
void PileupVertexAccumulator::initializeEvent ( edm::Event const &  e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 91 of file PileupVertexAccumulator.cc.

References pT_Hats_, and z_posns_.

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

Member Data Documentation

edm::InputTag cms::PileupVertexAccumulator::Mtag_
private

Definition at line 57 of file PileupVertexAccumulator.h.

Referenced by accumulate(), and PileupVertexAccumulator().

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

Definition at line 55 of file PileupVertexAccumulator.h.

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

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

Definition at line 56 of file PileupVertexAccumulator.h.

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