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 **************************************************************************/
18 #include <Riostream.h>
21 #include <TDirectory.h>
22 #include <TVirtualMC.h>
26 #include "AliSTARTdigit.h"
27 #include "AliSTARThit.h"
28 #include "AliSTARTvertex.h"
30 ClassImp(AliSTARTvertex)
32 AliSTARTvertex::AliSTARTvertex( Int_t * Zposit)
35 // The creator for the AliSTARTvertex class. This routine fills the
36 // AliSTARTvertex data members from the array vertex.
37 // The order of the elements in the vertex array are
38 // fZposition = vertex[0],
41 Zposit = &fZposition ;
44 void AliSTARTvertex::Reconstruct(Int_t evNumber=1)
46 /***************************************************
47 Resonstruct digits to vertex position
48 ****************************************************/
52 char nameTD[8],nameTR[8];
54 AliSTARTdigit *digits;
55 AliSTARTvertex *fvertex;
57 digits = new AliSTARTdigit();
58 fvertex = new AliSTARTvertex();
60 // Event ------------------------- LOOP
62 // gAlice->GetEvent(evNumber);
64 sprintf(nameTD,"START_D_%d",evNumber);
65 TObject *td = (TObject*)gDirectory->Get(nameTD);
66 printf("%s\n",nameTD);
69 cerr<<"something wrong with output...."<<endl;
74 if(digits->GetTimeDiff()<TMath::Abs(1000))
76 timediff=digits->GetTimeDiff(); //time in number of channels
77 timePs=(512-timediff)*2.5; // time in Ps channel_width =10ps
78 cout<<"timediff "<< timediff<<" timePs "<<timePs<<endl;
79 // Float_t c = 299792458/1.e9; //speed of light cm/ps
80 Float_t c = 0.3; //speed of light mm/ps
81 Float_t Zposit=timePs*c;// for 0 vertex
82 cout<<" Zposit "<<Zposit<<endl;
83 fvertex->Set((Int_t) Zposit);
85 sprintf(nameTR,"START_R_%d",evNumber);
86 printf("%s\n",nameTR);
87 fvertex->Write(nameTR);