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