]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSOnlineSPDfoChip.cxx
Fixes for Coverity warnings (A. Mastroserio)
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSPDfoChip.cxx
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),
67 fChipConfigArray(0x0)
68 {
69   //
70   //copy constructor 
71   // fChipConfigArray is not copied. This method is private
72   //
73
74   for(Int_t iPar =0; iPar < fNumDACparams; iPar++) fDACparams[iPar] = c.fDACparams[iPar]; 
75 }    
76 //--------------------------------------------------
77 AliITSOnlineSPDfoChip::~AliITSOnlineSPDfoChip()
78 {
79  // dctor
80   
81    fChipConfigArray->SetOwner(kTRUE);
82    fChipConfigArray->Clear();
83    delete fChipConfigArray;
84    delete [] fDACparams;
85 }
86 //--------------------------------------------------
87 void AliITSOnlineSPDfoChip::AddMeasurement(AliITSOnlineSPDfoChipConfig *confinfo)
88 {
89   //
90   //setter for the Chip global measurement
91   //
92   
93   fChipConfigArray->AddLast(confinfo);
94   fNumChipConfigs++;
95 }
96 //_____________________________________________________
97 void AliITSOnlineSPDfoChip::PrintInfo()
98 {
99   //
100   // prints container content
101   //
102   printf(" \n ActiveHS %d   ChipId %d",fActiveHS,fChipId);
103   printf(" DAC parameters : %d    %d    %d    %d \n",fDACparams[0],fDACparams[1],fDACparams[2],fDACparams[3]); 
104   for(Int_t i=0; i< fNumChipConfigs; i++) {
105     if(!(AliITSOnlineSPDfoChipConfig*)(GetChipConfigInfo()->At(i)) ) printf("AliISOnlineSPDfoChipConfig pointer null");
106     else ((AliITSOnlineSPDfoChipConfig*)(GetChipConfigInfo()->At(i)))->PrintInfo();   
107   }
108 }