]>
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 |
00a7cc50 | 18 | //SetUseV2Clusters(kTRUE); |
c5f0f3c1 | 19 | } |
20 | ||
88cb7938 | 21 | AliITSVertexer::AliITSVertexer(TString filename) { |
c5f0f3c1 | 22 | // Standard constructor |
88cb7938 | 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 | } | |
c5f0f3c1 | 30 | fCurrentVertex = 0; |
c5f0f3c1 | 31 | SetDebug(); |
32 | SetFirstEvent(0); | |
33 | SetLastEvent(0); | |
88cb7938 | 34 | rl->LoadHeader(); |
41b19549 | 35 | AliITSLoader* itsLoader = (AliITSLoader*) rl->GetLoader("ITSLoader"); |
979e3647 | 36 | if(!filename.Contains("default"))itsLoader->SetVerticesFileName(filename); |
2257f27e | 37 | if(!filename.Contains("null"))itsLoader->LoadVertices("recreate"); |
41b19549 | 38 | itsLoader->LoadRecPoints(); |
88cb7938 | 39 | Int_t lst; |
40 | if(rl->TreeE()){ | |
41 | lst = static_cast<Int_t>(rl->TreeE()->GetEntries()); | |
42 | SetLastEvent(lst-1); | |
c5f0f3c1 | 43 | } |
00a7cc50 | 44 | //SetUseV2Clusters(kTRUE); |
c5f0f3c1 | 45 | } |
46 | ||
41b19549 | 47 | //______________________________________________________________________ |
2257f27e | 48 | AliITSVertexer::AliITSVertexer(const AliITSVertexer &vtxr) : AliVertexer(vtxr) { |
41b19549 | 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 | ||
c5f0f3c1 | 62 | |
63 | //______________________________________________________________________ | |
64 | void AliITSVertexer::WriteCurrentVertex(){ | |
65 | // Write the current AliVertex object to file fOutFile | |
88cb7938 | 66 | AliRunLoader *rl = AliRunLoader::GetRunLoader(); |
41b19549 | 67 | AliITSLoader* itsLoader = (AliITSLoader*) rl->GetLoader("ITSLoader"); |
88cb7938 | 68 | fCurrentVertex->SetName("Vertex"); |
69 | // const char * name = fCurrentVertex->GetName(); | |
41b19549 | 70 | // itsLoader->SetVerticesContName(name); |
71 | Int_t rc = itsLoader->PostVertex(fCurrentVertex); | |
72 | rc = itsLoader->WriteVertices(); | |
c5f0f3c1 | 73 | } |