// Steer TRD QA train for Reconstruction (Clusterizer, Tracking and PID).
//
// Usage:
-// run.C(tasks, files)
-// tasks : "ALL" or one/more of the following:
+// run.C(optList, files, nev, first, runNo, ocdb_uri, grp_uri)
+//
+// optList : "ALL" [default] or one/more of the following:
// "EFF" : TRD Tracking Efficiency
// "EFFC" : TRD Tracking Efficiency Combined (barrel + stand alone) - only in case of simulations
// "MULT" : TRD single track selection
// "ALGN" : TRD alignment
// "PID" : TRD PID - pion efficiency
// "PIDR" : TRD PID - reference data
+// "V0" : monitor V0 performance for use in TRD PID calibration
// "DET" : Basic TRD Detector checks
+// ****** SPECIAL OPTIONS **********
// "NOFR" : Data set does not have AliESDfriends.root
-// "NOMC" : Data set does not have Monte Carlo Informations (real data), so all tasks which rely
-// on MC information are switched off
+// "NOMC" : Data set does not have Monte Carlo Informations (default have MC),
//
+// files : the list of ESD files to be processed [default AliESds.root from cwd]
+// nev : number of events to be processed [default all]
+// first : first event to process [default 0]
+// runNo : run number [default 0]
+// ocdb_uri : OCDB location [default local, $ALICE_ROOT]. In case of AliEn the syntax should be of the form
+// alien://folder=/alice/data/2010/OCDB?user=username?cacheF=yourDirectory?cacheS=yourSize
+// grp_uri : GRP/GRP/Data location [default cwd]. In case of AliEn the syntax should be of the form
+// alien://folder=/alice/data/2010/OCDB?user=username?cacheF=yourDirectory?cacheS=yourSize
// In compiled mode :
// Don't forget to load first the libraries
// gSystem->Load("libMemStat.so")
// gSystem->Load("libMemStatGui.so")
// gSystem->Load("libANALYSIS.so")
// gSystem->Load("libANALYSISalice.so")
+// gSystem->Load("libTENDER.so");
// gSystem->Load("libPWG1.so");
// gSystem->Load("libNetx.so") ;
// gSystem->Load("libRAliEn.so");
TChain* MakeChainLST(const char* filename = 0x0);
TChain* MakeChainXML(const char* filename = 0x0);
-void run(Char_t *optList="ALL", const Char_t *files=0x0, Long64_t nev=1234567890, Long64_t first = 0, Int_t runNo=0, const Char_t *ocdb_uri="local://$ALICE_ROOT/OCDB", const Char_t *grp_uri=Form("local://%s", gSystem->pwd()))
+void run(Char_t *optList="ALL", const Char_t *files=0x0, Long64_t nev=1234567890, Long64_t first = 0)
{
TMemStat *mem = 0x0;
if(MEM){
timer.Start();
// VERY GENERAL SETTINGS
- AliLog::SetGlobalLogLevel(AliLog::kError);
+ //AliLog::SetGlobalLogLevel(AliLog::kError);
+ gStyle->SetOptStat(0);
if(gSystem->Load("libANALYSIS.so")<0) return;
if(gSystem->Load("libANALYSISalice.so")<0) return;
if(gSystem->Load("libTENDER.so")<0) return;
Bool_t fHasMCdata = HasReadMCData(optList);
Bool_t fHasFriends = HasReadFriendData(optList);
- // INITIALIZATION OF RUNNING ENVIRONMENT
- // initialize OCDB manager
- AliCDBManager *cdbManager = AliCDBManager::Instance();
- cdbManager->SetDefaultStorage(ocdb_uri);
- if(!cdbManager->IsDefaultStorageSet()){
- Error("run.C", "Error setting OCDB.");
- return;
- }
- cdbManager->SetRun(runNo);
- cdbManager->SetSpecificStorage("GRP/GRP/Data", grp_uri);
- cdbManager->SetCacheFlag(kFALSE);
- // initialize magnetic field from the GRP manager.
- AliGRPManager grpMan;
- if(!grpMan.ReadGRPEntry()) return;
- if(!grpMan.SetMagField()) return;
- //AliRunInfo *runInfo = grpMan.GetRunInfo();
- AliGeomManager::LoadGeometry();
-
// DEFINE DATA CHAIN
TChain *chain = 0x0;
if(!files) chain = MakeChainLST();
else chain = MakeChainLST(files);
}
if(!chain) return;
- chain->SetBranchStatus("*FMD*",0);
- chain->SetBranchStatus("*Calo*",0);
- chain->SetBranchStatus("Tracks", 1);
- chain->SetBranchStatus("ESDfriend*",1);
chain->Lookup();
chain->GetListOfFiles()->Print();
Int_t nfound=(Int_t)chain->GetEntries();
// BUILD ANALYSIS MANAGER
AliAnalysisManager *mgr = new AliAnalysisManager("TRD Reconstruction Performance & Calibration");
- AliVEventHandler *esdH = 0x0, *mcH = 0x0;
- mgr->SetInputEventHandler(esdH = new AliESDInputHandler);
- //esdH->SetActiveBranches("ESDfriend");
+ AliESDInputHandlerRP *esdH(NULL);
+ mgr->SetInputEventHandler(esdH = new AliESDInputHandlerRP);
+ esdH->SetReadFriends(kTRUE);
+ esdH->SetActiveBranches("ESDfriend");
+ AliMCEventHandler *mcH(NULL);
if(fHasMCdata) mgr->SetMCtruthEventHandler(mcH = new AliMCEventHandler());
//mgr->SetDebugLevel(10);
+ mgr->SetSkipTerminate(kTRUE);
gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTrainPerformanceTRD.C");
if(!AddTrainPerformanceTRD(optList)) {
}
//mgr->PrintStatus();
mgr->StartAnalysis("local", chain, nev, first);
-
timer.Stop();
timer.Print();
- delete cdbManager;
-
// verbosity
printf("\tCLEANING TASK LIST:\n");
mgr->GetTasks()->Delete();
if(mcH) delete mcH;
delete esdH;
- delete mgr;
delete chain;
if(MEM) delete mem;
if(MEM) TMemStatViewerGUI::ShowGUI();