2 Macro to test functionality of the AnliAnalysisTaskFiltered.
3 To be used within UnitTest suit
4 $ALICE_ROOT/test/testAliAnalysisTaskFiltered/AliAnalysisTaskFilteredTest.sh
6 1.) CPU/Memory/Data volume
7 2.) Relative fracion of the information in exported trees
8 3.) Compression for points
15 void AliAnalysisTaskFilteredTest( const char* esdList,
16 Float_t scalingTracks,
18 Float_t scalingFriend,
30 printf("scalingTracks=%d\n",scalingTracks);
31 printf("scalingV0=%d\n",scalingV0);
32 printf("nFiles=%d\n",nFiles);
34 gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT/ITS -I$ALICE_ROOT -I$ALICE_ROOT/TRD");
36 gSystem->Load("libANALYSIS");
37 gSystem->Load("libANALYSISalice");
38 gSystem->Load("libTender");
39 gSystem->Load("libCORRFW");
40 gSystem->Load("libPWGUDbase");
41 gSystem->Load("libTPCcalib");
42 gSystem->Load("libPWGPP");
43 gSystem->Load("libPWGLFspectra");
45 //____________________________________________//
46 // Make the analysis manager
47 AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
48 mgr->SetDebugLevel(0);
50 AliESDInputHandler* esdH = new AliESDInputHandler();
51 //esdH->SetReadFriends(1);
52 esdH->SetReadFriends(1);
53 mgr->SetInputEventHandler(esdH);
55 // Enable MC event handler
56 AliMCEventHandler* handlerMC = new AliMCEventHandler;
57 //handler->SetReadTR(kFALSE);
58 if (mc) mgr->SetMCtruthEventHandler(handlerMC);
60 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/PilotTrain/AddTaskCDBconnect.C");
61 AddTaskCDBconnect(ocdb);
63 if (gSystem->AccessPathName("localOCDBaccessConfig.C", kFileExists)==0) {
64 gROOT->LoadMacro("localOCDBaccessConfig.C");
65 localOCDBaccessConfig();
68 gROOT->LoadMacro("$ALICE_ROOT/PWGUD/macros/CreateESDChain.C");
69 TChain* chain = CreateESDChain(esdList, nFiles,firstFile);
72 printf("ERROR: chain cannot be created\n");
79 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/macros/AddTaskFilteredTree.C");
80 AliAnalysisTaskFilteredTree* task = (AliAnalysisTaskFilteredTree*)AddTaskFilteredTree("Filtered.root");
81 task->SetLowPtTrackDownscaligF(scalingTracks);
82 task->SetLowPtV0DownscaligF(scalingV0);
83 task->SetFriendDownscaling(scalingFriend);
84 task->SetUseESDfriends(kTRUE);
86 if (!mgr->InitAnalysis())
90 mgr->StartAnalysis("local",chain,nEvents, firstEvent);
102 TFile * f = TFile::Open("Filtered.root");
103 TTree * highPt = (TTree*)f->Get("highPt");
104 TTree * treeV0s = (TTree*)f->Get("V0s");
108 Double_t ratioHighPtV0Entries=treeV0s->GetEntries()/Double_t(treeV0s->GetEntries()+highPt->GetEntries()+0.000001);
109 Double_t ratioHighPtV0Size=treeV0s->GetZipBytes()/Double_t(treeV0s->GetZipBytes()+highPt->GetZipBytes()+0.000001);
110 printf("#UnitTest:\tAliAnalysisTaskFiltered\tRatioPtToV0Entries\t%f\n",ratioHighPtV0Entries);
111 printf("#UnitTest:\tAliAnalysisTaskFiltered\tRatioPtToV0Size\t%f\n",ratioHighPtV0Size);
114 Double_t ratioPointsV0 = 2*treeV0s->GetBranch("friendTrack0.fCalibContainer")->GetZipBytes()/Double_t(0.00001+treeV0s->GetZipBytes());
115 Double_t ratioPointsHighPt = highPt->GetBranch("friendTrack.fCalibContainer")->GetZipBytes()/Double_t(0.00001+highPt->GetZipBytes());
116 printf("#UnitTest:\tAliAnalysisTaskFiltered\tRatioPointsV0\t%f\n",ratioPointsV0);
117 printf("#UnitTest:\tAliAnalysisTaskFiltered\tRatioPointsHighPt\t%f\n",ratioPointsHighPt);
119 // a.) Check track correspondence
121 Int_t entries= highPt->Draw("(friendTrack.fTPCOut.fP[3]-esdTrack.fIp.fP[3])/sqrt(friendTrack.fTPCOut.fC[9]+esdTrack.fIp.fC[9])","friendTrack.fTPCOut.fP[3]!=0","");
122 // here we should check if the tracks
123 Double_t pulls=TMath::RMS(entries, highPt->GetV1());
124 printf("#UnitTest:\tAliAnalysisTaskFiltered\tFriendPull\t%2.4f\n",pulls);
125 printf("#UnitTest:\tAliAnalysisTaskFiltered\tFriendOK\t%d\n",pulls<10);