]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSVertexerPPZ.cxx
Functions reInlined properly. Inlining needed for speed.
[u/mrichter/AliRoot.git] / ITS / AliITSVertexerPPZ.cxx
index 5db663b5f5f7a42b25e6dbb5e9dda2682bf756a5..cea187a3c1a410a005fe89484d72a52d942a1cbb 100644 (file)
@@ -95,7 +95,7 @@ void  AliITSVertexerPPZ::EvalZ(TH1F *hist,Int_t sepa, Int_t ncoinc, TArrayF *zva
   if(NbinNotZero==1){
     fZFound = curz;
     fZsig=0;
-    fCurrentVertex = new AliITSVertex(fZFound,fZsig,NbinNotZero);
+    fCurrentVertex = new AliESDVertex(fZFound,fZsig,NbinNotZero);
     return;
   }
   Float_t errsq = totst2/(N-1)-totst*totst/N/(N-1);
@@ -154,7 +154,7 @@ void  AliITSVertexerPPZ::EvalZ(TH1F *hist,Int_t sepa, Int_t ncoinc, TArrayF *zva
   if(N<1){fZFound=-110; fZsig=-110; return;}
   if(N==1){
     fZsig = 0;
-    fCurrentVertex = new AliITSVertex(fZFound,fZsig,N);
+    fCurrentVertex = new AliESDVertex(fZFound,fZsig,N);
     return;
   }
   errsq = (fZsig/(N-1)-fZFound*fZFound/N/(N-1))/N;
@@ -171,12 +171,12 @@ void  AliITSVertexerPPZ::EvalZ(TH1F *hist,Int_t sepa, Int_t ncoinc, TArrayF *zva
   fZFound*=fZsig;
   fZsig = TMath::Sqrt(fZsig);
   */
-  fCurrentVertex = new AliITSVertex(fZFound,fZsig,N);
+  fCurrentVertex = new AliESDVertex(fZFound,fZsig,N);
 }
 
 //______________________________________________________________________
-AliITSVertex* AliITSVertexerPPZ::FindVertexForCurrentEvent(Int_t evnumber){
-  // Defines the AliITSVertex for the current event
+AliESDVertex* AliITSVertexerPPZ::FindVertexForCurrentEvent(Int_t evnumber){
+  // Defines the AliESDVertex for the current event
   fCurrentVertex = 0;
   fZFound = -999;
   fZsig = -999;
@@ -195,24 +195,31 @@ AliITSVertex* AliITSVertexerPPZ::FindVertexForCurrentEvent(Int_t evnumber){
     Error("FindVertexForCurrentEvent","ITS geometry is not defined");
     return fCurrentVertex;
   }
-  TTree *TR=0;
-  TClonesArray *ITSrec  = 0;
+  TTree *tR=0;
+  TClonesArray *itsRec  = 0;
   Float_t lc[3]; for(Int_t ii=0; ii<3; ii++) lc[ii]=0.;
   Float_t gc[3]; for(Int_t ii=0; ii<3; ii++) gc[ii]=0.;
   Float_t lc2[3]; for(Int_t ii=0; ii<3; ii++) lc2[ii]=0.;
   Float_t gc2[3]; for(Int_t ii=0; ii<3; ii++) gc2[ii]=0.;
 
-  TR = ITSloader->TreeR();
-  if(!TR){
+  tR = ITSloader->TreeR();
+  if(!tR){
     Error("FindVertexForCurrentEvent","TreeR not found");
     return fCurrentVertex;
   }
-  ITSrec  = fITS->RecPoints();  // uses slow points or fast points if slow are
+  itsRec  = fITS->RecPoints();  // uses slow points or fast points if slow are
   // missing
-  TBranch *branch = TR->GetBranch("ITSRecPoints");
-  if(!branch){ 
-    branch = TR->GetBranch("ITSRecPointsF");
-    //   Warning("FindVertexForCurrentEvent","Using Fast points");
+  TClonesArray dummy("AliITSclusterV2",10000), *clusters=&dummy;
+  TBranch *branch;
+  if(fUseV2Clusters){
+    branch = tR->GetBranch("Clusters");
+    branch->SetAddress(&clusters);
+  }
+  else {
+    branch = tR->GetBranch("ITSRecPoints");
+    if(!branch){ 
+      branch = tR->GetBranch("ITSRecPointsF");
+    }
   }
   if(!branch){
    Error("FindVertexForCurrentEvent","branch for ITS rec points not found");
@@ -224,9 +231,12 @@ AliITSVertex* AliITSVertexerPPZ::FindVertexForCurrentEvent(Int_t evnumber){
   Int_t firipixe=0;
   for(Int_t module= fFirstL1; module<=fLastL1;module++){
     branch->GetEvent(module);
-    Int_t nrecp1 = ITSrec->GetEntries();
+    if(fUseV2Clusters){
+      Clusters2RecPoints(clusters,module,itsRec);
+    }
+    Int_t nrecp1 = itsRec->GetEntries();
     for(Int_t i=0; i<nrecp1;i++){
-      AliITSRecPoint *current = (AliITSRecPoint*)ITSrec->At(i);
+      AliITSRecPoint *current = (AliITSRecPoint*)itsRec->At(i);
       lc[0]=current->GetX();
       lc[2]=current->GetZ();
       geom->LtoG(module,lc,gc);
@@ -263,9 +273,12 @@ AliITSVertex* AliITSVertexerPPZ::FindVertexForCurrentEvent(Int_t evnumber){
   for(Int_t module= fFirstL1; module<=fLastL1;module++){
     if(fDebug>0)cout<<"processing module   "<<module<<"                  \r";
     branch->GetEvent(module);
-    Int_t nrecp1 = ITSrec->GetEntries();
+    if(fUseV2Clusters){
+      Clusters2RecPoints(clusters,module,itsRec);
+    }
+    Int_t nrecp1 = itsRec->GetEntries();
     TObjArray *poiL1 = new TObjArray(nrecp1);
-    for(Int_t i=0; i<nrecp1;i++)poiL1->AddAt(ITSrec->At(i),i);
+    for(Int_t i=0; i<nrecp1;i++)poiL1->AddAt(itsRec->At(i),i);
     fITS->ResetRecPoints();
     for(Int_t i=0; i<nrecp1;i++){
       AliITSRecPoint *current = (AliITSRecPoint*)poiL1->At(i);
@@ -280,9 +293,12 @@ AliITSVertex* AliITSVertexerPPZ::FindVertexForCurrentEvent(Int_t evnumber){
       if(fDebug>1)cout<<"module "<<module<<" "<<gc[0]<<" "<<gc[1]<<" "<<gc[2]<<" "<<phi1<<"     \n";
       for(Int_t modul2=fFirstL2; modul2<=fLastL2; modul2++){
        branch->GetEvent(modul2);
-       Int_t nrecp2 = ITSrec->GetEntries();
+       if(fUseV2Clusters){
+         Clusters2RecPoints(clusters,modul2,itsRec);
+       }
+       Int_t nrecp2 = itsRec->GetEntries();
        for(Int_t j=0; j<nrecp2;j++){
-         AliITSRecPoint *recp = (AliITSRecPoint*)ITSrec->At(j);
+         AliITSRecPoint *recp = (AliITSRecPoint*)itsRec->At(j);
          lc2[0]=recp->GetX();
          lc2[2]=recp->GetZ();
          geom->LtoG(modul2,lc2,gc2);