]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliESDTZERO.cxx
Provide place where T0 group will store resolutions inside ESD data,
[u/mrichter/AliRoot.git] / STEER / AliESDTZERO.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 //-------------------------------------------------------------------------
17 //                        Implemenation Class AliESDTZERO
18 //   This is a class that summarizes the TZERO data for the ESD   
19 //   Origin: Christian Klein-Boesing, CERN, Christian.Klein-Boesing@cern.ch 
20 //-------------------------------------------------------------------------
21
22
23
24 #include "AliESDTZERO.h"
25 #include "AliLog.h"
26
27
28 ClassImp(AliESDTZERO)
29
30 //______________________________________________________________________________
31 AliESDTZERO::AliESDTZERO() :
32   TObject(),
33   fT0clock(0),
34   fT0zVertex(0),
35   fT0timeStart(0),   
36   fT0trig(0)
37 {
38   for(int i = 0;i<24;i++)fT0time[i] = fT0amplitude[i] = 0;
39   for(int i = 0;i<3;i++) fT0TOF[i]=0;
40 }
41
42 AliESDTZERO::AliESDTZERO(const AliESDTZERO &tzero ) :
43   TObject(tzero),
44   fT0clock(tzero.fT0clock),  
45   fT0zVertex(tzero.fT0zVertex),
46   fT0timeStart(tzero.fT0timeStart),
47   fT0trig(tzero.fT0trig)
48 {
49   // copy constuctor
50   for(int i = 0;i<3;i++) fT0TOF[i] = tzero.fT0TOF[i];
51
52   for(int i = 0;i<24;i++){
53     fT0time[i] = tzero.fT0time[i]; 
54     fT0amplitude[i] = tzero.fT0amplitude[i];
55   }
56 }
57
58 AliESDTZERO& AliESDTZERO::operator=(const AliESDTZERO& tzero){
59   // assigmnent operator
60   if(this!=&tzero) {
61     TObject::operator=(tzero);
62     fT0clock = tzero.fT0clock;
63     fT0zVertex = tzero.fT0zVertex;
64     fT0timeStart = tzero.fT0timeStart;   
65     for(int i = 0;i<3;i++) fT0TOF[i] = tzero.fT0TOF[i];
66     for(int i = 0;i<24;i++){
67       fT0time[i] = tzero.fT0time[i]; 
68       fT0amplitude[i] = tzero.fT0amplitude[i];
69     }
70   } 
71   return *this;
72 }
73
74 void AliESDTZERO::Copy(TObject &obj) const {
75   
76   // this overwrites the virtual TOBject::Copy()
77   // to allow run time copying without casting
78   // in AliESDEvent
79
80   if(this==&obj)return;
81   AliESDTZERO *robj = dynamic_cast<AliESDTZERO*>(&obj);
82   if(!robj)return; // not an AliESDTZERO
83   *robj = *this;
84
85 }
86
87
88 //______________________________________________________________________________
89 void AliESDTZERO::Reset()
90 {
91   // reset contents
92   fT0clock=0;
93   fT0zVertex = 0;  
94   fT0timeStart = 0;
95   for(int i = 0;i<24;i++)fT0time[i] = fT0amplitude[i] = 0;
96   for(int i = 0;i<3;i++) fT0TOF[i] = 0;
97 }
98
99 //______________________________________________________________________________
100 void AliESDTZERO::Print(const Option_t *) const
101 {
102   // does noting fornow
103   AliInfo(Form(" Vertex %f (T0A+T0C)/2 %f #channels T0signal %f ns OrA %f ns OrC %f \n",fT0zVertex,  fT0timeStart, fT0TOF[0],fT0TOF[1],fT0TOF[2]));
104
105   Bool_t tr[5];
106   for (Int_t i=0; i<5; i++) tr[i] = fT0trig & (1<<i);
107   AliInfo(Form("T0 triggers %d %d %d %d %d",tr[0],tr[1],tr[2],tr[3],tr[4])); 
108
109 }