CMS 3D CMS Logo

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::TrackCollectionGTrackPileToken_
 
edm::EDGetTokenT< reco::TrackCollectionGTrackSigToken_
 
std::unique_ptr< reco::TrackCollectionNewTrackList_
 

Detailed Description

Definition at line 39 of file DataMixingGeneralTrackWorker.h.

Constructor & Destructor Documentation

DataMixingGeneralTrackWorker::DataMixingGeneralTrackWorker ( )

Definition at line 23 of file DataMixingGeneralTrackWorker.cc.

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

standard constructor

Definition at line 26 of file DataMixingGeneralTrackWorker.cc.

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

27  {
28 
29  // get the subdetector names
30  // this->getSubdetectorNames(); //something like this may be useful to check what we are supposed to do...
31 
32  // declare the products to produce
33 
34  GeneralTrackLabelSig_ = ps.getParameter<edm::InputTag>("GeneralTrackLabelSig");
35 
36  GeneralTrackPileInputTag_ = ps.getParameter<edm::InputTag>("GeneralTrackPileInputTag");
37 
38  GeneralTrackCollectionDM_ = ps.getParameter<std::string>("GeneralTrackDigiCollectionDM");
39 
42 
43  }
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:14
edm::EDGetTokenT< reco::TrackCollection > GTrackPileToken_
DataMixingGeneralTrackWorker::~DataMixingGeneralTrackWorker ( )
virtual

Default destructor

Definition at line 47 of file DataMixingGeneralTrackWorker.cc.

47  {
48  }

Member Function Documentation

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

Definition at line 76 of file DataMixingGeneralTrackWorker.cc.

References edm::EventPrincipal::id(), LogDebug, HiIsolationCommonParameters_cff::track, and l1t::tracks.

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

Definition at line 52 of file DataMixingGeneralTrackWorker.cc.

References edm::Event::getByToken(), HiIsolationCommonParameters_cff::track, and l1t::tracks.

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

Definition at line 101 of file DataMixingGeneralTrackWorker.cc.

References eostools::move(), and edm::Event::put().

101  {
102 
103  // collection of Tracks to put in the event
104 
105  // put the collection of digis in the event
106  LogInfo("DataMixingGeneralTrackWorker") << "total # Merged Tracks: " << NewTrackList_->size() ;
107 
108  // put collection
109 
111 
112  // clear local storage for this event
113  //NewTrackList_.clear();
114  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
std::unique_ptr< reco::TrackCollection > NewTrackList_
def move(src, dest)
Definition: eostools.py:511

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::unique_ptr<reco::TrackCollection> edm::DataMixingGeneralTrackWorker::NewTrackList_
private

Definition at line 69 of file DataMixingGeneralTrackWorker.h.