]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - START/AliSTARTvertex.cxx
EINCLUDE set to the value from libhijing.pkg
[u/mrichter/AliRoot.git] / START / AliSTARTvertex.cxx
... / ...
CommitLineData
1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15/*
16$Log$
17Revision 1.4 2000/12/22 16:17:15 hristov
18Updated START code from Alla
19
20Revision 1.3 2000/10/02 21:28:13 fca
21Removal of useless dependecies via forward declarations
22
23Revision 1.2 2000/07/13 16:41:29 fca
24New START corrected for coding conventions
25
26Revision 1.1 2000/03/24 17:46:58 alla
27Vertex reconstruction
28
29*/
30#include <TObject.h>
31#include "AliSTARTvertex.h"
32#include "AliSTARTdigit.h"
33#include "AliSTARThit.h"
34#include "AliSTART.h"
35#include "AliRun.h"
36#include "AliMC.h"
37
38//#include "TTree.h"
39#include "TDirectory.h"
40
41ClassImp(AliSTARTvertex)
42
43AliSTARTvertex::AliSTARTvertex( Int_t * Zposit)
44{
45 //
46 // The creator for the AliSTARTvertex class. This routine fills the
47 // AliSTARTvertex data members from the array vertex.
48 // The order of the elements in the vertex array are
49 // fZposition = vertex[0],
50 //
51
52 Zposit = &fZposition ;
53}
54
55void AliSTARTvertex::Reconstruct(Int_t evNumber=1)
56{
57 /***************************************************
58 Resonstruct digits to vertex position
59 ****************************************************/
60
61 Int_t timediff;
62 Float_t timePs;
63 char nameTD[8],nameTR[8];
64
65 TBranch *bRec=0;
66 TBranch *bd;
67 AliSTARTdigit *digits;
68 AliSTARTvertex *vertex;
69
70 Int_t buffersize=256;
71
72 // TParticle *particle;
73 digits = new AliSTARTdigit();
74 vertex = new AliSTARTvertex();
75
76 // Event ------------------------- LOOP
77
78 sprintf(nameTD,"TreeD%d",evNumber);
79 printf("%s\n",nameTD);
80 TTree *td = (TTree*)gDirectory->Get(nameTD);
81 bd = td->GetBranch("START");
82 bd->SetAddress(&digits);
83 bd->GetEvent(0);
84 sprintf(nameTR,"TreeR%d",evNumber);
85 TTree *tr = new TTree(nameTR,"START");
86 bRec = tr->Branch("START","AliSTARTvertex",&vertex,buffersize);
87 if(digits->GetTime()!=999999)
88 {
89 timediff=digits->GetTime(); //time in number of channels
90 timePs=(timediff-128)*10.; // time in Ps channel_width =10ps
91 Float_t c = 299792458/1.e9; //speed of light cm/ps
92 //Float_t c = 0.3; //speed of light mm/ps
93 Float_t Zposit=timePs*c;// for 0 vertex
94 vertex->Set(Zposit);
95 tr->Fill();
96 tr->Write();
97 }
98
99}
100
101
102
103