+ fNSamples = nSamples;
+ fSamples = new Int_t[fNSamples];
+ for (Int_t i = 0; i < fNSamples; i++) fSamples[i] = timeSamples[i];
+}
+
+//____________________________________________________________________________
+Bool_t AliEMCALRawDigit::GetMaximum(Int_t& amplitude, Int_t& time) const
+{
+ // Checks the maximum amplitude in the time sample
+
+ if (!fNSamples)
+ {
+ AliDebug(1,"Digit has no time sample");
+ return kFALSE;
+ }
+
+ amplitude = 0;
+ for (Int_t i = 0; i < fNSamples; i++)
+ {
+ Int_t t, a;
+ if (GetTimeSample(i, t, a))
+ {
+ if (a > amplitude)
+ {
+ amplitude = a;
+ time = t;
+ }
+ }
+ }
+
+ return kTRUE;