1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 Revision 1.6 2001/10/19 05:29:38 alla
20 Revision 1.5 2001/07/27 13:03:12 hristov
21 Default Branch split level set to 99
23 Revision 1.4 2000/12/22 16:17:15 hristov
24 Updated START code from Alla
26 Revision 1.3 2000/10/02 21:28:13 fca
27 Removal of useless dependecies via forward declarations
29 Revision 1.2 2000/07/13 16:41:29 fca
30 New START corrected for coding conventions
32 Revision 1.1 2000/03/24 17:46:58 alla
37 #include "AliSTARTvertex.h"
38 #include "AliSTARTdigit.h"
39 #include "AliSTARThit.h"
45 #include "TDirectory.h"
50 ClassImp(AliSTARTvertex)
52 AliSTARTvertex::AliSTARTvertex( Int_t * Zposit)
55 // The creator for the AliSTARTvertex class. This routine fills the
56 // AliSTARTvertex data members from the array vertex.
57 // The order of the elements in the vertex array are
58 // fZposition = vertex[0],
61 Zposit = &fZposition ;
64 void AliSTARTvertex::Reconstruct(Int_t evNumber=1)
66 /***************************************************
67 Resonstruct digits to vertex position
68 ****************************************************/
72 char nameTD[8],nameTR[8];
74 AliSTARTdigit *digits;
75 AliSTARTvertex *fvertex;
77 digits = new AliSTARTdigit();
78 fvertex = new AliSTARTvertex();
80 // Event ------------------------- LOOP
82 gAlice->GetEvent(evNumber);
84 sprintf(nameTD,"START_D_%d",evNumber);
85 TObject *td = (TObject*)gDirectory->Get(nameTD);
86 printf("%s\n",nameTD);
89 cerr<<"something wrong with output...."<<exit;
95 if(digits->GetTime()!=999999)
97 timediff=digits->GetTime(); //time in number of channels
98 timePs=(timediff-128)*10.; // time in Ps channel_width =10ps
99 Float_t c = 299792458/1.e9; //speed of light cm/ps
100 //Float_t c = 0.3; //speed of light mm/ps
101 Float_t Zposit=timePs*c;// for 0 vertex
102 cout<<" Zposit "<<Zposit<<endl;
103 fvertex->Set((Int_t) Zposit);
105 TTree *outTree = gAlice->TreeR();
107 cerr<<"something wrong with output...."<<exit;
110 TTree *outTreeR = gAlice->TreeR();
112 cerr<<"something wrong with output...."<<exit;
115 sprintf(nameTR,"START_R_%d",evNumber);
116 printf("%s\n",nameTR);
117 TDirectory *wd = gDirectory;
118 outTreeR->GetDirectory()->cd();
119 fvertex->Write(nameTR);