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