Inheritance from TObject. Automatic streamers.
[u/mrichter/AliRoot.git] / PHOS / AliPHOSTick.cxx
CommitLineData
7437a0f7 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//_________________________________________________________________________
19// Auxiliary class to help calculate the time of crossing
20// of the threshold by the front edge of the time signal
21//
22//*-- Author : Dmitri Peressounko (SUBATECH)
23//////////////////////////////////////////////////////////////////////////////
24
25// --- ROOT system ---
26
27// --- Standard library ---
28
29// --- AliRoot header files ---
30#include "AliPHOSTick.h"
31
32ClassImp(AliPHOSTick)
33
34
35//____________________________________________________________________________
36 AliPHOSTick::AliPHOSTick():TObject()
37{
38 fTime = 0;
39 fA = 0;
40 fB = 0 ;
41}
42
43//____________________________________________________________________________
44AliPHOSTick::AliPHOSTick(Float_t time, Float_t a, Float_t slope):TObject()
45{
46 fTime = time;
47 fA = a;
48 fB = slope ;
49}
50//____________________________________________________________________________
51Int_t AliPHOSTick::Compare(const TObject * obj) const {
52 if(obj->InheritsFrom("AliPHOSTick")){
53 AliPHOSTick * tick = (AliPHOSTick *) obj ;
54 if(fTime < tick->fTime)
55 return -1 ;
56 else
57 if(fTime == tick->fTime)
58 return 0 ;
59 else
60 return 1 ;
61 }
62 else
63 return 1 ;
64}
65//____________________________________________________________________________
66void AliPHOSTick::operator+=(AliPHOSTick const & tick)
67{
68 // Adds the amplitude of digits and completes the list of primary particles
69 // if amplitude is larger than
70
71 fA = fA + fB*(tick.fTime - fTime) + tick.fA ;
72 fB = fB + tick.fB ;
73 if(tick.fTime > fTime)
74 fTime = tick.fTime ;
75
76}