00001 #ifndef ROOT_MTEvent
00002 #define ROOT_MTEvent
00003
00004 #include "TObject.h"
00005 #include "TClonesArray.h"
00006 #include "TRefArray.h"
00007 #include "TRef.h"
00008 #include "TH1.h"
00009 #include "TMath.h"
00010 #include <vector>
00011 #include <map>
00012
00013 #include "root/MTChipSoftId.hh"
00014
00015
00016 class Event;
00017 class ChannelHit ;
00018 class MTChannel ;
00019 class MTTrack ;
00020
00021
00022
00023
00024
00025 class MTEvent : public TObject {
00026
00027 private:
00028 bool fSquareEvt;
00029 bool fBorderEvt;
00030 bool fChipEvt;
00031 bool fTimeInfo;
00032
00033 UInt_t fEventId;
00034 Double32_t fTemperature;
00035 std::map<UInt_t,Float_t> fTemperatureAsu1;
00036 std::map<UInt_t,Float_t> fTemperatureAsu2;
00037 std::map<UInt_t,Float_t> fTemperatureDif;
00038 Double32_t fPressure;
00039 ULong64_t fDifSynchro;
00040 ULong64_t fTimestamp;
00041 UInt_t fGlobalTriggerCounter;
00042 UInt_t fDifTriggerCounter;
00043
00044 std::map<UInt_t, std::map<UInt_t, UInt_t>* >fNbHitPerAbsTime;
00045
00046
00047 Int_t fNchannel;
00048 TClonesArray *fChannels;
00049
00050
00051
00052
00053 std::map<UInt_t, std::map<UInt_t, std::map<UInt_t, Float_t>* >* >fMeshVoltage;
00054 std::map<UInt_t, std::map<UInt_t, std::map<UInt_t, Float_t>* >* >fDriftVoltage;
00055
00056 std::vector<UInt_t> fDtCandidate;
00057
00058 MTTrack* fTrack;
00059
00060
00061
00062
00063
00064 static TClonesArray *fgChannels;
00065
00066
00067 bool fCrcIsCorrect;
00068 UInt_t fValid;
00069
00070 public:
00071 MTEvent();
00072 virtual ~MTEvent();
00073 MTEvent& operator=( const Event& rhs) ;
00074 MTEvent& operator=( const MTEvent& rhs);
00075
00076
00077 void Build(UInt_t evtId,ULong64_t difSynchro, Double32_t temperature, Double32_t pressure , ULong64_t timestamp );
00078 void SetTrack(MTTrack* aTrack) { fTrack = aTrack;};
00079 MTTrack* GetTrack(void){ return fTrack;} ;
00080
00081 bool GetSquareEvt(void) { return fSquareEvt; } ;
00082 void SetSquareEvt(bool value){ fSquareEvt = value; } ;
00083 bool GetBorderEvt(void) { return fBorderEvt; } ;
00084 void SetBorderEvt(bool value){ fBorderEvt = value; } ;
00085 bool GetChipEvt(void) { return fChipEvt; } ;
00086 void SetChipEvt(bool value){ fChipEvt = value; } ;
00087 bool GetTimeInfo(void) { return fTimeInfo; } ;
00088 void SetTimeInfo(bool value){ fTimeInfo = value; } ;
00089
00090 std::vector<UInt_t>& GetDtCandidate() { return fDtCandidate; }
00091
00092 void Clear(Option_t *option ="");
00093 static void Reset(Option_t *option ="");
00094 void SortChannel() { fChannels->Sort(); };
00095 void SetGlobalTriggerCounter(UInt_t value) { fGlobalTriggerCounter = value; };
00096 void SetDifTriggerCounter(UInt_t value) { fDifTriggerCounter = value; };
00097 UInt_t GetGlobalTriggerCounter(void) const { return fGlobalTriggerCounter; };
00098 UInt_t GetDifTriggerCounter(void) const { return fDifTriggerCounter; };
00099
00100 void AddHitForAbsTime(UInt_t boardId,UInt_t abs_time, UInt_t increment);
00101 UInt_t GetNbHitPerAbsTime(UInt_t boardId,UInt_t abs_time) const ;
00102 std::map< UInt_t, std::map<UInt_t, UInt_t>* > & GetNbHitPerAbsTime(){ return fNbHitPerAbsTime; };
00103
00104 bool GetCrcIsCorrect(void) const { return fCrcIsCorrect;} ;
00105 UInt_t GetValidFlag(void) const { return fValid;} ;
00106 void SetValidFlag(UInt_t value) { fValid = fValid + value; };
00107 bool IsValid(void);
00108
00109 void SetCrcIsCorrect(bool value) { fCrcIsCorrect = value; };
00110 bool IsSquare(UInt_t nbPad, UInt_t &asu, UInt_t &abs_time, UInt_t chb);
00111 bool IsBorder(UInt_t nbPad, UInt_t &asu, UInt_t &abs_time, UInt_t chb);
00112 bool IsChip(UInt_t nbPad, UInt_t &chip, UInt_t &abs_time, UInt_t chb);
00113
00114 void SetDifSynchro(ULong64_t t) { fDifSynchro = t; };
00115 void SetTemperature(Double32_t t) { fTemperature = t; };
00116 void SetPressure(Double32_t t) { fPressure = t; };
00117 void SetTimestamp(ULong64_t t) { fTimestamp = t; };
00118 void SetEventId(UInt_t aId) { fEventId = aId; } ;
00119 MTChannel* AddChannel(const ChannelHit& hit, UInt_t order);
00120 MTChannel* AddChannel(MTChannel* aChannel) ;
00121
00122
00123 UInt_t GetEventId() const { return fEventId; };
00124 UInt_t GetId() const { return GetEventId(); };
00125 ULong64_t GetDifSynchro() const { return fDifSynchro; } ;
00126 UInt_t GetNchannel() const { return fNchannel; };
00127 void SetNchannel(Int_t n) ;
00128
00129 UInt_t GetNchannel(UInt_t chamberId) const ;
00130 Double32_t GetTemperature() const { return fTemperature; };
00131 ULong64_t GetTimestamp() const {return fTimestamp;};
00132 Double32_t GetPressure() const { return fPressure; };
00133 TClonesArray* GetChannels() const { return fChannels; };
00134 MTChannel* GetChannelByOrder(UInt_t order,UInt_t chamberId) const;
00135
00136 std::map<UInt_t, std::map<UInt_t, std::map<UInt_t, Float_t>* >* >GetMeshVoltage() const { return fMeshVoltage; };
00137 std::map<UInt_t, std::map<UInt_t, std::map<UInt_t, Float_t>* >* >GetDriftVoltage() const { return fDriftVoltage; };
00138
00139 Float_t GetMeshVoltage(const Int_t chamberId,Int_t difId, Int_t boardId) const ;
00140 Float_t GetDriftVoltage(const Int_t chamberId,Int_t difId, Int_t boardId) const ;
00141
00142 void SetMeshVoltage(const Int_t chamberId, Int_t difId, Int_t boardId,const Float_t aValue) ;
00143 void SetDriftVoltage(const Int_t chamberId, Int_t difId, Int_t boardId,const Float_t aValue) ;
00144
00145 void SetTemperature(UInt_t difId,Float_t asu1, Float_t asu2, Float_t dif);
00146 void SetTemperatureAsu1(UInt_t difId,Float_t asu1);
00147 void SetTemperatureAsu2(UInt_t difId,Float_t asu2);
00148 void SetTemperatureDif(UInt_t difId, Float_t dif);
00149
00150 Float_t GetTemperatureAsu1( UInt_t difId ) const ;
00151 Float_t GetTemperatureAsu2( UInt_t difId ) const ;
00152 Float_t GetTemperatureDif( UInt_t difId ) const ;
00153
00154 std::map<UInt_t,Float_t>GetTemperatureAsu1(void) { return fTemperatureAsu1; } ;
00155 std::map<UInt_t,Float_t>GetTemperatureAsu2(void) { return fTemperatureAsu2; } ;
00156 std::map<UInt_t,Float_t>GetTemperatureDif(void) { return fTemperatureDif; } ;
00157
00158
00159
00160 private:
00161
00162 ClassDef(MTEvent, 30)
00163 };
00164
00165
00166 #endif