1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 Revision 1.2 2000/07/13 16:41:29 fca
18 New START corrected for coding conventions
20 Revision 1.1 2000/03/24 17:46:58 alla
25 #include <TDirectory.h>
27 #include "AliSTARTvertex.h"
28 #include "AliSTARTdigit.h"
29 #include "AliSTARThit.h"
34 ClassImp(AliSTARTvertex)
36 AliSTARTvertex::AliSTARTvertex( Int_t * Zposit)
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.
47 Zposit = &fZposition ;
50 void AliSTARTvertex::Reconstruct(Int_t evNumber=1)
55 char nameTD[8],nameTR[8];
59 AliSTARTdigit *digits;
60 AliSTARTvertex *vertex;
65 // TParticle *particle;
66 digits = new AliSTARTdigit();
67 vertex = new AliSTARTvertex();
69 // Event ------------------------- LOOP
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);
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);
82 // td->Print(); td->Show(0); td->GetBranch("START")->Dump();
84 printf("digits-> %d \n",digits->GetTime());
86 if(digits->GetTime()!=999999)
88 timediff=digits->GetTime(); //time in number of channels
89 timePs=(timediff-128)*10.; // time in Ps channel_width =10ps
90 printf(" timediff %d in PS %f\n",timediff,timePs);
91 Float_t c = 299792458/1.e9; //speed of light cm/ps
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);
96 // vertex->GetVertex();
100 //hTimediff->Fill(timePs);
101 //hVertex->Fill(Zposit);