coverity fix
[u/mrichter/AliRoot.git] / T0 / AliT0RecPoint.cxx
CommitLineData
dc7ca31d 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// Class AliT0RecPoint for T0 time and ADC signals
c41ceaac 19// fTimeA - A side TOF signal
20// fTimeC - C side TOF signal
21// fTimeBestA - TOF first particle on the A side
22// TimeBestC - TOF first particle on the C side
23// fTimeAverage = (fTimeBestA + TimeBestLeft ) /2. T0 signal
dc7ca31d 24// fVertex - vertex position
25//
26///////////////////////////////////////////////////////////////////////
27
28
29
30
31#include "AliT0RecPoint.h"
8f8d0732 32#include "AliLog.h"
4fe1424e 33
dc7ca31d 34
35ClassImp(AliT0RecPoint)
36
37//------------------------------------
4fe1424e 38 AliT0RecPoint::AliT0RecPoint() : TObject(),
c2337900 39 fTimeAverage(99999),
40 fTimeOnlineMean(99999),
41 fVertexPosition(999999),
e5835843 42 fTimeBestA(99999),
43 fTimeBestC(99999),
3c6a09a2 44 fMultC(0),fMultA(0),
adf36b9d 45 fT0clock(9999999),
b0e13b29 46 fT0trig(0),
47 fPileup(kFALSE),
e5835843 48 fSattelite(kFALSE),
49 fTime1stA(99999),
50 fTime1stC(99999)
51
adf36b9d 52
dc7ca31d 53{
54 //ctor
b0e13b29 55 for (Int_t i=0; i<24; i++) { fTime[i]=0; fADC[i]=0; fADCLED[i]=0;
56 for(Int_t iHit=0; iHit<5; iHit++) {
e5835843 57 fTimeFull[i][iHit] = 0;
58 fOrA[iHit] = 0;
59 fOrC[iHit] = 0;
60 fTVDC[iHit] = 0;
b0e13b29 61 }
62 }
dc7ca31d 63}
4fe1424e 64//_____________________________________________________________________________
65
66AliT0RecPoint::AliT0RecPoint(const AliT0RecPoint &r):TObject(),
e5835843 67 fTimeAverage(r.fTimeAverage),
68 fTimeOnlineMean(r.fTimeOnlineMean),
69 fVertexPosition(r.fVertexPosition),
70 fTimeBestA(r.fTimeBestA),
71 fTimeBestC(r.fTimeBestC),
72 fMultC(r.fMultC),
73 fMultA(r.fMultA),
74 fT0clock(r.fT0clock),
75 fT0trig(r.fT0trig),
76 fPileup(r.fPileup),
77 fSattelite(r.fSattelite),
78 fTime1stA(r.fTime1stA),
79 fTime1stC(r.fTime1stC)
80
4fe1424e 81{
82 //
83 // AliT0RecPoint copy constructor
84 //
e5835843 85 for (Int_t i=0; i<24; i++) {
86 fTime[i] = r. fTime[i];
87 fADC[i] = r.fADC[i];
88 fADCLED[i] = r. fADCLED[i];
89 for(Int_t iHit=0; iHit<5; iHit++) {
90 fTimeFull[i][iHit] = r.fTimeFull[i][iHit];
91 fOrA[iHit] = r.fOrA[iHit];
92 fOrC[iHit] = r.fOrC[iHit];
93 fTVDC[iHit] = r.fTVDC[iHit];
94 }
95 }
96 // ((AliT0RecPoint &) r).Copy(*this);
4fe1424e 97
98}
adf36b9d 99//_____________________________________________________________________________
100
e5835843 101/*
102//_____________________________________________________________________________
103
104AliT0RecPoint& AliT0RecPoint:: operator=(const AliT0RecPoint &r)
105{
106 //
107 // assign. operator
108 //
109
110 if (this == &r)
111 return *this;
112
113 fTimeAverage = r.fTimeAverage;
114 fTimeOnlineMean = r.fTimeOnlineMean;
115 fVertexPosition = r.fVertexPosition;
116 fTimeBestA = r.fTimeBestA;
117 fTimeBestC = r.fTimeBestC;
118 fMultC = r.fMultC;
119 fMultA = r.fMultA;
120 fT0clock = r.fT0clock;
121 fT0trig = r.fT0trig;
122 fPileup = r.fPileup;
123 fSattelite = r.fSattelite;
124 fTime1stA = r.fTime1stA;
125 fTime1stC = r.fTime1stC;
126 for (Int_t i=0; i<24; i++) {
127 fTime[i] = r. fTime[i];
128 fADC[i] = r.fADC[i];
129 fADCLED[i] = r. fADCLED[i];
130 for(Int_t iHit=0; iHit<5; iHit++) {
131 fTimeFull[i][iHit] = r.fTimeFull[i][iHit];
132 fOrA[iHit] = r.fOrA[iHit];
133 fOrC[iHit] = r.fOrC[iHit];
134 fTVDC[iHit] = r.fTVDC[iHit];
135 }
136 }
137
138 return *this;
139}
140*/
141//_____________________________________________________________________________
adf36b9d 142void AliT0RecPoint::SetT0Trig(Bool_t *tr)
143{
144 fT0trig=0;
b0e13b29 145 for (Int_t i=0; i<5; i++) fT0trig = fT0trig | (tr[i]?(1<<i):0);
adf36b9d 146}
147//_____________________________________________________________________________
148
149void AliT0RecPoint::PrintTriggerSignals(Int_t trig)
150{
151 Bool_t tr[5];
b0e13b29 152 for (Int_t i=0; i<5; i++) tr[i] = (trig&(1<<i))!=0;
adf36b9d 153
b0e13b29 154 AliInfo(Form("T0 triggers tvdc %d orA %d orC %d centr %d semicentral %d",tr[0],tr[1],tr[2],tr[3],tr[4]));
adf36b9d 155}