]> git.uio.no Git - u/mrichter/AliRoot.git/blame - START/AliSTARTvertex.cxx
User stepping methods added (E. Futo)
[u/mrichter/AliRoot.git] / START / AliSTARTvertex.cxx
CommitLineData
6740ab97 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$
4c475d27 17Revision 1.11 2002/10/22 15:40:19 alibrary
18Introducing Riostream.h
19
ef0750c2 20Revision 1.10 2002/10/14 14:57:32 hristov
21Merging the VirtualMC branch to the main development branch (HEAD)
22
b9d0a01d 23Revision 1.6.6.2 2002/07/24 09:50:10 alibrary
24Updating VirtualMC
25
26Revision 1.9 2002/07/23 11:48:05 alla
27new Digits structure
28
e73d68f2 29Revision 1.8 2002/04/16 10:52:41 hristov
30Wrong usage of exit() corrected (Sun)
31
00907af4 32Revision 1.7 2002/04/15 08:04:01 alla
33Digits and reconstruction with TObject
34
7115262b 35Revision 1.6 2001/10/19 05:29:38 alla
36bug in meduim fixed
37
4fdc4526 38Revision 1.5 2001/07/27 13:03:12 hristov
39Default Branch split level set to 99
40
d0f40f23 41Revision 1.4 2000/12/22 16:17:15 hristov
42Updated START code from Alla
43
f3ed336b 44Revision 1.3 2000/10/02 21:28:13 fca
45Removal of useless dependecies via forward declarations
46
94de3818 47Revision 1.2 2000/07/13 16:41:29 fca
48New START corrected for coding conventions
49
ef51244a 50Revision 1.1 2000/03/24 17:46:58 alla
51Vertex reconstruction
52
6740ab97 53*/
7115262b 54#include "TObject.h"
6740ab97 55#include "AliSTARTvertex.h"
56#include "AliSTARTdigit.h"
57#include "AliSTARThit.h"
58#include "AliSTART.h"
59#include "AliRun.h"
6740ab97 60
f3ed336b 61//#include "TTree.h"
62#include "TDirectory.h"
7115262b 63#include <stdlib.h>
ef0750c2 64#include <Riostream.h>
65#include <Riostream.h>
f3ed336b 66
6740ab97 67ClassImp(AliSTARTvertex)
68
69AliSTARTvertex::AliSTARTvertex( Int_t * Zposit)
70{
71 //
6740ab97 72 // The creator for the AliSTARTvertex class. This routine fills the
73 // AliSTARTvertex data members from the array vertex.
74 // The order of the elements in the vertex array are
f3ed336b 75 // fZposition = vertex[0],
6740ab97 76 //
77
78 Zposit = &fZposition ;
79}
80
81void AliSTARTvertex::Reconstruct(Int_t evNumber=1)
82{
f3ed336b 83 /***************************************************
84 Resonstruct digits to vertex position
85 ****************************************************/
86
6740ab97 87 Int_t timediff;
88 Float_t timePs;
89 char nameTD[8],nameTR[8];
90
6740ab97 91 AliSTARTdigit *digits;
7115262b 92 AliSTARTvertex *fvertex;
6740ab97 93
6740ab97 94 digits = new AliSTARTdigit();
7115262b 95 fvertex = new AliSTARTvertex();
6740ab97 96
97 // Event ------------------------- LOOP
98
e73d68f2 99 // gAlice->GetEvent(evNumber);
7115262b 100
101 sprintf(nameTD,"START_D_%d",evNumber);
102 TObject *td = (TObject*)gDirectory->Get(nameTD);
ef51244a 103 printf("%s\n",nameTD);
7115262b 104
105 if (!td) {
00907af4 106 cerr<<"something wrong with output...."<<endl;
107 exit(111);
7115262b 108 }
109 td->Read(nameTD);
110 digits->Read(nameTD);
e73d68f2 111 if(digits->GetTimeDiff()<TMath::Abs(1000))
ef51244a 112 {
e73d68f2 113 timediff=digits->GetTimeDiff(); //time in number of channels
114 timePs=(512-timediff)*2.5; // time in Ps channel_width =10ps
115 cout<<"timediff "<< timediff<<" timePs "<<timePs<<endl;
116 // Float_t c = 299792458/1.e9; //speed of light cm/ps
117 Float_t c = 0.3; //speed of light mm/ps
ef51244a 118 Float_t Zposit=timePs*c;// for 0 vertex
7115262b 119 cout<<" Zposit "<<Zposit<<endl;
120 fvertex->Set((Int_t) Zposit);
6740ab97 121 }
e73d68f2 122 /*
123 TTree *outTreeR = gAlice->TreeR();
7115262b 124 if (!outTreeR) {
00907af4 125 cerr<<"something wrong with output...."<<endl;
126 exit(111);
7115262b 127 }
e73d68f2 128 */
7115262b 129 sprintf(nameTR,"START_R_%d",evNumber);
130 printf("%s\n",nameTR);
e73d68f2 131 // TDirectory *wd = gDirectory;
132 // outTreeR->GetDirectory()->cd();
7115262b 133 fvertex->Write(nameTR);
e73d68f2 134 // wd->cd();
6740ab97 135}
136
137
138
139
7115262b 140
141