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