]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Bug fix affecting multiple events
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 May 2006 15:59:54 +0000 (15:59 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 May 2006 15:59:54 +0000 (15:59 +0000)
ITS/AliITSVertexerTracks.cxx
ITS/AliITSVertexerTracks.h

index fe2102357d183d31bea3ee2548902cf8d07334a6..5b8b64f0fd7439b1ef64bdff764a3a538088fa86 100644 (file)
@@ -51,7 +51,7 @@ AliITSVertexerTracks::AliITSVertexerTracks():AliITSVertexer() {
   SetMinTracks();
   fTrksToSkip = 0;
   fNTrksToSkip = 0;
-  fDCAcut=0;
+
 }
 //----------------------------------------------------------------------------
 AliITSVertexerTracks::AliITSVertexerTracks(TFile *inFile,TFile *outFile,
@@ -69,7 +69,6 @@ AliITSVertexerTracks::AliITSVertexerTracks(TFile *inFile,TFile *outFile,
   SetMinTracks();
   fTrksToSkip = 0;
   fNTrksToSkip = 0;
-  fDCAcut=0;
   SetDebug();
 }
 //----------------------------------------------------------------------------
@@ -85,7 +84,6 @@ AliITSVertexerTracks::AliITSVertexerTracks(TString fn,
   SetMinTracks();
   fTrksToSkip = 0;
   fNTrksToSkip = 0;
-  fDCAcut=0;
 }
 //______________________________________________________________________
 AliITSVertexerTracks::AliITSVertexerTracks(const AliITSVertexerTracks &vtxr) : AliITSVertexer(vtxr) {
@@ -252,7 +250,7 @@ Int_t AliITSVertexerTracks::PrepareTracks(TTree &trkTree) {
 
   if(fDebug) {
     printf(" PrepareTracks()\n");
-    trkTree.Print();
+    //    trkTree.Print();
   }
 
   for(Int_t i=0; i<nEntries; i++) {
@@ -276,8 +274,10 @@ Int_t AliITSVertexerTracks::PrepareTracks(TTree &trkTree) {
     track->PropagateTo(xlStart,field);   // to vtxSeed
 
     // select tracks with d0rphi < maxd0rphi
+   
     d0rphi = TMath::Abs(track->GetD(fNominalPos[0],fNominalPos[1],field));
     if(d0rphi > maxd0rphi) { delete track; continue; }
+   
 
     fTrkArray.AddLast(track);
     
@@ -377,8 +377,13 @@ AliESDVertex* AliITSVertexerTracks::FindPrimaryVertexForCurrentEvent(AliESD *esd
   trkTree->Branch("tracks","AliESDtrack",&esdTrack);
 
   for(Int_t i=0; i<entr; i++) {
-    esdTrack = (AliESDtrack*)esdEvent->GetTrack(i);
+    AliESDtrack *et = esdEvent->GetTrack(i);
+    esdTrack = new AliESDtrack(*et);
     if(!esdTrack->GetStatus()&AliESDtrack::kITSin) continue;
+    if(!esdTrack->GetStatus()&AliESDtrack::kITSrefit) continue;
+    Int_t nclus=esdTrack->GetNcls(0); // check number of clusters in ITS
+    if(nclus<5) continue;
+
     trkTree->Fill();
   }
   delete esdTrack;
@@ -408,7 +413,6 @@ AliESDVertex* AliITSVertexerTracks::FindPrimaryVertexForCurrentEvent(AliESD *esd
 
   esdEvent->SetVertex(fCurrentVertex);
 
-  cout<<"Vertex: "<<vtx[0]<<", "<<vtx[1]<<", "<<vtx[2]<<endl;
   return fCurrentVertex;
 }
 //---------------------------------------------------------------------------
@@ -442,10 +446,11 @@ void AliITSVertexerTracks::VertexFitter() {
     PrintStatus();
   }
   AliVertexerTracks *vertexer=new AliVertexerTracks(fNominalPos[0],fNominalPos[1]);
-  vertexer->SetFinderAlgorithm(5);
+  vertexer->SetFinderAlgorithm(1);
   AliVertex *thevert=(AliVertex*)vertexer->VertexForSelectedTracks(&fTrkArray);
   Double_t initPos[3];
   thevert->GetXYZ(initPos);
+  //  cout<<"Finder: "<<initPos[0]<<"; "<<initPos[1]<<"; "<<initPos[2]<<endl;
   delete vertexer;
 
 
index 6e24348b48e39ba1434c249f0b733a662d7feb14..537cf9c026e4dc4c1317cbb29e2e1fb85b683853 100644 (file)
@@ -73,8 +73,6 @@ class AliITSVertexerTracks : public AliITSVertexer {
   void  SetSkipTracks(Int_t n,Int_t *skipped); 
   void  SetVtxStart(Double_t x=0,Double_t y=0) 
     { fNominalPos[0]=x; fNominalPos[1]=y; return; }
-  void  SetDCAcut(Double_t maxdca)
-    { fDCAcut=maxdca; return;}
   
  private:
     // copy constructor (NO copy allowed: the constructor is protected
@@ -86,7 +84,6 @@ class AliITSVertexerTracks : public AliITSVertexer {
   TFile    *fOutFile;         // output file for vertices
   Double_t  fNominalPos[2];   // initial knowledge on vertex position
   Int_t     fMinTracks;       // minimum number of tracks
-  Double_t  fDCAcut;          // maximum DCA between 2 tracks used for vertex
   Double_t  fMaxChi2PerTrack; // maximum contribition to the chi2 
   TObjArray fTrkArray;        // array with tracks to be processed
   Int_t     *fTrksToSkip;     // tracks to be skipped for find and fit 
@@ -101,7 +98,7 @@ class AliITSVertexerTracks : public AliITSVertexer {
   //  void     VertexFinder(Int_t OptUseWeights=0);
   void     VertexFitter();
 
-  ClassDef(AliITSVertexerTracks,2) // 3D Vertexing with ITS tracks 
+  ClassDef(AliITSVertexerTracks,3) // 3D Vertexing with ITS tracks 
 };
 
 #endif