/////////////////////////////////////////////////////////////////////////////// // STNTUPLE description of a jet // // Description of the inline functions: // ------------------------------------ // Int_t Number(): returns index of this jet in the list of jets // Int_t ObjectType(): a jet can be classified as an electron, // photon, tau etc. This function returns type // of the corresponding object - see definition // of the types in the include file // Int_t ObjectNumber(): returns index of an object, matched to this // jet, in the corresponding list (list of // electrons, taus etc) // Float_t SeedEt(): returns Et of a seed tower for this jet // Float_t DetEta(): returns eta of a jet calculated assuming // Z(vertex) = 0 /////////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ #pragma implementation #endif #include "Stntuple/data/TStnTypes.hh" #include "Stntuple/obj/TStnJet.hh" ClassImp(TStnJet) // lengths of the integer and float TStnJet // data blocks const Int_t TStnJet::fgNIntegers[20] = { -1, -1, 3, 3, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; const Int_t TStnJet::fgNFloats[20] = { -1, -1, 21, 26, 26, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; //______________________________________________________________________________ void TStnJet::ReadV1(TBuffer &R__b) { // Stream V1 of an object of class TStnJet. struct TStnJetV1_t { Int_t fType; TLorentzVector fMomentum; Float_t fEt; Float_t fM; Float_t fEveta; Float_t fDteta; Float_t fPhi; Float_t fEmf; Float_t fWord; Float_t fCorfm; Float_t fCorfd; Float_t fCorfa; Float_t fNtr; // N(tracks) associated to the jet Float_t fNtrp; Float_t fEp; Int_t fNjtrk0; Float_t fTag; Float_t fEgrd; Float_t fVbpb; Float_t fPbpb; Float_t fScbpb; Float_t fScnpb; Float_t fPppb; Float_t fPnpb; Float_t fTau1; Float_t fTau2; Float_t fZvtx; Float_t fDz; Float_t fPtout; TArrayF fVpt; Float_t fNovpt; // number of the matched object in the // corresponding list (default : -1) Int_t fMatch; } jet; TObject::Streamer(R__b); R__b >> (Int_t&)jet.fType; jet.fMomentum.Streamer(R__b); R__b >> jet.fEt; R__b >> jet.fM; R__b >> jet.fEveta; R__b >> jet.fDteta; R__b >> jet.fPhi; R__b >> jet.fEmf; R__b >> jet.fWord; R__b >> jet.fCorfm; R__b >> jet.fCorfd; R__b >> jet.fCorfa; R__b >> jet.fNtr; R__b >> jet.fNtrp; R__b >> jet.fEp; R__b >> jet.fNjtrk0; R__b >> jet.fTag; R__b >> jet.fEgrd; R__b >> jet.fVbpb; R__b >> jet.fPbpb; R__b >> jet.fScbpb; R__b >> jet.fScnpb; R__b >> jet.fPppb; R__b >> jet.fPnpb; R__b >> jet.fTau1; R__b >> jet.fTau2; R__b >> jet.fZvtx; R__b >> jet.fDz; R__b >> jet.fPtout; jet.fVpt.Streamer(R__b); R__b >> jet.fNovpt; R__b >> jet.fMatch; // ****** copy the data into the object record // V1 doesnt' define SeedTower (et,ieta,iphi) fMomentum = jet.fMomentum; SetNTrackWord(int(jet.fNtr),int(jet.fNtrp),int(jet.fNjtrk0),int(jet.fNovpt)); SetTypeWord (jet.fType, jet.fMatch, 255, 255); fDetEta = jet.fDteta; fEmfr = jet.fEmf; fEp = jet.fEp; fSeedEt = -1; fEgrd = jet.fEgrd; fWord = jet.fWord; fCorfm = jet.fCorfm; fCorfd = jet.fCorfd; fCorfa = jet.fCorfa; fTag = jet.fTag; fVbpb = jet.fVbpb; fPbpb = jet.fPbpb; fScbpb = jet.fScbpb; fScnpb = jet.fScnpb; fPppb = jet.fPppb; fPnpb = jet.fPnpb; fTrackMass = -1.e6; fMaxTrackPt = jet.fTau2; fZvtx = jet.fZvtx; fDz = jet.fDz; fPtout = jet.fPtout; } //______________________________________________________________________________ void TStnJet::ReadV2(TBuffer &R__b) { // Stream V2 of an object of class TStnJet. struct TStnJetV2_t { Int_t fType; TLorentzVector fMomentum; Float_t fEt; Float_t fM; Float_t fEveta; Float_t fDteta; Float_t fPhi; Float_t fEmf; Float_t fWord; Float_t fCorfm; Float_t fCorfd; Float_t fCorfa; Float_t fNtr; // N(tracks) associated to the jet Float_t fNtrp; Float_t fEp; Int_t fNjtrk0; Float_t fTag; Float_t fEgrd; Float_t fVbpb; Float_t fPbpb; Float_t fScbpb; Float_t fScnpb; Float_t fPppb; Float_t fPnpb; Float_t fTau1; Float_t fTau2; Float_t fZvtx; Float_t fDz; Float_t fPtout; TArrayF fVpt; Float_t fNovpt; // number of the matched object in the // corresponding list (default : -1) Int_t fMatch; // parameters of the seed tower // ieta << 8 + iphi Short_t fSeedEtaPhi; Float_t fSeedEt; } jet; TObject::Streamer(R__b); R__b >> (Int_t&)jet.fType; jet.fMomentum.Streamer(R__b); R__b >> jet.fEt; R__b >> jet.fM; R__b >> jet.fEveta; R__b >> jet.fDteta; R__b >> jet.fPhi; R__b >> jet.fEmf; R__b >> jet.fWord; R__b >> jet.fCorfm; R__b >> jet.fCorfd; R__b >> jet.fCorfa; R__b >> jet.fNtr; R__b >> jet.fNtrp; R__b >> jet.fEp; R__b >> jet.fNjtrk0; R__b >> jet.fTag; R__b >> jet.fEgrd; R__b >> jet.fVbpb; R__b >> jet.fPbpb; R__b >> jet.fScbpb; R__b >> jet.fScnpb; R__b >> jet.fPppb; R__b >> jet.fPnpb; R__b >> jet.fTau1; R__b >> jet.fTau2; R__b >> jet.fZvtx; R__b >> jet.fDz; R__b >> jet.fPtout; jet.fVpt.Streamer(R__b); R__b >> jet.fNovpt; R__b >> jet.fMatch; // added in V2 R__b >> jet.fSeedEtaPhi; R__b >> jet.fSeedEt; // ****** copy the data into the object record fMomentum = jet.fMomentum; SetNTrackWord(int(jet.fNtr),int(jet.fNtrp),int(jet.fNjtrk0),int(jet.fNovpt)); SetTypeWord (jet.fType, jet.fMatch, (jet.fSeedEtaPhi >> 8) & 0xff, (jet.fSeedEtaPhi ) & 0xff); fDetEta = jet.fDteta; fEmfr = jet.fEmf; fEp = jet.fEp; fSeedEt = jet.fSeedEt; fEgrd = jet.fEgrd; fWord = jet.fWord; fCorfm = jet.fCorfm; fCorfd = jet.fCorfd; fCorfa = jet.fCorfa; fTag = jet.fTag; fVbpb = jet.fVbpb; fPbpb = jet.fPbpb; fScbpb = jet.fScbpb; fScnpb = jet.fScnpb; fPppb = jet.fPppb; fPnpb = jet.fPnpb; fTrackMass = -1.e6; fMaxTrackPt = jet.fTau2; fZvtx = jet.fZvtx; fDz = jet.fDz; fPtout = jet.fPtout; } //______________________________________________________________________________ void TStnJet::ReadV3(TBuffer &R__b) { // Stream V3 of an object of class TStnJet. // V4 has more words appended to the end of integer and float blocks // the beginning of those didn't change int R__v = 3; TObject::Streamer (R__b); fMomentum.Streamer(R__b); R__b.ReadFastArray(&fNTrackWord,NIntegers(R__v)); R__b.ReadFastArray(&fDetEta ,NFloats (R__v)); } //______________________________________________________________________________ void TStnJet::ReadV4(TBuffer &R__b) { // Stream V4 of an object of class TStnJet, V5 appends 3 more integers int R__v = 4; TObject::Streamer (R__b); fMomentum.Streamer(R__b); R__b.ReadFastArray(&fNTrackWord,NIntegers(R__v)); R__b.ReadFastArray(&fDetEta ,NFloats (R__v)); } //______________________________________________________________________________ void TStnJet::Streamer(TBuffer &R__b) { // Stream an object of class TStnJet. Version_t R__v; if (R__b.IsReading()) { R__v = R__b.ReadVersion(); if (R__v) { } if (R__v == 1) ReadV1(R__b); else if (R__v == 2) ReadV2(R__b); else if (R__v == 3) ReadV3(R__b); else if (R__v == 4) ReadV4(R__b); else { // current version: 4 TObject::Streamer(R__b); fMomentum.Streamer(R__b); R__b.ReadFastArray(&fNTrackWord,NIntegers(R__v)); R__b.ReadFastArray(&fDetEta ,NFloats (R__v)); } } else { R__v = Class_Version(); R__b.WriteVersion(TStnJet::IsA()); TObject::Streamer(R__b); fMomentum.Streamer(R__b); R__b.WriteFastArray(&fNTrackWord,NIntegers(R__v)); R__b.WriteFastArray(&fDetEta ,NFloats (R__v)); } } //------------------------------------------------------------------------------ TStnJet::TStnJet(Int_t I) { // default constructor SetNumber(I); SetTypeWord(TStnTypes::kJet,-1,-1,-1); fZvtx = 0; fEmfr = 0; fEp = 0; fDz = 0.; fWord = 0; fNTrackWord = 0; fCorfd = 1.; fCorfm = 1.; } //------------------------------------------------------------------------------ TStnJet::~TStnJet() { } //------------------------------------------------------------------------------ void TStnJet::Clear(Option_t* Option) { SetTypeWord(TStnTypes::kJet,-1,-1,-1); fZvtx = 0; fDz = 0.; fNTrackWord = 0; fCorfd = 1.; fCorfm = 1.; } //_____________________________________________________________________________ void TStnJet::Print(Option_t* opt) const { if ((strlen(opt) == 0) || (strstr(opt,"banner") != 0)) { printf("-------------------------------------------------------"); printf("-------------------------------------------------\n"); printf(" i Et Eta Phi Px Py Emfr E/P "); printf("corrfm corrfd Vz Dz N(trk)\n"); printf("------------------------------------------------------"); printf("-------------------------------------------------\n"); } // cast out const TStnJet* jet = (TStnJet*) this; if ((strlen(opt) == 0) || (strstr(opt,"data") != 0)) { // print jet parameters printf("%2i %7.2f %7.2f %7.2f %7.2f %7.2f ", Number(), Et(), jet->Momentum()->Eta(), jet->Momentum()->Phi(), jet->Momentum()->Px(), jet->Momentum()->Py()); printf("%5.3f %6.2f %6.2f %6.2f %7.3f %7.3f %5i\n", Emfr(), EOverP(), Corfm(), EtCorr(), Vz(), Dz(), NTracks()); } }