CMS 3D CMS Logo

Public Member Functions | Private Attributes

edm::DataMixingGeneralTrackWorker Class Reference

#include <DataMixingGeneralTrackWorker.h>

List of all members.

Public Member Functions

void addGeneralTrackPileups (const int bcr, const edm::EventPrincipal *, unsigned int EventId)
void addGeneralTrackSignals (const edm::Event &e)
 DataMixingGeneralTrackWorker (const edm::ParameterSet &ps)
 DataMixingGeneralTrackWorker ()
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.

{ }
DataMixingGeneralTrackWorker::DataMixingGeneralTrackWorker ( const edm::ParameterSet ps) [explicit]

standard constructor

Definition at line 29 of file DataMixingGeneralTrackWorker.cc.

References edm::ParameterSet::getParameter().

  {                                                         

    // get the subdetector names
    //    this->getSubdetectorNames();  //something like this may be useful to check what we are supposed to do...

    // create input selector
    //    if (label_.size()>0){
    //  sel_=new Selector( ModuleLabelSelector(label_));
    // }
    //else {
    //  sel_=new Selector( MatchAllSelector());

    // declare the products to produce

    GeneralTrackLabelSig_  = ps.getParameter<edm::InputTag>("GeneralTrackLabelSig");

    GeneralTrackPileInputTag_ = ps.getParameter<edm::InputTag>("GeneralTrackPileInputTag");

    GeneralTrackCollectionDM_  = ps.getParameter<std::string>("GeneralTrackDigiCollectionDM");

  }
DataMixingGeneralTrackWorker::~DataMixingGeneralTrackWorker ( ) [virtual]

Default destructor

Definition at line 54 of file DataMixingGeneralTrackWorker.cc.

                                                              { 
  }  

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().

                                                                                                                         {
    LogDebug("DataMixingGeneralTrackWorker") <<"\n===============> adding pileups from event  "<<ep->id()<<" for bunchcrossing "<<bcr;


    boost::shared_ptr<Wrapper<reco::TrackCollection >  const> inputPTR =
      getProductByTag<reco::TrackCollection >(*ep, GeneralTrackPileInputTag_ );

    if(inputPTR ) {

      const reco::TrackCollection  *tracks = const_cast< reco::TrackCollection * >(inputPTR->product());

    // grab tracks, store copy


      for (reco::TrackCollection::const_iterator track = tracks->begin();  track != tracks->end();  ++track) {
        NewTrackList_->push_back(*track);
      }
      
    }

  }
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().

                                                                             { 

    // Create new track list; Rely on the fact that addSignals gets called first...

    NewTrackList_ = std::auto_ptr<reco::TrackCollection>(new reco::TrackCollection());

    // grab tracks, store copy

    //edm::Handle<reco::TrackCollection> generalTrkHandle;
    //e.getByLabel("generalTracks", generalTrkHandle);
    edm::Handle<reco::TrackCollection> tracks;
    e.getByLabel(GeneralTrackLabelSig_, tracks);

    if (tracks.isValid()) {
      for (reco::TrackCollection::const_iterator track = tracks->begin();  track != tracks->end();  ++track) {
        NewTrackList_->push_back(*track);
      }
      
    }

  } // end of addGeneralTrackSignals
void DataMixingGeneralTrackWorker::putGeneralTrack ( edm::Event e)

Definition at line 107 of file DataMixingGeneralTrackWorker.cc.

References edm::Event::put().

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

                                                                {

    // collection of Tracks to put in the event

    // put the collection of digis in the event   
    LogInfo("DataMixingGeneralTrackWorker") << "total # Merged Tracks: " << NewTrackList_->size() ;

    // put collection

    e.put( NewTrackList_, GeneralTrackCollectionDM_ );

    // clear local storage for this event
    //NewTrackList_.clear();
  }

Member Data Documentation

Definition at line 60 of file DataMixingGeneralTrackWorker.h.

Definition at line 57 of file DataMixingGeneralTrackWorker.h.

Definition at line 58 of file DataMixingGeneralTrackWorker.h.

Definition at line 59 of file DataMixingGeneralTrackWorker.h.

Definition at line 64 of file DataMixingGeneralTrackWorker.h.