From 879cdb02fb6e1e98ec62bef9a59648e1ac7a5289 Mon Sep 17 00:00:00 2001 From: masera Date: Tue, 19 Oct 2010 20:05:27 +0000 Subject: [PATCH] - New histograms added for residual distributions vs. incidence angle - bug removal in method AliITStrackerMI::IsOKForPlaneEff() - removal of (severe) coverity warnings G. Bruno --- ITS/AliITSPlaneEff.h | 3 +- ITS/AliITSPlaneEffSDD.cxx | 36 +++++-- ITS/AliITSPlaneEffSDD.h | 3 +- ITS/AliITSPlaneEffSPD.cxx | 213 ++++++++++++++++++++++++++++++++++++-- ITS/AliITSPlaneEffSPD.h | 16 +-- ITS/AliITSPlaneEffSSD.cxx | 3 +- ITS/AliITSPlaneEffSSD.h | 3 +- ITS/AliITStrackerMI.cxx | 68 ++++++++++-- 8 files changed, 299 insertions(+), 46 deletions(-) diff --git a/ITS/AliITSPlaneEff.h b/ITS/AliITSPlaneEff.h index dc637899ef8..331d2d2d9ea 100644 --- a/ITS/AliITSPlaneEff.h +++ b/ITS/AliITSPlaneEff.h @@ -79,8 +79,7 @@ class AliITSPlaneEff : public AliPlaneEff { virtual void SetCreateHistos(Bool_t) {AliError("This method must be implemented in a derived class"); return; } virtual Bool_t GetCreateHistos() const {return fHis;}; - //virtual Bool_t FillHistos(UInt_t, Bool_t, Float_t[2], Float_t[2], Int_t[2]) - virtual Bool_t FillHistos(UInt_t, Bool_t, Float_t*, Float_t*, Int_t*) + virtual Bool_t FillHistos(UInt_t, Bool_t, Float_t*, Float_t*, Int_t*, Float_t*) {AliError("This method must be implemented in a derived class"); return kFALSE; } virtual Bool_t WriteHistosToFile(TString ,Option_t*) {AliError("This method must be implemented in a derived class"); return kFALSE; } diff --git a/ITS/AliITSPlaneEffSDD.cxx b/ITS/AliITSPlaneEffSDD.cxx index 530dc9cbe96..35876685b73 100644 --- a/ITS/AliITSPlaneEffSDD.cxx +++ b/ITS/AliITSPlaneEffSDD.cxx @@ -275,7 +275,11 @@ Int_t AliITSPlaneEffSDD::GetMissingTracksForGivenEff(Double_t eff, Double_t RelE if (im>=kNModule || ic>=kNChip || iw>=kNWing || is>=kNSubWing) {AliError("GetMissingTracksForGivenEff: you asked for a non existing block"); return -1;} -else return GetNTracksForGivenEff(eff,RelErr)-fTried[GetKey(im,ic,iw,is)]; +else { + UInt_t key=GetKey(im,ic,iw,is); + if (key chip number [0,kNSubWing-1] if (im>=kNModule || ic>=kNChip || iw>=kNWing || is>=kNSubWing) {AliError("PlaneEff(UInt_t,UInt_t,UInt_t,UInt_t): you asked for a non existing block"); return -1.;} - Int_t nf=fFound[GetKey(im,ic,iw,is)]; - Int_t nt=fTried[GetKey(im,ic,iw,is)]; +UInt_t key=GetKey(im,ic,iw,is); +Int_t nf=-1; +Int_t nt=-1; +if (key chip number [0,kNSubWing-1] if (im>=kNModule || ic>=kNChip || iw>=kNWing || is>=kNSubWing) {AliError("ErrPlaneEff(UInt_t,UInt_t,UInt_t,UInt_t): you asked for a non existing block"); return -1.;} -Int_t nf=fFound[GetKey(im,ic,iw,is)]; -Int_t nt=fTried[GetKey(im,ic,iw,is)]; +UInt_t key=GetKey(im,ic,iw,is); +Int_t nf=-1; +Int_t nt=-1; +if (key=kNModule || ic>=kNChip || iw>=kNWing || is>=kNSubWing) {AliError("UpDatePlaneEff: you asked for a non existing block"); return kFALSE;} - fTried[GetKey(im,ic,iw,is)]++; - if(Kfound) fFound[GetKey(im,ic,iw,is)]++; - return kTRUE; + UInt_t key=GetKey(im,ic,iw,is); + if (key cluster size 1 s.fHisResXclu[i][clu]->Copy(*fHisResXclu[i][clu]); s.fHisResZclu[i][clu]->Copy(*fHisResZclu[i][clu]); + s.fProfResXvsPhiclu[i][clu]->Copy(*fProfResXvsPhiclu[i][clu]); + s.fProfResZvsDipclu[i][clu]->Copy(*fProfResZvsDipclu[i][clu]); } for(Int_t chip=0; chipCopy(*fHisResXchip[i][chip]); s.fHisResZchip[i][chip]->Copy(*fHisResZchip[i][chip]); } + s.fProfResXvsPhi[i]->Copy(*fProfResXvsPhi[i]); + s.fProfResZvsDip[i]->Copy(*fProfResZvsDip[i]); s.fHisTrackErrX[i]->Copy(*fHisTrackErrX[i]); s.fHisTrackErrZ[i]->Copy(*fHisTrackErrZ[i]); s.fHisClusErrX[i]->Copy(*fHisClusErrX[i]); @@ -144,11 +156,15 @@ AliITSPlaneEffSPD& AliITSPlaneEffSPD::operator+=(const AliITSPlaneEffSPD &add){ for(Int_t clu=0; clu cluster size 1 fHisResXclu[i][clu]->Add(add.fHisResXclu[i][clu]); fHisResZclu[i][clu]->Add(add.fHisResZclu[i][clu]); + fProfResXvsPhiclu[i][clu]->Add(add.fProfResXvsPhiclu[i][clu]); + fProfResZvsDipclu[i][clu]->Add(add.fProfResZvsDipclu[i][clu]); } for(Int_t chip=0; chipAdd(add.fHisResXchip[i][chip]); fHisResZchip[i][chip]->Add(add.fHisResZchip[i][chip]); } + fProfResXvsPhi[i]->Add(add.fProfResXvsPhi[i]); + fProfResZvsDip[i]->Add(add.fProfResZvsDip[i]); fHisTrackErrX[i]->Add(add.fHisTrackErrX[i]); fHisTrackErrZ[i]->Add(add.fHisTrackErrZ[i]); fHisClusErrX[i]->Add(add.fHisClusErrX[i]); @@ -197,6 +213,10 @@ void AliITSPlaneEffSPD::CopyHistos(AliITSPlaneEffSPD &target) const { target.fHisResZclu=new TH1F**[kNHisto]; target.fHisResXchip=new TH1F**[kNHisto]; target.fHisResZchip=new TH1F**[kNHisto]; + target.fProfResXvsPhi=new TProfile*[kNHisto]; + target.fProfResZvsDip=new TProfile*[kNHisto]; + target.fProfResXvsPhiclu=new TProfile**[kNHisto]; + target.fProfResZvsDipclu=new TProfile**[kNHisto]; target.fHisTrackErrX=new TH1F*[kNHisto]; target.fHisTrackErrZ=new TH1F*[kNHisto]; target.fHisClusErrX=new TH1F*[kNHisto]; @@ -208,9 +228,13 @@ void AliITSPlaneEffSPD::CopyHistos(AliITSPlaneEffSPD &target) const { target.fHisClusterSize[i] = new TH2I(*fHisClusterSize[i]); target.fHisResXclu[i]=new TH1F*[kNclu]; target.fHisResZclu[i]=new TH1F*[kNclu]; + target.fProfResXvsPhiclu[i]=new TProfile*[kNclu]; + target.fProfResZvsDipclu[i]=new TProfile*[kNclu]; for(Int_t clu=0; clu cluster size 1 target.fHisResXclu[i][clu] = new TH1F(*fHisResXclu[i][clu]); target.fHisResZclu[i][clu] = new TH1F(*fHisResZclu[i][clu]); + target.fProfResXvsPhiclu[i][clu] = new TProfile(*fProfResXvsPhiclu[i][clu]); + target.fProfResZvsDipclu[i][clu] = new TProfile(*fProfResZvsDipclu[i][clu]); } target.fHisResXchip[i]=new TH1F*[kNChip]; target.fHisResZchip[i]=new TH1F*[kNChip]; @@ -218,6 +242,8 @@ void AliITSPlaneEffSPD::CopyHistos(AliITSPlaneEffSPD &target) const { target.fHisResXchip[i][chip] = new TH1F(*fHisResXchip[i][chip]); target.fHisResZchip[i][chip] = new TH1F(*fHisResZchip[i][chip]); } + target.fProfResXvsPhi[i] = new TProfile(*fProfResXvsPhi[i]); + target.fProfResZvsDip[i] = new TProfile(*fProfResZvsDip[i]); target.fHisTrackErrX[i] = new TH1F(*fHisTrackErrX[i]); target.fHisTrackErrZ[i] = new TH1F(*fHisTrackErrZ[i]); target.fHisClusErrX[i] = new TH1F(*fHisClusErrX[i]); @@ -260,7 +286,11 @@ Int_t AliITSPlaneEffSPD::GetMissingTracksForGivenEff(Double_t eff, Double_t RelE if (im>=kNModule || ic>=kNChip) {AliError("GetMissingTracksForGivenEff: you asked for a non existing chip"); return -1;} -else return GetNTracksForGivenEff(eff,RelErr)-fTried[GetKey(im,ic)]; +else { + UInt_t key=GetKey(im,ic); + if(key chip number [0,4] if (im>=kNModule || ic>=kNChip) {AliError("PlaneEff(Uint_t,Uint_t): you asked for a non existing chip"); return -1.;} - Int_t nf=fFound[GetKey(im,ic)]; - Int_t nt=fTried[GetKey(im,ic)]; +UInt_t key=GetKey(im,ic); +Int_t nf=-1; +Int_t nt=-1; +if(key chip number [0,4] if (im>=kNModule || ic>=kNChip) {AliError("ErrPlaneEff(Uint_t,Uint_t): you asked for a non existing chip"); return -1.;} -Int_t nf=fFound[GetKey(im,ic)]; -Int_t nt=fTried[GetKey(im,ic)]; +UInt_t key=GetKey(im,ic); +Int_t nf=-1; +Int_t nt=-1; +if(key=kNModule || ic>=kNChip) {AliError("UpDatePlaneEff: you asked for a non existing chip"); return kFALSE;} - fTried[GetKey(im,ic)]++; - if(Kfound) fFound[GetKey(im,ic)]++; - return kTRUE; + UInt_t key=GetKey(im,ic); + if(keySetName(aux.Data()); fHisClusErrZ[nhist]->SetTitle(aux.Data()); - } + aux=profnameResXvsPhi; + aux+=nhist; + fProfResXvsPhi[nhist]=new TProfile("histname","histname",40,-40.,40.0); // binning: range: -40°- 40° + fProfResXvsPhi[nhist]->SetName(aux.Data()); // bin width: 2° + fProfResXvsPhi[nhist]->SetTitle(aux.Data()); + + aux=profnameResZvsDip; + aux+=nhist; + fProfResZvsDip[nhist]=new TProfile("histname","histname",48,-72.,72.0); // binning: range: -70°-4° + fProfResZvsDip[nhist]->SetName(aux.Data()); // bin width: 3° + fProfResZvsDip[nhist]->SetTitle(aux.Data()); + + fProfResXvsPhiclu[nhist]=new TProfile*[kNclu]; + fProfResZvsDipclu[nhist]=new TProfile*[kNclu]; + for(Int_t clu=0; clu cluster size 1 + aux=profnameResXvsPhiclu; + aux+=nhist; + aux+="_clu_"; + aux+=clu+1; // clu=0 --> cluster size 1 + fProfResXvsPhiclu[nhist][clu]=new TProfile("histname","histname",40,-40.,40.0); // binning: range: -40°- 40 + fProfResXvsPhiclu[nhist][clu]->SetName(aux.Data()); // bin width: 2° + fProfResXvsPhiclu[nhist][clu]->SetTitle(aux.Data()); + + aux=profnameResZvsDipclu; + aux+=nhist; + aux+="_clu_"; + aux+=clu+1; // clu=0 --> cluster size 1 + fProfResZvsDipclu[nhist][clu]= new TProfile("histname","histname",48,-72.,72.0); // binning: range: -70°-7° + fProfResZvsDipclu[nhist][clu]->SetName(aux.Data()); // bin width: 3° + fProfResZvsDipclu[nhist][clu]->SetTitle(aux.Data()); + } + + } // end loop on module TH1::AddDirectory(kTRUE); @@ -797,13 +880,36 @@ void AliITSPlaneEffSPD::DeleteHistos() { for (Int_t i=0; i0 && csize[1]<=kNclu) fHisResZclu[id][csize[1]-1]->Fill(resz); fHisResXchip[id][chip]->Fill(resx); fHisResZchip[id][chip]->Fill(resz); + fProfResXvsPhi[id]->Fill(angtrkmod[0],resx); + fProfResZvsDip[id]->Fill(angtrkmod[1],resz); + if(csize[0]>0 && csize[0]<=kNclu) fProfResXvsPhiclu[id][csize[0]-1]->Fill(angtrkmod[0],resx); + if(csize[1]>0 && csize[1]<=kNclu) fProfResZvsDipclu[id][csize[1]-1]->Fill(angtrkmod[1],resz); } fHisTrackErrX[id]->Fill(tr[2]); fHisTrackErrZ[id]->Fill(tr[3]); @@ -866,6 +977,8 @@ Bool_t AliITSPlaneEffSPD::WriteHistosToFile(TString filename, Option_t* option) TH1F *histZchip[kNChip]; TH1F *histTrErrZ,*histTrErrX; TH1F *histClErrZ,*histClErrX; + TProfile *profXvsPhi,*profZvsDip; + TProfile *profXvsPhiclu[kNclu],*profZvsDipclu[kNclu]; histZ=new TH1F(); histX=new TH1F(); @@ -883,6 +996,13 @@ Bool_t AliITSPlaneEffSPD::WriteHistosToFile(TString filename, Option_t* option) histTrErrZ=new TH1F(); histClErrX=new TH1F(); histClErrZ=new TH1F(); + profXvsPhi=new TProfile(); + profZvsDip=new TProfile(); + for(Int_t clu=0;cluBranch("histX","TH1F",&histX,128000,0); SPDTree->Branch("histZ","TH1F",&histZ,128000,0); @@ -904,6 +1024,14 @@ Bool_t AliITSPlaneEffSPD::WriteHistosToFile(TString filename, Option_t* option) SPDTree->Branch("histTrErrZ","TH1F",&histTrErrZ,128000,0); SPDTree->Branch("histClErrX","TH1F",&histClErrX,128000,0); SPDTree->Branch("histClErrZ","TH1F",&histClErrZ,128000,0); + SPDTree->Branch("profXvsPhi","TProfile",&profXvsPhi,128000,0); + SPDTree->Branch("profZvsDip","TProfile",&profZvsDip,128000,0); + for(Int_t clu=0;cluBranch(branchname,"TProfile",&profXvsPhiclu[clu],128000,0); + sprintf(branchname,"profZvsDipclu_%d",clu+1); + SPDTree->Branch(branchname,"TProfile",&profZvsDipclu[clu],128000,0); + } for(Int_t j=0;jFill(); } hFile->Write(); @@ -943,6 +1078,7 @@ Bool_t AliITSPlaneEffSPD::ReadHistosFromFile(TString filename) { TH1F *h = 0; TH2F *h2 = 0; TH2I *h2i= 0; + TProfile *p = 0; TFile *file=TFile::Open(filename.Data(),"READONLY"); @@ -978,6 +1114,16 @@ Bool_t AliITSPlaneEffSPD::ReadHistosFromFile(TString filename) { TBranch *histTrErrZ = (TBranch*) tree->GetBranch("histTrErrZ"); TBranch *histClErrX = (TBranch*) tree->GetBranch("histClErrX"); TBranch *histClErrZ = (TBranch*) tree->GetBranch("histClErrZ"); + TBranch *profXvsPhi = (TBranch*) tree->GetBranch("profXvsPhi"); + TBranch *profZvsDip = (TBranch*) tree->GetBranch("profZvsDip"); + + TBranch *profXvsPhiclu[kNclu], *profZvsDipclu[kNclu]; + for(Int_t clu=0; cluGetBranch(branchname); + sprintf(branchname,"profZvsDipclu_%d",clu+1); + profZvsDipclu[clu]= (TBranch*) tree->GetBranch(branchname); + } gROOT->cd(); @@ -1108,9 +1254,54 @@ Bool_t AliITSPlaneEffSPD::ReadHistosFromFile(TString filename) { fHisClusErrZ[j]->Add(h); } + nevent = (Int_t)profXvsPhi->GetEntries(); + if(nevent!=kNHisto) + {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;} + profXvsPhi->SetAddress(&p); + for(Int_t j=0;jGetEntry(j); + fProfResXvsPhi[j]->Add(p); + } + + nevent = (Int_t)profZvsDip->GetEntries(); + if(nevent!=kNHisto) + {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;} + profZvsDip->SetAddress(&p); + for(Int_t j=0;jGetEntry(j); + fProfResZvsDip[j]->Add(p); + } + + for(Int_t clu=0; cluGetEntries(); + if(nevent!=kNHisto) + {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;} + profXvsPhiclu[clu]->SetAddress(&p); + for(Int_t j=0;jGetEntry(j); + fProfResXvsPhiclu[j][clu]->Add(p); + } + + nevent = (Int_t)profZvsDipclu[clu]->GetEntries(); + if(nevent!=kNHisto) + {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;} + profZvsDipclu[clu]->SetAddress(&p); + for(Int_t j=0;jGetEntry(j); + fProfResZvsDipclu[j][clu]->Add(p); + } + } + + delete h; h=0; delete h2; h2=0; delete h2i; h2i=0; + delete p; p=0; if (file) { file->Close(); diff --git a/ITS/AliITSPlaneEffSPD.h b/ITS/AliITSPlaneEffSPD.h index 33ba77d4b85..82ed8be2133 100644 --- a/ITS/AliITSPlaneEffSPD.h +++ b/ITS/AliITSPlaneEffSPD.h @@ -5,6 +5,7 @@ #include #include +#include #include "AliITSPlaneEff.h" #include "AliCDBId.h" @@ -75,8 +76,7 @@ class AliITSPlaneEffSPD : public AliITSPlaneEff { virtual void SetCreateHistos(Bool_t his=kFALSE) //{fHis=his; if(fHis) InitHistos(); else DeleteHistos(); return; } {fHis=his; if(fHis) {DeleteHistos(); InitHistos();} else DeleteHistos(); return; } - //Bool_t FillHistos(UInt_t key, Bool_t found, Float_t trackXZ[2], Float_t clusterXZ[2], Int_t ctXZ[2]); - virtual Bool_t FillHistos(UInt_t key, Bool_t found, Float_t *track, Float_t *cluster, Int_t *ctype); + virtual Bool_t FillHistos(UInt_t key, Bool_t found, Float_t *track, Float_t *cluster, Int_t *ctype, Float_t *angtrkmod); virtual Bool_t WriteHistosToFile(TString filename="PlaneEffSPDHistos.root",Option_t* option = "RECREATE"); virtual Bool_t ReadHistosFromFile(TString filename="PlaneEffSPDHistos.root"); // histos must exist already ! // This method increases the @@ -118,16 +118,18 @@ class AliITSPlaneEffSPD : public AliITSPlaneEff { TH1F ***fHisResZclu; //! histos with residual distribution along local Z for cluster type TH1F ***fHisResXchip; //! histos with residual distribution along local X (r-phi) chip by chip TH1F ***fHisResZchip; //! histos with residual distribution along local Z chip by chip - //TProfile **fProfResXvsLPhi; //! TProfile of X Residuals vs. impact Angle phi (of the track w.r.t. module) - //TProfile **fProfResZvsLPhi; //! TProfile of Z Residuals vs. impact Angle phi (of the track w.r.t. module) - //TProfile **fProfResXvsLDip; //! TProfile of X Residuals vs. impact dip Angle (of the track w.r.t. module) - //TProfile **fProfResZvsLDip; //! TProfile of Z Residuals vs. impact dip Angle (of the track w.r.t. module) + TProfile **fProfResXvsPhi; //! TProfile of X Residuals vs. impact Angle phi (of the track w.r.t. module) + //TProfile **fProfResZvsPhi; //! TProfile of Z Residuals vs. impact Angle phi (of the track w.r.t. module) + //TProfile **fProfResXvsDip; //! TProfile of X Residuals vs. impact dip Angle (of the track w.r.t. module) + TProfile **fProfResZvsDip; //! TProfile of Z Residuals vs. impact dip Angle (of the track w.r.t. module) + TProfile ***fProfResXvsPhiclu; //! TProfile of X Residuals vs. impact Angle phi (of the track w.r.t. module) for different clu. type + TProfile ***fProfResZvsDipclu; //! TProfile of Z Residuals vs. impact dip Angle (of the track w.r.t. module) for different clu. type TH1F **fHisTrackErrX; //! histos with track prediction error on Local X TH1F **fHisTrackErrZ; //! histos with track prediction error on Local Z TH1F **fHisClusErrX; //! histos with Local_X cluster error TH1F **fHisClusErrZ; //! histos with Local_Z cluster error - ClassDef(AliITSPlaneEffSPD,2) // SPD Plane Efficiency class + ClassDef(AliITSPlaneEffSPD,3) // SPD Plane Efficiency class }; // inline UInt_t AliITSPlaneEffSPD::Nblock() const {return kNModule*kNChip;} diff --git a/ITS/AliITSPlaneEffSSD.cxx b/ITS/AliITSPlaneEffSSD.cxx index 52332b22cbd..842312ebbf2 100644 --- a/ITS/AliITSPlaneEffSSD.cxx +++ b/ITS/AliITSPlaneEffSSD.cxx @@ -536,8 +536,7 @@ return; } //__________________________________________________________ Bool_t AliITSPlaneEffSSD::FillHistos(UInt_t key, Bool_t found, - // Float_t tXZ[2], Float_t cXZ[2], Int_t ctXZ[2]) { - Float_t *tr, Float_t *clu, Int_t *csize) { + Float_t *tr, Float_t *clu, Int_t *csize, Float_t*) { // this method fill the histograms // input: - key: unique key of the basic block // - found: Boolean to asses whether a cluster has been associated to the track or not diff --git a/ITS/AliITSPlaneEffSSD.h b/ITS/AliITSPlaneEffSSD.h index 7f7470c2f5d..beecd7e7161 100644 --- a/ITS/AliITSPlaneEffSSD.h +++ b/ITS/AliITSPlaneEffSSD.h @@ -65,8 +65,7 @@ class AliITSPlaneEffSSD : public AliITSPlaneEff { // method to set on/off the creation/updates of histograms (Histos are created/destroyed) virtual void SetCreateHistos(Bool_t his=kFALSE) {fHis=his; if(fHis) {DeleteHistos(); InitHistos();} else DeleteHistos(); return; } - //Bool_t FillHistos(UInt_t key, Bool_t found, Float_t trackXZ[2], Float_t clusterXZ[2], Int_t ctXZ[2]); - virtual Bool_t FillHistos(UInt_t key, Bool_t found, Float_t *track, Float_t *cluster, Int_t *ctype); + virtual Bool_t FillHistos(UInt_t key, Bool_t found, Float_t *track, Float_t *cluster, Int_t *ctype,Float_t*); virtual Bool_t WriteHistosToFile(TString filename="PlaneEffSSDHistos.root",Option_t* option = "RECREATE"); virtual Bool_t ReadHistosFromFile(TString filename="PlaneEffSSDHistos.root"); // histos must exist already ! // This method increases the diff --git a/ITS/AliITStrackerMI.cxx b/ITS/AliITStrackerMI.cxx index 6c22ebf7c59..8bc08253f44 100644 --- a/ITS/AliITStrackerMI.cxx +++ b/ITS/AliITStrackerMI.cxx @@ -32,6 +32,7 @@ #include #include #include +#include #include "AliLog.h" #include "AliGeomManager.h" @@ -4567,6 +4568,7 @@ Bool_t AliITStrackerMI::LocalModuleCoord(Int_t ilayer,Int_t idet, return kTRUE; } //------------------------------------------------------------------------ +//------------------------------------------------------------------------ Bool_t AliITStrackerMI::IsOKForPlaneEff(const AliITStrackMI* track, const Int_t *clusters, Int_t ilayer) const { // // Method to be optimized further: @@ -4605,14 +4607,15 @@ Bool_t AliITStrackerMI::IsOKForPlaneEff(const AliITStrackMI* track, const Int_t // require a minimal number of cluster in other layers and eventually clusters in closest layers Int_t ncl_out=0; Int_t ncl_in=0; for(Int_t lay=AliITSgeomTGeo::kNLayers-1;lay>ilayer;lay--) { // count n. of cluster in outermost layers - AliDebug(2,Form("trak=%d lay=%d ; index=%d ESD label= %d",tmp.GetLabel(),lay, + AliDebug(2,Form("trak=%d lay=%d ; index=%d ESD label= %d",tmp.GetLabel(),lay, tmp.GetClIndex(lay),((AliESDtrack*)tmp.GetESDtrack())->GetLabel())) ; - if (tmp.GetClIndex(lay)>=0) ncl_out++; + // if (tmp.GetClIndex(lay)>=0) ncl_out++; +if(index[lay]>=0)ncl_out++; } for(Int_t lay=ilayer-1; lay>=0;lay--) { // count n. of cluster in innermost layers AliDebug(2,Form("trak=%d lay=%d ; index=%d ESD label= %d",tmp.GetLabel(),lay, tmp.GetClIndex(lay),((AliESDtrack*)tmp.GetESDtrack())->GetLabel())) ; - if (tmp.GetClIndex(lay)>=0) ncl_in++; + if (index[lay]>=0) ncl_in++; } Int_t ncl=ncl_out+ncl_in; Bool_t nextout = kFALSE; @@ -4655,14 +4658,11 @@ Bool_t AliITStrackerMI::IsOKForPlaneEff(const AliITStrackMI* track, const Int_t //*************** // DEFINITION OF SEARCH ROAD FOR accepting a track // - //For the time being they are hard-wired, later on from AliITSRecoParam Double_t nsigx=AliITSReconstructor::GetRecoParam()->GetNSigXFromBoundaryPlaneEff(); Double_t nsigz=AliITSReconstructor::GetRecoParam()->GetNSigZFromBoundaryPlaneEff(); - // Double_t nsigz=4; - // Double_t nsigx=4; Double_t dx=nsigx*TMath::Sqrt(tmp.GetSigmaY2()); // those are precisions in the tracking reference system Double_t dz=nsigz*TMath::Sqrt(tmp.GetSigmaZ2()); // Use it also for the module reference system, as it is - // done for RecPoints + // done for RecPoints // exclude tracks at boundary between detectors //Double_t boundaryWidth=AliITSRecoParam::GetBoundaryWidthPlaneEff(); @@ -4670,7 +4670,6 @@ Bool_t AliITStrackerMI::IsOKForPlaneEff(const AliITStrackMI* track, const Int_t AliDebug(2,Form("Tracking: track impact x=%f, y=%f, z=%f",tmp.GetX(), tmp.GetY(), tmp.GetZ())); AliDebug(2,Form("Local: track impact x=%f, z=%f",locx,locz)); AliDebug(2,Form("Search Road. Tracking: dy=%f , dz=%f",dx,dz)); - if ( (locx-dx < blockXmn+boundaryWidth) || (locx+dx > blockXmx-boundaryWidth) || (locz-dz < blockZmn+boundaryWidth) || @@ -4806,6 +4805,9 @@ void AliITStrackerMI::UseTrackForPlaneEff(const AliITStrackMI* track, Int_t ilay Float_t tr[4]={99999.,99999.,9999.,9999.}; // initialize to high values Float_t clu[4]={-99999.,-99999.,9999.,9999.}; // (in some cases GetCov fails) Int_t cltype[2]={-999,-999}; + // and the module + +Float_t AngleModTrack[3]={99999.,99999.,99999.}; // angles (phi, z and "absolute angle") between the track and the mormal to the module (see below) tr[0]=locx; tr[1]=locz; @@ -4835,8 +4837,54 @@ void AliITStrackerMI::UseTrackForPlaneEff(const AliITStrackMI* track, Int_t ilay clu[3]=TMath::Sqrt(c.GetSigmaZ2()); //} } - fPlaneEff->FillHistos(key,found,tr,clu,cltype); + // Compute the angles between the track and the module + // compute the angle "in phi direction", i.e. the angle in the transverse plane + // between the normal to the module and the projection (in the transverse plane) of the + // track trajectory + // tgphi and tglambda of the track in tracking frame with alpha=det.GetPhi + Float_t tgl = tmp.GetTgl(); + Float_t phitr = tmp.GetSnp(); + phitr = TMath::ASin(phitr); + Int_t volId = AliGeomManager::LayerToVolUIDSafe(ilayer+1 ,idet ); + + Double_t tra[3]; AliGeomManager::GetOrigTranslation(volId,tra); + Double_t rot[9]; AliGeomManager::GetOrigRotation(volId,rot); + Double_t alpha =0.; + alpha = tmp.GetAlpha(); + Double_t phiglob = alpha+phitr; + Double_t p[3]; + p[0] = TMath::Cos(phiglob); + p[1] = TMath::Sin(phiglob); + p[2] = tgl; + TVector3 pvec(p[0],p[1],p[2]); + TVector3 normvec(rot[1],rot[4],rot[7]); + Double_t angle = pvec.Angle(normvec); + + if(angle>0.5*TMath::Pi()) angle = (TMath::Pi()-angle); + angle *= 180./TMath::Pi(); + + //Trasverse Plane + TVector3 pt(p[0],p[1],0); + TVector3 normt(rot[1],rot[4],0); + Double_t anglet = pt.Angle(normt); + + Double_t phiPt = TMath::ATan2(p[1],p[0]); + if(phiPt<0)phiPt+=2.*TMath::Pi(); + Double_t phiNorm = TMath::ATan2(rot[4],rot[1]); + if(phiNorm<0) phiNorm+=2.*TMath::Pi(); + if(anglet>0.5*TMath::Pi()) anglet = (TMath::Pi()-anglet); + if(phiNorm>phiPt) anglet*=-1.;// pt-->normt clockwise: anglet>0 + if((phiNorm-phiPt)>TMath::Pi()) anglet*=-1.; + anglet *= 180./TMath::Pi(); + + AngleModTrack[2]=(Float_t) angle; + AngleModTrack[0]=(Float_t) anglet; + // now the "angle in z" (much easier, i.e. the angle between the z axis and the track momentum + 90) + AngleModTrack[1]=TMath::ACos(tgl/TMath::Sqrt(tgl*tgl+1.)); + AngleModTrack[1]-=TMath::Pi()/2.; // range of angle is -pi/2 , pi/2 + AngleModTrack[1]*=180./TMath::Pi(); // in degree + + fPlaneEff->FillHistos(key,found,tr,clu,cltype,AngleModTrack); } return; } - -- 2.43.0