]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSVertexer.cxx
New classes added
[u/mrichter/AliRoot.git] / ITS / AliITSVertexer.cxx
1 #include <AliITSVertex.h>
2 #include <AliITSVertexer.h>
3
4 ClassImp(AliITSVertexer)
5
6 //////////////////////////////////////////////////////////////////////
7 // Base class for primary vertex reconstruction                     //
8 // AliITSVertex is a class for full 3D primary vertex finding       //
9 //////////////////////////////////////////////////////////////////////
10
11 //______________________________________________________________________
12 AliITSVertexer::AliITSVertexer() {
13   // Default Constructor
14
15     fCurrentVertex  = 0;
16     fInFile         = 0;
17     fOutFile        = 0;
18     SetDebug();
19     SetFirstEvent(0);
20     SetLastEvent(0);
21 }
22
23 AliITSVertexer::AliITSVertexer(TFile *infile, TFile *outfile) {
24   // Standard constructor
25   fCurrentVertex  = 0;   
26   SetInputFile(infile);
27   SetOutputFile(outfile);
28   SetDebug();
29   SetFirstEvent(0);
30   SetLastEvent(0);
31   if(gAlice){
32     Int_t lst;
33     if(gAlice->TreeE()){
34       lst = static_cast<Int_t>(gAlice->TreeE()->GetEntries());
35       SetLastEvent(lst);
36     }
37   }
38 }
39
40 //______________________________________________________________________
41 AliITSVertexer::~AliITSVertexer() {
42   // Default Destructor
43   // The objects poited by the following pointers are not owned
44   // by this class and are not deleted
45
46     fCurrentVertex  = 0;
47     fInFile         = 0;
48     fOutFile        = 0;
49 }
50
51 //______________________________________________________________________
52 void AliITSVertexer::WriteCurrentVertex(){
53   // Write the current AliVertex object to file fOutFile
54   if(!fOutFile){
55     Error("WriteCurrentEvent","The output file is not defined");
56     return;
57   }
58   TDirectory *curdir = gDirectory;
59   fOutFile->cd();
60   fCurrentVertex->Write();
61   curdir->cd();
62   fCurrentVertex = 0;
63 }