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 **************************************************************************/
18 #include <Riostream.h>
20 #include <TDirectory.h>
22 #include <AliRunLoader.h>
23 #include "AliSTARTLoader.h"
24 #include "AliSTARTdigit.h"
25 #include "AliSTARTReconstructor.h"
28 ClassImp(AliSTARTReconstructor)
30 void AliSTARTReconstructor::Reconstruct(AliRunLoader* /*rl*/) const
36 void AliSTARTReconstructor::FillESD(AliRunLoader* rl, AliESD *pESD) const
38 /***************************************************
39 Resonstruct digits to vertex position
40 ****************************************************/
46 Error("Reconstruct", "No run loader");
50 if (rl->GetDebug()>1) Info("Reconstruct","START!!!");
52 AliSTARTLoader* pStartLoader = (AliSTARTLoader*) rl->GetLoader("STARTLoader");
54 pStartLoader->LoadDigits();
55 AliSTARTdigit* pDigits=pStartLoader->Digits();
57 Error("Reconstruct", "no digits found");
61 if (rl->GetDebug()>1) pDigits->Dump();
63 if(pDigits->GetTimeDiff()<TMath::Abs(1000)) {
64 timediff=pDigits->GetTimeDiff(); //time in number of channels
65 timePs=(512-timediff)*2.5; // time in Ps channel_width =10ps
66 // Float_t c = 299792458/1.e9; //speed of light cm/ps
67 Float_t c = 0.3; //speed of light mm/ps
68 Float_t Zposit=timePs*c;// for 0 vertex
70 if (rl->GetDebug()>1) {
71 cout << "timediff " << timediff
72 <<" timePs " << timePs
73 <<" Zposit "<<Zposit<<endl;
76 pESD->SetT0zVertex(Zposit);
78 if (rl->GetDebug()>1) {
79 cout<<" vertex in ESD "<< pESD->GetT0zVertex()<<endl;
82 } // vertex in 3 sigma
83 pStartLoader->UnloadDigits();