ROOT logo
/**************************************************************************
 * Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/
#include <Riostream.h>
#include "AliESDVertex.h"
#include "AliLog.h"
#include <TString.h>
#include "AliITSVertexerFixed.h"

/////////////////////////////////////////////////////////////////////////
//                                                                     //
// Fixed vertexer - creates a vertex in a defined postion (x,y,z)      //
// the standard contructor takes a sting to specify the case           //
// Useful for reconstruction of injection tests with beam on TDI       //
//                                                                     //
/////////////////////////////////////////////////////////////////////////

using std::endl;
using std::cout;
ClassImp(AliITSVertexerFixed)

/* $Id$ */

//______________________________________________________________________
AliITSVertexerFixed::AliITSVertexerFixed():AliITSVertexer()
{
  // Default Constructor
  AliWarning("This contructor sets the vertex in (0,0,0)");
  for(Int_t k=0; k<3;k++){ 
    fVtxPos[k]=0.;
    fVtxErr[k]=0.5;  
  }
}

//______________________________________________________________________
AliITSVertexerFixed::AliITSVertexerFixed(TString option):AliITSVertexer()
{
  // Standard constructor
  if(option.Contains("TDI")){
    fVtxPos[0]=0.;
    fVtxPos[1]=0.;
    fVtxPos[2]=8000.;  // TDI at z=80 m
    fVtxErr[0]=1.;
    fVtxErr[1]=1.;
    fVtxErr[2]=100.;   
   }
  else if(option.Contains("TED")){
    fVtxPos[0]=0.;
    fVtxPos[1]=0.;
    fVtxPos[2]=34000.;  // TED at z=+340 m
    fVtxErr[0]=1.;
    fVtxErr[1]=1.;
    fVtxErr[2]=100.;   
  }else{
    AliError(Form("%s is invalid, sets the vertex in (0,0,0)",option.Data()));
    for(Int_t k=0; k<3;k++){ 
      fVtxPos[k]=0.;
      fVtxErr[k]=0.5;  
    }
  }
}


//______________________________________________________________________
AliESDVertex* AliITSVertexerFixed::FindVertexForCurrentEvent(TTree * /*itsClusterTree */){
  // Defines the AliITSVertex for the current event
  
  fCurrentVertex = new AliESDVertex(fVtxPos,fVtxErr,"Fixed Vertex");
  return fCurrentVertex;
  
}

//________________________________________________________
void AliITSVertexerFixed::PrintStatus() const {
  // Print current status
  cout <<"=======================================================\n";

  cout<<"Fixed positions: ";
  for(Int_t k=0;k<3;k++)cout<<" "<<fVtxPos[k]<<"+-"<<fVtxErr[k];
  cout<<endl;
}

 AliITSVertexerFixed.cxx:1
 AliITSVertexerFixed.cxx:2
 AliITSVertexerFixed.cxx:3
 AliITSVertexerFixed.cxx:4
 AliITSVertexerFixed.cxx:5
 AliITSVertexerFixed.cxx:6
 AliITSVertexerFixed.cxx:7
 AliITSVertexerFixed.cxx:8
 AliITSVertexerFixed.cxx:9
 AliITSVertexerFixed.cxx:10
 AliITSVertexerFixed.cxx:11
 AliITSVertexerFixed.cxx:12
 AliITSVertexerFixed.cxx:13
 AliITSVertexerFixed.cxx:14
 AliITSVertexerFixed.cxx:15
 AliITSVertexerFixed.cxx:16
 AliITSVertexerFixed.cxx:17
 AliITSVertexerFixed.cxx:18
 AliITSVertexerFixed.cxx:19
 AliITSVertexerFixed.cxx:20
 AliITSVertexerFixed.cxx:21
 AliITSVertexerFixed.cxx:22
 AliITSVertexerFixed.cxx:23
 AliITSVertexerFixed.cxx:24
 AliITSVertexerFixed.cxx:25
 AliITSVertexerFixed.cxx:26
 AliITSVertexerFixed.cxx:27
 AliITSVertexerFixed.cxx:28
 AliITSVertexerFixed.cxx:29
 AliITSVertexerFixed.cxx:30
 AliITSVertexerFixed.cxx:31
 AliITSVertexerFixed.cxx:32
 AliITSVertexerFixed.cxx:33
 AliITSVertexerFixed.cxx:34
 AliITSVertexerFixed.cxx:35
 AliITSVertexerFixed.cxx:36
 AliITSVertexerFixed.cxx:37
 AliITSVertexerFixed.cxx:38
 AliITSVertexerFixed.cxx:39
 AliITSVertexerFixed.cxx:40
 AliITSVertexerFixed.cxx:41
 AliITSVertexerFixed.cxx:42
 AliITSVertexerFixed.cxx:43
 AliITSVertexerFixed.cxx:44
 AliITSVertexerFixed.cxx:45
 AliITSVertexerFixed.cxx:46
 AliITSVertexerFixed.cxx:47
 AliITSVertexerFixed.cxx:48
 AliITSVertexerFixed.cxx:49
 AliITSVertexerFixed.cxx:50
 AliITSVertexerFixed.cxx:51
 AliITSVertexerFixed.cxx:52
 AliITSVertexerFixed.cxx:53
 AliITSVertexerFixed.cxx:54
 AliITSVertexerFixed.cxx:55
 AliITSVertexerFixed.cxx:56
 AliITSVertexerFixed.cxx:57
 AliITSVertexerFixed.cxx:58
 AliITSVertexerFixed.cxx:59
 AliITSVertexerFixed.cxx:60
 AliITSVertexerFixed.cxx:61
 AliITSVertexerFixed.cxx:62
 AliITSVertexerFixed.cxx:63
 AliITSVertexerFixed.cxx:64
 AliITSVertexerFixed.cxx:65
 AliITSVertexerFixed.cxx:66
 AliITSVertexerFixed.cxx:67
 AliITSVertexerFixed.cxx:68
 AliITSVertexerFixed.cxx:69
 AliITSVertexerFixed.cxx:70
 AliITSVertexerFixed.cxx:71
 AliITSVertexerFixed.cxx:72
 AliITSVertexerFixed.cxx:73
 AliITSVertexerFixed.cxx:74
 AliITSVertexerFixed.cxx:75
 AliITSVertexerFixed.cxx:76
 AliITSVertexerFixed.cxx:77
 AliITSVertexerFixed.cxx:78
 AliITSVertexerFixed.cxx:79
 AliITSVertexerFixed.cxx:80
 AliITSVertexerFixed.cxx:81
 AliITSVertexerFixed.cxx:82
 AliITSVertexerFixed.cxx:83
 AliITSVertexerFixed.cxx:84
 AliITSVertexerFixed.cxx:85
 AliITSVertexerFixed.cxx:86
 AliITSVertexerFixed.cxx:87
 AliITSVertexerFixed.cxx:88
 AliITSVertexerFixed.cxx:89
 AliITSVertexerFixed.cxx:90
 AliITSVertexerFixed.cxx:91
 AliITSVertexerFixed.cxx:92
 AliITSVertexerFixed.cxx:93