From 110d52b004223c4e331e8c4c5ca40c57a7d86b99 Mon Sep 17 00:00:00 2001 From: kowal2 Date: Mon, 8 Dec 2003 15:08:50 +0000 Subject: [PATCH] Changes required by the coding conventions --- TPC/AliTPCtrackerParam.cxx | 614 +++++++++++++++++++------------------ TPC/AliTPCtrackerParam.h | 85 +++-- 2 files changed, 361 insertions(+), 338 deletions(-) diff --git a/TPC/AliTPCtrackerParam.cxx b/TPC/AliTPCtrackerParam.cxx index e42d3e0a206..d7ca7d90754 100644 --- a/TPC/AliTPCtrackerParam.cxx +++ b/TPC/AliTPCtrackerParam.cxx @@ -25,8 +25,7 @@ * Output file contains sorted tracks, ready for matching with ITS. * * * * For details: * - * Alice Internal Note (submitted - get it from andrea.dainese@pd.infn.it)* - * http://www.pd.infn.it/alipd/talks/soft/adIII02/TPCtrackingParam.htm * + * Alice Internal Note 2003-011 * * * * Test macro is: AliBarrelRec_TPCparam.C * * * @@ -55,6 +54,11 @@ * Origin: Andrea Dainese, Padova - e-mail: andrea.dainese@pd.infn.it * * * **************************************************************************/ +// * +// This is a dummy comment +// +// +// * //------- Root headers -------- #include #include @@ -109,16 +113,16 @@ typedef struct { ClassImp(AliTPCtrackerParam) //----------------------------------------------------------------------------- -AliTPCtrackerParam::AliTPCtrackerParam(const Int_t coll,const Double_t Bz, - const Int_t n, const char* evfoldname): +AliTPCtrackerParam::AliTPCtrackerParam(const Int_t kcoll,const Double_t kBz, + const Int_t kn, const char* evfoldname): fEvFolderName(evfoldname) { //----------------------------------------------------------------------------- // This is the class conctructor //----------------------------------------------------------------------------- - fNevents = n; // events to be processed - fBz = Bz; // value of the z component of L3 field (Tesla) - fColl = coll; // collision code (0: PbPb6000; 1: pp) + fNevents = kn; // events to be processed + fBz = kBz; // value of the z component of L3 field (Tesla) + fColl = kcoll; // collision code (0: PbPb6000; 1: pp) fSelAndSmear = kTRUE; // by default selection and smearing are done if(fBz!=0.4) { @@ -140,6 +144,28 @@ AliTPCtrackerParam::AliTPCtrackerParam(const Int_t coll,const Double_t Bz, } //----------------------------------------------------------------------------- AliTPCtrackerParam::~AliTPCtrackerParam() {} +//---------------------------------------------------------------------------- +AliTPCtrackerParam::AliTPCseedGeant::AliTPCseedGeant( + Double_t x,Double_t y,Double_t z, + Double_t px,Double_t py,Double_t pz, + Int_t lab) { +//---------------------------------------------------------------------------- +// Constructor of the geant seeds +//---------------------------------------------------------------------------- + fXg = x; + fYg = y; + fZg = z; + fPx = px; + fPy = py; + fPz = pz; + fLabel = lab; + Double_t a = TMath::ATan2(y,x)*180./TMath::Pi(); + if(a<0) a += 360.; + fSector = (Int_t)(a/20.); + fAlpha = 10.+20.*fSector; + fAlpha /= 180.; + fAlpha *= TMath::Pi(); +} //----------------------------------------------------------------------------- Int_t AliTPCtrackerParam::BuildTPCtracks(const TFile *inp, TFile *out) { //----------------------------------------------------------------------------- @@ -251,8 +277,8 @@ Int_t AliTPCtrackerParam::BuildTPCtracks(const TFile *inp, TFile *out) { } // Get TPC detector - AliTPC *TPC=(AliTPC*)gAlice->GetDetector("TPC"); - Int_t ver = TPC->IsVersion(); + AliTPC *tpc=(AliTPC*)gAlice->GetDetector("TPC"); + Int_t ver = tpc->IsVersion(); cerr<<"+++ TPC version "<CdGAFile(); @@ -264,12 +290,12 @@ Int_t AliTPCtrackerParam::BuildTPCtracks(const TFile *inp, TFile *out) { else digp=(AliTPCParam*)infile->Get("75x40_100x60_150x60"); if(!digp) { cerr<<"TPC parameters have not been found !\n"; return 1; } - TPC->SetParam(digp); + tpc->SetParam(digp); // Set the conversion constant between curvature and Pt AliKalmanTrack::SetConvConst(100/0.299792458/fBz); - TParticle *Part=0; + TParticle *part=0; AliTPCseedGeant *seed=0; AliTPCtrack *tpctrack=0; Double_t sPt,sEta; @@ -306,10 +332,10 @@ Int_t AliTPCtrackerParam::BuildTPCtracks(const TFile *inp, TFile *out) { // loop on particles and store pdg codes for(Int_t l=0; lGetMCApp()->Particle(l); - pdgCodes[l] = Part->GetPdgCode(); - ptkine[l] = Part->Pt(); - pzkine[l] = Part->Pz(); + part = (TParticle*)gAlice->GetMCApp()->Particle(l); + pdgCodes[l] = part->GetPdgCode(); + ptkine[l] = part->Pt(); + pzkine[l] = part->Pz(); done[l] = kFALSE; } cerr<<"+++\n+++ Number of particles in event "<TreeH(); - MakeSeedsFromHits(TPC,TH,sArray); + TTree *th = tpcloader->TreeH(); + MakeSeedsFromHits(tpc,th,sArray); } else { // Get TreeTR with track references - TTree *TTR = rl->TreeTR(); - MakeSeedsFromRefs(TTR,sArray); + TTree *ttr = rl->TreeTR(); + MakeSeedsFromRefs(ttr,sArray); } @@ -504,18 +530,18 @@ void AliTPCtrackerParam::AnalyzedEdx(const Char_t *outName,Int_t pdg) { SetParticle(pdg); - const Int_t nTotBins = fDBgrid->GetTotBins(); + const Int_t knTotBins = fDBgrid->GetTotBins(); - cerr<<" Fit bins: "<SetXTitle("p [GeV/c]"); @@ -565,31 +591,31 @@ void AliTPCtrackerParam::AnalyzedEdx(const Char_t *outName,Int_t pdg) { switch(pdg) { case 211: - for(Int_t i=0; iSetName(hname); hDum->SetTitle(htitle); - hPulls0_[i] = *hDum; - sprintf(hname,"hPulls1_%d",i); + hPulls0[i] = *hDum; + sprintf(hname,"hPulls1%d",i); sprintf(htitle,"P1 pulls for bin %d",i); hDum->SetName(hname); hDum->SetTitle(htitle); - hPulls1_[i] = *hDum; - sprintf(hname,"hPulls2_%d",i); + hPulls1[i] = *hDum; + sprintf(hname,"hPulls2%d",i); sprintf(htitle,"P2 pulls for bin %d",i); hDum->SetName(hname); hDum->SetTitle(htitle); - hPulls2_[i] = *hDum; - sprintf(hname,"hPulls3_%d",i); + hPulls2[i] = *hDum; + sprintf(hname,"hPulls3%d",i); sprintf(htitle,"P3 pulls for bin %d",i); hDum->SetName(hname); hDum->SetTitle(htitle); - hPulls3_[i] = *hDum; - sprintf(hname,"hPulls4_%d",i); + hPulls3[i] = *hDum; + sprintf(hname,"hPulls4%d",i); sprintf(htitle,"P4 pulls for bin %d",i); hDum->SetName(hname); hDum->SetTitle(htitle); - hPulls4_[i] = *hDum; + hPulls4[i] = *hDum; } // loop on chain entries @@ -726,39 +752,39 @@ void AliTPCtrackerParam::AnalyzePulls(const Char_t *outName) { // fill histograms with the pulls bin = fDBgrid->GetBin(cmptrk.pt,cmptrk.eta); //cerr<<" pt "<10) { - g.SetRange(-3.*hPulls0_[i].GetRMS(),3.*hPulls0_[i].GetRMS()); - hPulls0_[i].Fit("g","R,Q,N"); - pulls[0].SetParam(i,g.GetParameter(2)); + if(hPulls0[i].GetEntries()>10) { + g->SetRange(-3.*hPulls0[i].GetRMS(),3.*hPulls0[i].GetRMS()); + hPulls0[i].Fit("g","R,Q,N"); + pulls[0].SetParam(i,g->GetParameter(2)); } else pulls[0].SetParam(i,-1.); - if(hPulls1_[i].GetEntries()>10) { - g.SetRange(-3.*hPulls1_[i].GetRMS(),3.*hPulls1_[i].GetRMS()); - hPulls1_[i].Fit("g","R,Q,N"); - pulls[1].SetParam(i,g.GetParameter(2)); + if(hPulls1[i].GetEntries()>10) { + g->SetRange(-3.*hPulls1[i].GetRMS(),3.*hPulls1[i].GetRMS()); + hPulls1[i].Fit("g","R,Q,N"); + pulls[1].SetParam(i,g->GetParameter(2)); } else pulls[1].SetParam(i,-1.); - if(hPulls2_[i].GetEntries()>10) { - g.SetRange(-3.*hPulls2_[i].GetRMS(),3.*hPulls2_[i].GetRMS()); - hPulls2_[i].Fit("g","R,Q,N"); - pulls[2].SetParam(i,g.GetParameter(2)); + if(hPulls2[i].GetEntries()>10) { + g->SetRange(-3.*hPulls2[i].GetRMS(),3.*hPulls2[i].GetRMS()); + hPulls2[i].Fit("g","R,Q,N"); + pulls[2].SetParam(i,g->GetParameter(2)); } else pulls[2].SetParam(i,-1.); - if(hPulls3_[i].GetEntries()>10) { - g.SetRange(-3.*hPulls3_[i].GetRMS(),3.*hPulls3_[i].GetRMS()); - hPulls3_[i].Fit("g","R,Q,N"); - pulls[3].SetParam(i,g.GetParameter(2)); + if(hPulls3[i].GetEntries()>10) { + g->SetRange(-3.*hPulls3[i].GetRMS(),3.*hPulls3[i].GetRMS()); + hPulls3[i].Fit("g","R,Q,N"); + pulls[3].SetParam(i,g->GetParameter(2)); } else pulls[3].SetParam(i,-1.); - if(hPulls4_[i].GetEntries()>10) { - g.SetRange(-3.*hPulls4_[i].GetRMS(),3.*hPulls4_[i].GetRMS()); - hPulls4_[i].Fit("g","R,Q,N"); - pulls[4].SetParam(i,g.GetParameter(2)); + if(hPulls4[i].GetEntries()>10) { + g->SetRange(-3.*hPulls4[i].GetRMS(),3.*hPulls4[i].GetRMS()); + hPulls4[i].Fit("g","R,Q,N"); + pulls[4].SetParam(i,g->GetParameter(2)); } else pulls[4].SetParam(i,-1.); } // loop on bins @@ -797,11 +823,11 @@ void AliTPCtrackerParam::AnalyzePulls(const Char_t *outName) { break; } - delete [] hPulls0_; - delete [] hPulls1_; - delete [] hPulls2_; - delete [] hPulls3_; - delete [] hPulls4_; + delete [] hPulls0; + delete [] hPulls1; + delete [] hPulls2; + delete [] hPulls3; + delete [] hPulls4; } // loop on particle species @@ -848,12 +874,12 @@ void AliTPCtrackerParam::AnalyzeResolutions(Int_t pdg) { SetParticle(pdg); - const Int_t nPtBins = fEff->GetPointsPt(); - cerr<<"nPtBins = "<GetPointsPt(); + cerr<<"knPtBins = "<GetArrayPt(pt); @@ -861,21 +887,21 @@ void AliTPCtrackerParam::AnalyzeResolutions(Int_t pdg) { TH1F *hDumP4 = new TH1F("nameP4","dC",100,-0.0005,0.0005); TH1F *hDumPt = new TH1F("namePt","dp_{T}/p_{T}",100,-0.5,0.5); - TF1 g("g","gaus"); + TF1 *g = new TF1("g","gaus"); // create histograms for the all the bins - TH1F *hP0_=NULL; - TH1F *hP4_=NULL; - TH1F *hPt_=NULL; + TH1F *hP0=NULL; + TH1F *hP4=NULL; + TH1F *hPt=NULL; - hP0_ = new TH1F[nPtBins]; - hP4_ = new TH1F[nPtBins]; - hPt_ = new TH1F[nPtBins]; + hP0 = new TH1F[knPtBins]; + hP4 = new TH1F[knPtBins]; + hPt = new TH1F[knPtBins]; - for(Int_t i=0; iGetBin(cmptrk.pt,cmptrk.eta)/fDBgrid->GetBinsEta(); //cerr<<" pt "<Divide(5,2); // Draw histograms - for(Int_t i=0; icd(i+1); hP0_[i].Draw(); - cP4res->cd(i+1); hP4_[i].Draw(); - cPtres->cd(i+1); hPt_[i].Draw(); + for(Int_t i=0; icd(i+1); hP0[i].Draw(); + cP4res->cd(i+1); hP4[i].Draw(); + cPtres->cd(i+1); hPt[i].Draw(); } // compute the sigma of the distributions - for(Int_t i=0; i10) { - g.SetRange(-3.*hP0_[i].GetRMS(),3.*hP0_[i].GetRMS()); - hP0_[i].Fit("g","R,Q,N"); - dP0[i] = g.GetParameter(2); + for(Int_t i=0; i10) { + g->SetRange(-3.*hP0[i].GetRMS(),3.*hP0[i].GetRMS()); + hP0[i].Fit("g","R,Q,N"); + dP0[i] = g->GetParameter(2); } else dP0[i] = 0.; - if(hP4_[i].GetEntries()>10) { - g.SetRange(-3.*hP4_[i].GetRMS(),3.*hP4_[i].GetRMS()); - hP4_[i].Fit("g","R,Q,N"); - dP4[i] = g.GetParameter(2); + if(hP4[i].GetEntries()>10) { + g->SetRange(-3.*hP4[i].GetRMS(),3.*hP4[i].GetRMS()); + hP4[i].Fit("g","R,Q,N"); + dP4[i] = g->GetParameter(2); } else dP4[i] = 0.; - if(hPt_[i].GetEntries()>10) { - g.SetRange(-3.*hPt_[i].GetRMS(),3.*hPt_[i].GetRMS()); - hPt_[i].Fit("g","R,Q,N"); - dPtToPt[i] = 100.*g.GetParameter(2); + if(hPt[i].GetEntries()>10) { + g->SetRange(-3.*hPt[i].GetRMS(),3.*hPt[i].GetRMS()); + hPt[i].Fit("g","R,Q,N"); + dPtToPt[i] = 100.*g->GetParameter(2); } else dPtToPt[i] = 0.; } // loop on bins - TGraph *grdP0 = new TGraph(nPtBins,pt,dP0); - TGraph *grdP4 = new TGraph(nPtBins,pt,dP4); - TGraph *grdPtToPt = new TGraph(nPtBins,pt,dPtToPt); + TGraph *grdP0 = new TGraph(knPtBins,pt,dP0); + TGraph *grdP4 = new TGraph(knPtBins,pt,dP4); + TGraph *grdPtToPt = new TGraph(knPtBins,pt,dPtToPt); grdP0->SetMarkerStyle(20); grdP0->SetMarkerColor(2); grdP0->SetMarkerSize(1.5); grdP4->SetMarkerStyle(21); grdP4->SetMarkerColor(3); grdP4->SetMarkerSize(1.5); @@ -978,9 +1004,9 @@ void AliTPCtrackerParam::AnalyzeResolutions(Int_t pdg) { delete [] pt; - delete [] hP0_; - delete [] hP4_; - delete [] hPt_; + delete [] hP0; + delete [] hP4; + delete [] hPt; return; } @@ -1103,7 +1129,7 @@ void AliTPCtrackerParam::CompareTPCtracks( Double_t *pt = new Double_t[effBinsPt]; fEffPi.GetArrayPt(pt); - TParticle *Part; + TParticle *part; Double_t ptgener; Bool_t usethis; Int_t label; @@ -1139,10 +1165,10 @@ void AliTPCtrackerParam::CompareTPCtracks( sprintf(tname,"TreeT_TPC_%d",evt); // particles from TreeK - const Int_t nparticles = gAlice->GetEvent(evt); + const Int_t knparticles = gAlice->GetEvent(evt); - Int_t *kalLab = new Int_t[nparticles]; - for(Int_t i=0; iGetEvent(j); label = geatrack->GetLabel(); - Part = (TParticle*)gAlice->GetMCApp()->Particle(label); + part = (TParticle*)gAlice->GetMCApp()->Particle(label); // use only injected tracks with fixed values of pT - ptgener = Part->Pt(); + ptgener = part->Pt(); usethis = kFALSE; for(Int_t l=0; lGetPdgCode(); - cmptrk.eta = Part->Eta(); - cmptrk.r = TMath::Sqrt(Part->Vx()*Part->Vx()+Part->Vy()*Part->Vy()); + cmptrk.pdg = part->GetPdgCode(); + cmptrk.eta = part->Eta(); + cmptrk.r = TMath::Sqrt(part->Vx()*part->Vx()+part->Vy()*part->Vy()); cmptrk.pt = 1/TMath::Abs(geatrack->Get1Pt()); cmptrk.cosl = TMath::Cos(TMath::ATan(geatrack->GetTgl())); @@ -1491,22 +1517,22 @@ void AliTPCtrackerParam::DrawEffs(const Char_t* inName,Int_t pdg) { ReadEffs(inName); SetParticle(pdg); - const Int_t n = fEff->GetPointsPt(); - Double_t *effsA = new Double_t[n]; - Double_t *effsB = new Double_t[n]; - Double_t *effsC = new Double_t[n]; - Double_t *pt = new Double_t[n]; + const Int_t kn = fEff->GetPointsPt(); + Double_t *effsA = new Double_t[kn]; + Double_t *effsB = new Double_t[kn]; + Double_t *effsC = new Double_t[kn]; + Double_t *pt = new Double_t[kn]; fEff->GetArrayPt(pt); - for(Int_t i=0;iGetParam(i,0); effsB[i] = fEff->GetParam(i,1); effsC[i] = fEff->GetParam(i,2); } - TGraph *grA = new TGraph(n,pt,effsA); - TGraph *grB = new TGraph(n,pt,effsB); - TGraph *grC = new TGraph(n,pt,effsC); + TGraph *grA = new TGraph(kn,pt,effsA); + TGraph *grB = new TGraph(kn,pt,effsB); + TGraph *grC = new TGraph(kn,pt,effsC); grA->SetMarkerStyle(20); grA->SetMarkerColor(2); grA->SetMarkerSize(1.5); grB->SetMarkerStyle(21); grB->SetMarkerColor(3); grB->SetMarkerSize(1.5); @@ -1569,21 +1595,21 @@ void AliTPCtrackerParam::DrawPulls(const Char_t* inName,Int_t pdg, ReadPulls(inName); SetParticle(pdg); - const Int_t n = (fPulls+par)->GetPointsPt(); - Double_t *pullsA = new Double_t[n]; - Double_t *pullsB = new Double_t[n]; - Double_t *pullsC = new Double_t[n]; - Double_t *pt = new Double_t[n]; + const Int_t kn = (fPulls+par)->GetPointsPt(); + Double_t *pullsA = new Double_t[kn]; + Double_t *pullsB = new Double_t[kn]; + Double_t *pullsC = new Double_t[kn]; + Double_t *pt = new Double_t[kn]; (fPulls+par)->GetArrayPt(pt); - for(Int_t i=0;iGetParam(i,0); pullsB[i] = (fPulls+par)->GetParam(i,1); pullsC[i] = (fPulls+par)->GetParam(i,2); } - TGraph *grA = new TGraph(n,pt,pullsA); - TGraph *grB = new TGraph(n,pt,pullsB); - TGraph *grC = new TGraph(n,pt,pullsC); + TGraph *grA = new TGraph(kn,pt,pullsA); + TGraph *grB = new TGraph(kn,pt,pullsB); + TGraph *grC = new TGraph(kn,pt,pullsC); grA->SetMarkerStyle(20); grA->SetMarkerColor(2); grA->SetMarkerSize(1.5); grB->SetMarkerStyle(21); grB->SetMarkerColor(3); grB->SetMarkerSize(1.5); @@ -1705,7 +1731,7 @@ void AliTPCtrackerParam::InitializeKineGrid(Option_t* which) { // "dEdx" -> initialize fdEdx... members //----------------------------------------------------------------------------- - const char *DB = strstr(which,"DB"); + const char *db = strstr(which,"DB"); const char *eff = strstr(which,"eff"); const char *pulls = strstr(which,"pulls"); const char *dEdx = strstr(which,"dEdx"); @@ -1722,7 +1748,7 @@ void AliTPCtrackerParam::InitializeKineGrid(Option_t* which) { Double_t *eta=0,*pt=0; - if(DB) { + if(db) { nEta = 2; nPt = 9; eta = etaPoints; @@ -1736,7 +1762,7 @@ void AliTPCtrackerParam::InitializeKineGrid(Option_t* which) { AliTPCkineGrid *dummy=0; - if(DB) { + if(db) { dummy = new AliTPCkineGrid(nPt,nEta,pt,eta); new(&fDBgridPi) AliTPCkineGrid(*dummy); new(&fDBgridKa) AliTPCkineGrid(*dummy); @@ -1849,63 +1875,63 @@ void AliTPCtrackerParam::MakeDataBase() { // InitializeKineGrid("DB"); - const Int_t nBinsPi = fDBgridPi.GetTotBins(); - const Int_t nBinsKa = fDBgridKa.GetTotBins(); - const Int_t nBinsPr = fDBgridPr.GetTotBins(); - const Int_t nBinsEl = fDBgridEl.GetTotBins(); - const Int_t nBinsMu = fDBgridMu.GetTotBins(); + const Int_t knBinsPi = fDBgridPi.GetTotBins(); + const Int_t knBinsKa = fDBgridKa.GetTotBins(); + const Int_t knBinsPr = fDBgridPr.GetTotBins(); + const Int_t knBinsEl = fDBgridEl.GetTotBins(); + const Int_t knBinsMu = fDBgridMu.GetTotBins(); // create the trees for cov. matrices // trees for pions - TTree *CovTreePi_ = NULL; - CovTreePi_ = new TTree[nBinsPi]; + TTree *covTreePi_ = NULL; + covTreePi_ = new TTree[knBinsPi]; // trees for kaons - TTree *CovTreeKa_ = NULL; - CovTreeKa_ = new TTree[nBinsKa]; + TTree *covTreeKa_ = NULL; + covTreeKa_ = new TTree[knBinsKa]; // trees for protons - TTree *CovTreePr_ = NULL; - CovTreePr_ = new TTree[nBinsPr]; + TTree *covTreePr_ = NULL; + covTreePr_ = new TTree[knBinsPr]; // trees for electrons - TTree *CovTreeEl_ = NULL; - CovTreeEl_ = new TTree[nBinsEl]; + TTree *covTreeEl_ = NULL; + covTreeEl_ = new TTree[knBinsEl]; // trees for muons - TTree *CovTreeMu_ = NULL; - CovTreeMu_ = new TTree[nBinsMu]; + TTree *covTreeMu_ = NULL; + covTreeMu_ = new TTree[knBinsMu]; Char_t hname[100], htitle[100]; COVMATRIX covmat; - for(Int_t i=0; imkdir("CovMatrices"); + TFile *dbfile = new TFile(fDBfileName.Data(),"update"); + dbfile->mkdir("CovMatrices"); gDirectory->cd("/CovMatrices"); gDirectory->mkdir("Pions"); gDirectory->mkdir("Kaons"); @@ -2021,25 +2047,25 @@ void AliTPCtrackerParam::MakeDataBase() { // store pions gDirectory->cd("/CovMatrices/Pions"); fDBgridPi.SetName("DBgridPi"); fDBgridPi.Write(); - for(Int_t i=0;icd("/CovMatrices/Kaons"); fDBgridKa.SetName("DBgridKa"); fDBgridKa.Write(); - for(Int_t i=0;icd("/CovMatrices/Protons"); fDBgridPr.SetName("DBgridPr"); fDBgridPr.Write(); - for(Int_t i=0;icd("/CovMatrices/Electrons"); fDBgridEl.SetName("DBgridEl"); fDBgridEl.Write(); - for(Int_t i=0;icd("/CovMatrices/Muons"); fDBgridMu.SetName("DBgridMu"); fDBgridMu.Write(); - for(Int_t i=0;iClose(); + dbfile->Close(); delete [] nPerBinPi; delete [] nPerBinKa; delete [] nPerBinPr; @@ -2049,7 +2075,7 @@ void AliTPCtrackerParam::MakeDataBase() { return; } //----------------------------------------------------------------------------- -void AliTPCtrackerParam::MakeSeedsFromHits(AliTPC *TPC,TTree *TH, +void AliTPCtrackerParam::MakeSeedsFromHits(AliTPC *tpc,TTree *th, TObjArray &seedArray) const { //----------------------------------------------------------------------------- // This function makes the seeds for tracks from the 1st hits in the TPC @@ -2057,7 +2083,7 @@ void AliTPCtrackerParam::MakeSeedsFromHits(AliTPC *TPC,TTree *TH, Double_t xg,yg,zg,px,py,pz,pt; Int_t label; - Int_t nTracks=(Int_t)TH->GetEntries(); + Int_t nTracks=(Int_t)th->GetEntries(); cerr<<"+++\n+++ Number of \"primary tracks\"(entries in TreeH): "<ResetHits(); - TH->GetEvent(l); + tpc->ResetHits(); + th->GetEvent(l); // Get FirstHit - tpcHit=(AliTPChit*)TPC->FirstHit(-1); - for( ; tpcHit; tpcHit=(AliTPChit*)TPC->NextHit() ) { + tpcHit=(AliTPChit*)tpc->FirstHit(-1); + for( ; tpcHit; tpcHit=(AliTPChit*)tpc->NextHit() ) { if(tpcHit->fQ !=0.) continue; // Get particle momentum at hit px=tpcHit->X(); py=tpcHit->Y(); pz=tpcHit->Z(); @@ -2084,7 +2110,7 @@ void AliTPCtrackerParam::MakeSeedsFromHits(AliTPC *TPC,TTree *TH, // Get track label label=tpcHit->Track(); - if((tpcHit=(AliTPChit*)TPC->NextHit())==0) break; + if((tpcHit=(AliTPChit*)tpc->NextHit())==0) break; if(tpcHit->fQ != 0.) continue; // Get global coordinates of hit xg=tpcHit->X(); yg=tpcHit->Y(); zg=tpcHit->Z(); @@ -2105,7 +2131,7 @@ void AliTPCtrackerParam::MakeSeedsFromHits(AliTPC *TPC,TTree *TH, return; } //----------------------------------------------------------------------------- -void AliTPCtrackerParam::MakeSeedsFromRefs(TTree *TTR, +void AliTPCtrackerParam::MakeSeedsFromRefs(TTree *ttr, TObjArray &seedArray) const { //----------------------------------------------------------------------------- // This function makes the seeds for tracks from the track references @@ -2117,7 +2143,7 @@ void AliTPCtrackerParam::MakeSeedsFromRefs(TTree *TTR, TClonesArray *tkRefArray = new TClonesArray("AliTrackReference"); - TBranch *b =(TBranch*)TTR->GetBranch("TPC"); + TBranch *b =(TBranch*)ttr->GetBranch("TPC"); if(!b) {cerr<<"TPC branch of TreeTR not found"<SetAddress(&tkRefArray); Int_t nTkRef = (Int_t)b->GetEntries(); @@ -2568,8 +2594,8 @@ void AliTPCtrackerParam::RegularizeCovMatrix(const Char_t *outName,Int_t pdg) { InitializeKineGrid("DB"); SetParticle(pdg); - const Int_t fitbins = fDBgrid->GetBinsPt(); - cerr<<" Fit bins: "<GetBinsPt(); + cerr<<" Fit bins: "<Divide(1,2); // create the graph for cov matrix - TGraphErrors *gr00 = new TGraphErrors(fitbins,p,mean00,ep,sigma00); + TGraphErrors *gr00 = new TGraphErrors(kfitbins,p,mean00,ep,sigma00); TString title00("C(y,y)"); title00.Prepend(part); TH2F *frame00 = new TH2F("frame00",title00.Data(),2,0.1,50,2,0,5e-3); frame00->SetXTitle("p [GeV/c]"); @@ -2761,12 +2787,12 @@ void AliTPCtrackerParam::RegularizeCovMatrix(const Char_t *outName,Int_t pdg) { gr00->Fit("RegFunc","R,Q"); func->GetParameters(fitpar); for(Int_t i=0; i<3; i++) fitRes(0,i)=fitpar[i]; - for(Int_t l=0; lDivide(1,2); // create the graph for cov matrix - TGraphErrors *gr11 = new TGraphErrors(fitbins,p,mean11,ep,sigma11); + TGraphErrors *gr11 = new TGraphErrors(kfitbins,p,mean11,ep,sigma11); TString title11("C(z,z)"); title11.Prepend(part); TH2F *frame11 = new TH2F("frame11",title11.Data(),2,0.1,50,2,0,6e-3); frame11->SetXTitle("p [GeV/c]"); @@ -2796,12 +2822,12 @@ void AliTPCtrackerParam::RegularizeCovMatrix(const Char_t *outName,Int_t pdg) { gr11->Fit("RegFunc","R,Q"); func->GetParameters(fitpar); for(Int_t i=0; i<3; i++) fitRes(1,i)=fitpar[i]; - for(Int_t l=0; lDivide(1,2); // create the graph for cov matrix - TGraphErrors *gr20 = new TGraphErrors(fitbins,p,mean20,ep,sigma20); + TGraphErrors *gr20 = new TGraphErrors(kfitbins,p,mean20,ep,sigma20); TString title20("C(#eta, y)"); title20.Prepend(part); TH2F *frame20 = new TH2F("frame20",title20.Data(),2,0.1,50,2,0,2.5e-4); frame20->SetXTitle("p [GeV/c]"); @@ -2831,12 +2857,12 @@ void AliTPCtrackerParam::RegularizeCovMatrix(const Char_t *outName,Int_t pdg) { gr20->Fit("RegFunc","R,Q"); func->GetParameters(fitpar); for(Int_t i=0; i<3; i++) fitRes(2,i)=fitpar[i]; - for(Int_t l=0; lDivide(1,2); // create the graph for cov matrix - TGraphErrors *gr22 = new TGraphErrors(fitbins,p,mean22,ep,sigma22); + TGraphErrors *gr22 = new TGraphErrors(kfitbins,p,mean22,ep,sigma22); TString title22("C(#eta, #eta)"); title22.Prepend(part); TH2F *frame22 = new TH2F("frame22",title22.Data(),2,0.1,50,2,0,3e-5); frame22->SetXTitle("p [GeV/c]"); @@ -2866,12 +2892,12 @@ void AliTPCtrackerParam::RegularizeCovMatrix(const Char_t *outName,Int_t pdg) { gr22->Fit("RegFunc","R,Q"); func->GetParameters(fitpar); for(Int_t i=0; i<3; i++) fitRes(3,i)=fitpar[i]; - for(Int_t l=0; lDivide(1,2); // create the graph for cov matrix - TGraphErrors *gr31 = new TGraphErrors(fitbins,p,mean31,ep,sigma31); + TGraphErrors *gr31 = new TGraphErrors(kfitbins,p,mean31,ep,sigma31); TString title31("C(tg #lambda,z)"); title31.Prepend(part); TH2F *frame31 = new TH2F("frame31",title31.Data(),2,0.1,50,2,-2e-4,0); frame31->SetXTitle("p [GeV/c]"); @@ -2901,12 +2927,12 @@ void AliTPCtrackerParam::RegularizeCovMatrix(const Char_t *outName,Int_t pdg) { gr31->Fit("RegFunc","R,Q"); func->GetParameters(fitpar); for(Int_t i=0; i<3; i++) fitRes(4,i)=fitpar[i]; - for(Int_t l=0; lDivide(1,2); // create the graph for cov matrix - TGraphErrors *gr33 = new TGraphErrors(fitbins,p,mean33,ep,sigma33); + TGraphErrors *gr33 = new TGraphErrors(kfitbins,p,mean33,ep,sigma33); TString title33("C(tg #lambda,tg #lambda)"); title33.Prepend(part); TH2F *frame33 = new TH2F("frame33",title33.Data(),2,0.1,50,2,0,1e-5); frame33->SetXTitle("p [GeV/c]"); @@ -2936,12 +2962,12 @@ void AliTPCtrackerParam::RegularizeCovMatrix(const Char_t *outName,Int_t pdg) { gr33->Fit("RegFunc","R,Q"); func->GetParameters(fitpar); for(Int_t i=0; i<3; i++) fitRes(5,i)=fitpar[i]; - for(Int_t l=0; lDivide(1,2); // create the graph for cov matrix - TGraphErrors *gr40 = new TGraphErrors(fitbins,p,mean40,ep,sigma40); + TGraphErrors *gr40 = new TGraphErrors(kfitbins,p,mean40,ep,sigma40); TString title40("C(C,y)"); title40.Prepend(part); TH2F *frame40 = new TH2F("frame40",title40.Data(),2,0.1,50,2,0,1e-6); frame40->SetXTitle("p [GeV/c]"); @@ -2971,12 +2997,12 @@ void AliTPCtrackerParam::RegularizeCovMatrix(const Char_t *outName,Int_t pdg) { gr40->Fit("RegFunc","R,Q"); func->GetParameters(fitpar); for(Int_t i=0; i<3; i++) fitRes(6,i)=fitpar[i]; - for(Int_t l=0; lDivide(1,2); // create the graph for cov matrix - TGraphErrors *gr42 = new TGraphErrors(fitbins,p,mean42,ep,sigma42); + TGraphErrors *gr42 = new TGraphErrors(kfitbins,p,mean42,ep,sigma42); TString title42("C(C, #eta)"); title42.Prepend(part); TH2F *frame42 = new TH2F("frame42",title42.Data(),2,0.1,50,2,0,2.2e-7); frame42->SetXTitle("p [GeV/c]"); @@ -3006,12 +3032,12 @@ void AliTPCtrackerParam::RegularizeCovMatrix(const Char_t *outName,Int_t pdg) { gr42->Fit("RegFunc","R,Q"); func->GetParameters(fitpar); for(Int_t i=0; i<3; i++) fitRes(7,i)=fitpar[i]; - for(Int_t l=0; lDivide(1,2); // create the graph for cov matrix - TGraphErrors *gr44 = new TGraphErrors(fitbins,p,mean44,ep,sigma44); + TGraphErrors *gr44 = new TGraphErrors(kfitbins,p,mean44,ep,sigma44); TString title44("C(C,C)"); title44.Prepend(part); TH2F *frame44 = new TH2F("frame44",title44.Data(),2,0.1,50,2,0,2e-9); frame44->SetXTitle("p [GeV/c]"); @@ -3041,12 +3067,12 @@ void AliTPCtrackerParam::RegularizeCovMatrix(const Char_t *outName,Int_t pdg) { gr44->Fit("RegFunc","R,Q"); func->GetParameters(fitpar); for(Int_t i=0; i<3; i++) fitRes(8,i)=fitpar[i]; - for(Int_t l=0; lmkdir(dirName); dir2->cd(); fdEdxMean->SetName(meanName); fdEdxMean->Write(); - fdEdxRMS->SetName(RMSName); fdEdxRMS->Write(); + fdEdxRMS->SetName(rmsName); fdEdxRMS->Write(); outFile->Close(); delete outFile; diff --git a/TPC/AliTPCtrackerParam.h b/TPC/AliTPCtrackerParam.h index dbf4c59c0ec..9a7c3343156 100644 --- a/TPC/AliTPCtrackerParam.h +++ b/TPC/AliTPCtrackerParam.h @@ -10,17 +10,21 @@ // TPC Tracking Parameterization Class // // Origin: Andrea Dainese, Padova - e-mail: andrea.dainese@pd.infn.it +// +// +// //----------------------------------------------------------------------------- //----- Root headers --------- #include //---- AliRoot headers ------- -#include "alles.h" -#include "AliGausCorr.h" -#include "AliMagF.h" +//#include "alles.h" +#include "AliRun.h" +//#include "AliGausCorr.h" +//#include "AliMagF.h" #include "AliTPCkineGrid.h" #include "AliTPCtrack.h" -#include "AliTrackReference.h" +//#include "AliTrackReference.h" //---------------------------- class AliTPCtrackerParam { @@ -45,8 +49,12 @@ class AliTPCtrackerParam { virtual ~AliTPCtrackerParam(); // this function performs the parameterized tracking + // + AliTPCtrackerParam(const AliTPCtrackerParam &p){ + // dummy copy constructor + } + // Int_t BuildTPCtracks(const TFile *inp, TFile *out); - // these functions are used to create a DB of cov. matrices, // including regularization, efficiencies and dE/dx void AllGeantTracks() { fSelAndSmear=kFALSE; return; } @@ -82,49 +90,38 @@ class AliTPCtrackerParam { //********* Internal class definition ******* class AliTPCseedGeant : public TObject { public: - AliTPCseedGeant(Double_t x,Double_t y,Double_t z, - Double_t px,Double_t py,Double_t pz, - Int_t lab) { - fXg = x; - fYg = y; - fZg = z; - fPx = px; - fPy = py; - fPz = pz; - fLabel = lab; - Double_t a = TMath::ATan2(y,x)*180./TMath::Pi(); - if(a<0) a += 360.; - fSector = (Int_t)(a/20.); - fAlpha = 10.+20.*fSector; - fAlpha /= 180.; - fAlpha *= TMath::Pi(); - } - Int_t GetLabel() { return fLabel; } - Double_t GetAlpha() { return fAlpha; } - Double_t GetXL() { return fXg*TMath::Cos(fAlpha)+fYg*TMath::Sin(fAlpha); } - Double_t GetYL() { return -fXg*TMath::Sin(fAlpha)+fYg*TMath::Cos(fAlpha); } - Double_t GetZL() { return fZg; } - Double_t GetPx() { return fPx; } - Double_t GetPy() { return fPy; } - Double_t GetPz() { return fPz; } - Double_t GetPt() { return TMath::Sqrt(fPx*fPx+fPy*fPy); } - Double_t GetEta() { return -TMath::Log(TMath::Tan(0.25*TMath::Pi()-0.5*TMath::ATan(fPz/GetPt()))); } + AliTPCseedGeant(Double_t x=0.,Double_t y=0.,Double_t z=0., + Double_t px=0.,Double_t py=0.,Double_t pz=0., + Int_t lab=0); + Int_t GetLabel() const { return fLabel; } + Double_t GetAlpha() const { return fAlpha; } + Double_t GetXL() const + { return fXg*TMath::Cos(fAlpha)+fYg*TMath::Sin(fAlpha); } + Double_t GetYL() const + { return -fXg*TMath::Sin(fAlpha)+fYg*TMath::Cos(fAlpha); } + Double_t GetZL() const { return fZg; } + Double_t GetPx() const { return fPx; } + Double_t GetPy() const { return fPy; } + Double_t GetPz() const { return fPz; } + Double_t GetPt() const { return TMath::Sqrt(fPx*fPx+fPy*fPy); } + Double_t GetEta() const + { return -TMath::Log(TMath::Tan(0.25*TMath::Pi()-0.5*TMath::ATan(fPz/GetPt()))); } void SetLabel(Int_t lab) { fLabel=lab; return; } - Bool_t InTPCAcceptance() { + Bool_t InTPCAcceptance() const { if(TMath::Abs(GetZL()+(244.-GetXL())*fPz/GetPt())>252.) return kFALSE; return kTRUE; } private: - Double_t fXg; - Double_t fYg; - Double_t fZg; - Double_t fPx; - Double_t fPy; - Double_t fPz; - Double_t fAlpha; - Int_t fLabel; - Int_t fSector; + Double_t fXg; // global x of seed + Double_t fYg; // global y of seed + Double_t fZg; // global z of seed + Double_t fPx; // global px + Double_t fPy; // global py + Double_t fPz; // global pz + Double_t fAlpha; // alpha angle + Int_t fLabel; // track label + Int_t fSector; // TPC sector }; //******* end of internal class **************** @@ -193,8 +190,8 @@ class AliTPCtrackerParam { void CookTrack(Double_t pt,Double_t eta); TMatrixD GetSmearingMatrix(Double_t *cc, Double_t pt,Double_t eta) const; void InitializeKineGrid(Option_t *which); - void MakeSeedsFromHits(AliTPC *TPC,TTree *TH,TObjArray &seedArray) const; - void MakeSeedsFromRefs(TTree *TTR, + void MakeSeedsFromHits(AliTPC *tpc,TTree *th,TObjArray &seedArray) const; + void MakeSeedsFromRefs(TTree *ttr, TObjArray &seedArray) const; Int_t ReadAllData(const Char_t *inName); Int_t ReadDBgrid(const Char_t *inName); -- 2.43.0