Adding additional variables - difernt counter of tracks
authormivanov <mivanov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Oct 2013 14:28:27 +0000 (14:28 +0000)
committermivanov <mivanov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Oct 2013 14:28:27 +0000 (14:28 +0000)
PWGPP/AliAnalysisTaskFilteredTree.cxx

index 6283431..853d08b 100644 (file)
@@ -61,6 +61,7 @@
 #include "AliAnalysisTaskFilteredTree.h"\r
 #include "AliKFParticle.h"\r
 #include "AliESDv0.h"\r
+#include "TVectorD.h"\r
 \r
 using namespace std;\r
 \r
@@ -919,6 +920,26 @@ void AliAnalysisTaskFilteredTree::ProcessAll(AliESDEvent *const esdEvent, AliMCE
   if(!vtxESD) return;\r
 \r
   Bool_t isEventOK = evtCuts->AcceptEvent(esdEvent,mcEvent,vtxESD); \r
+  \r
+  //\r
+  // Vertex info comparison and track multiplicity\r
+  //\r
+  AliESDVertex *vertexSPD =  (AliESDVertex *)esdEvent->GetPrimaryVertexSPD();\r
+  AliESDVertex *vertexTPC =  (AliESDVertex *)esdEvent->GetPrimaryVertexTPC(); \r
+  Int_t contSPD = vertexSPD->GetNContributors();\r
+  Int_t contTPC = vertexTPC->GetNContributors();        \r
+  TVectorD vertexPosTPC(3), vertexPosSPD(3);\r
+  vertexSPD->GetXYZ(vertexPosSPD.GetMatrixArray());\r
+  vertexTPC->GetXYZ(vertexPosTPC.GetMatrixArray());\r
+  Int_t ntracksTPC=0;\r
+  Int_t ntracksITS=0;\r
+  for (Int_t iTrack = 0; iTrack < esdEvent->GetNumberOfTracks(); iTrack++){\r
+    AliESDtrack *track = esdEvent->GetTrack(iTrack);    \r
+    if(!track) continue;\r
+    if (track->IsOn(AliVTrack::kTPCrefit)) ntracksTPC++;\r
+    if (track->IsOn(AliVTrack::kITSrefit)) ntracksITS++;\r
+  }\r
+  \r
   //printf("isEventOK %d, isEventTriggered %d \n",isEventOK, isEventTriggered);\r
   //printf("GetAnalysisMode() %d \n",GetAnalysisMode());\r
 \r
@@ -1147,11 +1168,10 @@ void AliAnalysisTaskFilteredTree::ProcessAll(AliESDEvent *const esdEvent, AliMCE
 \r
       Bool_t isOKtrackInnerC3 = kFALSE;\r
       AliExternalTrackParam *trackInnerC3 = new AliExternalTrackParam(*(track->GetInnerParam()));\r
-\r
       if(mcEvent) \r
       {\r
         if(!stack) return;\r
-\r
+       multMCTrueTracks = GetMCTrueTrackMult(mcEvent,evtCuts,accCuts);\r
         //\r
         // global track\r
        //\r
@@ -1395,6 +1415,14 @@ void AliAnalysisTaskFilteredTree::ProcessAll(AliESDEvent *const esdEvent, AliMCE
          "IRint2="<<ir2<<                        // interaction record (trigger) coutners - counter 2\r
          "mult="<<mult<<                         // multiplicity of tracks pointing to the primary vertex\r
          "ntracks="<<ntracks<<                   // number of the esd tracks (to take into account the pileup in the TPC)\r
+         //                                           important variables for the pile-up studies\r
+         "contTPC="<< contTPC<<                    // number of contributors to the TPC primary vertex candidate\r
+         "contSPD="<< contSPD<<                    // number of contributors to the SPD primary vertex candidate\r
+         "vertexPosTPC.="<<&vertexPosTPC<<          // TPC vertex position\r
+         "vertexPosSPD.="<<&vertexPosSPD<<          // SPD vertex position\r
+         "ntracksTPC="<<ntracksTPC<<               // total number of the TPC tracks which were refitted\r
+         "ntracksITS="<<ntracksITS<<               // total number of the ITS tracks which were refitted\r
+         //\r
          "esdTrack.="<<ptrack<<                  // esdTrack as used in the physical analysis\r
          "extTPCInnerC.="<<ptpcInnerC<<          // ??? \r
          "extInnerParamC.="<<ptrackInnerC<<      // ???\r
@@ -1414,6 +1442,7 @@ void AliAnalysisTaskFilteredTree::ProcessAll(AliESDEvent *const esdEvent, AliMCE
          if (!refEMCAL) refEMCAL = &refDummy;\r
          if (!refPHOS) refPHOS = &refDummy;\r
           (*fTreeSRedirector)<<"highPt"<<      \r
+           "multMCTrueTracks="<<multMCTrueTracks<<   // mC track multiplicities\r
            "nrefITS="<<nrefITS<<              // number of track references in the ITS\r
            "nrefTPC="<<nrefTPC<<              // number of track references in the TPC\r
            "nrefTRD="<<nrefTRD<<              // number of track references in the TRD\r
@@ -1615,7 +1644,25 @@ void AliAnalysisTaskFilteredTree::ProcessMCEff(AliESDEvent *const esdEvent, AliM
     return;\r
   }\r
 \r
-  if(!vtxESD) return;\r
+  if(!vtxESD) return;   \r
+  //\r
+  // Vertex info comparison and track multiplicity\r
+  //\r
+  AliESDVertex *vertexSPD =  (AliESDVertex *)esdEvent->GetPrimaryVertexSPD();\r
+  AliESDVertex *vertexTPC =  (AliESDVertex *)esdEvent->GetPrimaryVertexTPC(); \r
+  Int_t contSPD = vertexSPD->GetNContributors();\r
+  Int_t contTPC = vertexTPC->GetNContributors();        \r
+  TVectorD vertexPosTPC(3), vertexPosSPD(3);\r
+  vertexSPD->GetXYZ(vertexPosSPD.GetMatrixArray());\r
+  vertexTPC->GetXYZ(vertexPosTPC.GetMatrixArray());\r
+  Int_t ntracksTPC=0;\r
+  Int_t ntracksITS=0;\r
+  for (Int_t iTrack = 0; iTrack < esdEvent->GetNumberOfTracks(); iTrack++){\r
+    AliESDtrack *track = esdEvent->GetTrack(iTrack);    \r
+    if(!track) continue;\r
+    if (track->IsOn(AliVTrack::kTPCrefit)) ntracksTPC++;\r
+    if (track->IsOn(AliVTrack::kITSrefit)) ntracksITS++;\r
+  }\r
 \r
   Bool_t isEventOK = evtCuts->AcceptEvent(esdEvent,mcEvent,vtxESD); \r
   //printf("isEventOK %d, isEventTriggered %d \n",isEventOK, isEventTriggered);\r
@@ -1740,8 +1787,17 @@ void AliAnalysisTaskFilteredTree::ProcessMCEff(AliESDEvent *const esdEvent, AliM
           "evtNumberInFile="<<evtNumberInFile<<     // \r
           "Bz="<<bz<<                               // magnetic field\r
           "vtxESD.="<<vtxESD<<                      // vertex info\r
+         //\r
           "mult="<<mult<<                           // primary vertex 9whatewe found) multiplicity\r
          "multMCTrueTracks="<<multMCTrueTracks<<   // mC track multiplicities\r
+         //                                           important variables for the pile-up studies\r
+         "contTPC="<< contTPC<<                    // number of contributors to the TPC primary vertex candidate\r
+         "contSPD="<< contSPD<<                    // number of contributors to the SPD primary vertex candidate\r
+         "vertexPosTPC.="<<&vertexPosTPC<<          // TPC vertex position\r
+         "vertexPosSPD.="<<&vertexPosSPD<<          // SPD vertex position\r
+         "ntracksTPC="<<ntracksTPC<<               // total number of the TPC tracks which were refitted\r
+         "ntracksITS="<<ntracksITS<<               // total number of the ITS tracks which were refitted\r
+         //\r
          //\r
          "isAcc0="<<isESDtrackCut<<                // track accepted by ESD track cuts\r
          "isAcc1="<<isAccCuts<<                    // track accepted by acceptance cuts flag\r