00001
00002
00003
00004
00005
00006 TFile* filePtr;
00007 TTree* treePtr;
00008 TClonesArray* cutsArray;
00009 TOrdCollection* cutsColl;
00010
00011 void listStrangeCuts(const char* fileName="evMuDst.root");
00012
00013 void listStrangeCuts(const char* fileName) {
00014 filePtr = new TFile(fileName);
00015 if (!filePtr) return;
00016 cout << "_______________________________________________" << endl;
00017 cout << "Opened file: " << fileName << endl;
00018 cout << "_______________________________________________" << endl;
00019
00020 cutsColl = (TOrdCollection*) filePtr->Get("StrangeCuts");
00021 if (cutsColl) {
00022 cout << "Found cuts collection with " << cutsColl->GetSize()
00023 << " cuts." << endl;
00024 cout << "_______________________________________________" << endl;
00025 cutsColl->Print();
00026 cout << "_______________________________________________" << endl;
00027 return;
00028 }
00029
00030 treePtr = (TTree*) filePtr->Get("StrangeMuDst");
00031 if (!treePtr) treePtr = (TTree*) filePtr->Get("MuDst");
00032 if (!treePtr) return;
00033 if (!(treePtr->GetBranch("StrangeCuts"))) return;
00034
00035 cutArray = new TClonesArray("TCut",0);
00036 treePtr->SetBranchStatus("*",0);
00037 treePtr->SetBranchStatus("StrangeCuts.*",1);
00038 treePtr->SetBranchAddress("StrangeCuts",&cutArray);
00039 int ncuts=0;
00040 for (int i=0; i<treePtr->GetEntries(); i++) {
00041 treePtr->GetEvent(i);
00042 ncuts = cutArray->GetEntriesFast();
00043 if (ncuts) {
00044 cout << "Found cuts branch with " << ncuts << " cuts." << endl;
00045 cout << "_______________________________________________" << endl;
00046 cutArray->Print();
00047 break;
00048 }
00049 }
00050 if (!ncuts) cout << "Found cuts branch, but NO entries!!!" << endl;
00051 cout << "_______________________________________________" << endl;
00052 }
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066