Line data Source code
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 : #include <TBits.h>
27 :
28 :
29 172 : ClassImp(AliESDTZERO)
30 :
31 : //______________________________________________________________________________
32 : AliESDTZERO::AliESDTZERO() :
33 20 : TObject(),
34 20 : fT0clock(0),
35 20 : fT0zVertex(0),
36 20 : fT0timeStart(0),
37 20 : fT0trig(0),
38 20 : fPileup(kFALSE),
39 20 : fSattelite(kFALSE),
40 20 : fMultC(0),
41 20 : fMultA(0),
42 20 : fBackground(0),
43 20 : fPileupBits(0)
44 100 : {
45 1000 : for(int i = 0;i<24;i++) {
46 480 : fT0time[i] = fT0amplitude[i] = fT0NewAmplitude[i] = 0;
47 5760 : for(Int_t iHit=0; iHit<5; iHit++) {
48 2400 : fTimeFull[i][iHit] = -9999;
49 2500 : if (i==0) fOrA[iHit] = -9999;
50 2500 : if (i==0)fOrC[iHit] = -9999;
51 2500 : if (i==0) fTVDC[iHit] = -9999;
52 : }
53 : }
54 280 : for(Int_t iHit=0; iHit<6; iHit++) fPileupTime[iHit]= -9999;
55 160 : for(int i = 0;i<3;i++) {
56 60 : fT0TOF[i] = -9999;
57 60 : fT0TOFbest[i] = -9999;
58 : }
59 40 : }
60 : //______________________________________________________________________________
61 : AliESDTZERO::AliESDTZERO(const AliESDTZERO &tzero ) :
62 0 : TObject(tzero),
63 0 : fT0clock(tzero.fT0clock),
64 0 : fT0zVertex(tzero.fT0zVertex),
65 0 : fT0timeStart(tzero.fT0timeStart),
66 0 : fT0trig(tzero.fT0trig),
67 0 : fPileup(tzero.fPileup),
68 0 : fSattelite(tzero.fSattelite),
69 0 : fMultC(tzero.fMultC),
70 0 : fMultA(tzero.fMultA),
71 0 : fBackground(tzero.fBackground),
72 0 : fPileupBits(tzero.fPileupBits)
73 0 : {
74 : // copy constuctor
75 0 : for(int i = 0;i<3;i++) {
76 0 : fT0TOF[i] = tzero.fT0TOF[i];
77 0 : fT0TOFbest[i] = tzero.fT0TOFbest[i];
78 : }
79 0 : for(int iHit=0; iHit<6; iHit++) fPileupTime[iHit] = tzero.fPileupTime[iHit];
80 0 : for(int i = 0;i<24;i++){
81 0 : fT0time[i] = tzero.fT0time[i];
82 0 : fT0amplitude[i] = tzero.fT0amplitude[i];
83 0 : fT0NewAmplitude[i] = tzero.fT0NewAmplitude[i];
84 0 : for(Int_t iHit=0; iHit<5; iHit++) {
85 0 : fTimeFull[i][iHit] = tzero.fTimeFull[i][iHit];
86 0 : if (i==0) fOrA[iHit] = tzero.fOrA[iHit];
87 0 : if (i==0) fOrC[iHit] = tzero.fOrC[iHit];
88 0 : if (i==0) fTVDC[iHit] = tzero.fTVDC[iHit];
89 : }
90 : }
91 0 : }
92 : //______________________________________________________________________________
93 : AliESDTZERO& AliESDTZERO::operator=(const AliESDTZERO& tzero){
94 : // assigmnent operator
95 36 : if(this!=&tzero) {
96 18 : TObject::operator=(tzero);
97 18 : fT0clock = tzero.fT0clock;
98 18 : fT0zVertex = tzero.fT0zVertex;
99 18 : fT0timeStart = tzero.fT0timeStart;
100 18 : fPileup = tzero.fPileup;
101 18 : fSattelite = tzero.fSattelite;
102 18 : fBackground = tzero.fBackground;
103 18 : fMultC = tzero.fMultC;
104 18 : fMultA = tzero.fMultA;
105 18 : fT0trig = tzero.fT0trig;
106 18 : fPileupBits = tzero.fPileupBits;
107 :
108 144 : for(int i = 0;i<3;i++) {
109 54 : fT0TOF[i] = tzero.fT0TOF[i];
110 54 : fT0TOFbest[i] = tzero.fT0TOFbest[i];
111 : }
112 :
113 252 : for(int iHit=0; iHit<6; iHit++) fPileupTime[iHit] = tzero.fPileupTime[iHit];
114 900 : for(int i = 0;i<24;i++){
115 432 : fT0time[i] = tzero.fT0time[i];
116 432 : fT0amplitude[i] = tzero.fT0amplitude[i];
117 432 : fT0NewAmplitude[i] = tzero.fT0NewAmplitude[i];
118 5184 : for(Int_t iHit=0; iHit<5; iHit++) {
119 2160 : fTimeFull[i][iHit] = tzero.fTimeFull[i][iHit];
120 2250 : if (i==0) fOrA[iHit] = tzero.fOrA[iHit];
121 2250 : if (i==0) fOrC[iHit] = tzero.fOrC[iHit];
122 2250 : if (i==0) fTVDC[iHit] = tzero.fTVDC[iHit];
123 : }
124 : }
125 18 : }
126 18 : return *this;
127 : }
128 : //______________________________________________________________________________
129 : void AliESDTZERO::Copy(TObject &obj) const {
130 :
131 : // this overwrites the virtual TOBject::Copy()
132 : // to allow run time copying without casting
133 : // in AliESDEvent
134 :
135 4 : if(this==&obj)return;
136 6 : AliESDTZERO *robj = dynamic_cast<AliESDTZERO*>(&obj);
137 2 : if(!robj)return; // not an AliESDTZERO
138 2 : *robj = *this;
139 :
140 4 : }
141 :
142 :
143 : //______________________________________________________________________________
144 : void AliESDTZERO::Reset()
145 : {
146 : // reset contents
147 66 : fT0clock=0;
148 33 : fT0zVertex = -9999;
149 33 : fT0timeStart = 0;
150 1650 : for(int i = 0;i<24;i++) {
151 792 : fT0time[i] = fT0amplitude[i] = fT0NewAmplitude[i] = 0;
152 9504 : for(Int_t iHit=0; iHit<5; iHit++) fTimeFull[i][iHit] = -9999;
153 : }
154 396 : for(Int_t iHit=0; iHit<5; iHit++) fOrA[iHit] = fOrC[iHit] = fTVDC[iHit] = -9999;
155 462 : for(Int_t iHit=0; iHit<6; iHit++) fPileupTime[iHit]= -9999;
156 264 : for(int i = 0;i<3;i++) {
157 99 : fT0TOF[i] = -9999;
158 99 : fT0TOFbest[i] = -9999;
159 : }
160 33 : }
161 :
162 : //______________________________________________________________________________
163 : void AliESDTZERO::Print(const Option_t *) const
164 : {
165 : // does noting fornow
166 0 : printf(" Vertex %f (T0A+T0C)/2 %f #channels T0signal %f ns OrA %f ns OrC %f \n",fT0zVertex, fT0timeStart, fT0TOF[0],fT0TOF[1],fT0TOF[2]);
167 :
168 0 : printf(" AliESDTZERO:::fPileupBits CountBits() \n");
169 : // fPileupBits.CountBits());
170 0 : fPileupBits.Print();
171 :
172 0 : Bool_t tr[5];
173 0 : for (Int_t i=0; i<5; i++) tr[i] = fT0trig & (1<<i);
174 0 : printf("T0 triggers %d %d %d %d %d",tr[0],tr[1],tr[2],tr[3],tr[4]);
175 :
176 0 : for (Int_t i=0; i<24; i++)
177 0 : printf(" AliESDTZERO::: new amp %f old amp %f \n", fT0NewAmplitude[i], fT0amplitude[i]);
178 :
179 :
180 0 : }
|