]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Several patches were done to adapt the ITS reconstruction version V2 to the multi...
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 21 Oct 2001 19:20:02 +0000 (19:20 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 21 Oct 2001 19:20:02 +0000 (19:20 +0000)
ITS/AliITSComparisonV2.C
ITS/AliITSFindClustersV2.C
ITS/AliITSFindTracksV2.C
ITS/AliITStrackerV2.cxx
ITS/AliITStrackerV2.h

index 7209f90e45ed9b2acc2cf1e4693b4833ae621b3e..ef036cfc49125ef9aeac37a724c787bcedea8504 100644 (file)
   #include "TParticle.h"
 #endif
 
-struct GoodTrack {
+struct GoodTrackITS {
+  Int_t event;
   Int_t lab;
   Int_t code;
   Float_t px,py,pz;
   Float_t x,y,z;
 };
-Int_t good_tracks(GoodTrack *gt, Int_t max);
 
 Int_t AliITSComparisonV2() {
+   Int_t good_tracks_its(GoodTrackITS *gt, Int_t max);
+
    cerr<<"Doing comparison...\n";
 
    TFile *cf=TFile::Open("AliITSclustersV2.root");
@@ -41,7 +43,7 @@ Int_t AliITSComparisonV2() {
    TFile *tf=TFile::Open("AliITStracksV2.root");
    if (!tf->IsOpen()) {cerr<<"Can't open AliITStracksV2.root !\n"; return 3;}
    TObjArray tarray(2000);
-   TTree *tracktree=(TTree*)tf->Get("ITSf");
+   TTree *tracktree=(TTree*)tf->Get("TreeT_ITS_0");
    if (!tracktree) {cerr<<"Can't get a tree with ITS tracks !\n"; return 4;}
    TBranch *tbranch=tracktree->GetBranch("tracks");
    Int_t nentr=(Int_t)tracktree->GetEntries(),i;
@@ -66,22 +68,25 @@ Int_t AliITSComparisonV2() {
        }
        */
        tarray.AddLast(iotrack);
-   }   
+   }
+   delete tracktree; //Thanks to Mariana Bondila
    tf->Close();
+   delete geom; //Thanks to Mariana Bondila
    cf->Close();
 
 /////////////////////////////////////////////////////////////////////////
-   GoodTrack gt[15000];
+   const Int_t MAX=15000;
+   GoodTrackITS gt[MAX];
    Int_t ngood=0;
    ifstream in("good_tracks_its");
    if (in) {
       cerr<<"Reading good tracks...\n";
-      while (in>>gt[ngood].lab>>gt[ngood].code>>
+      while (in>>gt[ngood].event>>gt[ngood].lab>>gt[ngood].code>>
                  gt[ngood].px>>gt[ngood].py>>gt[ngood].pz>>
                  gt[ngood].x >>gt[ngood].y >>gt[ngood].z) {
          ngood++;
          cerr<<ngood<<'\r';
-         if (ngood==15000) {
+         if (ngood==MAX) {
             cerr<<"Too many good tracks !\n";
             break;
          }
@@ -89,13 +94,13 @@ Int_t AliITSComparisonV2() {
       if (!in.eof()) cerr<<"Read error (good_tracks_its) !\n";
    } else {
       cerr<<"Marking good tracks (this will take a while)...\n";
-      ngood=good_tracks(gt,15000);
+      ngood=good_tracks_its(gt,MAX);
       ofstream out("good_tracks_its");
       if (out) {
-         for (Int_t ngd=0; ngd<ngood; ngd++)            
-           out<<gt[ngd].lab<<' '<<gt[ngd].code<<' '<<
-                 gt[ngd].px<<' '<<gt[ngd].py<<' '<<gt[ngd].pz<<' '<<
-                 gt[ngd].x <<' '<<gt[ngd].y <<' '<<gt[ngd].z <<endl;
+       for (Int_t ngd=0; ngd<ngood; ngd++)
+         out<<gt[ngd].event<<' '<<gt[ngd].lab<<' '<<gt[ngd].code<<' '
+             <<gt[ngd].px<<' '<<gt[ngd].py<<' '<<gt[ngd].pz<<' '
+             <<gt[ngd].x <<' '<<gt[ngd].y <<' '<<gt[ngd].z <<endl;
       } else cerr<<"Can not open file (good_tracks_its) !\n";
       out.close();
    }
@@ -241,7 +246,7 @@ Int_t AliITSComparisonV2() {
    return 0;
 }
 
-Int_t good_tracks(GoodTrack *gt, Int_t max) {
+Int_t good_tracks_its(GoodTrackITS *gt, Int_t max) {
    if (gAlice) {delete gAlice; gAlice=0;}
 
    TFile *file=TFile::Open("galice.root");
@@ -263,14 +268,14 @@ Int_t good_tracks(GoodTrack *gt, Int_t max) {
    }
    AliITSgeom *geom=ITS->GetITSgeom();
    if (!geom) {
-      cerr<<"cen't get ITS geometry !\n"; exit(9);
+      cerr<<"can't get ITS geometry !\n"; exit(9);
    }
 
    TFile *cf=TFile::Open("AliITSclustersV2.root");
    if (!cf->IsOpen()){
       cerr<<"Can't open AliITSclustersV2.root !\n"; exit(6);
    }
-   TTree *cTree=(TTree*)cf->Get("cTree");
+   TTree *cTree=(TTree*)cf->Get("TreeC_ITS_0");
    if (!cTree) {
       cerr<<"Can't get cTree !\n"; exit(7);
    }
@@ -283,12 +288,12 @@ Int_t good_tracks(GoodTrack *gt, Int_t max) {
 
    Int_t entr=(Int_t)cTree->GetEntries();
    for (k=0; k<entr; k++) {
-     if (!cTree->GetEvent(k)) continue;
+     cTree->GetEvent(k);
+     Int_t ncl=clusters->GetEntriesFast(); if (ncl==0) continue;
      Int_t lay,lad,det;  geom->GetModuleId(k,lay,lad,det);
      if (lay<1 || lay>6) {
        cerr<<"wrong layer !\n"; exit(10);
      }
-     Int_t ncl=clusters->GetEntriesFast();
      while (ncl--) {
         AliITSclusterV2 *pnt=(AliITSclusterV2*)clusters->UncheckedAt(ncl);
         Int_t l0=pnt->GetLabel(0);
@@ -301,6 +306,7 @@ Int_t good_tracks(GoodTrack *gt, Int_t max) {
      }
    }
    clusters->Delete(); delete clusters;
+   delete cTree; //Thanks to Mariana Bondila
    cf->Close();
 
    ifstream in("good_tracks_tpc");
@@ -309,10 +315,11 @@ Int_t good_tracks(GoodTrack *gt, Int_t max) {
    }
    Int_t nt=0;
    Double_t px,py,pz,x,y,z;
-   Int_t code,lab;
-   while (in>>lab>>code>>px>>py>>pz>>x>>y>>z) {
+   Int_t code,lab,event;
+   while (in>>event>>lab>>code>>px>>py>>pz>>x>>y>>z) {
       if (good[lab] != 0x3F) continue;
       TParticle *p = (TParticle*)gAlice->Particle(lab);
+      gt[nt].event=event;
       gt[nt].lab=lab;
       gt[nt].code=p->GetPdgCode();
 //**** px py pz - in global coordinate system
index 0e06e7044ddf8f8c71f9a6d74752bd4c4f729695..bc82fa92ded1cf8ba936c00d4008bf3ee347d0a9 100644 (file)
@@ -1,4 +1,6 @@
 #ifndef __CINT__
+  #include <iostream.h>
+
   #include "AliRun.h"
   #include "AliITS.h"
   #include "AliITSgeom.h"
@@ -41,14 +43,15 @@ Int_t AliITSFindClustersV2() {
 
    gAlice->MakeTree("R"); ITS->MakeBranch("R",0);
 //////////////// Taken from ITSHitsToFastPoints.C ///////////////////////
-   AliITSsimulationFastPoints *sim = new AliITSsimulationFastPoints();
-   for (Int_t i=0;i<3;i++) { ITS->SetSimulationModel(i,sim); }
-
+   ITS->SetSimulationModel(0,new AliITSsimulationFastPoints());
+   ITS->SetSimulationModel(1,new AliITSsimulationFastPoints());
+   ITS->SetSimulationModel(2,new AliITSsimulationFastPoints());
    Int_t nsignal=25;
    Int_t size=-1;
    Int_t bgr_ev=Int_t(ev/nsignal);
    ITS->HitsToFastRecPoints(ev,bgr_ev,size," ","All"," ");
 //////////////////////////////////////////////////////////////////////////
+
    delete gAlice; gAlice=0;
    in->Close();
 
@@ -79,11 +82,12 @@ Int_t AliITSFindClustersV2() {
    geom->Write();
 
    TClonesArray *clusters=new TClonesArray("AliITSclusterV2",10000);
-   TTree *cTree=new TTree("cTree","ITS clusters");
+   //TTree *cTree=new TTree("cTree","ITS clusters");
+   TTree *cTree=new TTree("TreeC_ITS_0","ITS clusters");
    cTree->Branch("Clusters",&clusters);
 
    TTree *pTree=gAlice->TreeR();
-   if (!pTree) { 
+   if (!pTree) {
       cerr<<"Can't get TreeR !\n";
       return 7;
    }
@@ -102,13 +106,14 @@ Int_t AliITSFindClustersV2() {
    cerr<<"Number of entries: "<<nentr<<endl;
 
    for (Int_t i=0; i<nentr; i++) {
-       if (!pTree->GetEvent(i)) {cTree->Fill(); continue;}
+       points->Clear();
+       pTree->GetEvent(i);
+       Int_t ncl=points->GetEntriesFast(); if (ncl==0){cTree->Fill();continue;}
        Int_t lay,lad,det; geom->GetModuleId(i,lay,lad,det);
        Float_t x,y,zshift; geom->GetTrans(lay,lad,det,x,y,zshift); 
        Double_t rot[9];    geom->GetRotMatrix(lay,lad,det,rot);
        Double_t yshift = x*rot[0] + y*rot[1];
        Int_t ndet=(lad-1)*geom->GetNdetectors(lay) + (det-1);
-       Int_t ncl=points->GetEntriesFast();
        nclusters+=ncl;
        for (Int_t j=0; j<ncl; j++) {
           AliITSRecPoint *p=(AliITSRecPoint*)points->UncheckedAt(j);
@@ -147,10 +152,12 @@ Int_t AliITSFindClustersV2() {
    delete cTree; delete clusters; delete points;
 
    delete gAlice; gAlice=0;
+
    in->Close();
    out->Close();
 
    return 0;
+
 }
 
 
index fa490266e8d83df3ff7cb41f9702d49cd857075c..aa3ef1dcbf67254bade253cf51a3ee4f963dad94 100644 (file)
@@ -25,6 +25,8 @@ Int_t AliITSFindTracksV2() {
    Int_t rc=tracker.Clusters2Tracks(in,out);
    timer.Stop(); timer.Print();
 
+   delete geom; //Thanks to Mariana Bondila
+
    file->Close();
    in->Close();
    out->Close();
index 3b447b20266df4c2b8ce6d731f50e4a9204d2211..1a499862a5a9a3e1617a237fa381c2206a84200f 100644 (file)
@@ -92,11 +92,10 @@ if (phi<0) phi += 2*TMath::Pi();
 
   try {
      //Read clusters
-    //MI change 
-    char   cname[100]; 
-    sprintf(cname,"TreeC_ITS_%d",eventn);
+     //MI change 
+     char   cname[100]; 
+     sprintf(cname,"TreeC_ITS_%d",eventn);
      TTree *cTree=(TTree*)gDirectory->Get(cname);
-    //     TTree *cTree=(TTree*)gDirectory->Get("cTree");
 
      if (!cTree) throw 
         ("AliITStrackerV2::AliITStrackerV2 can't get cTree !\n");
@@ -111,7 +110,6 @@ if (phi<0) phi += 2*TMath::Pi();
      Int_t nentr=(Int_t)cTree->GetEntries();
      for (i=0; i<nentr; i++) {
        if (!cTree->GetEvent(i)) continue;
-       //Int_t lay,lad,det; g->GetModuleId(i-1,lay,lad,det);
        Int_t lay,lad,det; g->GetModuleId(i,lay,lad,det);
        Int_t ncl=clusters->GetEntriesFast();
        while (ncl--) {
@@ -131,6 +129,7 @@ cout<<lay-1<<' '<<lad-1<<' '<<det-1<<' '<<c->GetY()<<' '<<c->GetZ()<<endl;
        }
        clusters->Delete();
      }
+     delete cTree; //Thanks to Mariana Bondila
   }
   catch (const Char_t *msg) {
     cerr<<msg<<endl;
@@ -168,7 +167,6 @@ Int_t AliITStrackerV2::Clusters2Tracks(const TFile *inp, TFile *out) {
   char   tname[100];
   sprintf(tname,"TreeT_TPC_%d",fEventN);
   TTree *tpcTree=(TTree*)in->Get(tname);
-  //TTree *tpcTree=(TTree*)in->Get("TPCf");
 
   if (!tpcTree) {
      cerr<<"AliITStrackerV2::Clusters2Tracks() ";
@@ -267,6 +265,8 @@ cout<<fBestTrack.GetNumberOfClusters()<<" number of clusters\n\n";
   cerr<<"Number of TPC tracks: "<<nentr<<endl;
   cerr<<"Number of prolonged tracks: "<<ntrk<<endl;
 
+  delete tpcTree; //Thanks to Mariana Bondila
+
   delete itrack;
 
   return 0;
@@ -292,7 +292,7 @@ Int_t AliITStrackerV2::PropagateBack(const TFile *inp, TFile *out) {
   }
 
   in->cd();
-  TTree *itsTree=(TTree*)in->Get("ITSf");
+  TTree *itsTree=(TTree*)in->Get("TreeT_ITS_0");
   if (!itsTree) {
      cerr<<"AliITStrackerV2::PropagateBack() ";
      cerr<<"can't get a tree with ITS tracks !\n";
@@ -302,7 +302,7 @@ Int_t AliITStrackerV2::PropagateBack(const TFile *inp, TFile *out) {
   itsTree->SetBranchAddress("tracks",&itrack);
 
   out->cd();
-  TTree backTree("ITSb","Tree with back propagated ITS tracks");
+  TTree backTree("TreeT_ITSb_0","Tree with back propagated ITS tracks");
   AliTPCtrack *otrack=0;
   backTree.Branch("tracks","AliTPCtrack",&otrack,32000,0);
 
@@ -454,6 +454,8 @@ for (Int_t k=0; k<nc; k++) {
 
   delete itrack;
 
+  delete itsTree; //Thanks to Mariana Bondila
+
   return 0;
 }
 
@@ -638,6 +640,7 @@ AliITStrackerV2::AliITSlayer::AliITSlayer() {
   //--------------------------------------------------------------------
   fN=0;
   fDetectors=0;
+  for (Int_t i=0; i<kMaxClusterPerLayer; i++) fClusters[i]=0;
 }
 
 AliITStrackerV2::AliITSlayer::
@@ -648,6 +651,7 @@ AliITSlayer(Double_t r,Double_t p,Double_t z,Int_t nl,Int_t nd) {
   fR=r; fPhiOffset=p; fZOffset=z;
   fNladders=nl; fNdetectors=nd;
   fDetectors=new AliITSdetector[fNladders*fNdetectors];
+  for (Int_t i=0; i<kMaxClusterPerLayer; i++) fClusters[i]=0;
 
   fN=0;
   fI=0;
@@ -757,7 +761,7 @@ AliITStrackerV2::AliITSlayer::GetThickness(Double_t phi, Double_t z) const {
   //This function returns the thickness of this layer
   //--------------------------------------------------------------------
   //-pi<phi<+pi
-  if (3 <fR&&fR<8 ) return 1.1*0.096;
+  if (3 <fR&&fR<8 ) return 2.2*0.096;
   if (13<fR&&fR<26) return 1.1*0.088;
   if (37<fR&&fR<41) return 1.1*0.085;
   return 1.1*0.081;
index b524f73ad9075c6c3831a4ac2031f0b906a5aedd..a8e58cf06956c4f4defcf47f0c86005df3b18951 100644 (file)
@@ -21,7 +21,7 @@ class TFile;
 class AliITStrackerV2 : public AliTracker {
 public:
   AliITStrackerV2():AliTracker(){}
-  AliITStrackerV2(const AliITSgeom *geom, Int_t event) throw (const Char_t *);
+  AliITStrackerV2(const AliITSgeom *geom, Int_t event=0) throw (const Char_t *);
 
   AliCluster *GetCluster(Int_t index) const;
   Int_t Clusters2Tracks(const TFile *in, TFile *out);