1 #include <AliESDVertex.h>
2 #include <AliITSVertexer.h>
3 #include <AliRunLoader.h>
4 #include <AliITSLoader.h>
6 ClassImp(AliITSVertexer)
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 //////////////////////////////////////////////////////////////////////
15 //______________________________________________________________________
16 AliITSVertexer::AliITSVertexer():AliVertexer() {
17 // Default Constructor
18 //SetUseV2Clusters(kTRUE);
21 AliITSVertexer::AliITSVertexer(TString filename) {
22 // Standard constructor
23 AliRunLoader *rl = AliRunLoader::GetRunLoader();
25 Fatal("AliITSVertexer","Run Loader not found");
28 Fatal("AliITSVertexer","The AliRun object is not available - nothing done");
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();
41 lst = static_cast<Int_t>(rl->TreeE()->GetEntries());
44 //SetUseV2Clusters(kTRUE);
47 //______________________________________________________________________
48 AliITSVertexer::AliITSVertexer(const AliITSVertexer &vtxr) : AliVertexer(vtxr) {
50 // Copies are not allowed. The method is protected to avoid misuse.
51 Error("AliITSVertexer","Copy constructor not allowed\n");
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");
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();
75 //______________________________________________________________________
76 void AliITSVertexer::Clusters2RecPoints
77 (const TClonesArray *clusters, Int_t idx, TClonesArray *points) {
78 //------------------------------------------------------------
79 // Conversion AliITSRecPoint -> AliITSRecPoints for the ITS
80 // module "idx" (entry in the tree with the clusters).
81 // Simplified version, supposed to work with the pixels only !
82 //------------------------------------------------------------
83 const Int_t klastSPD1=79; //let's hope the number of the SPDs will not change
84 const Int_t klastSPD2=239;//let's hope the number of the SPDs will not change
86 Float_t yshift = 0; //see AliITSclustererV2.cxx about these shifts
87 Float_t zshift[4] = {-10.708000, -3.536000, 3.536000, 10.708000}; //let's hope the positioning of the SPDs will not change
90 yshift=0.248499; //let's hope the positioning of the SPDs will not change
91 } else if (idx<=klastSPD2) {
92 yshift=3.096207; //let's hope the positioning of the SPDs will not change
94 Fatal("Clusters2RecPoints","This is not an SPD module ! %d",idx);
97 TClonesArray &pn=*points;
98 Int_t ncl=clusters->GetEntriesFast();
99 for (Int_t i=0; i<ncl; i++) {
101 AliITSRecPoint *c = (AliITSRecPoint *)clusters->UncheckedAt(i);
103 Float_t x=c->GetY(); if (idx<=klastSPD1) x=-x;
107 z=-z; z+=zshift[idx%4];
112 p.SetSigmaDetLocX2(c->GetSigmaY2());
113 p.SetSigmaZ2(c->GetSigmaZ2());
114 p.SetLabel(c->GetLabel(0),0);
115 p.SetLabel(c->GetLabel(1),1);
116 p.SetLabel(c->GetLabel(2),2);
118 new (pn[i]) AliITSRecPoint(p);