--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+#include "AliT0LookUpValue.h"
+
+ClassImp(AliT0LookUpValue)
+
+ AliT0LookUpValue:: AliT0LookUpValue(): TObject(),
+ fTRM(-1),
+ fTDC(-1),
+ fChain(-1),
+ fChannel(-1)
+
+
+{
+
+ ///
+}
+
+ AliT0LookUpValue:: AliT0LookUpValue(Int_t trm, Int_t tdc, Int_t chain, Int_t channel) : TObject(),
+ fTRM(trm),
+ fTDC(tdc),
+ fChain(chain),
+ fChannel(channel)
+{
+
+}
+ Bool_t AliT0LookUpValue:: IsEqual(const TObject* obj) const
+{
+ AliT0LookUpValue *b = ( AliT0LookUpValue*)obj;
+/*
+printf("IsEqual %i %i\n %i %i\n %i %i\n %i %i\n \n",b->GetTRM(), fTRM,
+b->GetTDC(), fTDC, b->GetChain(), fChain, b->GetChannel(), fChannel );
+*/
+ if ( b->GetTRM() == fTRM &&
+ b->GetTDC() == fTDC &&
+ b->GetChain() == fChain &&
+ b->GetChannel() == fChannel ) return kTRUE;
+ else return kFALSE;
+}
+ULong_t AliT0LookUpValue:: Hash(void) const
+{
+ ULong_t hash = 1000*fTRM+100*fTDC+10*fChain+1*fChannel;
+ //printf("hash=%i\n",hash);
+ return hash;
+}
+/*
+void AliT0LookUpValue:: Clear()
+{
+ fTRM=-1;
+ fTDC=-1;
+ fChain=-1;
+ fChannel=-1;
+}
+*/
+
+ClassImp(AliT0LookUpKey)
+
+ AliT0LookUpKey::AliT0LookUpKey():TObject(),
+ fKey(0)
+ {
+
+ }
+
+ AliT0LookUpKey::AliT0LookUpKey(Int_t key):TObject(),
+ fKey(key)
+ {
+
+ }
+
+
+
+ Bool_t AliT0LookUpKey:: IsEqual(const TObject* obj) const
+{
+ Int_t k;
+// printf("IsEqual\n");
+ k=((AliT0LookUpKey*)obj)->GetKey();
+ if (k==fKey) return kTRUE; else return kFALSE;
+}
--- /dev/null
+#ifndef ALIT0LOOKUPVALUE_H
+#define ALIT0LOOKUPVALUE_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+#include "TObject.h"
+#include "TMap.h"
+
+class AliT0LookUpValue: public TObject
+{
+ public:
+
+ AliT0LookUpValue();
+ AliT0LookUpValue(Int_t trm, Int_t tdc, Int_t chain, Int_t channel );
+ virtual Bool_t IsEqual(const TObject* obj) const ;
+ virtual ULong_t Hash(void) const;
+ Int_t GetTRM(void) const {return fTRM;};
+ Int_t GetTDC(void) const {return fTDC;};
+ Int_t GetChain(void) const {return fChain;};
+ Int_t GetChannel(void) const {return fChannel;};
+ void SetTRM(Int_t n) {fTRM=n;};
+ void SetTDC(Int_t n) {fTDC=n;};
+ void SetChain(Int_t n) {fChain=n;};
+ void SetChannel(Int_t n) {fChannel=n;};
+ virtual void Clear (void) {fTRM = -1; fTDC=-1; fChain=-1; fChannel=-1;}
+// void Clear();
+
+ protected:
+
+ Int_t fTRM; //#TRM
+ Int_t fTDC; //#TDC
+ Int_t fChain; //#chain
+ Int_t fChannel; //#channel
+
+ ClassDef(AliT0LookUpValue,1) //Hits for detector T0
+};
+
+class AliT0LookUpKey: public TObject
+{
+ public:
+ AliT0LookUpKey();
+ AliT0LookUpKey(Int_t key);
+ Int_t GetKey(void) const {return fKey;};
+ void SetKey(Int_t n) {fKey=n;};
+ virtual Bool_t IsEqual(const TObject *obj) const;
+ virtual ULong_t Hash(void) const {return fKey;};
+// virtual void Clear(void) {fKey=0;}
+ protected:
+ Int_t fKey; //logical channel name
+ ClassDef(AliT0LookUpKey,1) //Hits for detector T0
+};
+
+#endif