]> git.uio.no Git - u/mrichter/AliRoot.git/blob - T0/AliT0LookUpValue.cxx
Reconstruction QA by Sylwester
[u/mrichter/AliRoot.git] / T0 / AliT0LookUpValue.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 #include "AliT0LookUpValue.h"
16
17 ClassImp(AliT0LookUpValue)
18
19   AliT0LookUpValue:: AliT0LookUpValue(): TObject(),
20                                      fTRM(-1),
21                                      fTDC(-1),
22                                      fChain(-1),
23                                      fChannel(-1)
24
25
26 {
27
28   ///
29 }
30
31  AliT0LookUpValue:: AliT0LookUpValue(Int_t trm, Int_t tdc, Int_t chain, Int_t channel) : TObject(),
32   fTRM(trm),
33   fTDC(tdc),
34   fChain(chain),
35   fChannel(channel)
36 {
37  
38 }
39  Bool_t AliT0LookUpValue:: IsEqual(const TObject* obj) const
40 {
41      AliT0LookUpValue *b = ( AliT0LookUpValue*)obj;
42 /*
43 printf("IsEqual %i %i\n %i %i\n %i %i\n %i %i\n \n",b->GetTRM(), fTRM, 
44 b->GetTDC(), fTDC, b->GetChain(), fChain, b->GetChannel(), fChannel );
45 */
46      if ( b->GetTRM() == fTRM && 
47           b->GetTDC() == fTDC && 
48           b->GetChain() == fChain &&
49           b->GetChannel() == fChannel  ) return kTRUE;
50      else return kFALSE;
51 }
52 ULong_t AliT0LookUpValue:: Hash(void) const 
53 {
54   ULong_t hash = 1000*fTRM+100*fTDC+10*fChain+1*fChannel;
55   //printf("hash=%i\n",hash);
56   return hash; 
57 }
58 /*
59 void AliT0LookUpValue:: Clear()  
60 {
61   fTRM=-1;
62   fTDC=-1;
63   fChain=-1;
64   fChannel=-1;
65 }
66 */
67
68 ClassImp(AliT0LookUpKey)
69
70  AliT0LookUpKey::AliT0LookUpKey():TObject(),
71  fKey(0)  
72  {
73  
74  }
75
76  AliT0LookUpKey::AliT0LookUpKey(Int_t key):TObject(),
77  fKey(key)  
78  {
79  
80  }
81
82
83
84   Bool_t AliT0LookUpKey:: IsEqual(const TObject* obj) const
85 {
86   Int_t k;
87 //  printf("IsEqual\n");
88     k=((AliT0LookUpKey*)obj)->GetKey();
89     if (k==fKey) return kTRUE; else return kFALSE;
90 }