#ifndef STNTUPLE_TStnTrackBlock #define STNTUPLE_TStnTrackBlock //----------------------------------------------------------------------------- // definition of the STNTUPLE track block // Author: Pasha Murat (CDF/FNAL) // Date: Oct 31 2000 // // the implementation is a trade-off between the performance in split and // non-split modes. I'm assuming that on a long term time scale TStnTrackBlock // will be written in split mode, however the TClonesArray itself may not // be split (if one needs tracks, he normally needs all the tracks, not only // track Pt) // Also one wants to control the streamer of the class, having a wrapper // around TClonesArray seems to be a reasonable compromise here //----------------------------------------------------------------------------- #include "TClonesArray.h" #include "TStnDataBlock.hh" #include "TStnTrack.hh" #include "Stntuple/mod/InitStntupleDataBlocks.hh" #include "Stntuple/run1/StnRun1InitDataBlocks.hh" class TStnEvent; class CdfTrack; class TStnTrackBlock: public TStnDataBlock { friend Int_t StntupleInitTrackBlock(TStnDataBlock*, AbsEvent* , int); friend Int_t StnRun1InitTrackBlock (TStnDataBlock*, TStnEvent*, int); public: //------------------------------------------------------------------------------ // data members //------------------------------------------------------------------------------ Int_t fNTracks; TClonesArray* fTrackList; //------------------------------------------------------------------------------ // functions //------------------------------------------------------------------------------ public: // ****** constructors and destructor TStnTrackBlock(); virtual ~TStnTrackBlock(); // ****** accessors Int_t NTracks () { return fNTracks; } TClonesArray* TrackList() { return fTrackList; } TStnTrack* Track(int i) { return (TStnTrack*) fTrackList->UncheckedAt(i); } // return index in the track list // of a given CDF Track Int_t TrackNumber(const CdfTrack* Track); // ****** modifiers TStnTrack* NewTrack() { TStnTrack* t = new ((*fTrackList)[fNTracks]) TStnTrack(fNTracks); fNTracks++; return t; } // ****** overloaded functions of // TObject void Clear(Option_t* opt=""); void Print(Option_t* option = "") const; ClassDef(TStnTrackBlock,1) }; #endif