1 /**************************************************************************
2 * Copyright(c) 2007-2009, 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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 /// This class provides storage container ITS SSD channel callibration data
23 ///////////////////////////////////////////////////////////////////////////////
26 #include <Riostream.h>
27 #include "AliITSChannelDaSSD.h"
29 ClassImp(AliITSChannelDaSSD)
33 const Float_t AliITSChannelDaSSD::fgkUndefinedValue = 32639.0f; // = 0x7F7F
35 AliITSChannelDaSSD::AliITSChannelDaSSD() :
39 fPedestal(fgkUndefinedValue),
40 fNoise(fgkUndefinedValue),
41 fZsThresholdFactor(0.0f)
47 AliITSChannelDaSSD::AliITSChannelDaSSD(const UShort_t stripID) :
51 fPedestal(fgkUndefinedValue),
52 fNoise(fgkUndefinedValue),
53 fZsThresholdFactor(0.0f)
55 // Costructor, initialize channal id
59 AliITSChannelDaSSD::AliITSChannelDaSSD(const UShort_t stripID, const Long_t eventsnumber) :
63 fPedestal(fgkUndefinedValue),
64 fNoise(fgkUndefinedValue),
65 fZsThresholdFactor(0.0f)
67 // Costructor, initialize channal id and allocate array for events data
68 if (stripID > fgkMaxStripId)
69 Warning("AliITSChannelDaSSD", "Wrong StripID: %i", stripID);
70 fSignal = new (nothrow) Short_t[eventsnumber];
72 fEventsNumber = eventsnumber;
73 memset(fSignal, fgkDefaultSignal, (eventsnumber * sizeof(Short_t)));
75 Error("AliITSChannelDaSSD", "Error allocating memory for %i Short_t objects!", eventsnumber);
83 AliITSChannelDaSSD::AliITSChannelDaSSD(const AliITSChannelDaSSD& strip) :
85 fStripId(strip.fStripId),
86 fEventsNumber(strip.fEventsNumber),
87 fSignal(strip.fSignal),
88 fPedestal(strip.fPedestal),
90 fZsThresholdFactor(strip.fZsThresholdFactor)
94 Fatal("AliITSChannelDaSSD", "copy constructor not implemented");
97 AliITSChannelDaSSD& AliITSChannelDaSSD::operator = (const AliITSChannelDaSSD& strip)
99 // assignment operator
101 Fatal("operator =", "assignment operator not implemented");
106 AliITSChannelDaSSD::~AliITSChannelDaSSD()
116 Bool_t AliITSChannelDaSSD::SetEvenetsNumber(const Long_t eventsnumber)
118 // Allocate array for events data
119 if (fSignal) {delete [] fSignal; fSignal = NULL; }
120 fSignal = new (nothrow) Short_t[eventsnumber];
122 fEventsNumber = eventsnumber;
123 memset(fSignal, fgkDefaultSignal, (eventsnumber * sizeof(Short_t)));
126 Error("AliITSChannelDaSSD", "Error allocating memory for %i Short_t objects!", eventsnumber);
135 Bool_t AliITSChannelDaSSD::SetSignal(const Long_t eventnumber, const Short_t signal)
137 // put signal value to array
138 if (eventnumber < fEventsNumber && fSignal)
140 fSignal[eventnumber] = signal;