1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 ///////////////////////////////////////////////////////////////////////////////
18 // class for TOF Online calibration: defining channel delay //
19 // using an array instead of a TObjArray //
21 ///////////////////////////////////////////////////////////////////////////////
23 #include <AliTOFChannelOnlineArray.h>
26 ClassImp(AliTOFChannelOnlineArray)
28 //________________________________________________________________
29 AliTOFChannelOnlineArray::AliTOFChannelOnlineArray():
36 //________________________________________________________________
37 AliTOFChannelOnlineArray::~AliTOFChannelOnlineArray()
42 //________________________________________________________________
43 AliTOFChannelOnlineArray::AliTOFChannelOnlineArray(Int_t size):
46 fArray(new Float_t[size])
49 for (Int_t ich = 0; ich<size; ich ++){
53 //________________________________________________________________
54 AliTOFChannelOnlineArray::AliTOFChannelOnlineArray(const AliTOFChannelOnlineArray & source):
60 fArray = new Float_t[fSize];
61 for (Int_t ich = 0; ich<fSize; ich ++){
62 fArray[ich] = source.fArray[ich];
65 //________________________________________________________________
66 AliTOFChannelOnlineArray &AliTOFChannelOnlineArray::operator=(const AliTOFChannelOnlineArray & source)
68 // assignment operator
73 TObject::operator=(source);
76 fArray = new Float_t[fSize];
77 memcpy(fArray,source.fArray,sizeof(Float_t)*fSize);
81 //________________________________________________________________
82 void AliTOFChannelOnlineArray::SetDelay(Int_t pos, Float_t parr)
84 // setting status for channel at position = pos
85 AliDebug(2,Form("status = %f",(Float_t)parr));
86 if (pos>-1 && pos < fSize)fArray[pos] = parr;
87 AliDebug(2,Form("fArray[%d] = %f",pos,(Float_t)fArray[pos]));
89 //________________________________________________________________
90 Float_t AliTOFChannelOnlineArray::GetDelay(Int_t pos) const
92 // getting the status for channel at position = pos
94 if (pos>-1 && pos < fSize)parr = fArray[pos];