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