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