fProtonEfficiencies(NULL),
fKaonEfficiencies(NULL),
fThresholds(NULL),
- fShowMessage(kFALSE)
+ fShowMessage(kFALSE),
+ fTotalChargeInSlice0(kFALSE)
{
//
// Default Constructor
fProtonEfficiencies(NULL),
fKaonEfficiencies(NULL),
fThresholds(NULL),
- fShowMessage(kFALSE)
+ fShowMessage(kFALSE),
+ fTotalChargeInSlice0(kFALSE)
{
//
// Main Constructor
fProtonEfficiencies(NULL),
fKaonEfficiencies(NULL),
fThresholds(NULL),
- fShowMessage(kFALSE)
+ fShowMessage(kFALSE),
+ fTotalChargeInSlice0(ref.fTotalChargeInSlice0)
{
//
// Copy constructor
AliHFEtrdPIDqa &target = dynamic_cast<AliHFEtrdPIDqa &>(ref);
target.fTRDpid = fTRDpid;
- target.fHistos = dynamic_cast<AliHFEcollection *>(fHistos->Clone());
+ target.fHistos = dynamic_cast<AliHFEcollection *>(fHistos->Clone());
+ target.fTotalChargeInSlice0 = fTotalChargeInSlice0;
}
//__________________________________________________________________
fHistos->CreateTHnSparse("fTRDtruncMean","TRD TruncatedMean studies", kQuantitiesTruncMean, nbins, binMin, binMax);
fHistos->BinLogAxis("fTRDtruncMean", kP);
- fHistos->CreateTH2F("fTRDslicesPions","TRD dEdx per slice for Pions", 8, 0, 8, 500, 0, 2000);
- fHistos->CreateTH2F("fTRDslicesElectrons","TRD dEdx per slice for Electrons", 8, 0, 8, 500, 0, 2000);
+ fHistos->CreateTH2F("fTRDslicesPions","TRD dEdx per slice for Pions", 8, 0, 8, 2000, 0, 8000);
+ fHistos->CreateTH2F("fTRDslicesElectrons","TRD dEdx per slice for Electrons", 8, 0, 8, 2000, 0, 8000);
}
quantitiesdEdx[kP] = track->GetTRDmomentum(iplane);
dEdxSum = 0.;
for(Int_t islice = 0; islice < nSlices; islice++){
- qSlice = track->GetTRDslice(iplane, islice);
+ if(fTotalChargeInSlice0 && islice >= 7) break;
+ qSlice = track->GetTRDslice(iplane, fTotalChargeInSlice0 ? islice + 1 : islice); // hack by mfasel: For data with the new reconstruction, slice 0 is used to store the total charge, the total number of slices is 7 instead of 8
if(qSlice > 1e-1){
// cut out 0 slices
nSlicesNonZero++;
}
}
quantitiesdEdx[kNonZeroSlices] = nSlicesNonZero;
- quantitiesdEdx[kdEdx] = dEdxSum;
+ quantitiesdEdx[kdEdx] = fTotalChargeInSlice0 ? track->GetTRDslice(iplane, 0) : dEdxSum; // hack by mfasel: In the new reconstruction, the total charge is stored in the first slice, in the old reconstruction it has to be calculated from the slice charges.
if(dEdxSum) ntrackletsNonZero++;
// Fill dEdx histogram
if(dEdxSum > 1e-1) fHistos->Fill("fQAdEdx", quantitiesdEdx); // Cut out 0 entries
if(!fPionEfficiencies){
fPionEfficiencies = new TList;
fPionEfficiencies->SetName("pionEfficiencies");
+ fPionEfficiencies->SetOwner();
}
if(!fProtonEfficiencies){
fProtonEfficiencies = new TList;
fProtonEfficiencies->SetName("protonEfficiencies");
+ fProtonEfficiencies->SetOwner();
}
if(!fThresholds){
fThresholds = new TList;
fThresholds->SetName("thresholds");
+ fThresholds->SetOwner();
}
for(Int_t itr = 4; itr <= 6; itr++){
}
//__________________________________________________________________
-void AliHFEtrdPIDqa::SaveThresholdParameters(const Char_t *name){
+void AliHFEtrdPIDqa::SaveThresholdParameters(const Char_t *name, Double_t lowerLimit, Double_t upperLimit){
//
// Fit the threshold histograms with the given parametrisation
// and store the TF1 in the file
threshhist = dynamic_cast<TGraph *>(lHistos->FindObject(Form("eff%d", static_cast<Int_t>(fgkElectronEff[ieff] * 100))));
if(!threshhist) continue;
- threshparam = MakeThresholds(threshhist);
+ threshparam = MakeThresholds(threshhist, lowerLimit, upperLimit);
threshparam->SetName(Form("thresh_%d_%d", itracklet, static_cast<Int_t>(fgkElectronEff[ieff] * 100)));
lFormulas->Add(threshparam);
}
hLikeTRD->GetAxis(kNTracklets)->SetRange(0, hLikeTRD->GetAxis(kNTracklets)->GetNbins());
// Prepare List for output
- TList *listPions = new TList; listPions->SetName(Form("%dTracklets", nTracklets));
- TList *listProtons = new TList; listProtons->SetName(Form("%dTracklets", nTracklets));
- TList *listThresholds = new TList; listThresholds->SetName(Form("%dTracklets", nTracklets));
+ TList *listPions = new TList; listPions->SetName(Form("%dTracklets", nTracklets)); listPions->SetOwner();
+ TList *listProtons = new TList; listProtons->SetName(Form("%dTracklets", nTracklets)); listProtons->SetOwner();
+ TList *listThresholds = new TList; listThresholds->SetName(Form("%dTracklets", nTracklets)); listThresholds->SetOwner();
fPionEfficiencies->Add(listPions);
fProtonEfficiencies->Add(listProtons);
fThresholds->Add(listThresholds);
// Optionally do Fit
if(doFit){
- threshfit = MakeThresholds(tr);
+ threshfit = MakeThresholds(tr, pmin, pmax);
threshfit->SetLineColor(kBlack);
threshfit->Draw("same");
}
}
//__________________________________________________________________
-TF1 *AliHFEtrdPIDqa::MakeThresholds(TGraph *threshist){
+TF1 *AliHFEtrdPIDqa::MakeThresholds(TGraph *threshist, Double_t lowerLimit, Double_t upperLimit){
//
// Create TF1 containing the threshold parametrisation
//
TF1 *threshparam = new TF1("thresh", "1-[0]-[1]*x-[2]*TMath::Exp(-[3]*x)", 0.1, 10);
- threshist->Fit(threshparam, "NE", "", 0.1, 3.5);
+ threshist->Fit(threshparam, "NE", "", lowerLimit, upperLimit);
return threshparam;
}