Line data Source code
1 : /**************************************************************************
2 : * Copyright(c) 2008-2010, 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 : /////////////////////////////////////////////////////////////////
19 : // Author: A. Mastroserio //
20 : // This class is used as a container for the FO scan //
21 : // //
22 : /////////////////////////////////////////////////////////////////
23 :
24 :
25 : #include <TObjArray.h>
26 : #include "AliITSOnlineSPDfoChipConfig.h"
27 : #include "AliITSOnlineSPDfoChip.h"
28 :
29 116 : ClassImp(AliITSOnlineSPDfoChip)
30 : //-----------------------------------------------
31 : AliITSOnlineSPDfoChip::AliITSOnlineSPDfoChip():
32 0 : TObject(),
33 0 : fActiveHS(0),
34 0 : fChipId(0),
35 0 : fNumDACparams(0),
36 0 : fNumChipConfigs(0),
37 0 : fDACparams(0x0),
38 0 : fChipConfigArray(0x0)
39 0 : {
40 : // default constructor
41 0 : }
42 :
43 : //-------------------------------------------------
44 : AliITSOnlineSPDfoChip::AliITSOnlineSPDfoChip(Short_t nparams):
45 0 : TObject(),
46 0 : fActiveHS(0),
47 0 : fChipId(0),
48 0 : fNumDACparams(nparams),
49 0 : fNumChipConfigs(0),
50 0 : fDACparams(0x0),
51 0 : fChipConfigArray(0x0)
52 0 : {
53 : //
54 : // constructor
55 : //
56 0 : fDACparams = new Short_t[fNumDACparams];
57 0 : fChipConfigArray = new TObjArray(); //starting with no objects, then adding...
58 0 : }
59 : //--------------------------------------------------
60 :
61 : AliITSOnlineSPDfoChip::AliITSOnlineSPDfoChip(const AliITSOnlineSPDfoChip &c):
62 0 : TObject(c),
63 0 : fActiveHS(c.fActiveHS),
64 0 : fChipId(c.fChipId),
65 0 : fNumDACparams(c.fNumDACparams),
66 0 : fNumChipConfigs(c.fNumChipConfigs),
67 0 : fDACparams(0x0),
68 0 : fChipConfigArray(0x0)
69 0 : {
70 : //
71 : //copy constructor
72 : // fChipConfigArray is not copied. This method is private
73 : //
74 0 : fDACparams = new Short_t[fNumDACparams];
75 0 : for(Int_t iPar =0; iPar < fNumDACparams; iPar++) fDACparams[iPar] = c.fDACparams[iPar];
76 0 : }
77 : //--------------------------------------------------
78 : AliITSOnlineSPDfoChip::~AliITSOnlineSPDfoChip()
79 0 : {
80 : // dctor
81 :
82 0 : fChipConfigArray->SetOwner(kTRUE);
83 0 : fChipConfigArray->Clear();
84 0 : delete fChipConfigArray;
85 0 : delete [] fDACparams;
86 0 : }
87 : //--------------------------------------------------
88 : void AliITSOnlineSPDfoChip::AddMeasurement(AliITSOnlineSPDfoChipConfig *confinfo)
89 : {
90 : //
91 : //setter for the Chip global measurement
92 : //
93 :
94 0 : fChipConfigArray->AddLast(confinfo);
95 0 : fNumChipConfigs++;
96 0 : }
97 : //_____________________________________________________
98 : void AliITSOnlineSPDfoChip::PrintInfo()
99 : {
100 : //
101 : // prints container content
102 : //
103 0 : printf(" \n ActiveHS %d ChipId %d",fActiveHS,fChipId);
104 0 : printf(" DAC parameters : %d %d %d %d \n",fDACparams[0],fDACparams[1],fDACparams[2],fDACparams[3]);
105 0 : for(Int_t i=0; i< fNumChipConfigs; i++) {
106 0 : if(!(AliITSOnlineSPDfoChipConfig*)(GetChipConfigInfo()->At(i)) ) printf("AliISOnlineSPDfoChipConfig pointer null");
107 0 : else ((AliITSOnlineSPDfoChipConfig*)(GetChipConfigInfo()->At(i)))->PrintInfo();
108 : }
109 0 : }
|