]> git.uio.no Git - u/mrichter/AliRoot.git/blame - START/AliSTARTvertex.cxx
README updated (R.Barbera)
[u/mrichter/AliRoot.git] / START / AliSTARTvertex.cxx
CommitLineData
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$
f3ed336b 17Revision 1.3 2000/10/02 21:28:13 fca
18Removal of useless dependecies via forward declarations
19
94de3818 20Revision 1.2 2000/07/13 16:41:29 fca
21New START corrected for coding conventions
22
ef51244a 23Revision 1.1 2000/03/24 17:46:58 alla
24Vertex reconstruction
25
6740ab97 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
f3ed336b 35//#include "TTree.h"
36#include "TDirectory.h"
37
6740ab97 38ClassImp(AliSTARTvertex)
39
40AliSTARTvertex::AliSTARTvertex( Int_t * Zposit)
41{
42 //
6740ab97 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
f3ed336b 46 // fZposition = vertex[0],
6740ab97 47 //
48
49 Zposit = &fZposition ;
50}
51
52void AliSTARTvertex::Reconstruct(Int_t evNumber=1)
53{
f3ed336b 54 /***************************************************
55 Resonstruct digits to vertex position
56 ****************************************************/
57
6740ab97 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();
6740ab97 73
74 // Event ------------------------- LOOP
75
ef51244a 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);
ef51244a 82 sprintf(nameTR,"TreeR%d",evNumber);
83 TTree *tr = new TTree(nameTR,"START");
84 bRec = tr->Branch("START","AliSTARTvertex",&vertex,buffersize,split);
ef51244a 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
6740ab97 89 Float_t c = 299792458/1.e9; //speed of light cm/ps
ef51244a 90 //Float_t c = 0.3; //speed of light mm/ps
91 Float_t Zposit=timePs*c;// for 0 vertex
6740ab97 92 vertex->Set(Zposit);
ef51244a 93 tr->Fill();
94 tr->Write();
6740ab97 95 }
96
97}
98
99
100
101