]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG/FLOW/Tasks/AliFlowEventCuts.cxx
only check correlation of global track and tpc only track multipliicty when running...
[u/mrichter/AliRoot.git] / PWG / FLOW / Tasks / AliFlowEventCuts.cxx
index 97c23c495ed9f5eabccca3ad839f83ac616f1975..e6bdcf55452e3c641cb2f3d5bada0b4a00c95a18 100644 (file)
@@ -81,6 +81,7 @@ AliFlowEventCuts::AliFlowEventCuts():
   fCutSPDvertexerAnomaly(kFALSE),
   fCutSPDTRKVtxZ(kFALSE),
   fCutTPCmultiplicityOutliers(kFALSE),
+  fCutTPCmultiplicityOutliersAOD(kFALSE),
   fUseCentralityUnchecked(kFALSE),
   fCentralityPercentileMethod(kTPConly),
   fCutZDCtiming(kFALSE),
@@ -129,6 +130,7 @@ AliFlowEventCuts::AliFlowEventCuts(const char* name, const char* title):
   fCutSPDvertexerAnomaly(kFALSE),
   fCutSPDTRKVtxZ(kFALSE),
   fCutTPCmultiplicityOutliers(kFALSE),
+  fCutTPCmultiplicityOutliersAOD(kFALSE),
   fUseCentralityUnchecked(kFALSE),
   fCentralityPercentileMethod(kTPConly),
   fCutZDCtiming(kFALSE),
@@ -177,6 +179,7 @@ AliFlowEventCuts::AliFlowEventCuts(const AliFlowEventCuts& that):
   fCutSPDvertexerAnomaly(that.fCutSPDvertexerAnomaly),
   fCutSPDTRKVtxZ(that.fCutSPDTRKVtxZ),
   fCutTPCmultiplicityOutliers(that.fCutTPCmultiplicityOutliers),
+  fCutTPCmultiplicityOutliersAOD(that.fCutTPCmultiplicityOutliersAOD),
   fUseCentralityUnchecked(that.fUseCentralityUnchecked),
   fCentralityPercentileMethod(that.fCentralityPercentileMethod),
   fCutZDCtiming(that.fCutZDCtiming),
@@ -261,6 +264,7 @@ AliFlowEventCuts& AliFlowEventCuts::operator=(const AliFlowEventCuts& that)
   fCutSPDvertexerAnomaly=that.fCutSPDvertexerAnomaly;
   fCutSPDTRKVtxZ=that.fCutSPDTRKVtxZ;
   fCutTPCmultiplicityOutliers=that.fCutTPCmultiplicityOutliers;
+  fCutTPCmultiplicityOutliersAOD=that.fCutTPCmultiplicityOutliersAOD;
   fUseCentralityUnchecked=that.fUseCentralityUnchecked;
   fCentralityPercentileMethod=that.fCentralityPercentileMethod;
   fCutZDCtiming=that.fCutZDCtiming;
@@ -292,34 +296,57 @@ Bool_t AliFlowEventCuts::PassesCuts(AliVEvent *event, AliMCEvent *mcevent)
   AliAODEvent* aodevent = dynamic_cast<AliAODEvent*>(event);
   Int_t multTPC = 0;
   Int_t multGlobal = 0; 
-  multTPC = fStandardTPCcuts->Count(event);
-  multGlobal = fStandardGlobalCuts->Count(event);
-  if (fQA)
-  {
-    QAbefore(0)->Fill(pvtxz);
-    QAbefore(1)->Fill(multGlobal,multTPC);
-  }
-  if (  (fCutTPCmultiplicityOutliers && esdevent) ||  (fCutTPCmultiplicityOutliers && aodevent)  )
+
+  // to remove multiplicity outliers, an explicit cut on the correlation 
+  // between global and tpc only tracks can be made by counting the two
+  // sets. as counting is expensive, only count when qa is requested or cut is enabeled
+  // the cut criteria are different for different data takign periods
+  // and (of course) cut criteria, specific routines exist for 10h, 11h data
+  // and esds (by calling AliFlowTrackCuts) or aods (evaluated here explicitely)
+  if(esdevent && (fQA || fCutTPCmultiplicityOutliers)) 
   {
     //this is pretty slow as we check the event track by track twice
     //this cut will work for 2010 PbPb data and is dependent on
     //TPC and ITS reco efficiency (e.g. geometry, calibration etc)
-    if(esdevent){
-      if (multTPC > ( 23+1.216*multGlobal)) {pass=kFALSE;}
-      if (multTPC < (-20+1.087*multGlobal)) {pass=kFALSE;}
+    multTPC = fStandardTPCcuts->Count(event);
+    multGlobal = fStandardGlobalCuts->Count(event);
+    if(fCutTPCmultiplicityOutliers) {
+      if (multTPC > ( 23+1.216*multGlobal)) pass = kFALSE;
+      if (multTPC < (-20+1.087*multGlobal)) pass = kFALSE;
     }
-    
-    /* commenting conflicting code, fix is pending
-    if(aodevent && fData2011){
-        if (multTPC > ( 62.87+1.78*multGlobal)) {pass=kFALSE;}
-        if (multTPC < (-36.73+1.48*multGlobal)) {pass=kFALSE;}
-      }
-    if(aodevent && !fData2011){
-        if (multTPC > ( 32.1+1.59*multGlobal)) {pass=kFALSE;}
-        if (multTPC < (-40.3+1.22*multGlobal)) {pass=kFALSE;}
-      }
-      */
   }
+  if(aodevent && (fQA || fCutTPCmultiplicityOutliersAOD)) 
+  {
+    //similar (slow) cut for aod's. will work for both 2010 and 2010 pbpb data
+    //but the user is responsible that this object is configured
+    //correctly to select the dataset
+    //FIXME data could dynamically be determined by this class via the
+    //runnumber
+    Int_t nTracks(aodevent->GetNumberOfTracks());
+    for(Int_t iTracks = 0; iTracks < nTracks; iTracks++) { 
+      AliAODTrack* track = aodevent->GetTrack(iTracks);
+      if(!track) continue;
+      if (!track || track->Pt() < .2 || track->Pt() > 5.0 || TMath::Abs(track->Eta()) > .8 || track->GetTPCNcls() < 70 || !track->GetDetPid() || track->GetDetPid()->GetTPCsignal() < 10.0)  continue;  // general quality cut
+      if (track->TestFilterBit(1) && track->Chi2perNDF() > 0.2) multTPC++;
+      if (!track->TestFilterBit(16) || track->Chi2perNDF() < 0.1) continue;
+      Double_t b[2] = {-99., -99.};
+      Double_t bCov[3] = {-99., -99., -99.};
+      AliAODTrack copy(*track);
+      if (copy.PropagateToDCA(event->GetPrimaryVertex(), event->GetMagneticField(), 100., b, bCov) && TMath::Abs(b[0]) < 0.3 && TMath::Abs(b[1]) < 0.3) multGlobal++;
+    }
+    if(fCutTPCmultiplicityOutliersAOD) 
+    {
+      if(!fData2011 && (multTPC < (-40.3+1.22*multGlobal) || multTPC > (32.1+1.59*multGlobal))) pass = kFALSE;
+      else if(fData2011  && (multTPC < (-36.73 + 1.48*multGlobal) || multTPC > (62.87 + 1.78*multGlobal))) pass = kFALSE;
+    }
+  }
+
+  if (fQA)
+  {
+    QAbefore(0)->Fill(pvtxz);
+    QAbefore(1)->Fill(multGlobal,multTPC);
+  }
   if (fCutNContributors)
   {
     if (ncontrib < fNContributorsMin || ncontrib >= fNContributorsMax) pass=kFALSE;
@@ -400,7 +427,7 @@ Bool_t AliFlowEventCuts::PassesCuts(AliVEvent *event, AliMCEvent *mcevent)
       if( TMath::Abs(tVtxZ-tSPDVtxZ) > 0.5 ) pass = kFALSE;
     }
     AliCentrality* centr = aodevent->GetHeader()->GetCentralityP();
-    if(fCutTPCmultiplicityOutliers){
+    if(fCutTPCmultiplicityOutliers || fCutTPCmultiplicityOutliersAOD){
       Double_t v0Centr  = centr->GetCentralityPercentile("V0M");
       Double_t trkCentr = centr->GetCentralityPercentile("TRK"); 
       if(TMath::Abs(v0Centr-trkCentr) > 5) pass = kFALSE;