]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
added a few prototypes for AOD analysis
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 6 Oct 2010 14:24:00 +0000 (14:24 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 6 Oct 2010 14:24:00 +0000 (14:24 +0000)
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.cxx
PWG2/FLOW/AliFlowTasks/AliFlowEvent.cxx
PWG2/FLOW/AliFlowTasks/AliFlowEvent.h

index 5fe7be6e0d184009c198d84ea24012a460829d46..eb38e97cbc60f683070490282631571f848bad3a 100644 (file)
@@ -311,6 +311,12 @@ void AliAnalysisTaskFlowEvent::UserExec(Option_t *)
     if (fRPType == "Global") {
       flowEvent = new AliFlowEvent(myESD,fCFManager1,fCFManager2);
     }
+    if (fRPType == "TPCOnly") {
+      flowEvent = new AliFlowEvent(myESD,fCFManager2,kFALSE);
+    }
+    if (fRPType == "TPCHybrid") {
+      flowEvent = new AliFlowEvent(myESD,fCFManager2,kTRUE);
+    }
     else if (fRPType == "Tracklet"){
       flowEvent = new AliFlowEvent(myESD,myTracklets,fCFManager2);
     }
index 0da99be989a8df32365d8dcf2a51bbed1f2fc7c4..517f067aa33030222d2101733159d9eeb8790f25 100644 (file)
@@ -241,12 +241,12 @@ AliFlowEvent::AliFlowEvent( const AliAODEvent* anInput,
     AliFlowTrack* pTrack = new AliFlowTrack(pParticle);
     pTrack->SetSource(AliFlowTrack::kFromAOD);
 
-    if (rpOK && rpCFManager)
+    if (rpOK /* && rpCFManager */ ) // to be fixed - with CF managers uncommented only empty events (NULL in header files)
     {
       pTrack->SetForRPSelection(kTRUE);
       fNumberOfRPs++;
     }
-    if (poiOK && poiCFManager)
+    if (poiOK /* && poiCFManager*/ )
     {
       pTrack->SetForPOISelection(kTRUE);
     }
@@ -429,6 +429,87 @@ AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
 
 }
 
+//-----------------------------------------------------------------------
+AliFlowEvent::AliFlowEvent( const AliESDEvent* esd,
+                           const AliCFManager* poiCFManager,
+                            Bool_t hybrid):
+  AliFlowEventSimple(20)
+{
+
+  //Select the particles of interest from the ESD
+  Int_t iNumberOfInputTracks = esd->GetNumberOfTracks() ;
+
+  //Double_t gPt = 0.0, gP = 0.0;
+  Double_t dca[2] = {0.0,0.0}, cov[3] = {0.0,0.0,0.0};  //The impact parameters and their covariance.
+  Double_t dca3D = 0.0;
+
+  AliESDtrack trackTPC;
+
+  //loop over tracks
+  for (Int_t itrkN=0; itrkN<iNumberOfInputTracks; itrkN++)
+    {
+
+      if (!esd->GetTrack(itrkN)) continue;
+
+      Bool_t useTPC = kFALSE;
+
+      AliESDtrack* pParticle = esd->GetTrack(itrkN);   //get input particle
+
+      //check if pParticle passes the cuts
+      Bool_t poiOK = kTRUE;
+
+      if (poiCFManager)
+      {
+        poiOK = ( poiCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
+                  poiCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
+      }
+
+      if (!(poiOK)) continue;
+
+      AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)pParticle->GetTPCInnerParam();
+
+      if (tpcTrack)
+      {
+
+//      gPt = tpcTrack->Pt();
+//      gP = tpcTrack->P();
+
+        useTPC = kTRUE;
+
+        const AliESDVertex *vertexSPD = esd->GetPrimaryVertexSPD();
+        const AliESDVertex *vertexTPC = esd->GetPrimaryVertexTPC();
+
+        if(hybrid)
+          tpcTrack->PropagateToDCA(vertexSPD,esd->GetMagneticField(),100.,dca,cov);
+        else
+          tpcTrack->PropagateToDCA(vertexTPC,esd->GetMagneticField(),100.,dca,cov);
+
+        dca3D = TMath::Sqrt(TMath::Power(dca[0],2)+TMath::Power(dca[1],2));
+
+      }
+
+      //make new AliFLowTrack
+      AliFlowTrack* pTrack = new AliFlowTrack(pParticle);
+
+      pTrack->SetSource(AliFlowTrack::kFromESD);
+
+      //marking the particles used for diff. flow:
+      if(poiOK && poiCFManager)
+      {
+        pTrack->SetForPOISelection(kTRUE);
+      }
+
+      if(useTPC)
+      {
+        pTrack->SetForRPSelection(kTRUE);
+        fNumberOfRPs++;
+      }
+
+      AddTrack(pTrack);
+
+    }//end of while (itrkN < iNumberOfInputTracks)
+
+}
 
 //-----------------------------------------------------------------------
 AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
index ade2e2407c13fb3611eb2a8a9828f34ef318ae71..35e6b23b94283bae16ef71941f9268adb7c7174e 100644 (file)
@@ -43,6 +43,9 @@ public:
   AliFlowEvent( const AliAODEvent* anInput, 
                 const AliCFManager* rpCFManager=NULL, 
                 const AliCFManager* poiCFManager=NULL );  //use CF(2x)
+  AliFlowEvent( const AliESDEvent* anInput,
+                const AliCFManager* poiCFManager,
+                Bool_t hybrid);
   AliFlowEvent( const AliESDEvent* anInput, 
                 const AliMCEvent* anInputMc, 
                 KineSource anOption=kNoKine,