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 **************************************************************************/
19 #include "AliSTARTvertex.h"
20 #include "AliSTARTdigit.h"
21 #include "AliSTARThit.h"
26 ClassImp(AliSTARTvertex)
28 AliSTARTvertex::AliSTARTvertex( Int_t * Zposit)
32 // The creator for the AliSTARTvertex class. This routine fills the
33 // AliSTARTvertex data members from the array vertex.
34 // The order of the elements in the vertex array are
35 // fEvent = digits[0], fZposition = vertex[1],
36 // fTime_diff = Vertex[2]
37 // Therefore the array digits is expected to be at least 3 elements long.
40 Zposit = &fZposition ;
43 void AliSTARTvertex::Reconstruct(Int_t evNumber=1)
48 char nameTD[8],nameTR[8];
52 AliSTARTdigit *digits;
53 AliSTARTvertex *vertex;
58 // TParticle *particle;
59 digits = new AliSTARTdigit();
60 vertex = new AliSTARTvertex();
61 // AliSTART *START = (AliSTART*) gAlice->GetDetector("START");
63 // Event ------------------------- LOOP
65 sprintf(nameTD,"TreeD%d",evNumber);
66 printf("%s\n",nameTD);
67 TTree *TD = (TTree*)gDirectory->Get(nameTD);
68 bd = TD->GetBranch("START");
69 bd->SetAddress(&digits);
71 printf(" Digits: "); digits->MyDump();
73 sprintf(nameTR,"TreeR%d",evNumber);
74 TTree *TR = new TTree(nameTR,"START");
75 bRec = TR->Branch("START","AliSTARTvertex",&vertex,buffersize,split);
77 // TD->Print(); TD->Show(0); TD->GetBranch("START")->Dump();
79 if(digits->fTime_average!=0)
81 timediff=digits->fTime_diff; //time in number of channels
82 timePs=(timediff-128)*10.; // time in Ps
83 printf(" timediff %d in PS %f\n",timediff,timePs);
84 Float_t c = 299792458/1.e9; //speed of light cm/ps
85 Float_t Zposit=timePs*c;
86 printf(" Z position %f\n",Zposit);
87 // vertex->GetVertex();
91 //hTimediff->Fill(timePs);
92 //hVertex->Fill(Zposit);