fTOFuseT0(kFALSE),
fTOFtuneMC(kFALSE),
fTOFresolution(0.0),
- fMaxTOFband(1E6),
+ fMinTOF(-1E6),
+ fMaxTOF( 1E6),
fLastRun(-1)
{
//
fUseITSSA(kTRUE),
fMaxITSband(1E6),
fTPCpLimit(0.35),
- fMinTPCband(-1E6),
- fMaxTPCband( 1E6),
+ fMinTPCband(5.0),
+ fMaxTPCband(5.0),
fESDtrackCutsTPC(),
fESDtrackCutsITS(),
fESDpid(0x0),
fTOFuseT0(kFALSE),
fTOFtuneMC(kFALSE),
fTOFresolution(0.0),
- fMaxTOFband(1E6),
+ fMinTOF(-1E6),
+ fMaxTOF( 1E6),
fLastRun(-1)
{
//
fTOFuseT0(copy.fTOFuseT0),
fTOFtuneMC(copy.fTOFtuneMC),
fTOFresolution(copy.fTOFresolution),
- fMaxTOFband(copy.fMaxTOFband),
+ fMinTOF(copy.fMinTOF),
+ fMaxTOF(copy.fMaxTOF),
fLastRun(-1)
{
//
// ----> 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
- SetTOFband(3.0);
-
+ 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(80);
- fESDtrackCutsTPC.SetMaxChi2PerClusterTPC(4);
+ //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.0420/pt^0.9"); // DCA pt dependent: 7*(0.0050+0.0060/pt0.9)
- fESDtrackCutsTPC.SetMaxDCAToVertexZ(1e6); // disabled
+ 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);
-
+
// ----> 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.);
+ 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
-
+
// ----> set the TOF calibration depending on type of input (sim/data)
SetTOFcorrectTExp(kTRUE);
SetTOFuseT0(kTRUE);
{
// don't do anything if the event is the same as before
if (fEvent != 0x0 && fEvent == event) return;
-
+
// retrieve the ESD event
AliESDEvent *esd = event->GetRefESD();
if (!esd)
{
fEvent = event;
}
-
+
// if absent, initialize ESD pid responst
if (!fESDpid)
{
fESDpid = new AliESDpid;
fESDpid->GetTPCResponse().SetBetheBlochParameters(fTPCpar[0],fTPCpar[1],fTPCpar[2],fTPCpar[3],fTPCpar[4]);
}
-
+
// initialize DB to current run
Int_t run = esd->GetRunNumber();
if (run != fLastRun)
{
cout << "Run = " << run << " -- LAST = " << fLastRun << endl;
fLastRun = run;
-
+
// setup TOF maker & calibration
if (!fTOFcalib) fTOFcalib = new AliTOFcalib;
fTOFcalib->SetCorrectTExp(fTOFcorrectTExp);
if (!fTOFmaker) fTOFmaker = new AliTOFT0maker(fESDpid, fTOFcalib);
fTOFmaker->SetTimeResolution(fTOFresolution);
-
+
AliCDBManager *cdb = AliCDBManager::Instance();
cdb->ClearCache(); // suggestion by Annalisa
cdb->Clear(); // suggestion by Annalisa
cdb->SetDefaultStorage("raw://");
cdb->SetRun(run);
-
+
fTOFcalib->SetCorrectTExp(fTOFcorrectTExp);
fTOFcalib->Init();
}
-
+
// if required, calibrate the TOF t0 maker with current event
if (fTOFcalibrateESD) fTOFcalib->CalibrateESD(esd);
if (fTOFtuneMC) fTOFmaker->TuneForMC(esd);
- if (fTOFuseT0)
+ if (fTOFuseT0)
{
fTOFmaker->ComputeT0TOF(esd);
fTOFmaker->ApplyT0TOF(esd);
if (!daughter) return kFALSE;
AliESDtrack *track = daughter->GetRefESDtrack();
if (!track) return kFALSE;
-
+
// if no reference event, skip
if (!fEvent) return kFALSE;
-
- // reject pseudorapidity too large
- if (TMath::Abs(daughter->P().Eta()) > 0.9) return kFALSE;
-
+
// ITS stuff #1 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;
-
+
ULong_t status;
Int_t k, nITS;
Double_t times[10], tpcNSigma, tpcMaxNSigma, itsSignal, itsNSigma, mom, tofTime, tofSigma, tofRef, tofRel;
Bool_t okQuality, okTOF, okTPC, okITS, isTPC, isITSSA, isTOF;
UChar_t itsCluMap;
-
+
// get commonly used variables
status = (ULong_t)track->GetStatus();
mom = track->P();
- isTPC = ((status & AliESDtrack::kTPCin) != 0);
+ isTPC = ((status & AliESDtrack::kTPCin) != 0);
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)*/);
- // accept only tracks which are TPC+ITS or ITS standalone if their flag is switched on
- if (!isTPC && !isITSSA) return kFALSE;
+ // reject tracks with zero momentum
+ if (daughter->P().Mag() < 1E-5) return kFALSE;
+
+ // reject pseudorapidity too large
+ if (TMath::Abs(daughter->P().Eta()) > 0.9) return kFALSE;
+
+ // check quality
+ AliESDtrackCuts *cuts = 0x0;
+ if (isTPC) cuts = &fESDtrackCutsTPC;
+ if (isITSSA) cuts = &fESDtrackCutsITS;
+ if (!cuts) return kFALSE;
+ 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)
{
- // check standard ESD cuts
- okQuality = fESDtrackCutsTPC.IsSelected(track);
- AliDebug(AliLog::kDebug + 2, Form("Global quality cut = %s", (okQuality ? "GOOD" : "BAD")));
- if (!okQuality) return kFALSE;
-
// check TPC dE/dx
if (fCheckTPC)
{
AliDebug(AliLog::kDebug + 2, Form("TPC nsigma = %f -- max = %f -- cut %s", tpcNSigma, tpcMaxNSigma, (okTPC ? "passed" : "failed")));
if (!okTPC) return kFALSE;
}
-
- // check TOF (only if momentum is large than function asymptote and flags are OK)
+
+ // check TOF (only if flags are OK)
if (fCheckTOF && 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)
+ if (tofRef > 0.0 && tofSigma > 0.0)
{
/*
tofRel = (tofTime - tofRef) / tofRef;
ymin = a2 / (mom - b2) + c2;
okTOF = (tofRel >= ymin && tofRel <= ymax);
*/
- tofRel = TMath::Abs(tofTime - tofRef) / tofSigma;
- okTOF = (tofRel <= fMaxTOFband);
- AliDebug(AliLog::kDebug + 2, Form("TOF nsigma = %f -- max = %f -- cut %s", tofRel, fMaxTOFband, (okTOF ? "passed" : "failed")));
+ 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;
}
}
//
// 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
+ // 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;
}
-
+
// 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;
}
-
+
// this branch is entered by all ITS standalone tracks
// is their usage is required in the initialization
if (isITSSA && fUseITSSA)
{
- // check standard ESD cuts
- okQuality = fESDtrackCutsITS.IsSelected(track);
- AliDebug(AliLog::kDebug + 2, Form("Global quality cut = %s", (okQuality ? "GOOD" : "BAD")));
- if (!okQuality) return kFALSE;
-
// check dE/dx
- itsSignal = track->GetITSsignal();
- itsCluMap = track->GetITSClusterMap();
- nITS = 0;
- for(k = 2; k < 6; k++) if(itsCluMap & (1 << k)) ++nITS;
- if (nITS < 3) return kFALSE;
- 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;
-
+ if (fCheckITS)
+ {
+ itsSignal = track->GetITSsignal();
+ itsCluMap = track->GetITSClusterMap();
+ nITS = 0;
+ for(k = 2; k < 6; k++) if(itsCluMap & (1 << k)) ++nITS;
+ if (nITS < 3) return kFALSE;
+ 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;
+ }
+
// 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;
}
-
+
// if we are here, the track is surely bad
return kFALSE;
}