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)
 
void addGeneralTrackSignals (const edm::Event &e)
 
 DataMixingGeneralTrackWorker ()
 
 DataMixingGeneralTrackWorker (const edm::ParameterSet &ps)
 
void putGeneralTrack (edm::Event &e)
 
virtual ~DataMixingGeneralTrackWorker ()
 

Private Attributes

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

Detailed Description

Definition at line 37 of file DataMixingGeneralTrackWorker.h.

Constructor & Destructor Documentation

DataMixingGeneralTrackWorker::DataMixingGeneralTrackWorker ( )

Definition at line 26 of file DataMixingGeneralTrackWorker.cc.

26 { }
DataMixingGeneralTrackWorker::DataMixingGeneralTrackWorker ( const edm::ParameterSet ps)
explicit

standard constructor

Definition at line 29 of file DataMixingGeneralTrackWorker.cc.

References edm::ParameterSet::getParameter().

30  {
31 
32  // get the subdetector names
33  // this->getSubdetectorNames(); //something like this may be useful to check what we are supposed to do...
34 
35  // create input selector
36  // if (label_.size()>0){
37  // sel_=new Selector( ModuleLabelSelector(label_));
38  // }
39  //else {
40  // sel_=new Selector( MatchAllSelector());
41 
42  // declare the products to produce
43 
44  GeneralTrackLabelSig_ = ps.getParameter<edm::InputTag>("GeneralTrackLabelSig");
45 
46  GeneralTrackPileInputTag_ = ps.getParameter<edm::InputTag>("GeneralTrackPileInputTag");
47 
48  GeneralTrackCollectionDM_ = ps.getParameter<std::string>("GeneralTrackDigiCollectionDM");
49 
50  }
T getParameter(std::string const &) const
DataMixingGeneralTrackWorker::~DataMixingGeneralTrackWorker ( )
virtual

Default destructor

Definition at line 54 of file DataMixingGeneralTrackWorker.cc.

54  {
55  }

Member Function Documentation

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

Definition at line 83 of file DataMixingGeneralTrackWorker.cc.

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

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

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

Definition at line 59 of file DataMixingGeneralTrackWorker.cc.

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

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

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

Definition at line 107 of file DataMixingGeneralTrackWorker.cc.

References edm::Event::put().

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

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

Member Data Documentation

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

Definition at line 60 of file DataMixingGeneralTrackWorker.h.

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

Definition at line 57 of file DataMixingGeneralTrackWorker.h.

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

Definition at line 58 of file DataMixingGeneralTrackWorker.h.

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

Definition at line 59 of file DataMixingGeneralTrackWorker.h.

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

Definition at line 64 of file DataMixingGeneralTrackWorker.h.