]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSVertexerFast.cxx
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / ITS / AliITSVertexerFast.cxx
index e48ab3898f29a321da31ac87a9b8c90d60659ff1..80428d8e08c7961bf90c39d34c45bc98f03a041a 100644 (file)
@@ -30,6 +30,9 @@
 // Origin: masera@to.infn.it     25/09/2003                            //
 //                                                                     //
 /////////////////////////////////////////////////////////////////////////
+
+using std::endl;
+using std::cout;
 ClassImp(AliITSVertexerFast)
 
 
@@ -40,7 +43,7 @@ fSmear(0)
 {
   // Default Constructor
   fSmear = 0;
-  AliRunLoader *rl =AliRunLoader::GetRunLoader();
+  AliRunLoader *rl =AliRunLoader::Instance();
   TTree *trK=(TTree*)rl->TreeK();
   if(!trK)AliFatal("This class should be used only with simulated events!!");
   rl->LoadHeader(); 
@@ -53,8 +56,8 @@ fSmear(0)
   // Standard constructor
   fSmear = new Double_t[3];
   for(Int_t i=0;i<3;i++)fSmear[i]=smear[i];
-  Info("AliITSVertexerFast","Gaussian smaring of the generated vertex. Parameters %f12.5 , %f12.5 , %f12.5 \n",fSmear[0],fSmear[1],fSmear[2]);
-  AliRunLoader *rl =AliRunLoader::GetRunLoader();
+  AliInfo(Form("Gaussian smaring of the generated vertex. Sigmas (x,y,z) = %12.5f , %12.5f , %12.5f cm",fSmear[0],fSmear[1],fSmear[2]));
+  AliRunLoader *rl =AliRunLoader::Instance();
   TTree *trK=(TTree*)rl->TreeK();
   if(!trK)AliFatal("This class should be used only with simulated events!!");
   rl->LoadHeader(); 
@@ -65,8 +68,7 @@ fSmear(0)
 //______________________________________________________________________
 AliITSVertexerFast::~AliITSVertexerFast(){
   // Destructor
-  if(fSmear)delete [] fSmear;
-  fSmear = 0;
+  delete [] fSmear;
 }
 
 //______________________________________________________________________
@@ -75,7 +77,7 @@ AliESDVertex* AliITSVertexerFast::FindVertexForCurrentEvent(TTree *itsClusterTre
   AliWarning(Form("This class should be used only with simulated events!! Input cluster tree (%p) will not be used!!",itsClusterTree));
 
   fCurrentVertex = 0;
-  AliRunLoader *rl =AliRunLoader::GetRunLoader();
+  AliRunLoader *rl =AliRunLoader::Instance();
   TArrayF primaryVertex(3);  // true vertex
   AliHeader* header = rl->GetHeader();
   AliGenEventHeader* genEventHeader = header->GenEventHeader();   
@@ -88,6 +90,7 @@ AliESDVertex* AliITSVertexerFast::FindVertexForCurrentEvent(TTree *itsClusterTre
     vrtx[k] = gRandom->Gaus(vrttrue[k],fSmear[k]);
   }
   fCurrentVertex = new AliESDVertex(vrtx,fSmear,"Smeared Generated Vertex");
+  fCurrentVertex->SetTitle("vertexer: smearMC");
   return fCurrentVertex;
   
 }