]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
fix for mixing type of RP and POI
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 20 Oct 2010 14:39:10 +0000 (14:39 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 20 Oct 2010 14:39:10 +0000 (14:39 +0000)
PWG2/FLOW/AliFlowTasks/AliFlowEvent.cxx
PWG2/FLOW/AliFlowTasks/AliFlowTrackCuts.cxx
PWG2/FLOW/AliFlowTasks/AliFlowTrackCuts.h

index 4be1c40469aa31ecaa534c21f2b5ef168ea521ec..8ffa8da4cbc76301d82b8c4266e75f727a0f482f 100644 (file)
@@ -654,17 +654,11 @@ AliFlowEvent::AliFlowEvent( AliVEvent* inputEvent,
 
       //make new AliFLowTrack
       AliFlowTrack* pTrack = NULL;
-      if (rp&&poi)
-      {
-        pTrack = rpCuts->MakeFlowTrack();
-        pTrack->TagRP(); fNumberOfRPs++;
-        pTrack->TagPOI();
-      }
-      else
       if (rp)
       {
         pTrack = rpCuts->MakeFlowTrack();
         pTrack->TagRP(); fNumberOfRPs++;
+        if (poi) pTrack->TagPOI();
       }
       else
       if (poi)
@@ -680,6 +674,7 @@ AliFlowEvent::AliFlowEvent( AliVEvent* inputEvent,
   {
     //here we have two different sources of particles, so we fill
     //them independently
+    AliFlowTrack* pTrack = NULL;
     //RP
     Int_t numberOfRPs = 0;
     if (trackletsRP) numberOfRPs = trackletsRP->GetNumberOfTracklets();
@@ -691,8 +686,9 @@ AliFlowEvent::AliFlowEvent( AliVEvent* inputEvent,
       else particle = eventRP->GetTrack(i);
       Bool_t rp = rpCuts->IsSelected(particle,i);
       if (!rp) continue;
-      AliFlowTrack* pTrack = rpCuts->MakeFlowTrack();
+      pTrack = rpCuts->MakeFlowTrack();
       pTrack->TagRP(); fNumberOfRPs++;
+      AddTrack(pTrack);
     }
     //POI
     Int_t numberOfPOIs = 0;
@@ -705,8 +701,9 @@ AliFlowEvent::AliFlowEvent( AliVEvent* inputEvent,
       else particle = eventPOI->GetTrack(i);
       Bool_t poi = poiCuts->IsSelected(particle,i);
       if (!poi) continue;
-      AliFlowTrack* pTrack = poiCuts->MakeFlowTrack();
+      pTrack = poiCuts->MakeFlowTrack();
       pTrack->TagPOI();
+      AddTrack(pTrack);
     }
   }
 }
index 259b58d57dc2f0cec3b7865be3aedc77eabc02a2..4e948d7e26ed73a2165b1cba303ee89b35db7a8d 100644 (file)
@@ -52,6 +52,7 @@ ClassImp(AliFlowTrackCuts)
 AliFlowTrackCuts::AliFlowTrackCuts():
   AliFlowTrackSimpleCuts(),
   fAliESDtrackCuts(new AliESDtrackCuts()),
+  fQA(kFALSE),
   fCutMCprocessType(kFALSE),
   fMCprocessType(kPNoProcess),
   fCutMCPID(kFALSE),
@@ -78,6 +79,7 @@ AliFlowTrackCuts::AliFlowTrackCuts():
 AliFlowTrackCuts::AliFlowTrackCuts(const AliFlowTrackCuts& someCuts):
   AliFlowTrackSimpleCuts(someCuts),
   fAliESDtrackCuts(new AliESDtrackCuts(*(someCuts.fAliESDtrackCuts))),
+  fQA(someCuts.fQA),
   fCutMCprocessType(someCuts.fCutMCprocessType),
   fMCprocessType(someCuts.fMCprocessType),
   fCutMCPID(someCuts.fCutMCPID),
@@ -106,6 +108,7 @@ AliFlowTrackCuts& AliFlowTrackCuts::operator=(const AliFlowTrackCuts& someCuts)
   //assignment
   AliFlowTrackSimpleCuts::operator=(someCuts);
   *fAliESDtrackCuts=*(someCuts.fAliESDtrackCuts);
+  fQA=someCuts.fQA;
   fCutMCprocessType=someCuts.fCutMCprocessType;
   fMCprocessType=someCuts.fMCprocessType;
   fCutMCPID=someCuts.fCutMCPID;
@@ -236,27 +239,29 @@ Bool_t AliFlowTrackCuts::PassesCuts(AliVParticle* vparticle)
   ////////////////////////////////////////////////////////////////
   ////////////////////////////////////////////////////////////////
 
+  Bool_t pass=kTRUE;
   //check the common cuts for the current particle (MC,AOD,ESD)
-  if (fCutPt) {if (fTrack->Pt() < fPtMin || fTrack->Pt() >= fPtMax ) return kFALSE;}
-  if (fCutEta) {if (fTrack->Eta() < fEtaMin || fTrack->Eta() >= fEtaMax ) return kFALSE;}
-  if (fCutPhi) {if (fTrack->Phi() < fPhiMin || fTrack->Phi() >= fPhiMax ) return kFALSE;}
-  if (fRequireCharge) {if (fTrack->Charge() == 0) return kFALSE;}
-  if (fCutCharge && !isMCparticle) {if (fTrack->Charge() != fCharge) return kFALSE;}
+  if (fCutPt) {if (fTrack->Pt() < fPtMin || fTrack->Pt() >= fPtMax ) pass=kFALSE;}
+  if (fCutEta) {if (fTrack->Eta() < fEtaMin || fTrack->Eta() >= fEtaMax ) pass=kFALSE;}
+  if (fCutPhi) {if (fTrack->Phi() < fPhiMin || fTrack->Phi() >= fPhiMax ) pass=kFALSE;}
+  if (fRequireCharge) {if (fTrack->Charge() == 0) pass=kFALSE;}
+  if (fCutCharge && !isMCparticle) {if (fTrack->Charge() != fCharge) pass=kFALSE;}
   if (fCutCharge && isMCparticle)
   { 
     //in case of an MC particle the charge is stored in units of 1/3|e| 
     Int_t charge = TMath::Nint(fTrack->Charge()/3.0); //mc particles have charge in units of 1/3e
     return (charge==fCharge);
   }
-  //if(fCutPID) {if (fTrack->PID() != fPID) return kFALSE;}
+  //if(fCutPID) {if (fTrack->PID() != fPID) pass=kFALSE;}
 
   //when additionally MC info is required
-  if (!PassesMCcuts()) return kFALSE;
+  if (!PassesMCcuts()) pass=kFALSE;
 
   //check all else for ESDs using aliesdtrackcuts
-  if (esdTrack && (fParamType!=kMC) ) return fAliESDtrackCuts->IsSelected(static_cast<AliESDtrack*>(fTrack));
+  if (esdTrack && (fParamType!=kMC) ) 
+    if (!fAliESDtrackCuts->IsSelected(static_cast<AliESDtrack*>(fTrack))) pass=kFALSE;
 
-  return kTRUE; //true by default, if we didn't set any cuts
+  return pass; //true by default, if we didn't set any cuts
 }
 
 //-----------------------------------------------------------------------
@@ -383,3 +388,8 @@ const char* AliFlowTrackCuts::GetParamTypeName(trackParameterType type)
   }
   return "unknown";
 }
+
+//-----------------------------------------------------------------------
+void AliFlowTrackCuts::DefineHistograms()
+{
+}
index e9ef62f67450b962a847592f82831c79cf88a5d8..b617cf4818ad4f82c4560721e5b97c3ae99ca166 100644 (file)
@@ -13,6 +13,7 @@
 #include "AliESDtrackCuts.h"
 #include "TMCProcess.h"
 
+class TDirectory;
 class AliVParticle;
 class AliMCParticle;
 class AliFlowTrack;
@@ -79,6 +80,9 @@ class AliFlowTrackCuts : public AliFlowTrackSimpleCuts {
   void GetPtRange( Float_t& r1, Float_t& r2 ) const { r1=GetPtMin(); r2=GetPtMax(); }
   Bool_t GetRequireCharge() const {return fRequireCharge;}
 
+  void SetQA(const char* dirname);
+  TDirectory* GetQA() const {return fQA;}
+
   //MC stuff
   void SetMCprocessType( TMCProcess t ) { fMCprocessType = t; fCutMCprocessType=kTRUE; }
   TMCProcess GetMCprocessType() const { return fMCprocessType; }
@@ -107,8 +111,10 @@ class AliFlowTrackCuts : public AliFlowTrackSimpleCuts {
   Bool_t PassesMCcuts();
   void HandleESDtrack(AliESDtrack* track);
   void HandleVParticle(AliVParticle* track);
+  void DefineHistograms();
 
   AliESDtrackCuts* fAliESDtrackCuts; //alianalysis cuts
+  TDirectory* fQA;                   //qa histograms go here
   Bool_t fCutMCprocessType;          //do we cut on mc process type?
   TMCProcess fMCprocessType;         //mc process type
   Bool_t fCutMCPID;                  //cut on MC pid?