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