Plane Efficiency framework upgrade: possibility to create histograms with residuals...
[u/mrichter/AliRoot.git] / ITS / AliITSDCSDataSDD.cxx
CommitLineData
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
28ClassImp(AliITSDCSDataSDD)
29
30//---------------------------------------------------------------
31AliITSDCSDataSDD::AliITSDCSDataSDD():
32TObject(),
33fNpts(0),
34fSetPoints(0),
35fTimeStamp(),
36fDriftField(),
37fTemperatureLeft(),
38fTemperatureRight()
39{
40 // default constructor
41}
42//---------------------------------------------------------------
43AliITSDCSDataSDD::AliITSDCSDataSDD(Int_t npts):
44TObject(),
45fNpts(npts),
46fSetPoints(0),
47fTimeStamp(npts),
48fDriftField(npts),
49fTemperatureLeft(npts),
50fTemperatureRight(npts)
51{
52 // standard constructor
53}
54//---------------------------------------------------------------
55void 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//---------------------------------------------------------------
65void 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//---------------------------------------------------------------
78void AliITSDCSDataSDD::Compress(){
79 // Redimension arrays removing the empty elements at the end
80 SetNPoints(fSetPoints);
81}
82//---------------------------------------------------------------
83void 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}