ROOT logo
//
// This cut implements all the checks done to accept a track as a Kaon
// for the PbPb analysis using 2010 runs.
// It is based on standard cuts on track quality and nsigma cuts
// with respect to the TPC and TOF signals for the PID.
//

#include <Riostream.h>

#include "AliLog.h"
#include "AliPID.h"
#include "AliPIDResponse.h"
#include "AliESDpid.h"
#include "AliAODpidUtil.h"
#include "AliRsnCutPhiRAA.h"
#include "AliESDtrackCuts.h"

ClassImp(AliRsnCutPhiRAA)

//__________________________________________________________________________________________________
AliRsnCutPhiRAA::AliRsnCutPhiRAA
(const char *name) :
   AliRsnCut(name, AliRsnTarget::kDaughter),
   fMode(k2011_1),
   fCutQuality(Form("%s_quality", name)),
   cut1(AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE, 1)),
   cut2(AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE, 0)),
   cut3(AliESDtrackCuts::GetStandardITSTPCTrackCuts2010())
{
//
// Constructor
// Initialize the contained cuts and sets defaults
//

//  cut1
  cut1->SetEtaRange(-0.8, 0.8);
  cut1->SetPtRange(0.30,1e10);
//  cut2
  cut2->SetEtaRange(-0.8, 0.8);
  cut2->SetPtRange(0.30,1e10);
//  cut3
  cut3->SetEtaRange(-0.8, 0.8);
  cut3->SetPtRange(0.30,1e10);

  //V end

}

//__________________________________________________________________________________________________
AliRsnCutPhiRAA::AliRsnCutPhiRAA(const AliRsnCutPhiRAA &copy) :
   AliRsnCut(copy),
   fMode(copy.fMode),
   fCutQuality(copy.fCutQuality),
   cut1(copy.cut1),
   cut2(copy.cut2),
   cut3(copy.cut3)

{
//
// Copy constructor
//
}

//__________________________________________________________________________________________________
AliRsnCutPhiRAA &AliRsnCutPhiRAA::operator=(const AliRsnCutPhiRAA &copy)
{
//
// Assignment operator
//

   AliRsnCut::operator=(copy);
   if (this == &copy)
      return *this;
   fMode = copy.fMode;
   fCutQuality = copy.fCutQuality;

   return *this;
}

//__________________________________________________________________________________________________
Bool_t AliRsnCutPhiRAA::IsSelected(TObject *obj)
{
//
// Global check
//

   // coherence check
   if (!TargetOK(obj)) return kFALSE;

   // check track
   AliVTrack *track = fDaughter->Ref2Vtrack();
   if (!track) {
      if (!fDaughter->GetRef()) AliWarning("NULL ref");
      return kFALSE;
   }

   // initialize check variables
   Bool_t   accept = kFALSE;

   // decide cut result depending on mode
   switch (fMode) {
     case k2010:
       fCutQuality.SetESDtrackCuts(cut3);
       if (fCutQuality.IsSelected(obj)) accept = kTRUE;
       ::Info("AnalysisSetup", "ESD cut 2010!!! ");
     break;
     case k2011_0:
 	   fCutQuality.SetESDtrackCuts(cut2);
       if (fCutQuality.IsSelected(obj)) accept = kTRUE;
     break;
     case k2011_1:
 	   fCutQuality.SetESDtrackCuts(cut1);
       if (fCutQuality.IsSelected(obj)) accept = kTRUE;
       ::Info("AnalysisSetup", "ESD cut 2011 ");
     break;
     case k2011_1_05:
    	  cut1->SetPtRange(0.50,1e10);
 	   fCutQuality.SetESDtrackCuts(cut1);
       if (fCutQuality.IsSelected(obj)) accept = kTRUE;
       ::Info("AnalysisSetup", "ESD cut 2011 pT > 0.5 GeV/c");
     break;
     case k2011_1_075:
    	  cut1->SetPtRange(0.75,1e10);
 	   fCutQuality.SetESDtrackCuts(cut1);
       if (fCutQuality.IsSelected(obj)) accept = kTRUE;
       ::Info("AnalysisSetup", "ESD cut 2011 pT > 0.75 GeV/c ");
     break;
     default:
         AliDebugClass(1, Form("[%s] Wrong mode", GetName()));
         accept = kFALSE;
   }

   AliDebugClass(1, Form("[%s] Track %s", GetName(), (accept ? "accepted" : "rejected")));
   return accept;
}
 AliRsnCutPhiRAA.cxx:1
 AliRsnCutPhiRAA.cxx:2
 AliRsnCutPhiRAA.cxx:3
 AliRsnCutPhiRAA.cxx:4
 AliRsnCutPhiRAA.cxx:5
 AliRsnCutPhiRAA.cxx:6
 AliRsnCutPhiRAA.cxx:7
 AliRsnCutPhiRAA.cxx:8
 AliRsnCutPhiRAA.cxx:9
 AliRsnCutPhiRAA.cxx:10
 AliRsnCutPhiRAA.cxx:11
 AliRsnCutPhiRAA.cxx:12
 AliRsnCutPhiRAA.cxx:13
 AliRsnCutPhiRAA.cxx:14
 AliRsnCutPhiRAA.cxx:15
 AliRsnCutPhiRAA.cxx:16
 AliRsnCutPhiRAA.cxx:17
 AliRsnCutPhiRAA.cxx:18
 AliRsnCutPhiRAA.cxx:19
 AliRsnCutPhiRAA.cxx:20
 AliRsnCutPhiRAA.cxx:21
 AliRsnCutPhiRAA.cxx:22
 AliRsnCutPhiRAA.cxx:23
 AliRsnCutPhiRAA.cxx:24
 AliRsnCutPhiRAA.cxx:25
 AliRsnCutPhiRAA.cxx:26
 AliRsnCutPhiRAA.cxx:27
 AliRsnCutPhiRAA.cxx:28
 AliRsnCutPhiRAA.cxx:29
 AliRsnCutPhiRAA.cxx:30
 AliRsnCutPhiRAA.cxx:31
 AliRsnCutPhiRAA.cxx:32
 AliRsnCutPhiRAA.cxx:33
 AliRsnCutPhiRAA.cxx:34
 AliRsnCutPhiRAA.cxx:35
 AliRsnCutPhiRAA.cxx:36
 AliRsnCutPhiRAA.cxx:37
 AliRsnCutPhiRAA.cxx:38
 AliRsnCutPhiRAA.cxx:39
 AliRsnCutPhiRAA.cxx:40
 AliRsnCutPhiRAA.cxx:41
 AliRsnCutPhiRAA.cxx:42
 AliRsnCutPhiRAA.cxx:43
 AliRsnCutPhiRAA.cxx:44
 AliRsnCutPhiRAA.cxx:45
 AliRsnCutPhiRAA.cxx:46
 AliRsnCutPhiRAA.cxx:47
 AliRsnCutPhiRAA.cxx:48
 AliRsnCutPhiRAA.cxx:49
 AliRsnCutPhiRAA.cxx:50
 AliRsnCutPhiRAA.cxx:51
 AliRsnCutPhiRAA.cxx:52
 AliRsnCutPhiRAA.cxx:53
 AliRsnCutPhiRAA.cxx:54
 AliRsnCutPhiRAA.cxx:55
 AliRsnCutPhiRAA.cxx:56
 AliRsnCutPhiRAA.cxx:57
 AliRsnCutPhiRAA.cxx:58
 AliRsnCutPhiRAA.cxx:59
 AliRsnCutPhiRAA.cxx:60
 AliRsnCutPhiRAA.cxx:61
 AliRsnCutPhiRAA.cxx:62
 AliRsnCutPhiRAA.cxx:63
 AliRsnCutPhiRAA.cxx:64
 AliRsnCutPhiRAA.cxx:65
 AliRsnCutPhiRAA.cxx:66
 AliRsnCutPhiRAA.cxx:67
 AliRsnCutPhiRAA.cxx:68
 AliRsnCutPhiRAA.cxx:69
 AliRsnCutPhiRAA.cxx:70
 AliRsnCutPhiRAA.cxx:71
 AliRsnCutPhiRAA.cxx:72
 AliRsnCutPhiRAA.cxx:73
 AliRsnCutPhiRAA.cxx:74
 AliRsnCutPhiRAA.cxx:75
 AliRsnCutPhiRAA.cxx:76
 AliRsnCutPhiRAA.cxx:77
 AliRsnCutPhiRAA.cxx:78
 AliRsnCutPhiRAA.cxx:79
 AliRsnCutPhiRAA.cxx:80
 AliRsnCutPhiRAA.cxx:81
 AliRsnCutPhiRAA.cxx:82
 AliRsnCutPhiRAA.cxx:83
 AliRsnCutPhiRAA.cxx:84
 AliRsnCutPhiRAA.cxx:85
 AliRsnCutPhiRAA.cxx:86
 AliRsnCutPhiRAA.cxx:87
 AliRsnCutPhiRAA.cxx:88
 AliRsnCutPhiRAA.cxx:89
 AliRsnCutPhiRAA.cxx:90
 AliRsnCutPhiRAA.cxx:91
 AliRsnCutPhiRAA.cxx:92
 AliRsnCutPhiRAA.cxx:93
 AliRsnCutPhiRAA.cxx:94
 AliRsnCutPhiRAA.cxx:95
 AliRsnCutPhiRAA.cxx:96
 AliRsnCutPhiRAA.cxx:97
 AliRsnCutPhiRAA.cxx:98
 AliRsnCutPhiRAA.cxx:99
 AliRsnCutPhiRAA.cxx:100
 AliRsnCutPhiRAA.cxx:101
 AliRsnCutPhiRAA.cxx:102
 AliRsnCutPhiRAA.cxx:103
 AliRsnCutPhiRAA.cxx:104
 AliRsnCutPhiRAA.cxx:105
 AliRsnCutPhiRAA.cxx:106
 AliRsnCutPhiRAA.cxx:107
 AliRsnCutPhiRAA.cxx:108
 AliRsnCutPhiRAA.cxx:109
 AliRsnCutPhiRAA.cxx:110
 AliRsnCutPhiRAA.cxx:111
 AliRsnCutPhiRAA.cxx:112
 AliRsnCutPhiRAA.cxx:113
 AliRsnCutPhiRAA.cxx:114
 AliRsnCutPhiRAA.cxx:115
 AliRsnCutPhiRAA.cxx:116
 AliRsnCutPhiRAA.cxx:117
 AliRsnCutPhiRAA.cxx:118
 AliRsnCutPhiRAA.cxx:119
 AliRsnCutPhiRAA.cxx:120
 AliRsnCutPhiRAA.cxx:121
 AliRsnCutPhiRAA.cxx:122
 AliRsnCutPhiRAA.cxx:123
 AliRsnCutPhiRAA.cxx:124
 AliRsnCutPhiRAA.cxx:125
 AliRsnCutPhiRAA.cxx:126
 AliRsnCutPhiRAA.cxx:127
 AliRsnCutPhiRAA.cxx:128
 AliRsnCutPhiRAA.cxx:129
 AliRsnCutPhiRAA.cxx:130
 AliRsnCutPhiRAA.cxx:131
 AliRsnCutPhiRAA.cxx:132
 AliRsnCutPhiRAA.cxx:133
 AliRsnCutPhiRAA.cxx:134
 AliRsnCutPhiRAA.cxx:135