From: vestbo Date: Tue, 21 Jan 2003 18:56:32 +0000 (+0000) Subject: Updated function EvaluatePoints. X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=8af8a456e4d980714b7bf1c0d4acd6de82087e9b Updated function EvaluatePoints. --- diff --git a/HLT/src/AliL3Evaluate.cxx b/HLT/src/AliL3Evaluate.cxx index fc90b1992a0..d173028c12d 100644 --- a/HLT/src/AliL3Evaluate.cxx +++ b/HLT/src/AliL3Evaluate.cxx @@ -136,7 +136,7 @@ AliL3Evaluate::~AliL3Evaluate() if(fNtuppel) delete fNtuppel; } - + void AliL3Evaluate::AssignIDs() { //Assign MC id to the tracks. @@ -559,22 +559,33 @@ TNtupleD *AliL3Evaluate::CalculateResiduals(Char_t *datapath) return ntuppel; } -TNtuple *AliL3Evaluate::EvaluatePoints(Char_t *rootfile) +TNtuple *AliL3Evaluate::EvaluatePoints(Char_t *path) { //Compare points to the exact crossing points of track and padrows. //The input file to this function, contains the exact clusters calculated //in AliTPC::Hits2ExactClusters. - + cout<<"Evaluating points"<SetDirectory(0); - TFile *exfile = TFile::Open(rootfile); + Char_t filename[1024]; + sprintf(filename,"%s/alirunfile.root",path); + TFile *exfile = TFile::Open(filename); if(!exfile) { - cerr<<"Error opening rootfile "<Get("gAlice"); + if (!gAlice) + { + LOG(AliL3Log::kError,"AliL3Evaluate::InitMC","gAlice") + <<"AliRun object non existing on file"<GetEvent(0); AliTPCParam *param = (AliTPCParam*)exfile->Get(AliL3Transform::GetParamName()); //Get the exact clusters from file: @@ -603,35 +614,41 @@ TNtuple *AliL3Evaluate::EvaluatePoints(Char_t *rootfile) AliL3Transform::Sector2Slice(slice,padrow,cursec,currow); if(slicefMaxSlice) continue; AliL3SpacePointData *points = fClusters[slice][0]; - - Int_t index = fRowid[slice][padrow]; - if(!fDigitsTree->GetEvent(index)) - printf("AliL3Evaluate::EvaluatePoints : ERROR IN DIGITSTREE\n"); + if(!points) + { + cerr<<"AliL3Evaluate::EvalutePoints : Error getting clusters "<UncheckedAt(m); Int_t mcId = cluster->fTracks[0]; - //Int_t mcId = cluster->GetLabel(0); + if(mcId <0) continue; TParticle *part = gAlice->Particle(mcId); - - Float_t xyz_cl[3] = {points[c].fX,points[c].fY,points[c].fZ}; - Float_t xyz_ex[3]; - AliL3Transform::Global2Raw(xyz_cl,cursec,currow); - if(fDigits->GetTrackID((Int_t)rint(xyz_cl[2]),(Int_t)rint(xyz_cl[1]),0)!=mcId && - fDigits->GetTrackID((Int_t)rint(xyz_cl[2]),(Int_t)rint(xyz_cl[1]),1)!=mcId && - fDigits->GetTrackID((Int_t)rint(xyz_cl[2]),(Int_t)rint(xyz_cl[1]),2)!=mcId) + if(points[c].fTrackID[0]!=mcId && + points[c].fTrackID[1]!=mcId && + points[c].fTrackID[2]!=mcId) continue; + AliL3Transform::Raw2Local(xyz_ex,cursec,currow,cluster->fY,cluster->fX); - AliL3Transform::Raw2Local(xyz_cl,cursec,currow,xyz_cl[1],xyz_cl[2]); + + //In function AliTPC::Hits2ExactClusters the time offset is not included, + //so we have to substract it again here. + xyz_ex[2]-=AliL3Transform::GetZOffset(); + Float_t resy = xyz_cl[1] - xyz_ex[1];//cluster->GetY() Float_t resz = xyz_cl[2] - xyz_ex[2];//cluster->GetZ() - + ntuppel->Fill(slice,padrow,resy,resz,xyz_ex[2],part->Pt()); } } diff --git a/HLT/src/AliL3Evaluate.h b/HLT/src/AliL3Evaluate.h index bc191e8c893..308a66e33ec 100644 --- a/HLT/src/AliL3Evaluate.h +++ b/HLT/src/AliL3Evaluate.h @@ -41,8 +41,8 @@ class AliL3Evaluate { AliL3TrackArray *fTracks; //! AliTPCParam *fParam; AliL3SpacePointData *fClusters[36][6]; //! - AliSimDigits *fDigits; TTree *fDigitsTree; + AliSimDigits *fDigits; Int_t fMinSlice; Int_t fMaxSlice; UInt_t fNcl[36][6]; @@ -74,7 +74,6 @@ class AliL3Evaluate { TH1F *fFakeTrackEffEta; - public: AliL3Evaluate(); AliL3Evaluate(Char_t *path,Int_t min_clusters,Int_t minhits,Double_t minpt=0.1,Int_t *slice=0); @@ -91,7 +90,7 @@ class AliL3Evaluate { void GetCFeff(Char_t *outfile); Int_t GetMCTrackLabel(AliL3Track *track); TNtupleD *CalculateResiduals(Char_t *datapath); - TNtuple *EvaluatePoints(Char_t *rootfile); + TNtuple *EvaluatePoints(Char_t *path); void SetMinPoints(Int_t f) {fMinPointsOnTrack = f;} void SetMinGoodPt(Double_t f) {fMinGoodPt = f;}