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 "AliVZEROSDigit.h"
17 :
18 44 : ClassImp(AliVZEROSDigit)
19 :
20 : //__________________________________________________________________________
21 : AliVZEROSDigit::AliVZEROSDigit()
22 257 : :AliDigit(),
23 257 : fPMNumber(0),
24 257 : fNBins(0),
25 257 : fCharges(NULL)
26 1285 : {
27 : // Standard default
28 : // constructor
29 514 : }
30 :
31 : //__________________________________________________________________________
32 : AliVZEROSDigit::AliVZEROSDigit(Int_t pmnumber,
33 : Int_t nbins,
34 : Float_t *charges,
35 : Int_t *labels)
36 256 : :AliDigit(),
37 256 : fPMNumber(pmnumber),
38 256 : fNBins(nbins),
39 256 : fCharges(NULL)
40 1280 : {
41 : // Constructor
42 : // Used in the digitizer
43 512 : fCharges = new Float_t[fNBins];
44 256 : if (charges) {
45 918016 : for(Int_t i = 0; i < fNBins; ++i)
46 458752 : fCharges[i] = charges[i];
47 256 : }
48 : else {
49 0 : for(Int_t i = 0; i < fNBins; ++i)
50 0 : fCharges[i] = 0;
51 : }
52 :
53 256 : if (labels)
54 2304 : for(Int_t iTrack = 0; iTrack < 3; ++iTrack) fTracks[iTrack] = labels[iTrack];
55 512 : }
56 :
57 : //__________________________________________________________________________
58 : AliVZEROSDigit::~AliVZEROSDigit()
59 390 : {
60 : // Destructor
61 : // Delete the charges array if it was allocated
62 65 : if (fCharges) {
63 128 : delete [] fCharges;
64 64 : fCharges = NULL;
65 64 : }
66 195 : }
67 :
68 : //__________________________________________________________________________
69 : void AliVZEROSDigit::Print(const Option_t*) const
70 : {
71 : // Dumps digit object
72 0 : Dump();
73 0 : }
|