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