#include #include #include ClassImp(TStnJetBlock) //______________________________________________________________________________ void TStnJetBlock::ReadV1(TBuffer &R__b) { // reads in V1 of TStnJetBlock - don't change the sequence! R__b >> fConeSize; R__b >> fNJets; R__b >> fNJet10; R__b >> fNJet15; R__b >> fNJet20; R__b >> fNJet25; fListOfJets->Streamer(R__b); //----------------------------------------------------------------------------- // added in V3 //----------------------------------------------------------------------------- fZVertex = TStnDataBlock::kUndefined; } //______________________________________________________________________________ void TStnJetBlock::ReadV2(TBuffer &R__b) { // reads in V2 of TStnJetBlock - don't change the sequence! R__b.ReadFastArray(&fNJets ,kNIntegersV2); R__b.ReadFastArray(&fConeSize,kNFloatsV2); if (fNJets > 0) { fListOfJets->Streamer(R__b); fTowerLinkList->Streamer(R__b); fTrackLinkList->Streamer(R__b); //----------------------------------------------------------------------------- // kludge problem with the initialization of the last element: in case the // last jet didn't have a corresponding track, we had a problem //----------------------------------------------------------------------------- if (fTrackLinkList->Last() < fNJets-1) { fTrackLinkList->InitLinks(fNJets-1); } } //----------------------------------------------------------------------------- // added in V3 //----------------------------------------------------------------------------- fZVertex = TStnDataBlock::kUndefined; } //______________________________________________________________________________ void TStnJetBlock::Streamer(TBuffer &R__b) { // Stream an object of class TStnJetBlock. if (R__b.IsReading()) { Version_t R__v = R__b.ReadVersion(); if (R__v == 1) ReadV1(R__b); else if (R__v == 2) ReadV2(R__b); else { // current version - V3 R__b.ReadFastArray(&fNJets ,kNIntegersV3); R__b.ReadFastArray(&fConeSize,kNFloatsV3); if (fNJets > 0) { fListOfJets->Streamer(R__b); fTowerLinkList->Streamer(R__b); fTrackLinkList->Streamer(R__b); //----------------------------------------------------------------------------- // kludge problem with the initialization of the last element: in case the // last jet didn't have a corresponding track, we had a problem //----------------------------------------------------------------------------- if (fTrackLinkList->Last() < fNJets-1) { fTrackLinkList->InitLinks(fNJets-1); } } } } else { // write current version of the block R__b.WriteVersion(TStnJetBlock::IsA()); R__b.WriteFastArray(&fNJets ,kNIntegersV3); R__b.WriteFastArray(&fConeSize,kNFloatsV3); if (fNJets > 0) { fListOfJets->Streamer(R__b); fTowerLinkList->Streamer(R__b); fTrackLinkList->Streamer(R__b); } } } //_____________________________________________________________________________ TStnJetBlock::TStnJetBlock() { fNJets = 0; fZVertex = TStnDataBlock::kUndefined; fListOfJets = new TClonesArray("TStnJet",10); fTowerLinkList = new TStnLinkBlock(); fTrackLinkList = new TStnLinkBlock(); fListOfJets->BypassStreamer(kFALSE); } //_____________________________________________________________________________ TStnJetBlock::~TStnJetBlock() { delete fTrackLinkList; delete fTowerLinkList; fListOfJets->Delete(); delete fListOfJets; } //_____________________________________________________________________________ Int_t TStnJetBlock::JetNumber(const CdfJet* aJet) const { Int_t ij = -1; TStnJet* j; for (int i = 0; i < fNJets; i++) { j = Jet (i); if ( j->GetCdfJet() == aJet) { ij = i; break; } } return ij; } //_____________________________________________________________________________ void TStnJetBlock::Clear(const char* opt) { fLinksInitialized = 0; fNJets = 0; fZVertex = TStnDataBlock::kUndefined; fListOfJets->Clear(); fTowerLinkList->Clear(); fTrackLinkList->Clear(); } //_____________________________________________________________________________ void TStnJetBlock::Print(const char* opt) const { // printf(" ************** N(jets) = %2i ",fNJets); int banner_printed = 0; for (int i=0; iPrint("banner"); banner_printed = 1; } jet->Print("data"); } }