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::DataMixingGeneralTrackWorker Class Reference

#include <DataMixingGeneralTrackWorker.h>

Public Member Functions

void addGeneralTrackPileups (const int bcr, const edm::EventPrincipal *, unsigned int EventId, ModuleCallingContext const *)
 
void addGeneralTrackSignals (const edm::Event &e)
 
 DataMixingGeneralTrackWorker ()
 
 DataMixingGeneralTrackWorker (const edm::ParameterSet &ps, edm::ConsumesCollector &&iC)
 
void putGeneralTrack (edm::Event &e)
 
virtual ~DataMixingGeneralTrackWorker ()
 

Private Attributes

std::string GeneralTrackCollectionDM_
 
edm::InputTag GeneralTrackcollectionSig_
 
edm::InputTag GeneralTrackLabelSig_
 
edm::InputTag GeneralTrackPileInputTag_
 
edm::EDGetTokenT
< reco::TrackCollection
GTrackPileToken_
 
edm::EDGetTokenT
< reco::TrackCollection
GTrackSigToken_
 
std::auto_ptr
< reco::TrackCollection
NewTrackList_
 

Detailed Description

Definition at line 39 of file DataMixingGeneralTrackWorker.h.

Constructor & Destructor Documentation

DataMixingGeneralTrackWorker::DataMixingGeneralTrackWorker ( )

Definition at line 28 of file DataMixingGeneralTrackWorker.cc.

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

standard constructor

Definition at line 31 of file DataMixingGeneralTrackWorker.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  GeneralTrackLabelSig_ = ps.getParameter<edm::InputTag>("GeneralTrackLabelSig");
40 
41  GeneralTrackPileInputTag_ = ps.getParameter<edm::InputTag>("GeneralTrackPileInputTag");
42 
43  GeneralTrackCollectionDM_ = ps.getParameter<std::string>("GeneralTrackDigiCollectionDM");
44 
47 
48  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::TrackCollection > GTrackSigToken_
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
edm::EDGetTokenT< reco::TrackCollection > GTrackPileToken_
DataMixingGeneralTrackWorker::~DataMixingGeneralTrackWorker ( )
virtual

Default destructor

Definition at line 52 of file DataMixingGeneralTrackWorker.cc.

52  {
53  }

Member Function Documentation

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

Definition at line 81 of file DataMixingGeneralTrackWorker.cc.

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

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

82  {
83  LogDebug("DataMixingGeneralTrackWorker") <<"\n===============> adding pileups from event "<<ep->id()<<" for bunchcrossing "<<bcr;
84 
85 
86  std::shared_ptr<Wrapper<reco::TrackCollection > const> inputPTR =
87  getProductByTag<reco::TrackCollection >(*ep, GeneralTrackPileInputTag_, mcc);
88 
89  if(inputPTR ) {
90 
91  const reco::TrackCollection *tracks = const_cast< reco::TrackCollection * >(inputPTR->product());
92 
93  // grab tracks, store copy
94 
95 
96  for (reco::TrackCollection::const_iterator track = tracks->begin(); track != tracks->end(); ++track) {
97  NewTrackList_->push_back(*track);
98  }
99 
100  }
101 
102  }
#define LogDebug(id)
EventID const & id() const
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
std::auto_ptr< reco::TrackCollection > NewTrackList_
tuple tracks
Definition: testEve_cfg.py:39
void DataMixingGeneralTrackWorker::addGeneralTrackSignals ( const edm::Event e)

Definition at line 57 of file DataMixingGeneralTrackWorker.cc.

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

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

57  {
58 
59  // Create new track list; Rely on the fact that addSignals gets called first...
60 
61  NewTrackList_ = std::auto_ptr<reco::TrackCollection>(new reco::TrackCollection());
62 
63  // grab tracks, store copy
64 
65  //edm::Handle<reco::TrackCollection> generalTrkHandle;
66  //e.getByLabel("generalTracks", generalTrkHandle);
68  e.getByToken(GTrackSigToken_, tracks);
69 
70  if (tracks.isValid()) {
71  for (reco::TrackCollection::const_iterator track = tracks->begin(); track != tracks->end(); ++track) {
72  NewTrackList_->push_back(*track);
73  }
74 
75  }
76 
77  } // end of addGeneralTrackSignals
edm::EDGetTokenT< reco::TrackCollection > GTrackSigToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
std::auto_ptr< reco::TrackCollection > NewTrackList_
tuple tracks
Definition: testEve_cfg.py:39
void DataMixingGeneralTrackWorker::putGeneralTrack ( edm::Event e)

Definition at line 106 of file DataMixingGeneralTrackWorker.cc.

References edm::Event::put().

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

106  {
107 
108  // collection of Tracks to put in the event
109 
110  // put the collection of digis in the event
111  LogInfo("DataMixingGeneralTrackWorker") << "total # Merged Tracks: " << NewTrackList_->size() ;
112 
113  // put collection
114 
116 
117  // clear local storage for this event
118  //NewTrackList_.clear();
119  }
std::auto_ptr< reco::TrackCollection > NewTrackList_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113

Member Data Documentation

std::string edm::DataMixingGeneralTrackWorker::GeneralTrackCollectionDM_
private

Definition at line 62 of file DataMixingGeneralTrackWorker.h.

edm::InputTag edm::DataMixingGeneralTrackWorker::GeneralTrackcollectionSig_
private

Definition at line 59 of file DataMixingGeneralTrackWorker.h.

edm::InputTag edm::DataMixingGeneralTrackWorker::GeneralTrackLabelSig_
private

Definition at line 60 of file DataMixingGeneralTrackWorker.h.

edm::InputTag edm::DataMixingGeneralTrackWorker::GeneralTrackPileInputTag_
private

Definition at line 61 of file DataMixingGeneralTrackWorker.h.

edm::EDGetTokenT<reco::TrackCollection> edm::DataMixingGeneralTrackWorker::GTrackPileToken_
private

Definition at line 65 of file DataMixingGeneralTrackWorker.h.

edm::EDGetTokenT<reco::TrackCollection> edm::DataMixingGeneralTrackWorker::GTrackSigToken_
private

Definition at line 64 of file DataMixingGeneralTrackWorker.h.

std::auto_ptr<reco::TrackCollection> edm::DataMixingGeneralTrackWorker::NewTrackList_
private

Definition at line 69 of file DataMixingGeneralTrackWorker.h.