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