-Int_t AliTOFanalyzeDigits(Int_t ndump=15, Int_t iEvNum=0)
+Int_t AliTOFanalyzeDigits(Int_t ndump=0, Int_t numberOfEvents=0)
{
+
+ /////////////////////////////////////////////////////////////////////////
//
// Analyzes the TOF digits and fills QA-histograms
- // report problems to pierella@bo.infn.it
- // iEvNum=0 means all events in the file
+ // numberOfEvents=0 means all events in the file
+ //
// Author: F. Pierella (Bologna University)
// Updated to the new I/O by: A. De Caro, C. Zampolli
+ //
+ // Report problems to decaro@sa.infn.it
+ //
+ /////////////////////////////////////////////////////////////////////////
Int_t rc = 0;
if (gAlice)
{
- delete gAlice->GetRunLoader();
+ delete AliRunLoader::Instance();
delete gAlice;
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";
return rc;
}
- cout << "First " << ndump << " Digits found in TOF TreeD branch have:" << endl;
-
- if (iEvNum == 0)
- {
- rl->LoadHeader();
- TTree *TE = rl->TreeE();
- iEvNum = (Int_t)TE->GetEntries();
- }
+ if (ndump) cout << "First " << ndump << " Digits found in TOF TreeD branch have: \n";
+
+ rl->LoadHeader();
+ if (numberOfEvents == 0) numberOfEvents = (Int_t)(rl->GetNumberOfEvents());
AliTOFdigit *tofdigit;
- for (Int_t ievent = 0; ievent < iEvNum; ievent++) {
+ for (Int_t ievent = 0; ievent < numberOfEvents; ievent++) {
printf ("Processing event %d \n", ievent);
rl->GetEvent(ievent);
}
if(k<ndump){
- cout << k << "-th | " << "Sector " << sector << " | Plate " << plate << " | Strip " << strip << " | PadZ " << padz << " | PadX " << padx << endl;
- cout << k << "-th | ADC " << adc << " [bin] | TDC " << tdc << " [bin]" << endl;
- cout << "----------------------------------------------------"<< endl;
+ cout << k << "-th | Sector " << sector << " | Plate " << plate << " | Strip " << strip << " | PadZ " << padz << " | PadX " << padx << endl;
+ cout << k << "-th | ADC " << adc << " [bin] | TDC " << tdc << " [bin] \n";
+ cout << "---------------------------------------------------- \n";
}
// filling digit volume histos
}
tofl->UnloadDigits();
- rl->UnloadHeader();
- rl->UnloadgAlice();
} // end loop on events
+ rl->UnloadHeader();
+ rl->UnloadgAlice();
+
TFile *fout = new TFile("TOF_digitsQA.root","RECREATE");
htdc->Write();
hadc->Write();
if (gAlice)
{
- delete gAlice->GetRunLoader();
+ delete AliRunLoader::Instance();
delete gAlice;
gAlice = 0x0;
}