fIsCosmic(0),
fLowMemoryConsumption(0)
{
+ //
+ // Default constructor
+ //
AliInfo("Default Constructor");
}
fIsCosmic(0),
fLowMemoryConsumption(0)
{
-
+ //
+ // No default constructor
+ //
SetName(name);
SetTitle(title);
// default values for dE/dx
fMIP = 50.;
fUseMax = kTRUE;
- fLowerTrunc = 0.0;
- fUpperTrunc = 0.7;
+ fLowerTrunc = 0.02;
+ fUpperTrunc = 0.6;
fUseShapeNorm = kTRUE;
fUsePosNorm = kFALSE;
fUsePadNorm = kFALSE;
AliTPCcalibTimeGain::~AliTPCcalibTimeGain(){
//
+ // Destructor
//
- //
+ delete fHistGainTime;
+ delete fGainVsTime;
+ delete fHistDeDxTotal;
}
void AliTPCcalibTimeGain::ProcessCosmicEvent(AliESDEvent *event) {
-
- AliESDfriend *ESDfriend=static_cast<AliESDfriend*>(event->FindListObject("AliESDfriend"));
- if (!ESDfriend) {
+ //
+ // Process in case of cosmic event
+ //
+ AliESDfriend *esdFriend=static_cast<AliESDfriend*>(event->FindListObject("AliESDfriend"));
+ if (!esdFriend) {
Printf("ERROR: ESDfriend not available");
return;
}
AliESDtrack *track = event->GetTrack(i);
if (!track) continue;
-
+ AliESDfriendTrack *friendTrack = esdFriend->GetTrack(i);
+ if (!friendTrack) continue;
const AliExternalTrackParam * trackIn = track->GetInnerParam();
- const AliExternalTrackParam * trackOut = track->GetOuterParam();
+ const AliExternalTrackParam * trackOut = friendTrack->GetTPCOut();
if (!trackIn) continue;
if (!trackOut) continue;
// calculate necessary track parameters
Double_t meanP = trackIn->GetP();
Double_t meanDrift = 250 - 0.5*TMath::Abs(trackIn->GetZ() + trackOut->GetZ());
- Int_t NclsDeDx = track->GetTPCNcls();
+ Int_t nclsDeDx = track->GetTPCNcls();
// exclude tracks which do not look like primaries or are simply too short or on wrong sectors
- if (NclsDeDx < 60) continue;
+ if (nclsDeDx < 60) continue;
if (TMath::Abs(trackIn->GetTgl()) > 1) continue;
if (TMath::Abs(trackIn->GetSnp()) > 0.6) continue;
// Get seeds
- AliESDfriendTrack *friendTrack = ESDfriend->GetTrack(i);
- if (!friendTrack) continue;
TObject *calibObject;
AliTPCseed *seed = 0;
for (Int_t l=0;(calibObject=friendTrack->GetCalibObject(l));++l) {
}
if (seed) {
- Double_t TPCsignal = GetTPCdEdx(seed);
- if (NclsDeDx > 100) fHistDeDxTotal->Fill(meanP, TPCsignal);
+ Double_t tpcSignal = GetTPCdEdx(seed);
+ if (nclsDeDx > 100) fHistDeDxTotal->Fill(meanP, tpcSignal);
//
if (fLowMemoryConsumption) {
if (meanP < 20) continue;
meanP = 30; // set all momenta to one in order to save memory
}
//dE/dx, time, type (1-muon cosmic,2-pion beam data), momenta
- Double_t vec[6] = {TPCsignal,time,1,meanDrift,meanP,runNumber};
+ Double_t vec[6] = {tpcSignal,time,1,meanDrift,meanP,runNumber};
fHistGainTime->Fill(vec);
}
void AliTPCcalibTimeGain::ProcessBeamEvent(AliESDEvent *event) {
-
- AliESDfriend *ESDfriend=static_cast<AliESDfriend*>(event->FindListObject("AliESDfriend"));
- if (!ESDfriend) {
+ //
+ // Process in case of beam event
+ //
+ AliESDfriend *esdFriend=static_cast<AliESDfriend*>(event->FindListObject("AliESDfriend"));
+ if (!esdFriend) {
Printf("ERROR: ESDfriend not available");
return;
}
AliESDtrack *track = event->GetTrack(i);
if (!track) continue;
+ AliESDfriendTrack *friendTrack = esdFriend->GetTrack(i);
+ if (!friendTrack) continue;
const AliExternalTrackParam * trackIn = track->GetInnerParam();
- const AliExternalTrackParam * trackOut = track->GetOuterParam();
+ const AliExternalTrackParam * trackOut = friendTrack->GetTPCOut();
if (!trackIn) continue;
if (!trackOut) continue;
// calculate necessary track parameters
Double_t meanP = trackIn->GetP();
Double_t meanDrift = 250 - 0.5*TMath::Abs(trackIn->GetZ() + trackOut->GetZ());
- Int_t NclsDeDx = track->GetTPCNcls();
+ Int_t nclsDeDx = track->GetTPCNcls();
// exclude tracks which do not look like primaries or are simply too short or on wrong sectors
- if (NclsDeDx < 60) continue;
+ if (nclsDeDx < 60) continue;
if (TMath::Abs(trackIn->GetTgl()) > 1) continue;
if (TMath::Abs(trackIn->GetSnp()) > 0.6) continue;
// Get seeds
- AliESDfriendTrack *friendTrack = ESDfriend->GetTrack(i);
- if (!friendTrack) continue;
TObject *calibObject;
AliTPCseed *seed = 0;
for (Int_t l=0;(calibObject=friendTrack->GetCalibObject(l));++l) {
}
if (seed) {
- Double_t TPCsignal = GetTPCdEdx(seed);
- fHistDeDxTotal->Fill(meanP, TPCsignal);
- //
if (fLowMemoryConsumption) {
if (meanP > 0.5 || meanP < 0.4) continue;
meanP = 0.45; // set all momenta to one in order to save memory
}
+ Double_t tpcSignal = GetTPCdEdx(seed);
+ fHistDeDxTotal->Fill(meanP, tpcSignal);
+ //
//dE/dx, time, type (1-muon cosmic,2-pion beam data), momenta
- Double_t vec[6] = {TPCsignal,time,2,meanDrift,meanP,runNumber};
+ Double_t vec[6] = {tpcSignal,time,2,meanDrift,meanP,runNumber};
fHistGainTime->Fill(vec);
}
Float_t AliTPCcalibTimeGain::GetTPCdEdx(AliTPCseed * seed) {
-
+ //
+ // calculate tpc dEdx
+ //
Double_t signal = 0;
//
if (!fUseCookAnalytical) {
void AliTPCcalibTimeGain::AnalyzeRun(Int_t minEntries) {
//
- //
+ // Analyze results of calibration
//
if (fIsCosmic) {
fHistGainTime->GetAxis(2)->SetRangeUser(0.51,1.49); // only cosmics
TGraphErrors * AliTPCcalibTimeGain::GetGraphGainVsTime(Int_t runNumber, Int_t minEntries) {
//
- //
+ // Analyze results and get the graph
//
if (runNumber == 0) {
if (!fGainVsTime) {
}
Long64_t AliTPCcalibTimeGain::Merge(TCollection *li) {
-
+ //
+ // merge component
+ //
TIterator* iter = li->MakeIterator();
AliTPCcalibTimeGain* cal = 0;
AliSplineFit * AliTPCcalibTimeGain::MakeSplineFit(TGraphErrors * graph) {
//
- //
+ // make spline fit of gain
//
AliSplineFit *fit = new AliSplineFit();
fit->SetGraph(graph);
-TGraphErrors * AliTPCcalibTimeGain::GetGraphAttachment(Int_t minEntries, Int_t nmaxBin, Float_t fracLow, Float_t fracUp) {
+TGraphErrors * AliTPCcalibTimeGain::GetGraphAttachment(Int_t minEntries, Int_t nmaxBin, Float_t /*fracLow*/, Float_t /*fracUp*/) {
//
// For each time bin the driftlength-dependence of the signal is fitted.
//
void AliTPCcalibTimeGain::BinLogX(THnSparse *h, Int_t axisDim) {
-
+ //
// Method for the correct logarithmic binning of histograms
-
+ //
TAxis *axis = h->GetAxis(axisDim);
int bins = axis->GetNbins();
Double_t from = axis->GetXmin();
Double_t to = axis->GetXmax();
- Double_t *new_bins = new Double_t[bins + 1];
+ Double_t *newBins = new Double_t[bins + 1];
- new_bins[0] = from;
+ newBins[0] = from;
Double_t factor = pow(to/from, 1./bins);
for (int i = 1; i <= bins; i++) {
- new_bins[i] = factor * new_bins[i-1];
+ newBins[i] = factor * newBins[i-1];
}
- axis->Set(bins, new_bins);
- delete new_bins;
+ axis->Set(bins, newBins);
+ delete[] newBins;
}
void AliTPCcalibTimeGain::BinLogX(TH1 *h) {
-
+ //
// Method for the correct logarithmic binning of histograms
-
+ //
TAxis *axis = h->GetXaxis();
int bins = axis->GetNbins();
Double_t from = axis->GetXmin();
Double_t to = axis->GetXmax();
- Double_t *new_bins = new Double_t[bins + 1];
+ Double_t *newBins = new Double_t[bins + 1];
- new_bins[0] = from;
+ newBins[0] = from;
Double_t factor = pow(to/from, 1./bins);
for (int i = 1; i <= bins; i++) {
- new_bins[i] = factor * new_bins[i-1];
+ newBins[i] = factor * newBins[i-1];
}
- axis->Set(bins, new_bins);
- delete new_bins;
+ axis->Set(bins, newBins);
+ delete[] newBins;
}
void AliTPCcalibTimeGain::CalculateBetheAlephParams(TH2F *hist, Double_t * ini) {
+ //
+ // Fit the bethe bloch params
+ //
//{0.0762*MIP,10.632,1.34e-05,1.863,1.948}
const Double_t sigma = 0.06;
foKaon->SetParameters(ini);
foProton->SetParameters(ini);
- TCanvas *CanvCheck1 = new TCanvas();
+ TCanvas *canvCheck1 = new TCanvas();
hist->Draw("colz");
foElectron->Draw("same");
foMuon->Draw("same");
TF1 * funcAlephD = new TF1("AlephParametrizationD", "AliExternalTrackParam::BetheBlochAleph(x,[0],[1],[2],[3],[4])",0.3,10000);
funcAlephD->SetParameters(ini);
- TCanvas *CanvCheck2 = new TCanvas();
+ TCanvas *canvCheck2 = new TCanvas();
histBG->Draw();
//FitSlices
foKaon->SetParameters(ini);
foProton->SetParameters(ini);
- TCanvas *CanvCheck3 = new TCanvas();
+ TCanvas *canvCheck3 = new TCanvas();
hist->Draw("colz");
foElectron->Draw("same");
foMuon->Draw("same");
foKaon->Draw("same");
foProton->Draw("same");
- CanvCheck1->Print();
- CanvCheck2->Print();
- CanvCheck3->Print();
+ canvCheck1->Print();
+ canvCheck2->Print();
+ canvCheck3->Print();
return;