]>
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 | **************************************************************************/ | |
4c475d27 | 15 | |
88cb7938 | 16 | /* $Id$ */ |
ef0750c2 | 17 | |
88cb7938 | 18 | #include <Riostream.h> |
19 | #include <stdlib.h> | |
94de3818 | 20 | |
88cb7938 | 21 | #include <TDirectory.h> |
22 | #include <TVirtualMC.h> | |
ef51244a | 23 | |
88cb7938 | 24 | #include "AliRun.h" |
25 | #include "AliSTART.h" | |
6740ab97 | 26 | #include "AliSTARTdigit.h" |
27 | #include "AliSTARThit.h" | |
88cb7938 | 28 | #include "AliSTARTvertex.h" |
f3ed336b | 29 | |
6740ab97 | 30 | ClassImp(AliSTARTvertex) |
31 | ||
32 | AliSTARTvertex::AliSTARTvertex( Int_t * Zposit) | |
33 | { | |
34 | // | |
6740ab97 | 35 | // The creator for the AliSTARTvertex class. This routine fills the |
36 | // AliSTARTvertex data members from the array vertex. | |
37 | // The order of the elements in the vertex array are | |
f3ed336b | 38 | // fZposition = vertex[0], |
6740ab97 | 39 | // |
40 | ||
41 | Zposit = &fZposition ; | |
42 | } | |
43 | ||
44 | void AliSTARTvertex::Reconstruct(Int_t evNumber=1) | |
45 | { | |
f3ed336b | 46 | /*************************************************** |
47 | Resonstruct digits to vertex position | |
48 | ****************************************************/ | |
49 | ||
6740ab97 | 50 | Int_t timediff; |
51 | Float_t timePs; | |
52 | char nameTD[8],nameTR[8]; | |
53 | ||
6740ab97 | 54 | AliSTARTdigit *digits; |
7115262b | 55 | AliSTARTvertex *fvertex; |
6740ab97 | 56 | |
6740ab97 | 57 | digits = new AliSTARTdigit(); |
7115262b | 58 | fvertex = new AliSTARTvertex(); |
6740ab97 | 59 | |
60 | // Event ------------------------- LOOP | |
61 | ||
e73d68f2 | 62 | // gAlice->GetEvent(evNumber); |
7115262b | 63 | |
64 | sprintf(nameTD,"START_D_%d",evNumber); | |
65 | TObject *td = (TObject*)gDirectory->Get(nameTD); | |
ef51244a | 66 | printf("%s\n",nameTD); |
7115262b | 67 | |
68 | if (!td) { | |
00907af4 | 69 | cerr<<"something wrong with output...."<<endl; |
70 | exit(111); | |
7115262b | 71 | } |
72 | td->Read(nameTD); | |
73 | digits->Read(nameTD); | |
e73d68f2 | 74 | if(digits->GetTimeDiff()<TMath::Abs(1000)) |
ef51244a | 75 | { |
e73d68f2 | 76 | timediff=digits->GetTimeDiff(); //time in number of channels |
77 | timePs=(512-timediff)*2.5; // time in Ps channel_width =10ps | |
78 | cout<<"timediff "<< timediff<<" timePs "<<timePs<<endl; | |
79 | // Float_t c = 299792458/1.e9; //speed of light cm/ps | |
80 | Float_t c = 0.3; //speed of light mm/ps | |
ef51244a | 81 | Float_t Zposit=timePs*c;// for 0 vertex |
7115262b | 82 | cout<<" Zposit "<<Zposit<<endl; |
83 | fvertex->Set((Int_t) Zposit); | |
6740ab97 | 84 | } |
7115262b | 85 | sprintf(nameTR,"START_R_%d",evNumber); |
86 | printf("%s\n",nameTR); | |
88cb7938 | 87 | fvertex->Write(nameTR); |
6740ab97 | 88 | } |
89 | ||
90 | ||
91 | ||
92 | ||
7115262b | 93 | |
94 |