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 : #include "AliPMDhit.h"
17 : #include <TClonesArray.h>
18 : #include "Riostream.h"
19 : #include "Rtypes.h"
20 :
21 12 : ClassImp(AliPMDhit)
22 :
23 : //_____________________________________________________________________________
24 167 : AliPMDhit::AliPMDhit():
25 167 : fEnergy(0.),
26 167 : fTime(0.)
27 835 : {
28 2338 : for (Int_t i=0; i<6; i++)
29 : {
30 1002 : fVolume[i] = 0;
31 : }
32 334 : }
33 : //_____________________________________________________________________________
34 : AliPMDhit::AliPMDhit(Int_t shunt,Int_t track, Int_t *vol, Float_t *hits):
35 575 : AliHit(shunt, track),
36 575 : fEnergy(hits[3]),
37 575 : fTime(hits[4])
38 2875 : {
39 : //
40 : // Add a PMD hit
41 : //
42 : Int_t i;
43 8050 : for (i=0; i<6; i++) fVolume[i] = vol[i];
44 575 : fX=hits[0];
45 575 : fY=hits[1];
46 575 : fZ=hits[2];
47 1150 : }
48 : //_____________________________________________________________________________
49 472 : AliPMDhit::AliPMDhit(AliPMDhit* oldhit):
50 472 : fEnergy(0.),
51 472 : fTime(0.)
52 2360 : {
53 472 : *this=*oldhit;
54 944 : }
55 :
56 : //_____________________________________________________________________________
57 : int AliPMDhit::operator == (AliPMDhit &cell) const
58 : {
59 : Int_t i;
60 41105 : if(fTrack!=cell.GetTrack()) return 0;
61 4340 : for (i=0; i<6; i++) if(fVolume[i]!=cell.GetVolume(i)) return 0;
62 103 : return 1;
63 13836 : }
64 :
65 : void
66 : AliPMDhit::Print(Option_t *) const {
67 0 : printf("PMD Cell %d %d %d %d %d %d\n Primary %d - Energy %f\n",
68 0 : fVolume[0],fVolume[1],fVolume[2],fVolume[3],
69 0 : fVolume[4],fVolume[5],fTrack,fEnergy);
70 0 : }
|