]> git.uio.no Git - u/mrichter/AliRoot.git/blame - START/AliSTARTvertex.cxx
Introducing Riostream.h
[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$
b9d0a01d 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
e73d68f2 23Revision 1.8 2002/04/16 10:52:41 hristov
24Wrong usage of exit() corrected (Sun)
25
00907af4 26Revision 1.7 2002/04/15 08:04:01 alla
27Digits and reconstruction with TObject
28
7115262b 29Revision 1.6 2001/10/19 05:29:38 alla
30bug in meduim fixed
31
4fdc4526 32Revision 1.5 2001/07/27 13:03:12 hristov
33Default Branch split level set to 99
34
d0f40f23 35Revision 1.4 2000/12/22 16:17:15 hristov
36Updated START code from Alla
37
f3ed336b 38Revision 1.3 2000/10/02 21:28:13 fca
39Removal of useless dependecies via forward declarations
40
94de3818 41Revision 1.2 2000/07/13 16:41:29 fca
42New START corrected for coding conventions
43
ef51244a 44Revision 1.1 2000/03/24 17:46:58 alla
45Vertex reconstruction
46
6740ab97 47*/
7115262b 48#include "TObject.h"
6740ab97 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
f3ed336b 56//#include "TTree.h"
57#include "TDirectory.h"
7115262b 58#include <stdlib.h>
59#include <iostream.h>
60#include <fstream.h>
f3ed336b 61
6740ab97 62ClassImp(AliSTARTvertex)
63
64AliSTARTvertex::AliSTARTvertex( Int_t * Zposit)
65{
66 //
6740ab97 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
f3ed336b 70 // fZposition = vertex[0],
6740ab97 71 //
72
73 Zposit = &fZposition ;
74}
75
76void AliSTARTvertex::Reconstruct(Int_t evNumber=1)
77{
f3ed336b 78 /***************************************************
79 Resonstruct digits to vertex position
80 ****************************************************/
81
6740ab97 82 Int_t timediff;
83 Float_t timePs;
84 char nameTD[8],nameTR[8];
85
6740ab97 86 AliSTARTdigit *digits;
7115262b 87 AliSTARTvertex *fvertex;
6740ab97 88
6740ab97 89 digits = new AliSTARTdigit();
7115262b 90 fvertex = new AliSTARTvertex();
6740ab97 91
92 // Event ------------------------- LOOP
93
e73d68f2 94 // gAlice->GetEvent(evNumber);
7115262b 95
96 sprintf(nameTD,"START_D_%d",evNumber);
97 TObject *td = (TObject*)gDirectory->Get(nameTD);
ef51244a 98 printf("%s\n",nameTD);
7115262b 99
100 if (!td) {
00907af4 101 cerr<<"something wrong with output...."<<endl;
102 exit(111);
7115262b 103 }
104 td->Read(nameTD);
105 digits->Read(nameTD);
e73d68f2 106 if(digits->GetTimeDiff()<TMath::Abs(1000))
ef51244a 107 {
e73d68f2 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
ef51244a 113 Float_t Zposit=timePs*c;// for 0 vertex
7115262b 114 cout<<" Zposit "<<Zposit<<endl;
115 fvertex->Set((Int_t) Zposit);
6740ab97 116 }
e73d68f2 117 /*
118 TTree *outTreeR = gAlice->TreeR();
7115262b 119 if (!outTreeR) {
00907af4 120 cerr<<"something wrong with output...."<<endl;
121 exit(111);
7115262b 122 }
e73d68f2 123 */
7115262b 124 sprintf(nameTR,"START_R_%d",evNumber);
125 printf("%s\n",nameTR);
e73d68f2 126 // TDirectory *wd = gDirectory;
127 // outTreeR->GetDirectory()->cd();
7115262b 128 fvertex->Write(nameTR);
e73d68f2 129 // wd->cd();
6740ab97 130}
131
132
133
134
7115262b 135
136