// default storage ""- data stored at current working directory
e.g.
- AliTPCPreprocessorOffline process;
- process.CalibTimeGain("CalibObjects.root",114000,121040,0);
+ gSystem->Load("libANALYSIS");
+ gSystem->Load("libTPCcalib");
+ AliTPCPreprocessorOffline proces;
+ proces.CalibTimeGain("TPCMultObjects.root",114000,140040,0);
TFile oo("OCDB/TPC/Calib/TimeGain/Run114000_121040_v0_s0.root")
TObjArray * arr = AliCDBEntry->GetObject()
arr->At(4)->Draw("alp")
AnalyzeGain(startRunNumber,endRunNumber, 1000,1.43);
AnalyzeAttachment(startRunNumber,endRunNumber);
AnalyzePadRegionGain();
+ AnalyzeGainMultiplicity();
//
// 3. Make control plots
//
}
+Bool_t AliTPCPreprocessorOffline::AnalyzeGainMultiplicity() {
+ //
+ // Analyze gain as a function of multiplicity and produce calibration graphs
+ //
+ if (!fGainMult) return kFALSE;
+ fGainMult->GetHistGainMult()->GetAxis(3)->SetRangeUser(3,3);
+ TH2D * histMultMax = fGainMult->GetHistGainMult()->Projection(0,4);
+ TH2D * histMultTot = fGainMult->GetHistGainMult()->Projection(1,4);
+ histMultMax->RebinX(4);
+ histMultTot->RebinX(4);
+ //
+ TObjArray arrMax;
+ TObjArray arrTot;
+ histMultMax->FitSlicesY(0,0,-1,0,"QNR",&arrMax);
+ histMultTot->FitSlicesY(0,0,-1,0,"QNR",&arrTot);
+ //
+ TH1D * meanMax = (TH1D*)arrMax.At(1);
+ TH1D * meanTot = (TH1D*)arrTot.At(1);
+ Float_t meanMult = histMultMax->GetMean();
+ meanMax->Scale(1./meanMax->GetBinContent(meanMax->FindBin(meanMult)));
+ meanTot->Scale(1./meanTot->GetBinContent(meanTot->FindBin(meanMult)));
+ Float_t xMultMax[50];
+ Float_t yMultMax[50];
+ Float_t yMultErrMax[50];
+ Float_t xMultTot[50];
+ Float_t yMultTot[50];
+ Float_t yMultErrTot[50];
+ //
+ Int_t nCountMax = 0;
+ for(Int_t iBin = 1; iBin < meanMax->GetXaxis()->GetNbins(); iBin++) {
+ Float_t yValMax = meanMax->GetBinContent(iBin);
+ if (yValMax < 0.01) continue;
+ if (meanMax->GetBinError(iBin)/yValMax > 0.01) continue;
+ xMultMax[nCountMax] = meanMax->GetXaxis()->GetBinCenter(iBin);
+ yMultMax[nCountMax] = yValMax;
+ yMultErrMax[nCountMax] = meanMax->GetBinError(iBin);
+ nCountMax++;
+ }
+ //
+ if (nCountMax < 10) return kFALSE;
+ TGraphErrors * fitMultMax = new TGraphErrors(nCountMax, xMultMax, yMultMax, 0, yMultErrMax);
+ fitMultMax->SetName("TGRAPHERRORS_MEANQMAX_MULTIPLICITYDEPENDENCE_BEAM_ALL");
+ //
+ Int_t nCountTot = 0;
+ for(Int_t iBin = 1; iBin < meanTot->GetXaxis()->GetNbins(); iBin++) {
+ Float_t yValTot = meanTot->GetBinContent(iBin);
+ if (yValTot < 0.1) continue;
+ if (meanTot->GetBinError(iBin)/yValTot > 0.1) continue;
+ xMultTot[nCountTot] = meanTot->GetXaxis()->GetBinCenter(iBin);
+ yMultTot[nCountTot] = yValTot;
+ yMultErrTot[nCountTot] = meanTot->GetBinError(iBin);
+ nCountTot++;
+ }
+ //
+ if (nCountTot < 10) return kFALSE;
+ TGraphErrors * fitMultTot = new TGraphErrors(nCountTot, xMultTot, yMultTot, 0, yMultErrTot);
+ fitMultTot->SetName("TGRAPHERRORS_MEANQTOT_MULTIPLICITYDEPENDENCE_BEAM_ALL");
+ //
+ fGainArray->AddLast(fitMultMax);
+ fGainArray->AddLast(fitMultTot);
+ //
+ return kTRUE;
+
+}
+
+
void AliTPCPreprocessorOffline::UpdateOCDBGain(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){
//
// Update OCDB entry
void SetCtgRange(Double_t ctgRange) {fCtgRange = ctgRange;}
void SetUseMultiplicityCorrectionDedx(Bool_t flag) {fUseMultiplicityCorrectionDedx = flag;}
void SetUseAlignmentTime(Bool_t flag) {fUseAlignmentTime = flag;}
-
+ void SetNeighborRowsDedx(Int_t nRows) {fNeighborRowsDedx = nRows;}
//
Int_t GetLastSeedRowSec() const { return fLastSeedRowSec;}
Int_t GetSeedGapPrim() const { return fSeedGapPrim;}
Bool_t GetUseTotCharge() const {return fUseTotCharge;} // switch use total or max charge
Float_t GetMinFraction() const {return fMinFraction;} // truncated mean - lower threshold
Float_t GetMaxFraction() const {return fMaxFaction;} // truncated mean - upper threshold
+ Int_t GetNeighborRowsDedx() const {return fNeighborRowsDedx;}
Bool_t GetUseTOFCorrection() {return fUseTOFCorrection;}
Bool_t fUseTotCharge; // switch use total or max charge
Float_t fMinFraction; // truncated mean - lower threshold
Float_t fMaxFaction; // truncated mean - upper threshold
+ Int_t fNeighborRowsDedx; // number of neighboring rows to identify cluster below thres in dEdx calculation 0 -> switch off
Bool_t fUseTOFCorrection; // switch - kTRUE use TOF correction kFALSE - do not use
//
#include <TFile.h>
#include <TObjArray.h>
#include <TTree.h>
+#include <TGraphErrors.h>
#include "AliLog.h"
#include "AliComplexCluster.h"
#include "AliESDEvent.h"
#include "AliTrackPointArray.h"
#include "TRandom.h"
#include "AliTPCcalibDB.h"
+#include "AliTPCcalibDButil.h"
#include "AliTPCTransform.h"
#include "AliTPCClusterParam.h"
if (!event) return 0;
const Int_t kMaxFriendTracks=2000;
fEvent = event;
+ // extract correction object for multiplicity dependence of dEdx
+ TObjArray * gainCalibArray = AliTPCcalibDB::Instance()->GetTimeGainSplinesRun(event->GetRunNumber());
+ const AliTPCRecoParam * recoParam = AliTPCcalibDB::Instance()->GetTransform()->GetCurrentRecoParam();
+ TGraphErrors * graphMultDependenceDeDx = 0x0;
+ if (recoParam->GetUseMultiplicityCorrectionDedx()) {
+ if (recoParam->GetUseTotCharge()) {
+ graphMultDependenceDeDx = (TGraphErrors *) gainCalibArray->FindObject("TGRAPHERRORS_MEANQTOT_MULTIPLICITYDEPENDENCE_BEAM_ALL");
+ } else {
+ graphMultDependenceDeDx = (TGraphErrors *) gainCalibArray->FindObject("TGRAPHERRORS_MEANQMAX_MULTIPLICITYDEPENDENCE_BEAM_ALL");
+ }
+ }
+ //
ReadSeeds(event,2);
fIteration=2;
//PrepareForProlongation(fSeeds,1);
Int_t ndedx = seed->GetNCDEDX(0);
Float_t sdedx = seed->GetSDEDX(0);
Float_t dedx = seed->GetdEdx();
+ // apply mutliplicity dependent dEdx correction if available
+ if (graphMultDependenceDeDx) {
+ Int_t nContribut = event->GetPrimaryVertexTPC()->GetNContributors();
+ Double_t corrGain = AliTPCcalibDButil::EvalGraphConst(graphMultDependenceDeDx, nContribut);
+ dedx /= corrGain;
+ }
esd->SetTPCsignal(dedx, sdedx, ndedx);
//
// add seed to the esd track in Calib level