#ifndef STNTUPLE_TStnVertexBlock #define STNTUPLE_TStnVertexBlock //----------------------------------------------------------------------------- // definition of the STNTUPLE primary vertex 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 TStnVertexBlock // 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 "TVector3.h" #include "TStnDataBlock.hh" #include "TStnVertex.hh" #include "Stntuple/mod/InitStntupleDataBlocks.hh" class TStnEvent; class TStnVertexBlock: public TStnDataBlock { friend Int_t StntupleInitVertexBlock (TStnDataBlock*, AbsEvent*, int); friend Int_t StntupleInitZVertexBlock(TStnDataBlock*, AbsEvent*, int); friend Int_t StnRun1InitVertexBlock (TStnDataBlock*, TStnEvent*, int); public: //------------------------------------------------------------------------------ // data members //------------------------------------------------------------------------------ Int_t fNVertices; // # of primary vertices Float_t fPtnov; Float_t fVzev; Float_t fVclassev; TVector3 fVxprim; TClonesArray* fVertexList; // list of primary vertices //------------------------------------------------------------------------------ // functions //------------------------------------------------------------------------------ public: // ****** constructors and destructor TStnVertexBlock(); virtual ~TStnVertexBlock(); //----------------------------------------------------------------------------- // accessors //----------------------------------------------------------------------------- // total number of vertices Int_t NVertices() { return fNVertices; } // number of vertices with class >= cl Int_t NVertices (int cl); TClonesArray* VertexList() { return fVertexList; } TStnVertex* Vertex(int i) { return (TStnVertex*) fVertexList->UncheckedAt(i); } // mode = 1 : highest Pt TStnVertex* GetBestVertex(int VClass, int Mode); //----------------------------------------------------------------------------- // modifiers //----------------------------------------------------------------------------- void SetNVertices(int n) { fNVertices = n; } TStnVertex* NewVertex() { TStnVertex* v = new ((*fVertexList)[fNVertices]) TStnVertex(fNVertices); fNVertices++; return v; } //----------------------------------------------------------------------------- // overloaded methods of TObject //----------------------------------------------------------------------------- void Clear(Option_t* opt=""); void Print(Option_t* opt="") const; ClassDef(TStnVertexBlock,1) }; #endif