]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALTick.cxx
add some missing copy ctors and progress toward code convention compliance
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALTick.cxx
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 
20 // help calculate the 
21 // time of crossing 
22 // of the threshold by 
23 // the front edge of the 
24 // time signal
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
36 ClassImp(AliEMCALTick)
37
38
39 //____________________________________________________________________________ 
40   AliEMCALTick::AliEMCALTick():TObject() 
41 {
42   //ctor
43   fTime = 0;
44   fA = 0;
45   fB = 0 ;
46 }
47
48 //____________________________________________________________________________ 
49 AliEMCALTick::AliEMCALTick(Float_t time, Float_t a, Float_t slope):TObject()
50 {
51   //ctor
52   fTime = time;
53   fA = a;
54   fB = slope ;  
55 }
56
57
58
59 //____________________________________________________________________________ 
60 Int_t AliEMCALTick::Compare(const TObject * obj) const 
61 {
62   // compares time values
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 //____________________________________________________________________________
77 void 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 }