]>
Commit | Line | Data |
---|---|---|
cfaccd71 | 1 | /************************************************************************** |
2 | * Copyright(c) 2007-2009, 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 | // // | |
20 | // Implementation of the class containing SDD DCS data // | |
21 | // Origin: F.Prino, Torino, prino@to.infn.it // | |
22 | // // | |
23 | /////////////////////////////////////////////////////////////////// | |
24 | ||
25 | #include "AliITSDCSDataSDD.h" | |
26 | #include "AliLog.h" | |
27 | ||
28 | ClassImp(AliITSDCSDataSDD) | |
29 | ||
30 | //--------------------------------------------------------------- | |
31 | AliITSDCSDataSDD::AliITSDCSDataSDD(): | |
32 | TObject(), | |
33 | fNpts(0), | |
34 | fSetPoints(0), | |
35 | fTimeStamp(), | |
36 | fDriftField(), | |
37 | fTemperatureLeft(), | |
38 | fTemperatureRight() | |
39 | { | |
40 | // default constructor | |
41 | } | |
42 | //--------------------------------------------------------------- | |
43 | AliITSDCSDataSDD::AliITSDCSDataSDD(Int_t npts): | |
44 | TObject(), | |
45 | fNpts(npts), | |
46 | fSetPoints(0), | |
47 | fTimeStamp(npts), | |
48 | fDriftField(npts), | |
49 | fTemperatureLeft(npts), | |
50 | fTemperatureRight(npts) | |
51 | { | |
52 | // standard constructor | |
53 | } | |
54 | //--------------------------------------------------------------- | |
55 | void AliITSDCSDataSDD::SetNPoints(Int_t npts){ | |
56 | // Redimension and resets arrays | |
57 | fNpts=npts; | |
58 | fTimeStamp.Set(npts); | |
59 | fDriftField.Set(npts); | |
60 | fTemperatureLeft.Set(npts); | |
61 | fTemperatureRight.Set(npts); | |
62 | } | |
63 | ||
64 | //--------------------------------------------------------------- | |
65 | void AliITSDCSDataSDD::SetValues(Int_t time, Float_t field, Float_t templ, Float_t tempr){ | |
66 | // Set values of next array elements | |
67 | if(fSetPoints>=fNpts){ | |
68 | AliWarning("Try to write outside array range"); | |
69 | return; | |
70 | } | |
71 | fTimeStamp.AddAt(time,fSetPoints); | |
72 | fDriftField.AddAt(field,fSetPoints); | |
73 | fTemperatureLeft.AddAt(templ,fSetPoints); | |
74 | fTemperatureRight.AddAt(tempr,fSetPoints); | |
75 | fSetPoints++; | |
76 | } | |
77 | //--------------------------------------------------------------- | |
78 | void AliITSDCSDataSDD::Compress(){ | |
79 | // Redimension arrays removing the empty elements at the end | |
80 | SetNPoints(fSetPoints); | |
81 | } | |
82 | //--------------------------------------------------------------- | |
83 | void AliITSDCSDataSDD::PrintValues() const { | |
84 | // Printout array contents | |
85 | for(Int_t i=0;i<fNpts;i++){ | |
86 | printf("TimeStamp=%d Drift Field=%f Temperatures: Left Hybr=%f Right Hybr=%f\n",fTimeStamp.At(i),fDriftField.At(i),fTemperatureLeft.At(i),fTemperatureRight.At(i)); | |
87 | } | |
88 | } |