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