]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSVertexer.cxx
Obsolete - removed
[u/mrichter/AliRoot.git] / ITS / AliITSVertexer.cxx
CommitLineData
c5f0f3c1 1#include <AliITSVertex.h>
2#include <AliITSVertexer.h>
88cb7938 3#include <AliRunLoader.h>
4#include <AliITSLoader.h>
c5f0f3c1 5
6ClassImp(AliITSVertexer)
7
8//////////////////////////////////////////////////////////////////////
9// Base class for primary vertex reconstruction //
10// AliITSVertex is a class for full 3D primary vertex finding //
41b19549 11// derived classes: AliITSVertexerIons AliITSvertexerPPZ //
12// AliITSVertexerTracks //
c5f0f3c1 13//////////////////////////////////////////////////////////////////////
14
15//______________________________________________________________________
16AliITSVertexer::AliITSVertexer() {
17 // Default Constructor
18
19 fCurrentVertex = 0;
c5f0f3c1 20 SetDebug();
21 SetFirstEvent(0);
22 SetLastEvent(0);
23}
24
88cb7938 25AliITSVertexer::AliITSVertexer(TString filename) {
c5f0f3c1 26 // Standard constructor
88cb7938 27 AliRunLoader *rl = AliRunLoader::GetRunLoader();
28 if(!rl){
29 Fatal("AliITSVertexer","Run Loader not found");
30 }
31 if(rl->LoadgAlice()){
32 Fatal("AliITSVertexer","The AliRun object is not available - nothing done");
33 }
c5f0f3c1 34 fCurrentVertex = 0;
c5f0f3c1 35 SetDebug();
36 SetFirstEvent(0);
37 SetLastEvent(0);
88cb7938 38 rl->LoadHeader();
41b19549 39 AliITSLoader* itsLoader = (AliITSLoader*) rl->GetLoader("ITSLoader");
40 if(filename.Data()!="default")itsLoader->SetVerticesFileName(filename);
41 itsLoader->LoadVertices("recreate");
42 itsLoader->LoadRecPoints();
88cb7938 43 Int_t lst;
44 if(rl->TreeE()){
45 lst = static_cast<Int_t>(rl->TreeE()->GetEntries());
46 SetLastEvent(lst-1);
c5f0f3c1 47 }
48}
49
41b19549 50//______________________________________________________________________
51AliITSVertexer::AliITSVertexer(const AliITSVertexer &vtxr) : TObject(vtxr) {
52 // Copy constructor
53 // Copies are not allowed. The method is protected to avoid misuse.
54 Error("AliITSVertexer","Copy constructor not allowed\n");
55}
56
57//______________________________________________________________________
58AliITSVertexer& AliITSVertexer::operator=(const AliITSVertexer& /* vtxr */){
59 // Assignment operator
60 // Assignment is not allowed. The method is protected to avoid misuse.
61 Error("= operator","Assignment operator not allowed\n");
62 return *this;
63}
64
c5f0f3c1 65//______________________________________________________________________
66AliITSVertexer::~AliITSVertexer() {
67 // Default Destructor
41b19549 68 // The objects pointed by the following pointers are not owned
c5f0f3c1 69 // by this class and are not deleted
70
71 fCurrentVertex = 0;
c5f0f3c1 72}
73
74//______________________________________________________________________
75void AliITSVertexer::WriteCurrentVertex(){
76 // Write the current AliVertex object to file fOutFile
88cb7938 77 AliRunLoader *rl = AliRunLoader::GetRunLoader();
41b19549 78 AliITSLoader* itsLoader = (AliITSLoader*) rl->GetLoader("ITSLoader");
88cb7938 79 fCurrentVertex->SetName("Vertex");
80 // const char * name = fCurrentVertex->GetName();
41b19549 81 // itsLoader->SetVerticesContName(name);
82 Int_t rc = itsLoader->PostVertex(fCurrentVertex);
83 rc = itsLoader->WriteVertices();
c5f0f3c1 84}