Project

General

Profile

BrianSlicerUseCase

We have 3 classes in our RecoBase package, Prong, Shower and Track.  Shower and Track inherit from Prong. They have a couple of extra data members and accessors for those members, however in our event display we only need to know about the Prong data members.  

Say that in a module I made a collection of tracks:

void MyTrackMaker::produce([insert appropriate args here]){

//get the auto_ptr to the collection of tracks we are going to make
std::auto_ptr< std::vector<recob::Track> > trackcol(new std::vector<recob::Track>);

//do stuff to make tracks here

//save the collection of tracks to the event
evt.put(trackcol);

}//done producing

Now I want to just have one method in my event display to draw Prongs that will work for any Showers or Tracks reconstructed in my event:

DrawProng(const edm::Event &evt, std::string moduleLabel){

//grab the prongs from the event - here moduleLabel is going to be the module that made the //tracks.  
edm::Handle< std::vector<recob::Prong> > plistHandle;
evt.getByLabel(moduleLabel,plistHandle);

//now do stuff with the list of prongs to draw them

}