PWGPP-3, PWGPP-4, ATO-20, ATO-71 - Extended test to check integrity AliAnalysistask...
authormivanov <marian.ivanov@cern.ch>
Mon, 21 Jul 2014 12:00:36 +0000 (14:00 +0200)
committerhristov <Peter.Hristov@cern.ch>
Thu, 24 Jul 2014 11:06:01 +0000 (13:06 +0200)
PWGPP/AliAnalysisTaskFilteredTree.cxx
test/testAliAnalysisTaskFiltered/AliAnalysisTaskFilteredTest.C
test/testAliAnalysisTaskFiltered/AliAnalysisTaskFilteredTest.sh

index 52c875e..338a027 100644 (file)
@@ -368,7 +368,7 @@ void AliAnalysisTaskFilteredTree::ProcessCosmics(AliESDEvent *const event, AliES
   Int_t ntracks=event->GetNumberOfTracks(); 
   UInt_t specie = event->GetEventSpecie();  // skip laser events
   if (specie==AliRecoParam::kCalib) return;
-
+  Int_t ntracksFriend = esdFriend->GetNumberOfTracks();
 
 
   for (Int_t itrack0=0;itrack0<ntracks;itrack0++) {
@@ -389,7 +389,11 @@ void AliAnalysisTaskFilteredTree::ProcessCosmics(AliESDEvent *const event, AliES
     //if (TMath::Abs(dcaTPC[1])<kMaxDelta[0]*2) continue;
     //    const AliExternalTrackParam * trackIn0 = track0->GetInnerParam();
     AliESDfriendTrack* friendTrack0=NULL;
-    if (esdFriend) {if (!esdFriend->TestSkipBit()) friendTrack0 = esdFriend->GetTrack(itrack0);} //this guy can be NULL
+    if (esdFriend &&!esdFriend->TestSkipBit()){
+      if (itrack0<ntracksFriend){
+       friendTrack0 = esdFriend->GetTrack(itrack0);
+      } //this guy can be NULL
+    }
 
     for (Int_t itrack1=itrack0+1;itrack1<ntracks;itrack1++) {
       AliESDtrack *track1 = event->GetTrack(itrack1);
@@ -444,7 +448,12 @@ void AliAnalysisTaskFilteredTree::ProcessCosmics(AliESDEvent *const event, AliES
       
 
       AliESDfriendTrack* friendTrack1=NULL;
-      if (esdFriend) {if (!esdFriend->TestSkipBit()) friendTrack1 = esdFriend->GetTrack(itrack1);} //this guy can be NULL
+      if (esdFriend &&!esdFriend->TestSkipBit()){
+       if (itrack1<ntracksFriend){
+         friendTrack1 = esdFriend->GetTrack(itrack1);
+       } //this guy can be NULL
+      }
+
       //
       AliESDfriendTrack *friendTrackStore0=friendTrack0;    // store friend track0 for later processing
       AliESDfriendTrack *friendTrackStore1=friendTrack1;    // store friend track1 for later processing
@@ -1833,8 +1842,13 @@ void AliAnalysisTaskFilteredTree::ProcessV0(AliESDEvent *const esdEvent, AliMCEv
       AliESDfriendTrack* friendTrack1=NULL;
       if (esdFriend)       {
         if (!esdFriend->TestSkipBit()){
-          friendTrack0 = esdFriend->GetTrack(v0->GetIndex(0)); //this guy can be NULL
-          friendTrack1 = esdFriend->GetTrack(v0->GetIndex(1)); //this guy can be NULL
+         Int_t ntracksFriend = esdFriend->GetNumberOfTracks();
+         if (v0->GetIndex(0)<ntracksFriend){
+           friendTrack0 = esdFriend->GetTrack(v0->GetIndex(0)); //this guy can be NULL
+         }
+         if (v0->GetIndex(1)<ntracksFriend){
+           friendTrack1 = esdFriend->GetTrack(v0->GetIndex(1)); //this guy can be NULL
+         }
         }
       }
       if (track0->GetSign()<0) {
@@ -1990,7 +2004,13 @@ void AliAnalysisTaskFilteredTree::ProcessdEdx(AliESDEvent *const esdEvent, AliMC
       AliESDtrack *track = esdEvent->GetTrack(iTrack);
       if(!track) continue;
       AliESDfriendTrack* friendTrack=NULL;
-      if (esdFriend) {if (!esdFriend->TestSkipBit()) friendTrack = esdFriend->GetTrack(iTrack);} //this guy can be NULL
+      if (esdFriend && !esdFriend->TestSkipBit()) {
+       Int_t ntracksFriend = esdFriend->GetNumberOfTracks();
+       if (iTrack<ntracksFriend){
+         friendTrack = esdFriend->GetTrack(iTrack);
+       } //this guy can be NULL        
+      }
+      
       if(track->Charge()==0) continue;
       if(!esdTrackCuts->AcceptTrack(track)) continue;
       if(!accCuts->AcceptTrack(track)) continue;
index efb442a..f45ac1d 100755 (executable)
@@ -115,5 +115,13 @@ void CheckOutput(){
   Double_t ratioPointsHighPt = highPt->GetBranch("friendTrack.fCalibContainer")->GetZipBytes()/Double_t(0.00001+highPt->GetZipBytes());
   printf("#UnitTest:\tAliAnalysisTaskFiltered\tRatioPointsV0\t%f\n",ratioPointsV0);
   printf("#UnitTest:\tAliAnalysisTaskFiltered\tRatioPointsHighPt\t%f\n",ratioPointsHighPt);
+  //
+  // a.) Check track correspondence
+  //
+  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","");
+  // here we should check if the tracks
+  Double_t pulls=TMath::RMS(entries, highPt->GetV1());
+  printf("#UnitTest:\tAliAnalysisTaskFiltered\tFriendPull\t%2.4f\n",pulls);
+  printf("#UnitTest:\tAliAnalysisTaskFiltered\tFriendOK\t%d\n",pulls<10);
 
 }
index 732a694..c5de770 100755 (executable)
@@ -31,11 +31,11 @@ source $UnitTestConfig
 #get path to input list
     inputListfiles=$TestData_pPb
 #get scale number for tracks
-    filterT=${2-100}
+    filterT=${2-20}
 #get scale number for V0s
-    filterV=${3-10}
-#get scale number of riends
-    filterFriend=${4--10}
+    filterV=${3-2}
+#get scale number of friends
+    filterFriend=${4--1}
 #get OCDB path (optional)
     OCDBpath=${5-"\"$OCDBPath_pPb\""}
 #get max number of files