]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALTick.cxx
Fix bug in digitization of multiple events
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALTick.cxx
CommitLineData
51ecce10 1/**************************************************************************
2 * Copyright(c) 1998-1999, 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//_________________________________________________________________________
14ce0a6e 19// Auxiliary class to
20// help calculate the
21// time of crossing
22// of the threshold by
23// the front edge of the
24// time signal
51ecce10 25//
26//*-- Author : Dmitri Peressounko (SUBATECH)
27//////////////////////////////////////////////////////////////////////////////
28
29// --- ROOT system ---
30
31// --- Standard library ---
32
33// --- AliRoot header files ---
34#include "AliEMCALTick.h"
35
36ClassImp(AliEMCALTick)
37
38
39//____________________________________________________________________________
40 AliEMCALTick::AliEMCALTick():TObject()
41{
d64c959b 42 //ctor
51ecce10 43 fTime = 0;
44 fA = 0;
45 fB = 0 ;
46}
47
48//____________________________________________________________________________
49AliEMCALTick::AliEMCALTick(Float_t time, Float_t a, Float_t slope):TObject()
50{
d64c959b 51 //ctor
51ecce10 52 fTime = time;
53 fA = a;
54 fB = slope ;
55}
0a4cb131 56
57
58
51ecce10 59//____________________________________________________________________________
d64c959b 60Int_t AliEMCALTick::Compare(const TObject * obj) const
61{
62 // compares time values
51ecce10 63 if(obj->InheritsFrom("AliEMCALTick")){
64 AliEMCALTick * tick = (AliEMCALTick *) obj ;
65 if(fTime < tick->fTime)
66 return -1 ;
67 else
68 if(fTime == tick->fTime)
69 return 0 ;
70 else
71 return 1 ;
72 }
73 else
74 return 1 ;
75}
76//____________________________________________________________________________
77void AliEMCALTick::operator+=(AliEMCALTick const & tick)
78{
79 // Adds the amplitude of digits and completes the list of primary particles
80 // if amplitude is larger than
81
82 fA = fA + fB*(tick.fTime - fTime) + tick.fA ;
83 fB = fB + tick.fB ;
84 if(tick.fTime > fTime)
85 fTime = tick.fTime ;
86
87}