fLvsEta(0x0),
fLvsEtaProjections(0x0),
fMakeTOFcorrelations(kTRUE),
- fMakeTOFTPCcorrelations(kFALSE)
- //fDebug(0)
+ fMakeTOFTPCcorrelationsPi(kFALSE),
+ fMakeTOFTPCcorrelationsKa(kFALSE),
+ fMakeTOFTPCcorrelationsPr(kFALSE),
+ fTOFIntervalFactorTOFTPC(1.)
{
fLvsEta(0x0),
fLvsEtaProjections(0x0),
fMakeTOFcorrelations(kTRUE),
- fMakeTOFTPCcorrelations(kFALSE)
- //fDebug(0)
+ fMakeTOFTPCcorrelationsPi(kFALSE),
+ fMakeTOFTPCcorrelationsKa(kFALSE),
+ fMakeTOFTPCcorrelationsPr(kFALSE),
+ fTOFIntervalFactorTOFTPC(1.)
{
}
// Create TOF/TPC correlation histograms. (DPhi,DEta,TOF,TPC).
- if (fMakeTOFTPCcorrelations) {
+ if (fMakeTOFTPCcorrelationsPi || fMakeTOFTPCcorrelationsKa || fMakeTOFTPCcorrelationsPr) {
Double_t ptarrayTOFTPC[16] = {2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6,
2.8, 3.0, 3.2, 3.4, 3.6, 3.8,
nptbins, ptarrayTOFTPC);
fOutputList->Add(fMixedEventsTOFTPCbins);
- Int_t NBinsTOFTPC[4] = {32, 32, 60, 40};
- Double_t minTOFTPC[4] = {-TMath::Pi()/2., -1.6, -1., -1.};
- Double_t maxTOFTPC[4] = {3.*TMath::Pi()/2., 1.6, -1., -1.};
-
- Double_t sTOFest = 110.;
- Double_t sTPCest = 4.5;
-
fTOFTPChistos = new TObjArray(3);
fTOFTPChistos->SetOwner(kTRUE);
fTOFTPChistos->SetName("CorrelationsTOFTPC");
for (Int_t iSpecies = 0; iSpecies < 3; iSpecies++) {
+ // Create the directory structure Pion, Kaon, Proton, regardless
+ // of wether the histograms are created (to keep the order.)
TObjArray* TOFTPChistosTmp = new TObjArray(fTOFTPCPtAxis->GetNbins());
TOFTPChistosTmp->SetOwner(kTRUE);
TOFTPChistosTmp->SetName(speciesname[iSpecies].Data());
TOFTPCmismatchTmp->SetName(speciesname[iSpecies].Data());
}
- for (Int_t iBinPt = 1; iBinPt < (fTOFTPCPtAxis->GetNbins() + 1); iBinPt++) {
-
- // Determine PID ranges.
-
- // Set range +/- 5 sigma of main peak. (+ 10 sigma for TOF max, for mismatches.)
- Double_t TOFmin = -5. * sTOFest;
- Double_t TOFmax = 10. * sTOFest;
- Double_t TPCmin = -4. * sTPCest;
- Double_t TPCmax = 4. * sTPCest;
-
- Double_t TOFexp = AliFunctionsDiHadronPID::TOFExpTime(fTOFTPCPtAxis->GetBinLowEdge(iBinPt), 0.4, AliFunctionsDiHadronPID::M(iSpecies));
- Double_t TPCexp = AliFunctionsDiHadronPID::TPCExpdEdX(fTOFTPCPtAxis->GetBinLowEdge(iBinPt), 0.4, AliFunctionsDiHadronPID::M(iSpecies));
-
- for (Int_t jSpecies = 0; jSpecies < 3; jSpecies++) {
-
- if (iSpecies == jSpecies) {continue;}
-
- Double_t TOFexpOther = AliFunctionsDiHadronPID::TOFExpTime(fTOFTPCPtAxis->GetBinLowEdge(iBinPt), 0.4, AliFunctionsDiHadronPID::M(jSpecies));
- Double_t TPCexpOther = AliFunctionsDiHadronPID::TPCExpdEdX(fTOFTPCPtAxis->GetBinLowEdge(iBinPt), 0.4, AliFunctionsDiHadronPID::M(jSpecies));
-
- // If any peak is within +/- 7 sigma, then also add this peak.
- if ( (TMath::Abs(TOFexp - TOFexpOther) < 7. * sTOFest) ||
- (TMath::Abs(TPCexp - TPCexpOther) < 7. * sTPCest) ) {
+ // Only Create the TOF/TPC histograms when requested.
+ Bool_t MakeTOFTPCcorrelations[3] = {fMakeTOFTPCcorrelationsPi, fMakeTOFTPCcorrelationsKa, fMakeTOFTPCcorrelationsPr};
+ if (MakeTOFTPCcorrelations[iSpecies]) {
+ for (Int_t iBinPt = 1; iBinPt < (fTOFTPCPtAxis->GetNbins() + 1); iBinPt++) {
+
+ // Approximate resolutions of TOF and TPC detector.
+ const Double_t sTOFest = 110.;
+ const Double_t sTPCest = 4.5;
+
+ // Set range +/- 5 sigma of main peak. (+ 10 sigma for TOF max, for mismatches.)
+ Double_t TOFmin = -5. * sTOFest;
+ Double_t TOFmax = 10. * sTOFest;
+ Double_t TPCmin = -4. * sTPCest;
+ Double_t TPCmax = 4. * sTPCest;
+
+ Double_t TOFexp = AliFunctionsDiHadronPID::TOFExpTime(fTOFTPCPtAxis->GetBinLowEdge(iBinPt), 0.4, AliFunctionsDiHadronPID::M(iSpecies));
+ Double_t TPCexp = AliFunctionsDiHadronPID::TPCExpdEdX(fTOFTPCPtAxis->GetBinLowEdge(iBinPt), 0.4, AliFunctionsDiHadronPID::M(iSpecies));
+
+ for (Int_t jSpecies = 0; jSpecies < 3; jSpecies++) {
+
+ if (iSpecies == jSpecies) {continue;}
+
+ Double_t TOFexpOther = AliFunctionsDiHadronPID::TOFExpTime(fTOFTPCPtAxis->GetBinLowEdge(iBinPt), 0.4, AliFunctionsDiHadronPID::M(jSpecies));
+ Double_t TPCexpOther = AliFunctionsDiHadronPID::TPCExpdEdX(fTOFTPCPtAxis->GetBinLowEdge(iBinPt), 0.4, AliFunctionsDiHadronPID::M(jSpecies));
+
+ // If any peak is within +/- 7 sigma, then also add this peak.
+ if ( (TMath::Abs(TOFexp - TOFexpOther) < 7. * sTOFest) ||
+ (TMath::Abs(TPCexp - TPCexpOther) < 7. * sTPCest) ) {
+
+ TOFmin = TMath::Min(TOFmin, (TOFexpOther - TOFexp - 2. * sTOFest) );
+ TOFmax = TMath::Max(TOFmax, (TOFexpOther - TOFexp + 10. * sTOFest) );
+ TPCmin = TMath::Min(TPCmin, (TPCexpOther - TPCexp - 2. * sTPCest) );
+ TPCmax = TMath::Max(TPCmax, (TPCexpOther - TPCexp + 2. * sTPCest) );
- TOFmin = TMath::Min(TOFmin, (TOFexpOther - TOFexp - 2. * sTOFest) );
- TOFmax = TMath::Max(TOFmax, (TOFexpOther - TOFexp + 10. * sTOFest) );
- TPCmin = TMath::Min(TPCmin, (TPCexpOther - TPCexp - 2. * sTPCest) );
- TPCmax = TMath::Max(TPCmax, (TPCexpOther - TPCexp + 2. * sTPCest) );
+ }
}
- }
-
- minTOFTPC[2] = TOFmin;
- maxTOFTPC[2] = TOFmax;
- minTOFTPC[3] = TPCmin;
- maxTOFTPC[3] = TPCmax;
-
- THnF* htmp = new THnF(Form("fCorrelationsTOFTPC_%i",iBinPt),
- Form("%5.3f < p_{T} < %5.3f", fTOFTPCPtAxis->GetBinLowEdge(iBinPt), fTOFTPCPtAxis->GetBinUpEdge(iBinPt)),
- 4, NBinsTOFTPC, minTOFTPC, maxTOFTPC);
-
- (htmp->GetAxis(0))->SetTitle("#Delta#phi");
- (htmp->GetAxis(1))->SetTitle("#Delta#eta");
- (htmp->GetAxis(2))->SetTitle("t_{TOF} (ps)");
- (htmp->GetAxis(3))->SetTitle("dE/dx (a.u.)");
-
- TOFTPChistosTmp->Add(htmp);
-
- if (fCalculateMismatch) {
- // Mismatch histogram.
- TH2F* htmp2 = new TH2F(Form("fMismatchTOFTPC_%i",iBinPt),
- Form("%5.3f < p_{T} < %5.3f; t_{TOF} (ps); dE/dx (a.u.)", fTOFTPCPtAxis->GetBinLowEdge(iBinPt), fTOFTPCPtAxis->GetBinUpEdge(iBinPt)),
- NBinsTOFTPC[2], TOFmin, TOFmax, NBinsTOFTPC[3], TPCmin, TPCmax);
- htmp2->SetDirectory(0);
-
- TOFTPCmismatchTmp->Add(htmp2);
-
- }
-
- }
+ // With the standard TOF range, fitting the deuterons and the TOF mismatches is
+ // hard. This flag doubles the range of the TOF axis in the TOF/TPC histograms,
+ // while leaving the resolution the same. Turning on this flag will greatly increase
+ // the memory consumption of the task, to the point that it's probably too much
+ // to save a Buffer with all three species included.
+ Double_t TOFreach = TOFmax - TOFmin;
+ TOFmax += (TOFreach * (fTOFIntervalFactorTOFTPC - 1.));
+ Int_t TOFbins = (60. * fTOFIntervalFactorTOFTPC);
+
+ Int_t NBinsTOFTPC[4] = {32, 32, TOFbins, 40};
+ Double_t minTOFTPC[4] = {-TMath::Pi()/2., -1.6, TOFmin, TPCmin};
+ Double_t maxTOFTPC[4] = {3.*TMath::Pi()/2., 1.6, TOFmax, TPCmax};
+
+ THnF* htmp = new THnF(Form("fCorrelationsTOFTPC_%i",iBinPt),
+ Form("%5.3f < p_{T} < %5.3f", fTOFTPCPtAxis->GetBinLowEdge(iBinPt), fTOFTPCPtAxis->GetBinUpEdge(iBinPt)),
+ 4, NBinsTOFTPC, minTOFTPC, maxTOFTPC);
+
+ (htmp->GetAxis(0))->SetTitle("#Delta#phi");
+ (htmp->GetAxis(1))->SetTitle("#Delta#eta");
+ (htmp->GetAxis(2))->SetTitle("t_{TOF} (ps)");
+ (htmp->GetAxis(3))->SetTitle("dE/dx (a.u.)");
+
+ TOFTPChistosTmp->Add(htmp);
+
+ if (fCalculateMismatch) {
+ // Mismatch histogram.
+ TH2F* htmp2 = new TH2F(Form("fMismatchTOFTPC_%i",iBinPt),
+ Form("%5.3f < p_{T} < %5.3f; t_{TOF} (ps); dE/dx (a.u.)", fTOFTPCPtAxis->GetBinLowEdge(iBinPt), fTOFTPCPtAxis->GetBinUpEdge(iBinPt)),
+ NBinsTOFTPC[2], TOFmin, TOFmax, NBinsTOFTPC[3], TPCmin, TPCmax);
+ htmp2->SetDirectory(0);
+
+ TOFTPCmismatchTmp->Add(htmp2);
+
+ }
+ } // End loop over pT bins.
+ } // End species if.
fTOFTPChistos->Add(TOFTPChistosTmp);
if (fCalculateMismatch) {fTOFTPCmismatch->Add(TOFTPCmismatchTmp);}
}
}
- if (fMakeTOFTPCcorrelations) {
+ Bool_t MakeTOFTPCcorrelations[3] = {fMakeTOFTPCcorrelationsPi, fMakeTOFTPCcorrelationsKa, fMakeTOFTPCcorrelationsPr};
+ if (fMakeTOFTPCcorrelationsPi || fMakeTOFTPCcorrelationsKa || fMakeTOFTPCcorrelationsPr) {
for (Int_t iSpecies = 0; iSpecies < 3; iSpecies++) {
+ if (!MakeTOFTPCcorrelations[iSpecies]) {continue;}
+
TObjArray* atmp = (TObjArray*)fTOFTPCmismatch->At(iSpecies);
Int_t ptbin = fTOFTPCPtAxis->FindBin(apt);
if (fCorrelationsTOFbins) fCorrelationsTOFbins->Fill(DPhi,DEta,associatedtrack->Pt());
if (fCorrelationsTOFTPCbins) fCorrelationsTOFTPCbins->Fill(DPhi,DEta,associatedtrack->Pt());
- for (Int_t iSpecies = 0; iSpecies < 3; iSpecies++) {
-
- Double_t apt = associatedtrack->Pt();
+ Double_t apt = associatedtrack->Pt();
- // Fill TOF correlations.
- if (fMakeTOFcorrelations) {
+ // Fill TOF correlations.
+ if (fMakeTOFcorrelations) {
+ for (Int_t iSpecies = 0; iSpecies < 3; iSpecies++) {
+
TObjArray* atmp = (TObjArray*)fTOFhistos->At(iSpecies);
Int_t ptbin = fTOFPtAxis->FindBin(apt);
}
}
+ }
+
+ // Fill TOF/ TPC Correlations.
+ Bool_t MakeTOFTPCcorrelations[3] = {fMakeTOFTPCcorrelationsPi, fMakeTOFTPCcorrelationsKa, fMakeTOFTPCcorrelationsPr};
+ if (fMakeTOFTPCcorrelationsPi || fMakeTOFTPCcorrelationsKa || fMakeTOFTPCcorrelationsPr) {
- // Fill TOF/ TPC Correlations.
- if (fMakeTOFTPCcorrelations) {
+ for (Int_t iSpecies = 0; iSpecies < 3; iSpecies++) {
+
+ if (!MakeTOFTPCcorrelations[iSpecies]) {continue;}
TObjArray* atmp = (TObjArray*)fTOFTPChistos->At(iSpecies);
Int_t ptbin = fTOFTPCPtAxis->FindBin(apt);
htmp->Fill(TOFTPCfill);
}
- }
- }
+ }
+ }
}
}