ClassImp(AliRsnCutESD2010)
-//_________________________________________________________________________________________________
-AliRsnCutESD2010::AliRsnCutESD2010() :
- AliRsnCut(AliRsnCut::kDaughter),
- fIsMC(kFALSE),
- fCheckITS(kTRUE),
- fCheckTPC(kTRUE),
- fCheckTOF(kTRUE),
- fUseGlobal(kTRUE),
- fUseITSSA(kTRUE),
- fMaxITSband(1E6),
- fTPCpLimit(0.35),
- fMinTPCband(-1E6),
- fMaxTPCband( 1E6),
- fESDtrackCutsTPC(),
- fESDtrackCutsITS(),
- fESDpid(0x0),
- fTOFmaker(0x0),
- fTOFcalib(0x0),
- fTOFcalibrateESD(kFALSE),
- fTOFcorrectTExp(kFALSE),
- fTOFuseT0(kFALSE),
- fTOFtuneMC(kFALSE),
- fTOFresolution(0.0),
- fMinTOF(-1E6),
- fMaxTOF( 1E6),
- fLastRun(-1)
-{
-//
-// Default constructor.
-//
-
- Int_t i = 0;
- for (i = 0; i < 5; i++) fTPCpar[i] = 0.0;
-}
-
//_________________________________________________________________________________________________
AliRsnCutESD2010::AliRsnCutESD2010
-(const char *name) :
+(const char *name, Bool_t isMC) :
AliRsnCut(name, AliRsnCut::kDaughter, 0.0, 0.0),
- fIsMC(kFALSE),
+ fIsMC(isMC),
fCheckITS(kTRUE),
fCheckTPC(kTRUE),
fCheckTOF(kTRUE),
fUseGlobal(kTRUE),
fUseITSSA(kTRUE),
- fMaxITSband(1E6),
+ fMaxEta(1E6),
+ fMaxITSband(3.0),
fTPCpLimit(0.35),
- fMinTPCband(5.0),
+ fMinTPCband(3.0),
fMaxTPCband(5.0),
fESDtrackCutsTPC(),
fESDtrackCutsITS(),
fESDpid(0x0),
fTOFmaker(0x0),
fTOFcalib(0x0),
- fTOFcalibrateESD(kFALSE),
- fTOFcorrectTExp(kFALSE),
- fTOFuseT0(kFALSE),
- fTOFtuneMC(kFALSE),
- fTOFresolution(0.0),
- fMinTOF(-1E6),
- fMaxTOF( 1E6),
+ fTOFcalibrateESD(!isMC),
+ fTOFcorrectTExp(kTRUE),
+ fTOFuseT0(kTRUE),
+ fTOFtuneMC(isMC),
+ fTOFresolution(100.0),
+ fMinTOF(-2.5),
+ fMaxTOF( 3.5),
fLastRun(-1)
{
//
// Main constructor.
//
- Int_t i = 0;
- for (i = 0; i < 5; i++) fTPCpar[i] = 0.0;
+ SetMC(isMC);
+
+ // set default quality cuts for TPC+ITS tracks
+ // TPC
+ fESDtrackCutsTPC.SetRequireTPCStandAlone(kTRUE); // to get chi2 and ncls of kTPCin
+ fESDtrackCutsTPC.SetMinNClustersTPC(70);
+ fESDtrackCutsTPC.SetMaxChi2PerClusterTPC(4);
+ fESDtrackCutsTPC.SetAcceptKinkDaughters(kFALSE);
+ fESDtrackCutsTPC.SetRequireTPCRefit(kTRUE);
+ // ITS
+ fESDtrackCutsTPC.SetRequireITSRefit(kTRUE);
+ fESDtrackCutsTPC.SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
+ fESDtrackCutsTPC.SetMaxDCAToVertexXYPtDep("0.0350+0.0490/pt^1.0");
+ fESDtrackCutsTPC.SetMaxDCAToVertexZ(1.e6);
+ fESDtrackCutsTPC.SetDCAToVertex2D(kFALSE);
+ fESDtrackCutsTPC.SetRequireSigmaToVertex(kFALSE);
+ fESDtrackCutsTPC.SetEtaRange(-fMaxEta, fMaxEta);
+
+ // set default quality cuts for ITS standalone tracks
+ fESDtrackCutsITS.SetRequireITSStandAlone(kTRUE);
+ fESDtrackCutsITS.SetRequireITSPureStandAlone(kFALSE);
+ fESDtrackCutsITS.SetRequireITSRefit(kTRUE);
+ fESDtrackCutsITS.SetMinNClustersITS(4);
+ fESDtrackCutsITS.SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
+ fESDtrackCutsITS.SetMaxChi2PerClusterITS(2.5);
+ fESDtrackCutsITS.SetMaxDCAToVertexXYPtDep("0.0595+0.0182/pt^1.55");
+ fESDtrackCutsITS.SetEtaRange(-fMaxEta, fMaxEta);
}
//_________________________________________________________________________________________________
fCheckTOF(copy.fCheckTOF),
fUseGlobal(copy.fUseGlobal),
fUseITSSA(copy.fUseITSSA),
+ fMaxEta(copy.fMaxEta),
fMaxITSband(copy.fMaxITSband),
fTPCpLimit(copy.fTPCpLimit),
fMinTPCband(copy.fMinTPCband),
fLastRun(-1)
{
//
-// Main constructor.
+// Copy constructor.
//
Int_t i = 0;
}
//_________________________________________________________________________________________________
-void AliRsnCutESD2010::InitializeToDefaults(Bool_t isSim)
+AliRsnCutESD2010& AliRsnCutESD2010::operator=(const AliRsnCutESD2010& copy)
{
//
-// Main constructor.
+// Assignment operator
//
- // ----> set TPC range for PID and calibration
- SetTPCrange(5.0, 3.0);
- SetTPCpLimit(0.35);
-
- // ----> set ITS range for PID
- SetITSband(3.0);
-
- // ----> set TOF range for PID
- SetTOFrange(-2.5, 3.0);
-
- // ----> set TPC calibration
- if (isSim) SetTPCpar(2.15898 / 50.0, 1.75295E1, 3.40030E-9, 1.96178, 3.91720);
- else SetTPCpar(1.41543 / 50.0, 2.63394E1, 5.0411E-11, 2.12543, 4.88663);
-
- // ----> set standard quality cuts for TPC global tracks
- //fESDtrackCutsTPC.SetRequireTPCStandAlone(kTRUE); // require to have the projection at inner TPC wall
- fESDtrackCutsTPC.SetMinNClustersTPC(70);
- fESDtrackCutsTPC.SetMaxChi2PerClusterTPC(4.0);
- fESDtrackCutsTPC.SetAcceptKinkDaughters(kFALSE);
- fESDtrackCutsTPC.SetRequireTPCRefit(kTRUE);
- fESDtrackCutsTPC.SetRequireITSRefit(kTRUE);
- fESDtrackCutsTPC.SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
- fESDtrackCutsTPC.SetMaxDCAToVertexXYPtDep("0.0350+0.0490/pt"); // DCA pt dependent: 7*(0.0050+0.0060/pt0.9)
- fESDtrackCutsTPC.SetMaxDCAToVertexZ(1e6); // disabled
- fESDtrackCutsTPC.SetDCAToVertex2D(kFALSE); // each DCA is checked separately
- fESDtrackCutsTPC.SetRequireSigmaToVertex(kFALSE);
+ AliRsnCut::operator=(copy);
+
+ fIsMC = copy.fIsMC;
+ fCheckITS = copy.fCheckITS;
+ fCheckTPC = copy.fCheckTPC;
+ fCheckTOF = copy.fCheckTOF;
+ fUseGlobal = copy.fUseGlobal;
+ fUseITSSA = copy.fUseITSSA;
+ fMaxEta = copy.fMaxEta;
+ fMaxITSband = copy.fMaxITSband;
+ fTPCpLimit = copy.fTPCpLimit;
+ fMinTPCband = copy.fMinTPCband;
+ fMaxTPCband = copy.fMaxTPCband;
+ fESDtrackCutsTPC = copy.fESDtrackCutsTPC;
+ fESDtrackCutsITS = copy.fESDtrackCutsITS;
+ fTOFcalibrateESD = copy.fTOFcalibrateESD;
+ fTOFcorrectTExp = copy.fTOFcorrectTExp;
+ fTOFuseT0 = copy.fTOFuseT0;
+ fTOFtuneMC = copy.fTOFtuneMC;
+ fTOFresolution = copy.fTOFresolution;
+ fMinTOF = copy.fMinTOF;
+ fMaxTOF = copy.fMaxTOF;
+ fLastRun = copy.fLastRun;
+
+ Int_t i = 0;
+ for (i = 0; i < 5; i++) fTPCpar[i] = copy.fTPCpar[i];
+
+ return (*this);
+}
- // ----> set standard quality cuts for ITS standalone tracks
- fESDtrackCutsITS.SetRequireITSStandAlone(kTRUE);
- fESDtrackCutsITS.SetRequireITSRefit(kTRUE);
- fESDtrackCutsITS.SetMinNClustersITS(4);
- fESDtrackCutsITS.SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
- fESDtrackCutsITS.SetMaxChi2PerClusterITS(2.5);
- fESDtrackCutsITS.SetMaxDCAToVertexXYPtDep("0.0595+0.0182/pt^1.55"); // DCA pt dependent (7 sigma)
- fESDtrackCutsITS.SetMaxDCAToVertexZ(1e6); // disabled
- fESDtrackCutsITS.SetDCAToVertex2D(kFALSE); // each DCA is checked separately
+//_________________________________________________________________________________________________
+void AliRsnCutESD2010::SetMC(Bool_t isMC)
+{
+//
+// Sets some aspects of cuts depending on the fact that runs on MC or not
+//
- // ----> set the TOF calibration depending on type of input (sim/data)
- SetTOFcorrectTExp(kTRUE);
- SetTOFuseT0(kTRUE);
- SetTOFresolution(100.0);
- if (isSim)
+ fIsMC = isMC;
+
+ if (isMC)
{
+ SetTPCpar(2.15898 / 50.0, 1.75295E1, 3.40030E-9, 1.96178, 3.91720);
SetTOFcalibrateESD(kFALSE);
SetTOFtuneMC(kTRUE);
}
else
{
+ SetTPCpar(1.41543 / 50.0, 2.63394E1, 5.0411E-11, 2.12543, 4.88663);
SetTOFcalibrateESD(kTRUE);
SetTOFtuneMC(kFALSE);
}
// if no reference event, skip
if (!fEvent) return kFALSE;
- // ITS stuff #1 create the response function
+ // ITS: create the response function
AliITSPIDResponse itsrsp(fIsMC);
// TOF: define fixed function for compatibility range
- //Double_t a1 = 0.01, a2 = -0.03;
- //Double_t b1 = 0.25, b2 = 0.25;
- //Double_t c1 = 0.05, c2 = -0.03;
- //Double_t ymax, ymin;
+ Double_t a1 = 0.01, a2 = -0.03;
+ Double_t b1 = 0.25, b2 = 0.25;
+ Double_t c1 = 0.05, c2 = -0.03;
+ Double_t ymax, ymin;
ULong_t status;
Int_t k, nITS;
isITSSA = ((status & AliESDtrack::kTPCin) == 0 && (status & AliESDtrack::kITSrefit) != 0 && (status & AliESDtrack::kITSpureSA) == 0 && (status & AliESDtrack::kITSpid) != 0);
isTOF = (((status & AliESDtrack::kTOFout) != 0) && ((status & AliESDtrack::kTIME) != 0) /* && mom > TMath::Max(b1, b2)*/);
- // reject tracks with zero momentum
- if (daughter->P().Mag() < 1E-5) return kFALSE;
+ // check if the track type matches what is required
+ if (!isTPC && !isITSSA)
+ {
+ AliDebug(AliLog::kDebug + 2, "Track is not either a TPC track or a ITS standalone. Rejected");
+ return kFALSE;
+ }
+ else if (isTPC && !fUseGlobal)
+ {
+ AliDebug(AliLog::kDebug + 2, "Global tracks not used. Rejected");
+ return kFALSE;
+ }
+ else if (isITSSA && !fUseITSSA)
+ {
+ AliDebug(AliLog::kDebug + 2, "ITS standalone not used. Rejected");
+ return kFALSE;
+ }
- // reject pseudorapidity too large
- if (TMath::Abs(daughter->P().Eta()) > 0.9) return kFALSE;
+ // does a preliminary check on TOF values, if necessary
+ // then, if the reference time or TOF signal are meaningless
+ // even if the 'isTOF' flag is true, switch it to false
+ if (isTOF)
+ {
+ track->GetIntegratedTimes(times);
+ tofTime = (Double_t)track->GetTOFsignal();
+ tofSigma = fTOFmaker->GetExpectedSigma(mom, times[AliPID::kKaon], AliPID::ParticleMass(AliPID::kKaon));
+ tofRef = times[AliPID::kKaon];
+ if (tofRef <= 0.0 && tofSigma <= 0.0) isTOF = kFALSE;
+ }
- // check quality
+ // check quality (eta range must be adapted)
AliESDtrackCuts *cuts = 0x0;
- if (isTPC) cuts = &fESDtrackCutsTPC;
+ if (isTPC) cuts = &fESDtrackCutsTPC;
if (isITSSA) cuts = &fESDtrackCutsITS;
- if (!cuts) return kFALSE;
+ if (!cuts) return kFALSE;
+ cuts->SetEtaRange(-fMaxEta, fMaxEta);
okQuality = cuts->IsSelected(track);
AliDebug(AliLog::kDebug + 2, Form("Global quality cut = %s", (okQuality ? "GOOD" : "BAD")));
if (!okQuality) return kFALSE;
- // this branch is entered by all global tracks
- // is their usage is required in the initialization
- if (isTPC && fUseGlobal)
+ if (isTPC) // this branch is entered by all global tracks
{
- // check TPC dE/dx
+ // check TPC dE/dx:
if (fCheckTPC)
{
tpcNSigma = TMath::Abs(fESDpid->NumberOfSigmasTPC(track, AliPID::kKaon));
if (track->GetInnerParam()->P() > fTPCpLimit) tpcMaxNSigma = fMinTPCband; else tpcMaxNSigma = fMaxTPCband;
okTPC = (tpcNSigma <= tpcMaxNSigma);
AliDebug(AliLog::kDebug + 2, Form("TPC nsigma = %f -- max = %f -- cut %s", tpcNSigma, tpcMaxNSigma, (okTPC ? "passed" : "failed")));
- if (!okTPC) return kFALSE;
+ }
+ else
+ {
+ // if TPC is not checked, it is as if all tracks do pass the cut
+ okTPC = kTRUE;
+ AliDebug(AliLog::kDebug + 2, "TPC not checked, track accepted");
}
// check TOF (only if flags are OK)
- if (fCheckTOF && isTOF)
+ if (fCheckTOF)
{
- track->GetIntegratedTimes(times);
- tofTime = (Double_t)track->GetTOFsignal();
- tofSigma = fTOFmaker->GetExpectedSigma(mom, times[AliPID::kKaon], AliPID::ParticleMass(AliPID::kKaon));
- tofRef = times[AliPID::kKaon];
- if (tofRef > 0.0 && tofSigma > 0.0)
+ if (isTOF)
{
- /*
+ // TOF can be checked only when track is matched there
+ track->GetIntegratedTimes(times);
+ tofTime = (Double_t)track->GetTOFsignal();
+ tofSigma = fTOFmaker->GetExpectedSigma(mom, times[AliPID::kKaon], AliPID::ParticleMass(AliPID::kKaon));
+ tofRef = times[AliPID::kKaon];
tofRel = (tofTime - tofRef) / tofRef;
ymax = a1 / (mom - b1) + c1;
ymin = a2 / (mom - b2) + c2;
okTOF = (tofRel >= ymin && tofRel <= ymax);
- */
+ /*
tofRel = (tofTime - tofRef) / tofSigma;
okTOF = (tofRel >= fMinTOF && tofRel <= fMaxTOF);
+ */
AliDebug(AliLog::kDebug + 2, Form("TOF nsigma = %f -- range = %f %f -- cut %s", tofRel, fMinTOF, fMaxTOF, (okTOF ? "passed" : "failed")));
- if (!okTOF) return kFALSE;
+ }
+ else
+ {
+ // if TOF is not matched, the answer depends on TPC:
+ // - if TPC is required, track is checked only there and TOF simply ignored
+ // - if TPC is not required, track is rejected when TOF does not match it, if TOF check is required
+ if (fCheckTPC) okTOF = kTRUE; else okTOF = kFALSE;
}
}
else
{
- //
- // the opposite of previous condition (fCheckTOF && isTOF) is
- // NOT fCheckTOF OR NOT isTOF
- //
-
- // if TOF must not be checked, TPC is assumed to be checked
- // otherwise, just quality cuts have been checked, but anyway
- // all other cuts have already been checked and no further check
- // is needed here;
- // Just print a debug message
- if (!isTOF) AliDebug(AliLog::kDebug + 2, "TOF not matched");
-
- // instead, if track has not a match in TOF, we must reject it
- // in case it was not already checked in the TPC, since we cannot
- // say anything about not matched track if TOF is the only detector
- if (!fCheckTPC && !isTOF) return kFALSE;
+ okTOF = kTRUE;
}
-
- // if we arrive here, the cut is passed,
- // since in all points where something goew wrong,
- // and exit point is implemented which returns kFALSE
- return kTRUE;
+
+ // properly combine the outcome of TPC and TOF cuts
+ return okTPC && okTOF;
}
-
- // this branch is entered by all ITS standalone tracks
- // is their usage is required in the initialization
- if (isITSSA && fUseITSSA)
+ else if (isITSSA) // this branch is entered by all ITS standalone tracks
{
- // check dE/dx
+ // check dE/dx only if this is required, otherwise ITS standalone are just added but not checked for PID
if (fCheckITS)
{
itsSignal = track->GetITSsignal();
itsNSigma = itsrsp.GetNumberOfSigmas(mom, itsSignal, AliPID::kKaon, nITS, kTRUE);
okITS = (TMath::Abs(itsNSigma) <= fMaxITSband);
AliDebug(AliLog::kDebug + 2, Form("ITS nsigma = %f -- max = %f -- cut %s", itsNSigma, fMaxITSband, (okITS ? "passed" : "failed")));
- if (!okITS) return kFALSE;
+ }
+ else
+ {
+ okITS = kTRUE;
}
- // if we arrive here, the cut is passed,
- // since in all points where something goew wrong,
- // and exit point is implemented which returns kFALSE
- return kTRUE;
+ return okITS;
+ }
+ else
+ {
+ // if we are here, the track is surely bad
+ return kFALSE;
}
-
- // if we are here, the track is surely bad
- return kFALSE;
}