]> git.uio.no Git - u/mrichter/AliRoot.git/blob - START/AliSTARTReconstructor.cxx
a4bdec998769cbfcb4b68e86a9a204a686fa7af8
[u/mrichter/AliRoot.git] / START / AliSTARTReconstructor.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15
16 /* $Id$ */
17
18 #include <Riostream.h>
19
20 #include <TDirectory.h>
21
22 #include "AliRunLoader.h"
23 #include "AliRun.h"
24 #include "AliSTARTLoader.h"
25 #include "AliSTARTdigit.h"
26 #include "AliSTARTReconstructor.h"
27 #include <AliESD.h>
28
29 ClassImp(AliSTARTReconstructor)
30
31   void AliSTARTReconstructor::Reconstruct(/*AliRunLoader* runLoader*/) 
32 {
33 // nothing to be done
34 }
35
36 void AliSTARTReconstructor::FillESD(AliRunLoader* rl, AliESD *pESD) const
37 {
38   /***************************************************
39   Resonstruct digits to vertex position
40   ****************************************************/
41   
42   Float_t c = 0.3;  //speed of light mm/ps
43   Int_t channelWigth=25; //ps
44   if (!rl) {
45     Error("Reconstruct", "No run loader");
46     return;
47   }
48
49   if (rl->GetDebug()>1) Info("Reconstruct","START!!!");
50
51   AliSTARTLoader* pStartLoader = (AliSTARTLoader*) rl->GetLoader("STARTLoader");
52  
53   pStartLoader->LoadDigits();
54   AliSTARTdigit* pDigits=pStartLoader->Digits();
55   if (!pDigits) {
56     Error("Reconstruct", "no digits found");
57     return;
58   }
59
60   if (rl->GetDebug()>1) pDigits->Dump();
61   if(pDigits) {
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;
67   
68     
69     pESD->SetT0zVertex(Zposit);
70     
71     if (rl->GetDebug()>1) {
72       cout<<" vertex in ESD "<< pESD->GetT0zVertex()<<endl;
73     }
74     
75   } // vertex in 3 sigma
76   pStartLoader->UnloadDigits();
77  }
78
79
80
81
82
83