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"
24 #include "AliSTARTLoader.h"
25 #include "AliSTARTdigit.h"
26 #include "AliSTARTReconstructor.h"
29 ClassImp(AliSTARTReconstructor)
31 void AliSTARTReconstructor::Reconstruct(AliRunLoader* /*runLoader*/) const
36 void AliSTARTReconstructor::FillESD(AliRunLoader* rl, AliESD *pESD) const
38 /***************************************************
39 Resonstruct digits to vertex position
40 ****************************************************/
42 Float_t c = 0.3; //speed of light mm/ps
43 Int_t channelWigth=25; //ps
45 Error("Reconstruct", "No run loader");
49 if (rl->GetDebug()>1) Info("Reconstruct","START!!!");
51 AliSTARTLoader* pStartLoader = (AliSTARTLoader*) rl->GetLoader("STARTLoader");
53 pStartLoader->LoadDigits();
54 AliSTARTdigit* pDigits=pStartLoader->Digits();
56 Error("Reconstruct", "no digits found");
60 if (rl->GetDebug()>1) pDigits->Dump();
62 Int_t besttimeright = pDigits->GetBestTimeRight();
63 Int_t besttimeleft = pDigits->GetBestTimeLeft();
64 Float_t besttimerightPs = Float_t (besttimeright*channelWigth);
65 Float_t besttimeleftPs = Float_t (besttimeleft*channelWigth);
66 Float_t Zposit=(c*(besttimerightPs-besttimeleftPs)-(3500.-697))/2;
69 pESD->SetT0zVertex(Zposit);
71 if (rl->GetDebug()>1) {
72 cout<<" vertex in ESD "<< pESD->GetT0zVertex()<<endl;
75 } // vertex in 3 sigma
76 pStartLoader->UnloadDigits();