00001 #ifndef ROOT_MTChannel 00002 #define ROOT_MTChannel 00003 00004 ////////////////////////////////////////////////////////////////////////// 00005 // // 00006 // MTChannel for MICROMEGAS GASSIPLEX READOUT // 00007 // // 00008 // Description of thechannel parameters // 00009 // // 00010 ////////////////////////////////////////////////////////////////////////// 00011 00012 00013 #include "TObject.h" 00014 #include "TClonesArray.h" 00015 #include "TRefArray.h" 00016 #include "TRef.h" 00017 #include "TH1.h" 00018 #include "TMath.h" 00019 #include <vector> 00020 #include <map> 00021 00022 #include "root/MTChannelSoftId.hh" 00023 00024 class TDirectory; 00025 class ChannelHit; 00026 00027 //////////////////////////////////////////////////////////////////////////////////////// 00028 /// CLASS CHANNEL 00029 /// Represent ChannelHit and not physical Chip channel 00030 /////////////////////////////////////////////////////////////////////////////////////// 00031 class MTChannel : public TObject { 00032 00033 private: 00034 Int_t fAnalogValue; // Analog Value of MTChannel for Gassiplex and Dirac 00035 Int_t fDigitalValue; // Digiatl Value of MTChannel for Hardroc and Dirac 00036 Float_t fEnergy; // Reconstructed Energy 00037 MTChannelSoftId fSoftId; // unique Id of MTChannel for all Chambers a 00038 UInt_t fHardId; // Id of MTChannel for its chamber 00039 Int_t fX; // X coordinate of channel 00040 Int_t fY; // Y coordinate of channel 00041 Int_t fZ; // Z coordinate of channel 00042 UInt_t fOrder; // Order of MTChannel for its chamber 00043 // hardroc-specific data 00044 ULong64_t timestamp; // common unix timestamp 00045 UInt_t bcIdAbs; // t1: absolute BCID (BCID_abs) 00046 UInt_t bcIdDif; // t2: BCID of the DIF (BCID_dif) 00047 UInt_t bcIdHit; // t3: BCID of the hit (BCID_hit) 00048 UInt_t bcIdHitFine; // t3: BCID of the hit (BCID_hit) 00049 UInt_t memoryOrder ; // Ordre de lecture dans la memoire du Chip pour un meme trigger 00050 bool rejected; //bad hit, hardware tagging 00051 00052 UInt_t rowInChamber; // row in Chamber alongside X axis 00053 UInt_t colInChamber; // col in Chamber alongside Y axis 00054 00055 00056 00057 00058 public: 00059 MTChannel(); 00060 MTChannel(const MTChannel& orig); // copy constructor 00061 MTChannel(const ChannelHit& hit, UInt_t order); 00062 virtual ~MTChannel() {Clear();} 00063 00064 Int_t GetAnalogValue(void) const { return fAnalogValue; } 00065 Int_t GetDigitalValue(void) const { return fDigitalValue; } 00066 Float_t GetEnergy(void) const { return fEnergy; } 00067 const MTChannelSoftId& GetSoftId() const { return fSoftId; } 00068 UInt_t GetHardId(void) const { return fHardId; } 00069 Int_t GetX(void) const { return fX; } 00070 Int_t GetY(void) const { return fY; } 00071 Int_t GetZ(void) const { return fZ; } 00072 UInt_t GetOrder(void) const { return fOrder; } 00073 UInt_t GetChb(void) const { return GetChamberId();} 00074 UInt_t GetChamberId(void) const; 00075 UInt_t GetDifId(void) const; 00076 UInt_t GetChipId(void) const; 00077 UInt_t GetBoardId(void) const; 00078 UInt_t GetRowInChip(void) const; 00079 UInt_t GetColInChip(void) const; 00080 UInt_t GetRowInChamber() const { return rowInChamber;} 00081 UInt_t GetColInChamber() const { return colInChamber;} 00082 00083 00084 ULong64_t GetTimestamp(void) const { return(timestamp); }; 00085 UInt_t GetBcIdAbs(void) const { return(bcIdAbs); }; 00086 UInt_t SetBcIdAbs(UInt_t bcId) { bcIdAbs=bcId ; }; 00087 00088 UInt_t GetBcIdDif(void) const { return(bcIdDif); }; 00089 UInt_t GetBcIdHit(void) const { return(bcIdHit); }; 00090 UInt_t GetBcIdHitFine(void) const { return(bcIdHitFine); }; 00091 UInt_t GetAbsTime(void ) const; 00092 00093 bool GetRejected(void) const { return rejected;}; 00094 void SetRejected(bool aValue) { rejected = aValue; }; 00095 00096 void SetMemoryOrder(const UInt_t order) { memoryOrder = order; }; 00097 UInt_t GetMemoryOrder(void) const { return memoryOrder ;} ; 00098 00099 00100 void SetX(Int_t val) { fX = val; } 00101 void SetY(Int_t val) { fY = val; } 00102 void SetZ(Int_t val) { fZ = val; } 00103 void SetEnergy(Float_t val) { fEnergy = val; } 00104 Int_t Compare(const TObject *obj) const; 00105 Bool_t IsSortable() const { return kTRUE; } 00106 00107 00108 00109 ClassDef(MTChannel, 34) 00110 00111 }; 00112 00113 #endif