X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSComparisonV2.C;h=e142816392b750b95978776ab9cf03726a217c17;hb=95867fd1a1e4c0184dffddff44ad89b1058d7e62;hp=b86d41959f1468b34a3ce1fc235a8ee6e634b9ae;hpb=4fa1e6291d9ab876a2071941429efeaf1799d8fb;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSComparisonV2.C b/ITS/AliITSComparisonV2.C index b86d41959f1..e142816392b 100644 --- a/ITS/AliITSComparisonV2.C +++ b/ITS/AliITSComparisonV2.C @@ -21,7 +21,7 @@ #include #include #include - #include + #include #include #include "AliStack.h" @@ -33,8 +33,7 @@ #include "AliITS.h" #include "AliITSgeom.h" - #include "AliITStrackV2.h" - #include "AliITSclusterV2.h" + #include "AliITSRecPoint.h" #include "AliITSLoader.h" #endif @@ -69,11 +68,11 @@ Int_t AliITSComparisonV2 TH1F *hmpt=(TH1F*)gROOT->FindObject("hmpt"); if (!hmpt) - hmpt=new TH1F("hmpt","Transverse impact parameter",30,-300,300); + hmpt=new TH1F("hmpt","Transverse impact parameter",30,-777,777); hmpt->SetFillColor(6); TH1F *hz=(TH1F*)gROOT->FindObject("hz"); - if (!hz) hz=new TH1F("hz","Longitudinal impact parameter",30,-300,300); + if (!hz) hz=new TH1F("hz","Longitudinal impact parameter",30,-777,777); @@ -145,21 +144,20 @@ Int_t AliITSComparisonV2 return 4; } } - TKey *key=0; - TIter next(ef->GetListOfKeys()); - + AliESD* event = new AliESD; + TTree* esdTree = (TTree*) ef->Get("esdTree"); + if (!esdTree) { + ::Error("AliITSComparison.C", "no ESD tree found"); + return 6; + } + esdTree->SetBranchAddress("ESD", &event); //******* Loop over events ********* Int_t e=0; - while ((key=(TKey*)next())!=0) { + while (esdTree->GetEvent(e)) { cout<ReadObj(); - - Float_t field=event->GetMagneticField(); - AliKalmanTrack::SetConvConst(1000/0.299792458/field); - Int_t nentr=event->GetNumberOfTracks(); allfound+=nentr; @@ -190,16 +188,12 @@ Int_t AliITSComparisonV2 AliESDtrack *esd=0; Int_t cnt=0; - Int_t pipe=0; for (Int_t i=0; iGetTrack(i); UInt_t status=t->GetStatus(); - UInt_t flags=AliESDtrack::kTPCin|AliESDtrack::kITSin; if ((status&AliESDtrack::kITSrefit)==0) continue; - if ((status&flags)==status) pipe=1; - Int_t lbl=t->GetLabel(); if (lab==TMath::Abs(lbl)) { if (cnt==0) {esd=t; tlab=lbl;} @@ -222,14 +216,9 @@ Int_t AliITSComparisonV2 hfake->Fill(ptg); } - AliITStrackV2 track(*esd); - if (pipe!=0) { - track.PropagateTo(3.,0.0028,65.19); - track.PropagateToVertex(); // This is not "exactly" the vertex - } - - Double_t xv,par[5]; track.GetExternalParameters(xv,par); - Float_t phi=TMath::ASin(par[2]) + track.GetAlpha(); + Double_t alpha=esd->GetAlpha(),xv,par[5]; + esd->GetExternalParameters(xv,par); + Float_t phi=TMath::ASin(par[2]) + alpha; if (phi<-TMath::Pi()) phi+=2*TMath::Pi(); if (phi>=TMath::Pi()) phi-=2*TMath::Pi(); Float_t lam=TMath::ATan(par[3]); @@ -241,16 +230,14 @@ Int_t AliITSComparisonV2 Float_t lamg=TMath::ATan2(ref->Pz(),ptg); hl->Fill((lam - lamg)*1000.); - Double_t d=10000*track.GetD(ref->X(),ref->Y()); - hmpt->Fill(d); - - Double_t z=10000*(track.GetZ()-ref->Z()); - hz->Fill(z); + Float_t d,z; esd->GetImpactParameters(d,z); + hmpt->Fill(10000*d); + hz->Fill(10000*z); hpt->Fill((pt_1 - 1/ptg)/(1/ptg)*100.); Float_t mom=1./(pt_1*TMath::Cos(lam)); - Float_t dedx=track.GetdEdx(); + Float_t dedx=esd->GetITSsignal(); hep->Fill(mom,dedx,1.); Int_t pdg=(Int_t)ref->GetLength(); //this is particle's PDG ! @@ -281,9 +268,9 @@ Int_t AliITSComparisonV2 cout<<"Number of \"good\" tracks : "<Clear(); - delete event; } //***** End of the loop over events + delete event; ef->Close(); delete itsTree; @@ -446,7 +433,7 @@ Int_t GoodTracksITS(const Char_t *dir) { sprintf(fname,"%s/GoodTracksITS.root",dir); TFile *itsFile=TFile::Open(fname,"recreate"); - TClonesArray dummy("AliTrackReference",1000), *itsRefs=&dummy; + TClonesArray dummy2("AliTrackReference",1000), *itsRefs=&dummy2; TTree itsTree("itsTree","Tree with info about the reconstructable ITS tracks"); itsTree.Branch("ITS",&itsRefs); @@ -468,13 +455,13 @@ Int_t GoodTracksITS(const Char_t *dir) { delete rl; return 8; } - TBranch *branch=cTree->GetBranch("Clusters"); + TBranch *branch=cTree->GetBranch("ITSRecPoints"); if (!branch) { ::Error("GoodTracksITS","Can't get the clusters branch !"); delete rl; return 9; } - TClonesArray dummy("AliITSclusterV2",10000), *clusters=&dummy; + TClonesArray dummy("AliITSRecPoint",10000), *clusters=&dummy; branch->SetAddress(&clusters); Int_t entr=(Int_t)cTree->GetEntries(); @@ -488,7 +475,7 @@ Int_t GoodTracksITS(const Char_t *dir) { return 10; } while (ncl--) { - AliITSclusterV2 *pnt=(AliITSclusterV2*)clusters->UncheckedAt(ncl); + AliITSRecPoint *pnt=(AliITSRecPoint*)clusters->UncheckedAt(ncl); Int_t l0=pnt->GetLabel(0); if (l0>=np) { // cerr<<"Wrong label: "<SetMomentum(p->Px(),p->Py(),p->Pz()); - ref->SetPosition(p->Vx(),p->Vy(),p->Vz()); + AliTrackReference *ref=new((*itsRefs)[nt]) AliTrackReference(*tpcRef); + ref->SetMomentum(p->Px(),p->Py(),p->Pz()); + ref->SetPosition(p->Vx(),p->Vy(),p->Vz()); nt++; } tpcRefs->Clear();