]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSVertexer.cxx
Removing useless const to avoid warnings on alphacxx6
[u/mrichter/AliRoot.git] / ITS / AliITSVertexer.cxx
CommitLineData
d681bb2d 1#include <AliESDVertex.h>
c5f0f3c1 2#include <AliITSVertexer.h>
88cb7938 3#include <AliRunLoader.h>
4#include <AliITSLoader.h>
2257f27e 5#include <AliITSRecPoint.h>
6#include <AliITSclusterV2.h>
c5f0f3c1 7
8ClassImp(AliITSVertexer)
9
10//////////////////////////////////////////////////////////////////////
11// Base class for primary vertex reconstruction //
d681bb2d 12// AliESDVertexer is a class for full 3D primary vertex finding //
41b19549 13// derived classes: AliITSVertexerIons AliITSvertexerPPZ //
14// AliITSVertexerTracks //
c5f0f3c1 15//////////////////////////////////////////////////////////////////////
16
17//______________________________________________________________________
2257f27e 18AliITSVertexer::AliITSVertexer():AliVertexer() {
c5f0f3c1 19 // Default Constructor
2257f27e 20 SetUseV2Clusters(kTRUE);
c5f0f3c1 21}
22
88cb7938 23AliITSVertexer::AliITSVertexer(TString filename) {
c5f0f3c1 24 // Standard constructor
88cb7938 25 AliRunLoader *rl = AliRunLoader::GetRunLoader();
26 if(!rl){
27 Fatal("AliITSVertexer","Run Loader not found");
28 }
29 if(rl->LoadgAlice()){
30 Fatal("AliITSVertexer","The AliRun object is not available - nothing done");
31 }
c5f0f3c1 32 fCurrentVertex = 0;
c5f0f3c1 33 SetDebug();
34 SetFirstEvent(0);
35 SetLastEvent(0);
88cb7938 36 rl->LoadHeader();
41b19549 37 AliITSLoader* itsLoader = (AliITSLoader*) rl->GetLoader("ITSLoader");
979e3647 38 if(!filename.Contains("default"))itsLoader->SetVerticesFileName(filename);
2257f27e 39 if(!filename.Contains("null"))itsLoader->LoadVertices("recreate");
41b19549 40 itsLoader->LoadRecPoints();
88cb7938 41 Int_t lst;
42 if(rl->TreeE()){
43 lst = static_cast<Int_t>(rl->TreeE()->GetEntries());
44 SetLastEvent(lst-1);
c5f0f3c1 45 }
2257f27e 46 SetUseV2Clusters(kTRUE);
c5f0f3c1 47}
48
41b19549 49//______________________________________________________________________
2257f27e 50AliITSVertexer::AliITSVertexer(const AliITSVertexer &vtxr) : AliVertexer(vtxr) {
41b19549 51 // Copy constructor
52 // Copies are not allowed. The method is protected to avoid misuse.
53 Error("AliITSVertexer","Copy constructor not allowed\n");
54}
55
56//______________________________________________________________________
57AliITSVertexer& AliITSVertexer::operator=(const AliITSVertexer& /* vtxr */){
58 // Assignment operator
59 // Assignment is not allowed. The method is protected to avoid misuse.
60 Error("= operator","Assignment operator not allowed\n");
61 return *this;
62}
63
c5f0f3c1 64
65//______________________________________________________________________
66void AliITSVertexer::WriteCurrentVertex(){
67 // Write the current AliVertex object to file fOutFile
88cb7938 68 AliRunLoader *rl = AliRunLoader::GetRunLoader();
41b19549 69 AliITSLoader* itsLoader = (AliITSLoader*) rl->GetLoader("ITSLoader");
88cb7938 70 fCurrentVertex->SetName("Vertex");
71 // const char * name = fCurrentVertex->GetName();
41b19549 72 // itsLoader->SetVerticesContName(name);
73 Int_t rc = itsLoader->PostVertex(fCurrentVertex);
74 rc = itsLoader->WriteVertices();
c5f0f3c1 75}
2257f27e 76
77//______________________________________________________________________
78void AliITSVertexer::Clusters2RecPoints
79(const TClonesArray *clusters, Int_t idx, TClonesArray *points) {
80 //------------------------------------------------------------
81 // Conversion AliITSclusterV2 -> AliITSRecPoints for the ITS
82 // module "idx" (entry in the tree with the clusters).
83 // Simplified version, supposed to work with the pixels only !
84 //------------------------------------------------------------
85 const Int_t lastSPD1=79; //let's hope the number of the SPDs will not change
86 const Int_t lastSPD2=239;//let's hope the number of the SPDs will not change
87
88 Float_t yshift = 0; //see AliITSclustererV2.cxx about these shifts
89 Float_t zshift[4] = {-10.708000, -3.536000, 3.536000, 10.708000}; //let's hope the positioning of the SPDs will not change
90
91 if (idx<=lastSPD1) {
92 yshift=0.248499; //let's hope the positioning of the SPDs will not change
93 } else if (idx<=lastSPD2) {
94 yshift=3.096207; //let's hope the positioning of the SPDs will not change
95 } else {
96 Fatal("Clusters2RecPoints","This is not an SPD module ! %d",idx);
97 }
98
99 TClonesArray &pn=*points;
100 Int_t ncl=clusters->GetEntriesFast();
101 for (Int_t i=0; i<ncl; i++) {
102 AliITSRecPoint p;
103 AliITSclusterV2 *c = (AliITSclusterV2 *)clusters->UncheckedAt(i);
104
105 Float_t x=c->GetY(); if (idx<=lastSPD1) x=-x;
106 x+=yshift;
107
108 Float_t z=c->GetZ();
109 z=-z; z+=zshift[idx%4];
110
111 p.SetX(x);
112 p.SetZ(z);
113 p.SetQ(c->GetQ());
114 p.SetSigmaX2(c->GetSigmaY2());
115 p.SetSigmaZ2(c->GetSigmaZ2());
116 p.SetLabel(0,c->GetLabel(0));
117 p.SetLabel(1,c->GetLabel(1));
118 p.SetLabel(2,c->GetLabel(2));
119
120 new (pn[i]) AliITSRecPoint(p);
121 }
122
123}