/////////////////////////////////////////////////////////////////////////////// #include #include using std::istream; using std::ostream; #include ClassImp(TStnClusterBlock) //____________________________________________________________________________ void TStnClusterBlock::Streamer(TBuffer &R__b) { // Stream an object of class TStnClusterBlock. if (R__b.IsReading()) { Version_t R__v = R__b.ReadVersion(); if (R__v) { } R__b >> fNCesTrkClusters; fCesTrkClusterList->Streamer(R__b); R__b >> fNCesUnbClusters; fCesUnbClusterList->Streamer(R__b); R__b >> fNCprTrkClusters; fCprTrkClusterList->Streamer(R__b); R__b >> fNCprUnbClusters; fCprUnbClusterList->Streamer(R__b); R__b >> fNPesClusters; fPesClusterList->Streamer(R__b); } else { R__b.WriteVersion(TStnClusterBlock::IsA()); R__b << fNCesTrkClusters; fCesTrkClusterList->Streamer(R__b); R__b << fNCesUnbClusters; fCesUnbClusterList->Streamer(R__b); R__b << fNCprTrkClusters; fCprTrkClusterList->Streamer(R__b); R__b << fNCprUnbClusters; fCprUnbClusterList->Streamer(R__b); R__b << fNPesClusters; fPesClusterList->Streamer(R__b); } } //_____________________________________________________________________________ TStnClusterBlock::TStnClusterBlock() { fNCesTrkClusters = 0; fCesTrkClusterList = new TClonesArray("TCesCluster",10); fCesTrkClusterList->BypassStreamer(kFALSE); fNCesUnbClusters = 0; fCesUnbClusterList = new TClonesArray("TCesCluster",10); fCesUnbClusterList->BypassStreamer(kFALSE); fNCprTrkClusters = 0; fCprTrkClusterList = new TClonesArray("TCprCluster",10); fCprTrkClusterList->BypassStreamer(kFALSE); fNCprUnbClusters = 0; fCprUnbClusterList = new TClonesArray("TCprCluster",10); fCprUnbClusterList->BypassStreamer(kFALSE); fNPesClusters = 0; fPesClusterList = new TClonesArray("TPesCluster",10); fPesClusterList->BypassStreamer(kFALSE); for (int is=0; is<2; is++) { for (int iw=0; iw<24; iw++) { fCesU[is][iw][0] = 0; fCesU[is][iw][1] = 0; } } } //_____________________________________________________________________________ TStnClusterBlock::~TStnClusterBlock() { fCesTrkClusterList->Delete(); delete fCesTrkClusterList; fCesUnbClusterList->Delete(); delete fCesUnbClusterList; fCprTrkClusterList->Delete(); delete fCprTrkClusterList; fCprUnbClusterList->Delete(); delete fCprUnbClusterList; fPesClusterList->Delete(); delete fPesClusterList; if (fCesU[0][0][0]) { //----------------------------------------------------------------------------- // reconstruction arrays have been initialized, delete them //----------------------------------------------------------------------------- for (int is=0; is<2; is++) { for (int iw=0; iw<24; iw++) { fCesU[is][iw][0]->Clear(); fCesU[is][iw][1]->Clear(); delete fCesU[is][iw][0]; delete fCesU[is][iw][1]; } } } } //_____________________________________________________________________________ void TStnClusterBlock::Clear(const char* opt) { fNCesTrkClusters = 0; fCesTrkClusterList->Clear(); fNCesUnbClusters = 0; fCesUnbClusterList->Clear(); fNCprTrkClusters = 0; fCprTrkClusterList->Clear(); fNCprUnbClusters = 0; fCprUnbClusterList->Clear(); fNPesClusters = 0; fPesClusterList->Clear(); if (fCesU[0][0][0]) { //----------------------------------------------------------------------------- // reconstruction arrays have been initialized, clear them //----------------------------------------------------------------------------- for (int is=0; is<2; is++) { for (int iw=0; iw<24; iw++) { fCesU[is][iw][0]->Clear(); fCesU[is][iw][1]->Clear(); } } } } //_____________________________________________________________________________ void TStnClusterBlock::InitCesRecoArrays() { TCesCluster* cl; int nces, side, wedge, view; // reco arrays have not been created for (int is=0; is<2; is++) { for (int iw=0; iw<24; iw++) { if (fCesU[is][iw][0] == 0) { fCesU[is][iw][0] = new TObjArray(); fCesU[is][iw][1] = new TObjArray(); } else { fCesU[is][iw][0]->Clear(); fCesU[is][iw][1]->Clear(); } } } // fill them nces = NCesUnbClusters(); for (int i=0; iUncheckedAt(i); side = cl->Side (); wedge = cl->Wedge(); view = cl->View (); // somebody smart didn't follow the // hardware convention, so in the CDF // reco code iv=0 for wires, // iv=1 for strips // back to hardware convention fCesU[side][wedge][1-view]->Add(cl); } } //_____________________________________________________________________________ void TStnClusterBlock::Print(const char* Option) const { int print_ces(1), print_cpr(1), print_pes(1), banner_printed; TString opt = Option; if (opt.Index("/ces-only") >= 0) { print_cpr = 0; print_pes = 0; } else if (opt.Index("/pes-only") >= 0) { print_ces = 0; print_pes = 0; } else if (opt.Index("/cpr-only") >= 0) { print_ces = 0; print_cpr = 0; } TStnClusterBlock* block = (TStnClusterBlock*) this; if (print_ces) { printf("---------------------------------------------------------------\n"); printf(" N(Track-based CES_Clusters): %3i\n", fNCesTrkClusters); printf("---------------------------------------------------------------\n"); banner_printed = 0; TCesCluster* cl; for (int side=0; side<2; side++) { for (int wedge=0; wedge<24; wedge++) { for (int i=0; iCesTrkCluster(i); if ((cl->Side() == side) && (cl->Wedge() == wedge)) { if (! banner_printed) { banner_printed = 1; cl->Print("banner: i"); } if (! cl->View()) cl->Print(Form("data:%3i",i)); } } for (int i=0; iCesTrkCluster(i); if ((cl->Side() == side) && (cl->Wedge() == wedge)) { if (! banner_printed) { banner_printed = 1; cl->Print("banner: i"); } if (cl->View()) cl->Print(Form("data:%3i",i)); } } } } printf("---------------------------------------------------------------\n"); printf(" N(Seed-based CES_Clusters): N: %3i\n",fNCesUnbClusters); printf("---------------------------------------------------------------\n"); banner_printed = 0; for (int side=0; side<2; side++) { for (int wedge=0; wedge<24; wedge++) { for (int i=0; iCesUnbCluster(i); if ((cl->Side() == side) && (cl->Wedge() == wedge)) { if (! banner_printed) { banner_printed = 1; cl->Print("banner: i"); } cl->Print(Form("data:%3i",i)); } } } } } if (print_cpr) { printf("---------------------------------------------------------------\n"); printf(" N(Track-based CPR_Clusters): %3i\n", fNCprTrkClusters); printf("---------------------------------------------------------------\n"); banner_printed = 0; for (int i=0; iCprTrkCluster(i); if (! banner_printed) { banner_printed = 1; cluster->Print("banner: i"); } cluster->Print(Form("data:%3i",i)); } printf("---------------------------------------------------------------\n"); printf(" N(Seed-based CPR_Clusters): %3i\n",fNCprUnbClusters); printf("---------------------------------------------------------------\n"); banner_printed = 0; for (int i=0; iCprUnbCluster(i); if (! banner_printed) { banner_printed = 1; cluster->Print("banner: i"); } cluster->Print(Form("data:%3i",i)); } } if (print_pes) { printf("---------------------------------------------------------------\n"); printf(" N(PES_Clusters): %3i\n",fNPesClusters); printf("---------------------------------------------------------------\n"); banner_printed = 0; for (int i=0; iPesCluster(i); if (! banner_printed) { banner_printed = 1; cluster->Print("banner: i"); } cluster->Print(Form("data:%3i",i)); } } }