From 18856a77c37e4c544e4310fd0bf754f0bf35cd7d Mon Sep 17 00:00:00 2001 From: hristov Date: Thu, 13 Nov 2003 18:45:51 +0000 Subject: [PATCH] Coding conventions, additional comments, code clean-up (Yu.Belikov) --- ITS/AliCascadeVertexer.cxx | 14 +++++++++--- ITS/AliCascadeVertexer.h | 2 +- ITS/AliITSComparisonV2.C | 44 +++++++++++++++++++------------------- ITS/AliITStrackerV2.cxx | 43 +++++++++++++++++++++---------------- ITS/AliITStrackerV2.h | 10 ++++----- ITS/AliV0vertexer.cxx | 9 +++++--- ITS/AliV0vertexer.h | 6 +++--- 7 files changed, 72 insertions(+), 56 deletions(-) diff --git a/ITS/AliCascadeVertexer.cxx b/ITS/AliCascadeVertexer.cxx index 2eede113605..e808bbdd7e0 100644 --- a/ITS/AliCascadeVertexer.cxx +++ b/ITS/AliCascadeVertexer.cxx @@ -15,7 +15,8 @@ //------------------------------------------------------------------------- // Implementation of the cascade vertexer class -// +// Reads V0s and tracks, writes out cascade vertices +// Fills the ESD with the cascades // Origin: Christian Kuhn, IReS, Strasbourg, christian.kuhn@ires.in2p3.fr //------------------------------------------------------------------------- #include @@ -23,7 +24,6 @@ #include "AliESD.h" #include "AliESDv0.h" -#include "AliESDcascade.h" #include "AliCascadeVertex.h" #include "AliCascadeVertexer.h" #include "AliITStrackV2.h" @@ -50,8 +50,16 @@ Int_t AliCascadeVertexer::V0sTracks2CascadeVertices(AliESD *event) { TObjArray trks(ntr); for (i=0; iGetTrack(i); + Int_t status=esdtr->GetStatus(); + + if ((status&AliESDtrack::kITSrefit)==0) + if ((status&AliESDtrack::kITSout)!=0 || (status&AliESDtrack::kITSin)==0) + continue; + AliITStrackV2 *iotrack=new AliITStrackV2(*esdtr); - iotrack->PropagateTo(3.,0.0023,65.19); iotrack->PropagateTo(2.5,0.,0.); + if ((status&AliESDtrack::kITSrefit)==0) //correction for the beam pipe + iotrack->PropagateTo(3.,0.0023,65.19); //material + iotrack->PropagateTo(2.5,0.,0.); trks.AddLast(iotrack); } diff --git a/ITS/AliCascadeVertexer.h b/ITS/AliCascadeVertexer.h index c14b5ffc1eb..edbecf55fff 100644 --- a/ITS/AliCascadeVertexer.h +++ b/ITS/AliCascadeVertexer.h @@ -5,7 +5,7 @@ //------------------------------------------------------------------ // Cascade Vertexer Class -// +// Reads V0s and tracks, writes out cascade vertices // Origin: Christian Kuhn, IReS, Strasbourg, christian.kuhn@ires.in2p3.fr //------------------------------------------------------------------ diff --git a/ITS/AliITSComparisonV2.C b/ITS/AliITSComparisonV2.C index 892c5210333..952d88b45af 100644 --- a/ITS/AliITSComparisonV2.C +++ b/ITS/AliITSComparisonV2.C @@ -54,18 +54,18 @@ Int_t AliITSComparisonV2() { return 1; } rl->LoadgAlice(); - if (rl->GetAliRun()) + if (rl->GetAliRun()) AliKalmanTrack:: SetConvConst(1000/0.299792458/rl->GetAliRun()->Field()->SolenoidField()); else { cerr<<"AliITSComparisonV2.C :Can't get AliRun !\n"; return 1; } - rl->UnloadgAlice(); + //rl->UnloadgAlice(); AliITSLoader* itsl = (AliITSLoader*)rl->GetLoader("ITSLoader"); if (itsl == 0x0) { - cerr<<"AliITSComparisonV2.C : Can not find TPCLoader\n"; + cerr<<"AliITSComparisonV2.C : Can not find ITSLoader\n"; delete rl; return 3; } @@ -76,23 +76,6 @@ Int_t AliITSComparisonV2() { const char* evfoldname = AliConfig::fgkDefaultEventFolderName );//declaration only - Int_t nentr=0; TObjArray tarray(2000); - {/* Load tracks */ - itsl->LoadTracks(); - TTree *tracktree=itsl->TreeT(); - if (!tracktree) {cerr<<"Can't get a tree with ITS tracks !\n"; return 4;} - TBranch *tbranch=tracktree->GetBranch("tracks"); - nentr=(Int_t)tracktree->GetEntries(); - - for (Int_t i=0; iSetAddress(&iotrack); - tracktree->GetEvent(i); - tarray.AddLast(iotrack); - } - itsl->UnloadTracks(); - } - /* Generate a list of "good" tracks */ GoodTrackITS gt[MAX]; Int_t ngood=0; @@ -123,6 +106,23 @@ Int_t AliITSComparisonV2() { out.close(); } + Int_t nentr=0; TObjArray tarray(2000); + {/* Load tracks */ + itsl->LoadTracks(); + TTree *tracktree=itsl->TreeT(); + if (!tracktree) {cerr<<"Can't get a tree with ITS tracks !\n"; return 4;} + TBranch *tbranch=tracktree->GetBranch("tracks"); + nentr=(Int_t)tracktree->GetEntries(); + + for (Int_t i=0; iSetAddress(&iotrack); + tracktree->GetEvent(i); + tarray.AddLast(iotrack); + } + itsl->UnloadTracks(); + } + TH1F *hp=new TH1F("hp","PHI resolution",50,-20.,20.); hp->SetFillColor(4); TH1F *hl=new TH1F("hl","LAMBDA resolution",50,-20,20);hl->SetFillColor(4); TH1F *hpt=new TH1F("hpt","Relative Pt resolution",30,-10.,10.); @@ -325,14 +325,14 @@ Int_t AliITSComparisonV2() { Int_t good_tracks_its(GoodTrackITS *gt, const Int_t max, const char* evfoldname) { AliRunLoader* rl = AliRunLoader::GetRunLoader(evfoldname); if (rl == 0x0) { - ::Fatal("AliTPCComparison.C::good_tracks_its", + ::Fatal("AliITSComparisonV2.C::good_tracks_its", "Can not find Run Loader in Folder Named %s", evfoldname); } AliITSLoader* itsl = (AliITSLoader*)rl->GetLoader("ITSLoader"); if (itsl == 0x0) { - cerr<<"AliITSComparisonV2.C : Can not find TPCLoader\n"; + cerr<<"AliITSComparisonV2.C : Can not find ITSLoader\n"; delete rl; return 3; } diff --git a/ITS/AliITStrackerV2.cxx b/ITS/AliITStrackerV2.cxx index fb72a090dfa..768ca5fb021 100644 --- a/ITS/AliITStrackerV2.cxx +++ b/ITS/AliITStrackerV2.cxx @@ -15,7 +15,8 @@ //------------------------------------------------------------------------- // Implementation of the ITS tracker class -// +// It reads AliITSclusterV2 clusters and creates AliITStrackV2 tracks +// and fills with them the ESD // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch // dEdx analysis by: Boris Batyunya, JINR, Boris.Batiounia@cern.ch //------------------------------------------------------------------------- @@ -33,7 +34,7 @@ ClassImp(AliITStrackerV2) -AliITStrackerV2::AliITSlayer AliITStrackerV2::fLayers[kMaxLayer]; // ITS layers +AliITStrackerV2::AliITSlayer AliITStrackerV2::fgLayers[kMaxLayer]; // ITS layers AliITStrackerV2::AliITStrackerV2(const AliITSgeom *geom) : AliTracker() { //-------------------------------------------------------------------- @@ -60,7 +61,7 @@ AliITStrackerV2::AliITStrackerV2(const AliITSgeom *geom) : AliTracker() { r += TMath::Sqrt(x*x + y*y); r*=0.25; - new (fLayers+i-1) AliITSlayer(r,poff,zoff,nlad,ndet); + new (fgLayers+i-1) AliITSlayer(r,poff,zoff,nlad,ndet); for (Int_t j=1; jGetEvent(j)) continue; Int_t ncl=clusters->GetEntriesFast(); while (ncl--) { AliITSclusterV2 *c=(AliITSclusterV2*)clusters->UncheckedAt(ncl); - fLayers[i].InsertCluster(new AliITSclusterV2(*c)); + fgLayers[i].InsertCluster(new AliITSclusterV2(*c)); } clusters->Delete(); } - fLayers[i].ResetRoad(); //road defined by the cluster density + fgLayers[i].ResetRoad(); //road defined by the cluster density } return 0; @@ -136,7 +137,7 @@ void AliITStrackerV2::UnloadClusters() { //-------------------------------------------------------------------- //This function unloads ITS clusters //-------------------------------------------------------------------- - for (Int_t i=0; iGetLabel()); fTrackToFollow.CookdEdx(); CookLabel(&fTrackToFollow,0.); //For comparison only + + fTrackToFollow.PropagateTo(3.,0.0028,65.19); //The beam pipe + fTrackToFollow.PropagateToVertex(); + fTrackToFollow.UpdateESDtrack(AliESDtrack::kITSrefit); UseClusters(&fTrackToFollow); ntrk++; @@ -682,7 +687,7 @@ AliCluster *AliITStrackerV2::GetCluster(Int_t index) const { //-------------------------------------------------------------------- Int_t l=(index & 0xf0000000) >> 28; Int_t c=(index & 0x0fffffff) >> 00; - return fLayers[l].GetCluster(c); + return fgLayers[l].GetCluster(c); } @@ -693,13 +698,13 @@ void AliITStrackerV2::FollowProlongation() { while (fI>fLastLayerToTrackTo) { Int_t i=fI-1; - AliITSlayer &layer=fLayers[i]; + AliITSlayer &layer=fgLayers[i]; AliITStrackV2 &track=fTracks[i]; Double_t r=layer.GetR(); if (i==3 || i==1) { - Double_t rs=0.5*(fLayers[i+1].GetR() + r); + Double_t rs=0.5*(fgLayers[i+1].GetR() + r); Double_t d=0.0034, x0=38.6; if (i==1) {rs=9.; d=0.0097; x0=42;} if (!fTrackToFollow.PropagateTo(rs,d,x0)) { @@ -791,7 +796,7 @@ Int_t AliITStrackerV2::TakeNextProlongation() { // // dEdx analysis by: Boris Batyunya, JINR, Boris.Batiounia@cern.ch //-------------------------------------------------------------------- - AliITSlayer &layer=fLayers[fI]; + AliITSlayer &layer=fgLayers[fI]; ResetTrackToFollow(fTracks[fI]); Double_t dz=7*TMath::Sqrt(fTrackToFollow.GetSigmaZ2() + kSigmaZ2[fI]); @@ -1104,10 +1109,10 @@ Double_t AliITStrackerV2::GetEffectiveThickness(Double_t y,Double_t z) const Double_t d=0.0028*3*3; //beam pipe Double_t x0=0; - Double_t xn=fLayers[fI].GetR(); + Double_t xn=fgLayers[fI].GetR(); for (Int_t i=0; i1) { @@ -1116,7 +1121,7 @@ Double_t AliITStrackerV2::GetEffectiveThickness(Double_t y,Double_t z) const } if (fI>3) { - Double_t xi=0.5*(fLayers[3].GetR()+fLayers[4].GetR()); + Double_t xi=0.5*(fgLayers[3].GetR()+fgLayers[4].GetR()); d+=0.0034*xi*xi; } @@ -1170,13 +1175,13 @@ AliITStrackerV2::RefitAt(Double_t xx,AliITStrackV2 *t,const AliITStrackV2 *c) { } for (Int_t i=from; i != to; i += step) { - AliITSlayer &layer=fLayers[i]; + AliITSlayer &layer=fgLayers[i]; Double_t r=layer.GetR(); { Double_t hI=i-0.5*step; if (TMath::Abs(hI-1.5)<0.01 || TMath::Abs(hI-3.5)<0.01) { - Double_t rs=0.5*(fLayers[i-step].GetR() + r); + Double_t rs=0.5*(fgLayers[i-step].GetR() + r); Double_t d=0.0034, x0=38.6; if (TMath::Abs(hI-1.5)<0.01) {rs=9.; d=0.0097; x0=42;} if (!t->PropagateTo(rs,-step*d,x0)) { diff --git a/ITS/AliITStrackerV2.h b/ITS/AliITStrackerV2.h index b5983255ed4..e821cd4c839 100644 --- a/ITS/AliITStrackerV2.h +++ b/ITS/AliITStrackerV2.h @@ -1,12 +1,12 @@ -#ifndef ALIITSTRACKER_H -#define ALIITSTRACKER_H +#ifndef ALIITSTRACKERV2_H +#define ALIITSTRACKERV2_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ //------------------------------------------------------------------------- // ITS tracker -// -// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch +// reads AliITSclusterV2 clusters and creates AliITStrackV2 tracks +// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch //------------------------------------------------------------------------- #include "AliTracker.h" #include "AliITSrecoV2.h" @@ -105,7 +105,7 @@ private: new(&fTrackToFollow) AliITStrackV2(t); } Int_t fI; // index of the current layer - static AliITSlayer fLayers[kMaxLayer]; // ITS layers + static AliITSlayer fgLayers[kMaxLayer];// ITS layers AliITStrackV2 fTracks[kMaxLayer]; // track estimations at the ITS layers AliITStrackV2 fBestTrack; // "best" track AliITStrackV2 fTrackToFollow; // followed track diff --git a/ITS/AliV0vertexer.cxx b/ITS/AliV0vertexer.cxx index 4eda554ec57..139d3b95d76 100644 --- a/ITS/AliV0vertexer.cxx +++ b/ITS/AliV0vertexer.cxx @@ -15,7 +15,8 @@ //------------------------------------------------------------------------- // Implementation of the V0 vertexer class -// +// reads tracks writes out V0 vertices +// fills the ESD with the V0s // Origin: Iouri Belikov, IReS, Strasbourg, Jouri.Belikov@cern.ch //------------------------------------------------------------------------- #include @@ -52,7 +53,8 @@ Int_t AliV0vertexer::Tracks2V0vertices(AliESD *event) { AliITStrackV2 *iotrack=new AliITStrackV2(*esd); iotrack->SetLabel(i); // now it is the index in array of ESD tracks - iotrack->PropagateTo(3.,0.0023,65.19); + if ((status&AliESDtrack::kITSrefit)==0) //correction for the beam pipe + iotrack->PropagateTo(3.,0.0023,65.19); //material iotrack->PropagateTo(2.5,0.,0.); if (iotrack->Get1Pt() > 0.) {nneg++; negtrks.AddLast(iotrack);} @@ -213,7 +215,8 @@ Int_t AliV0vertexer::Tracks2V0vertices(TTree *tTree, TTree *vTree) { return 0; } -Double_t AliV0vertexer::PropagateToDCA(AliITStrackV2 *n, AliITStrackV2 *p) { +Double_t +AliV0vertexer::PropagateToDCA(AliITStrackV2 *n, AliITStrackV2 *p) const { //-------------------------------------------------------------------- // This function returns the DCA between two tracks // The tracks will be moved to the point of DCA ! diff --git a/ITS/AliV0vertexer.h b/ITS/AliV0vertexer.h index 0f5cd52094b..6ddf03aa14f 100644 --- a/ITS/AliV0vertexer.h +++ b/ITS/AliV0vertexer.h @@ -5,7 +5,7 @@ //------------------------------------------------------------------ // V0 Vertexer Class -// +// reads tracks writes out V0 vertices // Origin: Iouri Belikov, IReS, Strasbourg, Jouri.Belikov@cern.ch //------------------------------------------------------------------ @@ -26,10 +26,10 @@ public: Int_t Tracks2V0vertices(AliESD *event); Int_t Tracks2V0vertices(TTree *in, TTree *out); - Double_t PropagateToDCA(AliITStrackV2 *nt, AliITStrackV2 *pt); + Double_t PropagateToDCA(AliITStrackV2 *nt, AliITStrackV2 *pt) const; void GetCuts(Double_t cuts[7]) const; - void GetVertex(Double_t *vtx) { vtx[0]=fX; vtx[1]=fY; vtx[2]=fZ; } + void GetVertex(Double_t *vtx) const { vtx[0]=fX; vtx[1]=fY; vtx[2]=fZ; } private: -- 2.39.3