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 "/home/alla/AliRoot/verynew/RAW/AliRawReader.h"
25 #include "AliSTARTLoader.h"
26 #include "AliSTARTdigit.h"
27 #include "AliSTARTReconstructor.h"
29 #include "AliSTARTRecPoint.h"
31 ClassImp(AliSTARTReconstructor)
33 void AliSTARTReconstructor::Reconstruct(/*AliRunLoader* runLoader*/)
38 void AliSTARTReconstructor::FillESD(AliRunLoader* rl, AliESD *pESD) const
40 /***************************************************
41 Resonstruct digits to vertex position
42 ****************************************************/
44 Float_t c = 0.3; //speed of light mm/ps
45 Int_t channelWigth=25; //ps
47 Error("Reconstruct", "No run loader");
51 if (rl->GetDebug()>1) Info("Reconstruct","START!!!");
53 AliSTARTLoader* pStartLoader = (AliSTARTLoader*) rl->GetLoader("STARTLoader");
55 pStartLoader->LoadDigits();
56 AliSTARTdigit* pDigits=pStartLoader->Digits();
58 Error("Reconstruct", "no digits found");
62 if (rl->GetDebug()>1) pDigits->Dump();
64 Int_t besttimeright = pDigits->GetBestTimeRight();
65 Int_t besttimeleft = pDigits->GetBestTimeLeft();
66 Float_t besttimerightPs = Float_t (besttimeright*channelWigth);
67 Float_t besttimeleftPs = Float_t (besttimeleft*channelWigth);
68 Float_t Zposit=(c*(besttimerightPs-besttimeleftPs)-(3500.-697))/2;
71 pESD->SetT0zVertex(Zposit);
73 if (rl->GetDebug()>1) {
74 cout<<" vertex in ESD "<< pESD->GetT0zVertex()<<endl;
77 } // vertex in 3 sigma
78 pStartLoader->UnloadDigits();