#ifndef STNTUPLE_TStnTauBlock #define STNTUPLE_TStnTauBlock //----------------------------------------------------------------------------- // definition of the STNTUPLE photon 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 TStnTauBlock // 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 "TStnDataBlock.hh" #include "TStnLinkBlock.hh" #include "TStnTau.hh" #include class TStnEvent; class TStnTauBlock: public TStnDataBlock { friend Int_t StntupleInitTauBlock(TStnDataBlock*, AbsEvent* , int); friend Int_t StnRun1InitTauBlock (TStnTauBlock* , TStnEvent*, int); public: //------------------------------------------------------------------------------ // data members //------------------------------------------------------------------------------ Int_t fNTaus; // # of taus Int_t fNGTau; // # of "golden" taus TClonesArray* fTauList; // list of tau's TStnLinkBlock* fTrackLinkList; // || links to the tracks TStnLinkBlock* fTowerLinkList; // || links to the towers TStnLinkBlock* fPi0LinkList; // || links to the towers //------------------------------------------------------------------------------ // functions //------------------------------------------------------------------------------ public: // ****** constructors and destructor TStnTauBlock(); virtual ~TStnTauBlock(); // ****** accessors Int_t NTaus () { return fNTaus; } Int_t NGTau () { return fNGTau; } TClonesArray* TauList () { return fTauList; } TStnTau* Tau(int i) { return (TStnTau*) fTauList->UncheckedAt(i); } TStnLinkBlock* TrackLinkList() { return fTrackLinkList; } TStnLinkBlock* TowerLinkList() { return fTowerLinkList; } TStnLinkBlock* Pi0LinkList () { return fPi0LinkList; } // tau may have several tracks, // associated with it. Return // track number in the TrackBlock // of I-th tau track Int_t TrackNumber(Int_t Itau, Int_t I) { return fTrackLinkList->Index(Itau,I); } // tower key: // iphi+ieta<<8+valid_code<<16 Int_t TowerKey (Int_t Itau, Int_t I) { return fTowerLinkList->Index(Itau,I); } Int_t TowerIEta (Int_t Itau, Int_t I) { int ieta = (TowerKey(Itau,I) >> 8) & 0xff; return ieta; } Int_t TowerIPhi (Int_t Itau, Int_t I) { int iphi = TowerKey(Itau,I) & 0xff; return iphi; } Int_t TowerValidCode (Int_t Itau, Int_t I) { int code = (TowerKey(Itau,I) >> 16) & 0xff; return code; } Int_t Pi0Number (Int_t Itau, Int_t I) { return fPi0LinkList->Index(Itau,I); } // ****** setters TStnTau* NewTau() { TStnTau* t = new ((*fTauList)[fNTaus]) TStnTau(fNTaus); fNTaus++; return t; } // ****** overloaded functions of // TObject void Clear(Option_t* opt=""); void Print(Option_t* opt="") const; // ****** schema evolutioin void ReadV1(TBuffer& R__b); ClassDef(TStnTauBlock,2) }; #endif