X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TOF%2FAliTOFanalyzeSDigitsV2.C;h=f46968ada455454a9d6c185d0400ccd4f1afa088;hb=941603c023b092ec7d873264b0837cc5abb15fbd;hp=e5012ea09449cc9a70f47b533e903749e8312f75;hpb=da3d3acdb35a1789beb85ca161e018521ae64e65;p=u%2Fmrichter%2FAliRoot.git diff --git a/TOF/AliTOFanalyzeSDigitsV2.C b/TOF/AliTOFanalyzeSDigitsV2.C index e5012ea0944..f46968ada45 100644 --- a/TOF/AliTOFanalyzeSDigitsV2.C +++ b/TOF/AliTOFanalyzeSDigitsV2.C @@ -1,11 +1,25 @@ -Int_t AliTOFanalyzeSDigitsV2(Int_t ndump=15, Int_t iEvNum=0) +Int_t AliTOFanalyzeSDigitsV2(Int_t ndump=0, Int_t iEvNum=-1, Int_t nEvent=0) { + + ///////////////////////////////////////////////////////////////////////// // // Analyzes the TOF sdigits and fills QA-histograms - // report problems to pierella@bo.infn.it - // iEvNum=0 means all events in the file + // iEvNum=-1 and nEvent=0 means all events in the file + // + // root[0] .L AliTOFanalyzeSDigitsV2.C + // root[1] AliTOFanalyzeSDigitsV2() + // + // If you want analyze only the sdigits in the 2th event + // (existing int the header file), see in the following: + // + // root[0] .L AliTOFanalyzeSDigitsV2.C + // root[1] AliTOFanalyzeSDigitsV2(0,2,1) // // Updated to the new I/O by: A. De Caro, C. Zampolli + // + // Report problems to: decaro@sa.infn.it + // + ///////////////////////////////////////////////////////////////////////// Int_t rc = 0; @@ -34,7 +48,7 @@ Int_t AliTOFanalyzeSDigitsV2(Int_t ndump=15, Int_t iEvNum=0) gAlice = 0x0; } - AliRunLoader *rl = AliRunLoader::Open("galice.root",AliConfig::fgkDefaultEventFolderName,"read"); + AliRunLoader *rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),"read"); if (!rl) { cerr<<"Can't load RunLoader from file"<<"!\n"; @@ -52,6 +66,8 @@ Int_t AliTOFanalyzeSDigitsV2(Int_t ndump=15, Int_t iEvNum=0) return rc; } + rl->LoadHeader(); + AliLoader *tofl = rl->GetLoader("TOFLoader"); AliTOF *tof = (AliTOF *) rl->GetAliRun()->GetDetector("TOF"); @@ -62,35 +78,39 @@ Int_t AliTOFanalyzeSDigitsV2(Int_t ndump=15, Int_t iEvNum=0) return rc; } - cout << "First " << ndump << " SDigits found in TOF TreeS branch have:" << endl; + cout << "First " << ndump << " SDigits found in TOF TreeS branch have: \n"; - if (iEvNum == 0) - { - rl->LoadHeader(); - TTree *TE = rl->TreeE(); - iEvNum = (Int_t)TE->GetEntries(); - } + Int_t upperLimit; + Int_t bottomLimit; + + if (iEvNum<0) bottomLimit=0; + else bottomLimit = iEvNum; + + if (nEvent == 0) upperLimit = (Int_t)(rl->GetNumberOfEvents()); + else upperLimit = nEvent+bottomLimit; AliTOFSDigit *tofsdigit; - for (Int_t ievent = 0; ievent < iEvNum; ievent++) { - printf ("Processing event %d \n", ievent); + for (Int_t ievent = bottomLimit; ievent < upperLimit; ievent++) { + rl->GetEvent(ievent); + printf ("Processing event %d \n", ievent); // Get the pointer SDigit tree - tofl->LoadSDigits(); + tofl->LoadSDigits("read"); TTree *TS=tofl->TreeS(); tof->SetTreeAddress(); if(!TS) { - cout << " No TreeS found" << endl; + cout << " No TreeS found \n"; rc = 4; return rc; } TClonesArray * TOFsdigits = new TClonesArray("AliTOFSDigit",1000); - TOFsdigits = tof->SDigits(); + //TOFsdigits = tof->SDigits(); + tof->SDigits(); TOFsdigits = TS->GetBranch("TOF")->SetAddress(&TOFsdigits); Int_t nEntries = TS->GetEntries(); @@ -120,15 +140,15 @@ Int_t AliTOFanalyzeSDigitsV2(Int_t ndump=15, Int_t iEvNum=0) if (isSDigitBad) { - cout << " strange sdigit found" << endl; + cout << " strange sdigit found \n"; rc = 4; return rc; } if(k