Bug #92237 fixed as Barth suggested
[u/mrichter/AliRoot.git] / ZDC / AliZDCHit.cxx
CommitLineData
8e308087 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
803d1ab0 16/* $Id$ */
8e308087 17
8a2624cc 18// **************************************************************
3ff116f2 19//
8a2624cc 20// Hits classes for ZDC
3ff116f2 21//
8a2624cc 22// **************************************************************
8e308087 23
24#include "AliZDCHit.h"
25
26ClassImp(AliZDCHit)
27
28//_____________________________________________________________________________
cc2abffd 29AliZDCHit::AliZDCHit() :
30// AliHit(shunt, track),
6c79713a 31 fPrimKinEn(0.),
cc2abffd 32 fXImpact(0.),
33 fYImpact(0.),
34 fSFlag(0),
35 fLightPMQ(0.),
36 fLightPMC(0.),
47709f57 37 fEnergy(0.),
f7f9e40c 38 fPDGCode(0),
ae3870e6 39 fMotherPDGCode(0),
f7f9e40c 40 fTrackTOF(0.)
cc2abffd 41
42{
43 //
44 // Default constructor
45 //
6c79713a 46 for(Int_t i=0; i<2; i++) fVolume[i] = 0;
cc2abffd 47}
48
49//_____________________________________________________________________________
50AliZDCHit::AliZDCHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits) :
51 AliHit(shunt, track),
52 fPrimKinEn(hits[3]),
53 fXImpact(hits[4]),
54 fYImpact(hits[5]),
55 fSFlag(hits[6]),
56 fLightPMQ(hits[7]),
57 fLightPMC(hits[8]),
47709f57 58 fEnergy(hits[9]),
f7f9e40c 59 fPDGCode((Int_t) hits[10]),
ae3870e6 60 fMotherPDGCode((Int_t) hits[11]),
61 fTrackTOF(hits[12])
cc2abffd 62
8e308087 63{
64 //
cc2abffd 65 // Standard constructor
8e308087 66 //
67 Int_t i;
cc2abffd 68 for(i=0; i<2; i++) fVolume[i] = vol[i];
5a881c97 69 fX = hits[0];
70 fY = hits[1];
71 fZ = hits[2];
cc2abffd 72}
8e308087 73
cc2abffd 74//_____________________________________________________________________________
75AliZDCHit::AliZDCHit(const AliZDCHit &oldhit) :
a718c993 76 AliHit(0,oldhit.GetTrack()),
77 fPrimKinEn(oldhit.GetPrimKinEn()),
78 fXImpact(oldhit.GetXImpact()),
79 fYImpact(oldhit.GetYImpact()),
80 fSFlag(oldhit.GetSFlag()),
81 fLightPMQ(oldhit.GetLightPMQ()),
82 fLightPMC(oldhit.GetLightPMC()),
47709f57 83 fEnergy(oldhit.GetEnergy()),
f7f9e40c 84 fPDGCode(oldhit.GetPDGCode()),
ae3870e6 85 fMotherPDGCode(oldhit.GetMotherPDGCode()),
f7f9e40c 86 fTrackTOF(oldhit.GetTrackTOF())
cc2abffd 87{
88 // Copy constructor
89 fX = oldhit.X();
90 fY = oldhit.Y();
91 fZ = oldhit.Z();
92 for(Int_t i=0; i<2; i++) fVolume[i] = oldhit.GetVolume(i);
8e308087 93}
be004c43 94
95//_____________________________________________________________________________
96AliZDCHit &AliZDCHit::operator= (const AliZDCHit &hit)
97{
98 //assignemnt operator
99 if(&hit == this) return *this;
100
101 fPrimKinEn = hit.GetPrimKinEn();
102 fXImpact = hit.GetXImpact();
103 fYImpact = hit.GetYImpact();
104 fSFlag = hit.GetSFlag();
105 fLightPMQ = hit.GetLightPMQ();
106 fLightPMC = hit.GetLightPMC();
107 fEnergy = hit.GetEnergy();
108 fPDGCode = hit.GetPDGCode();
109 fMotherPDGCode = hit.GetMotherPDGCode();
110 fTrackTOF = hit.GetTrackTOF();
111
112 fX = hit.X();
113 fY = hit.Y();
114 fZ = hit.Z();
115 for(Int_t i=0; i<2; i++) fVolume[i] = hit.GetVolume(i);
116
117 return *this;
118}
8a2624cc 119
cc2abffd 120
8a2624cc 121//_____________________________________________________________________________
122void AliZDCHit::Print(Option_t *) const
123{
124 // Print method
e4d73825 125 printf("\t AliZDCHit: track %d PDGcode %d TOF %1.1f ns E_prim = %1.2f GeV SFlag = %1.0f\n"
126 "\t DETECTOR (%d, %d) (X, Y)_impact (%f, %f) cm\n"
127 "\t PMQLight %1.0f, PMCLight %1.0f, E_dep %1.2f\n ",
f7f9e40c 128 fTrack,fPDGCode,fTrackTOF,fPrimKinEn,fSFlag,
129 fVolume[0],fVolume[1],fXImpact,fYImpact,
130 fLightPMQ,fLightPMC,fEnergy);
8a2624cc 131}