#ifndef STNTUPLE_TStnCosmicBlock #define STNTUPLE_TStnCosmicBlock //----------------------------------------------------------------------------- // definition of the STNTUPLE cosmic block // Author: Anyes Taffard (CDF/FNAL) // Date: May 13 2002 // // 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 TStnCosmicBlock // 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 #include "TStnLinkBlock.hh" #include class TStnEvent; class CdfTrack; class TStnCosmicBlock: public TStnDataBlock { friend Int_t StntupleInitCosmicBlock(TStnDataBlock*, AbsEvent* , int); public: enum { kTop = 0, kBot = 1 }; protected: //----------------------------------------------------------------------------- // data members //----------------------------------------------------------------------------- //NB some of those variables are redundant can get them from other blocks //Ntracks, NMuons, NStubs Int_t fLeg[2]; //Contains the idx of the cosmic Muons in the MuonBlock Int_t fCosmicBit; // bit-packed word // Int_t fNLegs; // # of cosmic legs Int_t fNTrkVtx; // Number of track used to make vertex Int_t fTrackId[2]; // Track id; used for matching Int_t fTofM[2]; //Time of Flight Method //new version 2.0 Int_t fAlgo[2]; Int_t fFitDir[2][2]; Int_t fFitNCOTH[2][2]; Int_t fFitNCOTHExp[2][2]; // ***** here the float block starts Float_t fDPhiMuStub; // delta phi between stub phi and track phi //new verssion 2.0 Float_t fAcollinearity; // Acollinearity between the 2 cosmic legs Float_t fD0Rho; // sqrt(d_1^2+d0_2^2) Float_t fD0Beta; // tan(beta)=d0_2/d0_1 Float_t fDPhi; // delta(phi1,phi2) Float_t fSumEta; // Sum(Eta_1,Eta_2) Float_t fZi; //Seed to vertex Float_t fdZi; //Error on above Float_t fZt; //Mean Float_t fdZt; //error on above // TOP=0 & BOTTOM=1 Float_t fDeltaT0[2]; //delta t0 of refitted COT track Float_t fErrorDeltaT0[2]; //error on above Float_t fDeltaBetaInv[2]; //delta beta^-1 of refitted COT track Float_t fErrorDeltaBetaInv[2]; //error on above Float_t fEmE[2]; //Em Energy of the neighbouring towers Float_t fHadE[2]; //Had Energy of the neighbouring towers Float_t fHadTDC[2]; //Hadron TDC time Float_t fTof[2]; //Time of Flight Float_t fCsp[2]; //CSP time information Float_t fCsx[2]; //CSX time information Float_t fNgbrEmE[2]; //Em Energy of the neighbouring towers Float_t fNgbrHadE[2]; //Had Energy of the neighbouring towers Float_t fNgbrHadTDC[2]; //Hadron TDC time of the neighbouring towers Float_t fStubPhi[2]; //Muon stub phi //new version 2.0 //track parameters. Ig algo=-1 this are the refitted parameters Float_t fPt[2]; Float_t fCrv[2]; Float_t fCot[2]; Float_t fPhi[2]; Float_t fEta[2]; Float_t fZ0[2]; Float_t fD0[2]; Float_t fD0C[2]; Float_t fFitT0[2][2]; //Refitted track values Float_t fFitdT0[2][2]; Float_t fFitCrdT0[2][2]; Float_t fFitChi2[2][2]; Float_t fFitdChi2[2][2]; void* fEOR; // ! end of record, internal use only //----------------------------------------------------------------------------- // functions //----------------------------------------------------------------------------- public: // ****** constructors and destructor // ****** constructors and destructor TStnCosmicBlock(); virtual ~TStnCosmicBlock(); // ****** accessors Int_t HasCosmicRay () const { return (fCosmicBit ) & 0x1; } //Methods to read cosmicBit Int_t HasFewTracks () const { return (fCosmicBit >> 1) & 0x1; } Int_t HasLargeD0 () const { return (fCosmicBit >> 2) & 0x1; } Int_t HasLargeZ0 () const { return (fCosmicBit >> 3) & 0x1; } Int_t HasAcolTrack () const { return (fCosmicBit >> 4) & 0x1; } Int_t HasOOTEnergy () const { return (fCosmicBit >> 5) & 0x1; } Int_t HasOOTScintillators () const { return (fCosmicBit >> 6) & 0x1; } Int_t HasNoVertex () const { return (fCosmicBit >> 7) & 0x1; } Int_t HasLargeDz () const { return (fCosmicBit >> 8) & 0x1; } Int_t HasLargeDPhiMyStb () const { return (fCosmicBit >> 9) & 0x1; } //Cosmic muon Categories Int_t isMuonNothing () const { return (fCosmicBit >> 9) & 0x1; } Int_t isMuonStub () const { return (fCosmicBit >> 10) & 0x1; } Int_t isMuonTrack () const { return (fCosmicBit >> 11) & 0x1; } Int_t isMuonMuon () const { return (fCosmicBit >> 12) & 0x1; } //new versin 2.0 Int_t HasOOTTof () const { return (fCosmicBit >> 13) & 0x1; } Int_t HasNotOutgoingPair () const { return (fCosmicBit >> 14) & 0x1; } Int_t HasLowEmFrac () const { return (fCosmicBit >> 15) & 0x1; } Int_t HasLowQFrac () const { return (fCosmicBit >> 16) & 0x1; } Int_t HasOOTCaloE () const { return (fCosmicBit >> 17) & 0x1; } Int_t NLegs () const { return fNLegs; } Float_t dPhiMuStub () const { return fDPhiMuStub;} //new version 2.0 Float_t Acollinearity () const { return fAcollinearity; } Float_t D0Rho () const { return fD0Rho; } Float_t D0Beta () const { return fD0Beta; } Float_t DeltaPhi () const { return fDPhi; } Float_t SumEta () const { return fSumEta; } Float_t Zi () const { return fZi; } Float_t DZi () const { return fdZi; } Int_t NTrkVtx () const { return fNTrkVtx; } Float_t Zt () const { return fZt; } Float_t DZt () const { return fdZt; } Int_t TrackId (Int_t iLeg) const {return fTrackId[iLeg];} Int_t Algo (Int_t iLeg) const {return fAlgo[iLeg];} Float_t Pt (Int_t iLeg) const {return fPt[iLeg];} Float_t Crv (Int_t iLeg) const {return fCrv[iLeg];} Float_t Cot (Int_t iLeg) const {return fCot[iLeg];} Float_t Phi (Int_t iLeg) const {return fPhi[iLeg];} Float_t Eta (Int_t iLeg) const {return fEta[iLeg];} Float_t Z0 (Int_t iLeg) const {return fZ0[iLeg];} Float_t D0 (Int_t iLeg) const {return fD0[iLeg];} Float_t D0C (Int_t iLeg) const {return fD0C[iLeg];} Float_t Charge (Int_t iLeg) const { if(ValidTrack(iLeg)) return (fCrv[iLeg]>0)? +1: -1; else return 999999;} Float_t DeltaT0 (Int_t iLeg) const {return fDeltaT0[iLeg];} Float_t ErrorDeltaT0 (Int_t iLeg) const {return fErrorDeltaT0[iLeg];} Float_t DeltaBetaInv (Int_t iLeg) const {return fDeltaBetaInv[iLeg];} Float_t ErrorDeltaBetaInv (Int_t iLeg) const {return fErrorDeltaBetaInv[iLeg];} Float_t FitT0 (Int_t iLeg,Int_t iType) const {return fFitT0[iLeg][iType];} Float_t FitdT0 (Int_t iLeg,Int_t iType) const {return fFitdT0[iLeg][iType];} Float_t FitCrudeT0 (Int_t iLeg,Int_t iType) const {return fFitCrdT0[iLeg][iType];} Float_t FitChi2 (Int_t iLeg,Int_t iType) const {return fFitChi2[iLeg][iType];} Float_t FitdChi2 (Int_t iLeg,Int_t iType) const {return fFitdChi2[iLeg][iType];} Int_t FitDirection (Int_t iLeg,Int_t iType) const {return fFitDir[iLeg][iType];} Int_t FitNCOTHits (Int_t iLeg,Int_t iType) const {return fFitNCOTH[iLeg][iType];} Int_t FitNCOTHitsExp(Int_t iLeg,Int_t iType) const {return fFitNCOTHExp[iLeg][iType];} Float_t EmE (Int_t iLeg) const {return fEmE[iLeg];} Float_t HadE (Int_t iLeg) const {return fHadE[iLeg];} Float_t HadTDC (Int_t iLeg) const {return fHadTDC[iLeg];} Float_t Tof (Int_t iLeg) const {return fTof[iLeg];} Int_t TofMethod (Int_t iLeg) const {return fTofM[iLeg];} //new version 2.0 Float_t Csp (Int_t iLeg) const {return fCsp[iLeg];} Float_t Csx (Int_t iLeg) const {return fCsx[iLeg];} Float_t NgbrEmE (Int_t iLeg) const {return fNgbrEmE[iLeg];} Float_t NgbrHadE (Int_t iLeg) const {return fNgbrHadE[iLeg];} Float_t NgbrHadTDC (Int_t iLeg) const {return fNgbrHadTDC[iLeg];} Float_t StubPhi (Int_t iLeg) const {return fStubPhi[iLeg];} Bool_t ValidTrack (Int_t iLeg) const {return fTrackId[iLeg] != 999999;} //need to be changed might have track without Bool_t ValidStub (Int_t iLeg) const {return fStubPhi[iLeg] != 999999;} Bool_t ValidEnergy (Int_t iLeg) const {return (fEmE[iLeg] != 999999 || fHadE[iLeg] != 999999 || fNgbrEmE[iLeg] != 999999 || fNgbrHadE[iLeg] != 999999);} Bool_t ValidHadTDC (Int_t iLeg) const {return fHadTDC[iLeg] != 999999;} Bool_t ValidNgbrHadTDC(Int_t iLeg) const {return fNgbrHadTDC[iLeg] != 999999;} Bool_t ValidTof (Int_t iLeg) const {return fTof[iLeg] != 999999;} Bool_t ValidCsp (Int_t iLeg) const {return fCsp[iLeg] != 999999;} Bool_t ValidCsx (Int_t iLeg) const {return fCsx[iLeg] != 999999;} Bool_t TrackLessMuon (Int_t iLeg) const { if( !ValidTrack(iLeg) && ValidStub(iLeg)) return true; else return false;} Bool_t StubLessMuon (Int_t iLeg) const { if( ValidTrack(iLeg) && !ValidStub(iLeg)) return true; else return false;} Float_t DeltaTDC () const { if(ValidHadTDC(0) && ValidHadTDC(1)) return HadTDC(0)-HadTDC(1) ; else return 999999;} Float_t DeltaTof () const { if(ValidTof(0) && ValidTof(1)) return Tof(0)-Tof(1); else return 999999;} Int_t Leg (Int_t i) const { return fLeg[i];} Int_t TopLeg () const { return fLeg[0];} Int_t BotLeg () const { return fLeg[1];} Bool_t ValidLeg (Int_t i) const { return fLeg[i] != 999999; } //----------------------------------------------------------------------------- // setters //----------------------------------------------------------------------------- void SetDPhi(Float_t dPhi) {fDPhi=dPhi;} void SetSumEta(Float_t sEta) {fSumEta=sEta;} void SetMuonNumber(Int_t It, Int_t legId){ fLeg[legId] = It; } void Clear(Option_t* opt = ""); void Print(Option_t* opt = "") const; // ****** schema evolution // read version 1 of the block void ReadV1(TBuffer& R__b); void ReadV2(TBuffer& R__b); ClassDef(TStnCosmicBlock,3) }; #endif