]> git.uio.no Git - u/mrichter/AliRoot.git/blob - START/AliSTARTReconstructor.cxx
b40ec4fb612f9399bdab694547845f203ce979c9
[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 "AliSTARTLoader.h"
24 #include "AliSTARTdigit.h"
25 #include "AliSTARTReconstructor.h"
26 #include <AliESD.h>
27
28 ClassImp(AliSTARTReconstructor)
29
30 void AliSTARTReconstructor::Reconstruct(AliRunLoader* /*rl*/) const
31 {
32 // nothing to be done
33
34 }
35
36 void AliSTARTReconstructor::FillESD(AliRunLoader* rl, AliESD *pESD) const
37 {
38   /***************************************************
39   Resonstruct digits to vertex position
40   ****************************************************/
41
42   Int_t timediff;
43   Float_t timePs;
44   
45   if (!rl) {
46     Error("Reconstruct", "No run loader");
47     return;
48   }
49
50   if (rl->GetDebug()>1) Info("Reconstruct","START!!!");
51
52   AliSTARTLoader* pStartLoader = (AliSTARTLoader*) rl->GetLoader("STARTLoader");
53  
54   pStartLoader->LoadDigits();
55   AliSTARTdigit* pDigits=pStartLoader->Digits();
56   if (!pDigits) {
57     Error("Reconstruct", "no digits found");
58     return;
59   }
60
61   if (rl->GetDebug()>1) pDigits->Dump();
62
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
69     
70     if (rl->GetDebug()>1) {
71       cout << "timediff " << timediff
72            <<" timePs " << timePs 
73            <<" Zposit "<<Zposit<<endl;
74     }
75     
76     pESD->SetT0zVertex(Zposit);
77     
78     if (rl->GetDebug()>1) {
79       cout<<" vertex in ESD "<< pESD->GetT0zVertex()<<endl;
80     }
81     
82   } // vertex in 3 sigma
83   pStartLoader->UnloadDigits();
84  }
85
86
87
88
89
90