Change of logic:
authormivanov <mivanov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Aug 2013 23:40:05 +0000 (23:40 +0000)
committermivanov <mivanov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Aug 2013 23:40:05 +0000 (23:40 +0000)
1. New logic enable us to test differnt esdTrack cuts
2. In case we simulate pileup tit has to be done in new way

Old logic:
loop over particles
        loop over reconstructed tracks which are fulfilling some criteria ESD track cuts and acc. cuts - find pair
            writeis Rec status and pairs

New logic:
loop over particles
        loop over reconstructed tracks find pair
            write rec. status and pairs    and ESDtrack cuts and acceptance cuts status (I do not cut)
            (to be extended to different setting of the track cuts in future 2010, 2011 ..)

PWGPP/AliAnalysisTaskFilteredTree.cxx

index 305bed2..d78a31e 100644 (file)
@@ -1617,8 +1617,7 @@ void AliAnalysisTaskFilteredTree::ProcessMCEff(AliESDEvent *const esdEvent, AliM
     Double_t runNumber = esdEvent->GetRunNumber();\r
     Double_t evtTimeStamp = esdEvent->GetTimeStamp();\r
     Int_t evtNumberInFile = esdEvent->GetEventNumberInFile();\r
-\r
-    // loop over MC stack\r
+      // loop over MC stack\r
     for (Int_t iMc = 0; iMc < mcStackSize; ++iMc) \r
     {\r
       particle = stack->Particle(iMc);\r
@@ -1646,27 +1645,35 @@ void AliAnalysisTaskFilteredTree::ProcessMCEff(AliESDEvent *const esdEvent, AliM
 \r
       // check if particle reconstructed\r
       Bool_t isRec = kFALSE;\r
-      Int_t  trackIndex = -1;\r
+      Int_t  trackIndex = -1;  \r
+      Int_t isESDtrackCut= 0;\r
+      Int_t isAccCuts    = 0;\r
+      AliESDtrack *recTrack = NULL; \r
+\r
       for (Int_t iTrack = 0; iTrack < esdEvent->GetNumberOfTracks(); iTrack++)\r
       {\r
-\r
         AliESDtrack *track = esdEvent->GetTrack(iTrack);\r
         if(!track) continue;\r
         if(track->Charge()==0) continue;\r
-        if(esdTrackCuts->AcceptTrack(track) && accCuts->AcceptTrack(track)) \r
-        {\r
-          Int_t label =  TMath::Abs(track->GetLabel());\r
-          if (label >= mcStackSize) continue;\r
-          if(label == iMc) {\r
-            isRec = kTRUE;\r
-            trackIndex = iTrack;\r
-            break;\r
-          }\r
-        } \r
+       //\r
+       Int_t label =  TMath::Abs(track->GetLabel());\r
+       if (label >= mcStackSize) continue;\r
+       if(label == iMc) {        \r
+         Bool_t isAcc=esdTrackCuts->AcceptTrack(track);\r
+         if (isAcc) isESDtrackCut=1;\r
+         if (accCuts->AcceptTrack(track)) isAccCuts=1;\r
+         isRec = kTRUE;\r
+         if (recTrack){\r
+           if (track->GetTPCncls()<recTrack->GetTPCncls()) continue; // in case looper tracks use longer track\r
+           if (!isAcc) continue;\r
+           trackIndex = iTrack;\r
+         }\r
+         recTrack = esdEvent->GetTrack(trackIndex); \r
+         continue;\r
+       }        \r
       }\r
-\r
+      \r
       // Store information in the output tree\r
-      AliESDtrack *recTrack = NULL; \r
       if(trackIndex>-1)  { \r
         recTrack = esdEvent->GetTrack(trackIndex); \r
       } else {\r
@@ -1692,14 +1699,18 @@ void AliAnalysisTaskFilteredTree::ProcessMCEff(AliESDEvent *const esdEvent, AliM
           "triggerClass.="<<&triggerClass<<\r
           "runNumber="<<runNumber<<\r
           "evtTimeStamp="<<evtTimeStamp<<\r
-          "evtNumberInFile="<<evtNumberInFile<<\r
-          "Bz="<<bz<<\r
-          "vtxESD.="<<vtxESD<<\r
-          "mult="<<mult<<\r
+          "evtNumberInFile="<<evtNumberInFile<<     // \r
+          "Bz="<<bz<<                               // magnetic field\r
+          "vtxESD.="<<vtxESD<<                      // vertex info\r
+          "mult="<<mult<<                           // primary vertex 9whatewe found) multiplicity\r
+         "multMCTrueTracks="<<multMCTrueTracks<<   // mC track multiplicities\r
+         //\r
+         "isAcc0="<<isESDtrackCut<<                // track accepted by ESD track cuts\r
+         "isAcc1="<<isAccCuts<<                    // track accepted by acceptance cuts flag\r
           "esdTrack.="<<recTrack<<\r
           "isRec="<<isRec<<\r
-          "tpcTrackLength="<<tpcTrackLength<<\r
-          "particle.="<<particle<<\r
+          "tpcTrackLength="<<tpcTrackLength<<       // track length in the TPC r projection\r
+          "particle.="<<particle<<                  // particle properties\r
           "particleMother.="<<particleMother<<\r
           "mech="<<mech<<\r
           "\n";\r