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
edm::DataMixingTrackingParticleWorker Class Reference

#include <DataMixingTrackingParticleWorker.h>

Public Member Functions

void addTrackingParticlePileups (const int bcr, const edm::EventPrincipal *, unsigned int EventId, ModuleCallingContext const *)
 
void addTrackingParticleSignals (const edm::Event &e)
 
 DataMixingTrackingParticleWorker ()
 
 DataMixingTrackingParticleWorker (const edm::ParameterSet &ps, edm::ConsumesCollector &&iC)
 
void putTrackingParticle (edm::Event &e)
 
virtual ~DataMixingTrackingParticleWorker ()
 

Private Attributes

std::auto_ptr< std::vector
< TrackingParticle > > 
NewTrackList_
 
std::auto_ptr< std::vector
< TrackingVertex > > 
NewVertexList_
 
std::string TrackingParticleCollectionDM_
 
edm::InputTag TrackingParticlecollectionSig_
 
edm::InputTag TrackingParticleLabelSig_
 
edm::InputTag TrackingParticlePileInputTag_
 
edm::EDGetTokenT< std::vector
< TrackingParticle > > 
TrackPileToken_
 
edm::EDGetTokenT< std::vector
< TrackingParticle > > 
TrackSigToken_
 
edm::EDGetTokenT< std::vector
< TrackingVertex > > 
VtxPileToken_
 
edm::EDGetTokenT< std::vector
< TrackingVertex > > 
VtxSigToken_
 

Detailed Description

Definition at line 38 of file DataMixingTrackingParticleWorker.h.

Constructor & Destructor Documentation

DataMixingTrackingParticleWorker::DataMixingTrackingParticleWorker ( )

Definition at line 28 of file DataMixingTrackingParticleWorker.cc.

28 { }
DataMixingTrackingParticleWorker::DataMixingTrackingParticleWorker ( const edm::ParameterSet ps,
edm::ConsumesCollector &&  iC 
)
explicit

standard constructor

Definition at line 31 of file DataMixingTrackingParticleWorker.cc.

References edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

32  {
33 
34  // get the subdetector names
35  // this->getSubdetectorNames(); //something like this may be useful to check what we are supposed to do...
36 
37  // declare the products to produce
38 
39  TrackingParticleLabelSig_ = ps.getParameter<edm::InputTag>("TrackingParticleLabelSig");
40 
41  TrackingParticlePileInputTag_ = ps.getParameter<edm::InputTag>("TrackingParticlePileInputTag");
42 
43  TrackingParticleCollectionDM_ = ps.getParameter<std::string>("TrackingParticleCollectionDM");
44 
45  TrackSigToken_ = iC.consumes<std::vector<TrackingParticle> >(TrackingParticleLabelSig_);
46  TrackPileToken_ = iC.consumes<std::vector<TrackingParticle> >(TrackingParticlePileInputTag_);
47 
48  VtxSigToken_ = iC.consumes<std::vector<TrackingVertex> >(TrackingParticleLabelSig_);
49  VtxPileToken_ = iC.consumes<std::vector<TrackingVertex> >(TrackingParticlePileInputTag_);
50 
51  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< std::vector< TrackingVertex > > VtxSigToken_
edm::EDGetTokenT< std::vector< TrackingVertex > > VtxPileToken_
edm::EDGetTokenT< std::vector< TrackingParticle > > TrackPileToken_
edm::EDGetTokenT< std::vector< TrackingParticle > > TrackSigToken_
DataMixingTrackingParticleWorker::~DataMixingTrackingParticleWorker ( )
virtual

Default destructor

Definition at line 55 of file DataMixingTrackingParticleWorker.cc.

55  {
56  }

Member Function Documentation

void DataMixingTrackingParticleWorker::addTrackingParticlePileups ( const int  bcr,
const edm::EventPrincipal ep,
unsigned int  EventId,
ModuleCallingContext const *  mcc 
)

Definition at line 98 of file DataMixingTrackingParticleWorker.cc.

References edm::EventPrincipal::id(), LogDebug, and testEve_cfg::tracks.

Referenced by edm::DataMixingModule::pileWorker().

99  {
100 
101  LogDebug("DataMixingTrackingParticleWorker") <<"\n===============> adding pileups from event "<<ep->id()<<" for bunchcrossing "<<bcr;
102 
103 
104  std::shared_ptr<Wrapper<std::vector<TrackingParticle> > const> inputPTR =
105  getProductByTag<std::vector<TrackingParticle> >(*ep, TrackingParticlePileInputTag_, mcc);
106 
107  if(inputPTR ) {
108 
109  const std::vector<TrackingParticle> *tracks = const_cast< std::vector<TrackingParticle> * >(inputPTR->product());
110 
111  // grab tracks, store copy
112 
113 
114  for (std::vector<TrackingParticle>::const_iterator track = tracks->begin(); track != tracks->end(); ++track) {
115  NewTrackList_->push_back(*track);
116  }
117 
118  }
119 
120  std::shared_ptr<Wrapper<std::vector<TrackingVertex> > const> inputVPTR =
121  getProductByTag<std::vector<TrackingVertex> >(*ep, TrackingParticlePileInputTag_, mcc);
122 
123  if(inputVPTR ) {
124 
125  const std::vector<TrackingVertex> *vtxs = const_cast< std::vector<TrackingVertex> * >(inputVPTR->product());
126 
127  // grab vertices, store copy
128 
129  for (std::vector<TrackingVertex>::const_iterator vtx = vtxs->begin(); vtx != vtxs->end(); ++vtx) {
130  NewVertexList_->push_back(*vtx);
131  }
132 
133  }
134 
135  }
#define LogDebug(id)
std::auto_ptr< std::vector< TrackingVertex > > NewVertexList_
EventID const & id() const
tuple tracks
Definition: testEve_cfg.py:39
std::auto_ptr< std::vector< TrackingParticle > > NewTrackList_
void DataMixingTrackingParticleWorker::addTrackingParticleSignals ( const edm::Event e)

Definition at line 60 of file DataMixingTrackingParticleWorker.cc.

References edm::Event::getByToken(), edm::HandleBase::isValid(), and testEve_cfg::tracks.

Referenced by edm::DataMixingModule::addSignals().

60  {
61 
62  // Create new track/vertex lists; Rely on the fact that addSignals gets called first...
63 
64  NewTrackList_ = std::auto_ptr<std::vector<TrackingParticle>>(new std::vector<TrackingParticle>());
65  NewVertexList_ = std::auto_ptr<std::vector<TrackingVertex>>(new std::vector<TrackingVertex>());
66 
67  // grab tracks, store copy
68 
69  //edm::Handle<std::vector<TrackingParticle>> generalTrkHandle;
70  //e.getByLabel("generalTracks", generalTrkHandle);
72  e.getByToken(TrackSigToken_, tracks);
73 
74  if (tracks.isValid()) {
75  for (std::vector<TrackingParticle>::const_iterator track = tracks->begin(); track != tracks->end(); ++track) {
76  NewTrackList_->push_back(*track);
77  }
78 
79  }
80  // grab Vertices, store copy
81 
82  //edm::Handle<std::vector<TrackingVertex>> generalTrkHandle;
83  //e.getByLabel("generalTracks", generalTrkHandle);
85  e.getByToken(VtxSigToken_, vtxs);
86 
87  if (vtxs.isValid()) {
88  for (std::vector<TrackingVertex>::const_iterator vtx = vtxs->begin(); vtx != vtxs->end(); ++vtx) {
89  NewVertexList_->push_back(*vtx);
90  }
91 
92  }
93 
94  } // end of addTrackingParticleSignals
std::auto_ptr< std::vector< TrackingVertex > > NewVertexList_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
edm::EDGetTokenT< std::vector< TrackingVertex > > VtxSigToken_
edm::EDGetTokenT< std::vector< TrackingParticle > > TrackSigToken_
bool isValid() const
Definition: HandleBase.h:75
tuple tracks
Definition: testEve_cfg.py:39
std::auto_ptr< std::vector< TrackingParticle > > NewTrackList_
void DataMixingTrackingParticleWorker::putTrackingParticle ( edm::Event e)

Definition at line 139 of file DataMixingTrackingParticleWorker.cc.

References edm::Event::put().

Referenced by edm::DataMixingModule::put().

139  {
140 
141  // collection of Tracks to put in the event
142 
143  // put the collection of digis in the event
144  LogInfo("DataMixingTrackingParticleWorker") << "total # Merged Tracks: " << NewTrackList_->size() ;
145 
146  // put collections
147 
150 
151  // clear local storage for this event
152  //NewTrackList_.clear();
153  //NewVertexList_.clear();
154  }
std::auto_ptr< std::vector< TrackingVertex > > NewVertexList_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:115
std::auto_ptr< std::vector< TrackingParticle > > NewTrackList_

Member Data Documentation

std::auto_ptr<std::vector<TrackingParticle> > edm::DataMixingTrackingParticleWorker::NewTrackList_
private

Definition at line 70 of file DataMixingTrackingParticleWorker.h.

std::auto_ptr<std::vector<TrackingVertex> > edm::DataMixingTrackingParticleWorker::NewVertexList_
private

Definition at line 71 of file DataMixingTrackingParticleWorker.h.

std::string edm::DataMixingTrackingParticleWorker::TrackingParticleCollectionDM_
private

Definition at line 61 of file DataMixingTrackingParticleWorker.h.

edm::InputTag edm::DataMixingTrackingParticleWorker::TrackingParticlecollectionSig_
private

Definition at line 58 of file DataMixingTrackingParticleWorker.h.

edm::InputTag edm::DataMixingTrackingParticleWorker::TrackingParticleLabelSig_
private

Definition at line 59 of file DataMixingTrackingParticleWorker.h.

edm::InputTag edm::DataMixingTrackingParticleWorker::TrackingParticlePileInputTag_
private

Definition at line 60 of file DataMixingTrackingParticleWorker.h.

edm::EDGetTokenT<std::vector<TrackingParticle> > edm::DataMixingTrackingParticleWorker::TrackPileToken_
private

Definition at line 64 of file DataMixingTrackingParticleWorker.h.

edm::EDGetTokenT<std::vector<TrackingParticle> > edm::DataMixingTrackingParticleWorker::TrackSigToken_
private

Definition at line 63 of file DataMixingTrackingParticleWorker.h.

edm::EDGetTokenT<std::vector<TrackingVertex> > edm::DataMixingTrackingParticleWorker::VtxPileToken_
private

Definition at line 66 of file DataMixingTrackingParticleWorker.h.

edm::EDGetTokenT<std::vector<TrackingVertex> > edm::DataMixingTrackingParticleWorker::VtxSigToken_
private

Definition at line 65 of file DataMixingTrackingParticleWorker.h.