]>
Commit | Line | Data |
---|---|---|
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 | |
28db0d85 | 21 | //.. |
22 | //.. | |
7437a0f7 | 23 | //*-- Author : Dmitri Peressounko (SUBATECH) |
24 | ////////////////////////////////////////////////////////////////////////////// | |
25 | ||
26 | // --- ROOT system --- | |
27 | ||
28 | // --- Standard library --- | |
29 | ||
30 | // --- AliRoot header files --- | |
31 | #include "AliPHOSTick.h" | |
32 | ||
33 | ClassImp(AliPHOSTick) | |
34 | ||
35 | ||
36 | //____________________________________________________________________________ | |
37 | AliPHOSTick::AliPHOSTick():TObject() | |
38 | { | |
28db0d85 | 39 | // default ctor |
7437a0f7 | 40 | fTime = 0; |
41 | fA = 0; | |
42 | fB = 0 ; | |
43 | } | |
44 | ||
45 | //____________________________________________________________________________ | |
46 | AliPHOSTick::AliPHOSTick(Float_t time, Float_t a, Float_t slope):TObject() | |
47 | { | |
28db0d85 | 48 | //ctor |
7437a0f7 | 49 | fTime = time; |
50 | fA = a; | |
51 | fB = slope ; | |
52 | } | |
53 | //____________________________________________________________________________ | |
28db0d85 | 54 | Int_t AliPHOSTick::Compare(const TObject * obj) const |
55 | { | |
56 | // compare the times of two tick objects | |
57 | // return = -1 if smaller | |
58 | // 0 if equal | |
59 | // 1 id larger | |
60 | ||
7437a0f7 | 61 | if(obj->InheritsFrom("AliPHOSTick")){ |
62 | AliPHOSTick * tick = (AliPHOSTick *) obj ; | |
63 | if(fTime < tick->fTime) | |
64 | return -1 ; | |
65 | else | |
66 | if(fTime == tick->fTime) | |
67 | return 0 ; | |
68 | else | |
69 | return 1 ; | |
70 | } | |
71 | else | |
72 | return 1 ; | |
73 | } | |
74 | //____________________________________________________________________________ | |
75 | void AliPHOSTick::operator+=(AliPHOSTick const & tick) | |
76 | { | |
77 | // Adds the amplitude of digits and completes the list of primary particles | |
78 | // if amplitude is larger than | |
79 | ||
80 | fA = fA + fB*(tick.fTime - fTime) + tick.fA ; | |
81 | fB = fB + tick.fB ; | |
82 | if(tick.fTime > fTime) | |
83 | fTime = tick.fTime ; | |
84 | ||
85 | } |