]>
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$ | |
4fdc4526 | 17 | Revision 1.5 2001/07/27 13:03:12 hristov |
18 | Default Branch split level set to 99 | |
19 | ||
d0f40f23 | 20 | Revision 1.4 2000/12/22 16:17:15 hristov |
21 | Updated START code from Alla | |
22 | ||
f3ed336b | 23 | Revision 1.3 2000/10/02 21:28:13 fca |
24 | Removal of useless dependecies via forward declarations | |
25 | ||
94de3818 | 26 | Revision 1.2 2000/07/13 16:41:29 fca |
27 | New START corrected for coding conventions | |
28 | ||
ef51244a | 29 | Revision 1.1 2000/03/24 17:46:58 alla |
30 | Vertex reconstruction | |
31 | ||
6740ab97 | 32 | */ |
33 | #include <TObject.h> | |
34 | #include "AliSTARTvertex.h" | |
35 | #include "AliSTARTdigit.h" | |
36 | #include "AliSTARThit.h" | |
37 | #include "AliSTART.h" | |
38 | #include "AliRun.h" | |
39 | #include "AliMC.h" | |
40 | ||
f3ed336b | 41 | //#include "TTree.h" |
42 | #include "TDirectory.h" | |
43 | ||
6740ab97 | 44 | ClassImp(AliSTARTvertex) |
45 | ||
46 | AliSTARTvertex::AliSTARTvertex( Int_t * Zposit) | |
47 | { | |
48 | // | |
6740ab97 | 49 | // The creator for the AliSTARTvertex class. This routine fills the |
50 | // AliSTARTvertex data members from the array vertex. | |
51 | // The order of the elements in the vertex array are | |
f3ed336b | 52 | // fZposition = vertex[0], |
6740ab97 | 53 | // |
54 | ||
55 | Zposit = &fZposition ; | |
56 | } | |
57 | ||
58 | void AliSTARTvertex::Reconstruct(Int_t evNumber=1) | |
59 | { | |
f3ed336b | 60 | /*************************************************** |
61 | Resonstruct digits to vertex position | |
62 | ****************************************************/ | |
63 | ||
6740ab97 | 64 | Int_t timediff; |
65 | Float_t timePs; | |
66 | char nameTD[8],nameTR[8]; | |
67 | ||
68 | TBranch *bRec=0; | |
69 | TBranch *bd; | |
70 | AliSTARTdigit *digits; | |
71 | AliSTARTvertex *vertex; | |
72 | ||
73 | Int_t buffersize=256; | |
6740ab97 | 74 | |
75 | // TParticle *particle; | |
76 | digits = new AliSTARTdigit(); | |
77 | vertex = new AliSTARTvertex(); | |
6740ab97 | 78 | |
79 | // Event ------------------------- LOOP | |
80 | ||
ef51244a | 81 | sprintf(nameTD,"TreeD%d",evNumber); |
82 | printf("%s\n",nameTD); | |
83 | TTree *td = (TTree*)gDirectory->Get(nameTD); | |
84 | bd = td->GetBranch("START"); | |
85 | bd->SetAddress(&digits); | |
86 | bd->GetEvent(0); | |
ef51244a | 87 | sprintf(nameTR,"TreeR%d",evNumber); |
88 | TTree *tr = new TTree(nameTR,"START"); | |
d0f40f23 | 89 | bRec = tr->Branch("START","AliSTARTvertex",&vertex,buffersize); |
ef51244a | 90 | if(digits->GetTime()!=999999) |
91 | { | |
92 | timediff=digits->GetTime(); //time in number of channels | |
93 | timePs=(timediff-128)*10.; // time in Ps channel_width =10ps | |
6740ab97 | 94 | Float_t c = 299792458/1.e9; //speed of light cm/ps |
ef51244a | 95 | //Float_t c = 0.3; //speed of light mm/ps |
96 | Float_t Zposit=timePs*c;// for 0 vertex | |
4fdc4526 | 97 | vertex->Set((Int_t) Zposit); |
ef51244a | 98 | tr->Fill(); |
99 | tr->Write(); | |
6740ab97 | 100 | } |
101 | ||
102 | } | |
103 | ||
104 | ||
105 | ||
106 |