|
//____________________________________________________________________ // // $Id: BrPhDSEvent.cxx,v 1.2 2001/11/05 06:53:17 ouerdane Exp $ // $Author: ouerdane $ // $Date: 2001/11/05 06:53:17 $ // $Copyright: 2001 BRAHMS Collaboration <brahmlib@rhic.bnl.gov> // //____________________________________________________________________ #include "BrPhDSEvent.h" //____________________________________________________________________ ClassImp(BrPhDSEvent); //____________________________________________________________________ TClonesArray *BrPhDSEvent::fgParticles = 0; //____________________________________________________________________ BrPhDSEvent::BrPhDSEvent() { // Create an Event object. // When the constructor is invoked for the first time, the class static // variable fgTracks is 0 and the TClonesArray fgTracks is created. if (!fgParticles) fgParticles = new TClonesArray("BrParticle", 100); fParticles = fgParticles; fNParticles = 0; } //____________________________________________________________________ BrPhDSEvent::~BrPhDSEvent() { Clear(); } //____________________________________________________________________ void BrPhDSEvent::AddParticle(BrParticle *particle) { // Add a new particle to the list of particles for this event. // To avoid calling the very time consuming operator new for each track, // the standard but not well know C++ operator "new with placement" // is called. If tracks[i] is 0, a new Track object will be created // otherwise the previous Track[i] will be overwritten. TClonesArray &particles = *fParticles; new(particles[fNParticles++]) BrParticle(*particle); } //____________________________________________________________________ void BrPhDSEvent::SetEventHeader(BrEventHeader *header) { fEventHeader.SetEventHeader(header); } //____________________________________________________________________ void BrPhDSEvent::Clear(Option_t *option) { fParticles->Clear(option); fNParticles = 0; fTileMult=0; fTileCentralityCut=0; fSiMult=0; fRdoBB.Clear(); fRdoZDC.Clear(); fMrsTrackVertex.Clear(); fMRSClusterVertex.Clear(); } //____________________________________________________________________ void BrPhDSEvent::Reset(Option_t *option) { // Static function to reset all static objects for this event // fgTracks->Delete(option); delete fgParticles; fgParticles = 0; } // $Log: BrPhDSEvent.cxx,v $ // Revision 1.2 2001/11/05 06:53:17 ouerdane // changed FFS to Ffs, MRS to Mrs etc // // Revision 1.1.1.1 2001/06/21 14:55:02 hagel // Initial revision of brat2 // // Revision 1.1 2001/04/20 16:11:22 hagel // Initial revision // |
||||||
This page automatically generated by script docBrat by Christian Holm |
Copyright ; 2002 BRAHMS Collaboration
<brahmlib@rcf.rhic.bnl.gov>
|