/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/include/root/MTEvent.hh

Go to the documentation of this file.
00001 #ifndef ROOT_MTEvent
00002 #define ROOT_MTEvent
00003 
00004 #include "TObject.h"
00005 #include "TString.h"
00006 #include "TClonesArray.h"
00007 #include "TRefArray.h"
00008 #include "TRef.h"
00009 #include "TH1.h"
00010 #include "TMath.h"
00011 #include <vector>
00012 #include <map>
00013 
00014 #include "root/MTChipSoftId.hh"
00015 
00016 
00017 class Event;
00018 class ChannelHit ;
00019 class MTChannel ;
00020 class MTTrack ;
00021 ////////////////////////////////////////////////////////////////////////////////////////
00022 ///     CLASS EVENT (containing Header and MTChannel)
00023 /// - Hardroc + Dirac: 1 evenement == 1 lecture de tous les chips d'une Dif 
00024 /// - Gassiplex : 1 evenement == 1 Trigger PM == 1 ecriture Gassiplex
00025 ///////////////////////////////////////////////////////////////////////////////////////
00026 class MTEvent : public TObject {
00027 
00028 private:
00029    bool fSquareEvt; // default false
00030    bool fBorderEvt; // default false
00031    bool fChipEvt; // default false
00032    bool fTimeInfo; // default false:  ->true si l'info en temps est vrai, c.a.d. si la dernièrer lecture était il y a moins de 3.35 s. sinon false
00033 
00034    UInt_t                   fEventId;
00035    Double32_t               fTemperature;
00036    std::map<UInt_t,Float_t> fTemperatureAsu1;  // Key is difId
00037    std::map<UInt_t,Float_t> fTemperatureAsu2;  // Key is difId
00038    std::map<UInt_t,Float_t> fTemperatureDif;  // Key is difId
00039    Double32_t               fPressure;
00040    ULong64_t                  fDifSynchro;
00041    ULong64_t                fTimestamp;  // millisecond fromn 1 janv 1970
00042    UInt_t                   fGlobalTriggerCounter; // increment at each trigger
00043    UInt_t                   fDifTriggerCounter;    // increment on trigger only if dif store data
00044 
00045    std::map<UInt_t, std::map<UInt_t, UInt_t>* >fNbHitPerAbsTime;   // key is boardId, key is bcId_hit, value is nbHi
00046    // Absolutime is compute as following : bcid_abs - (bcid_dif - bcid_hit)
00047 
00048    Int_t          fNchannel;          //Number of channels hit for this event
00049    TClonesArray  *fChannels;          //->array with all channels
00050    // channels are sorted before being inserted into TClonesArray.
00051    // Thus fChannels[0] will contain highest channel response and fChannels[fChannels.GetSize()-1]
00052    // will contain lowest channel responce
00053 
00054    std::map<UInt_t, std::map<UInt_t, std::map<UInt_t, Float_t>* >* >fMeshVoltage;
00055    std::map<UInt_t, std::map<UInt_t, std::map<UInt_t, Float_t>* >* >fDriftVoltage;
00056 
00057    std::vector<UInt_t> fDtCandidate;
00058 
00059    MTTrack* fTrack;
00060 
00061 
00062 
00063 
00064 
00065    static TClonesArray *fgChannels;
00066 
00067 
00068    bool fCrcIsCorrect;
00069    UInt_t fValid;
00070 
00071 public:
00072    MTEvent();
00073    virtual ~MTEvent();
00074    MTEvent&  operator=( const  Event& rhs) ;
00075    MTEvent&  operator=( const  MTEvent& rhs);
00076 
00077    //MTEvent&      operator=( const  MTEvent& rhs) ;
00078    void          Build(UInt_t evtId,ULong64_t difSynchro, Double32_t  temperature, Double32_t  pressure , ULong64_t  timestamp );
00079    void          SetTrack(MTTrack* aTrack) { fTrack = aTrack;};
00080    MTTrack*      GetTrack(void) const {  return fTrack;} ;
00081 
00082    bool          GetSquareEvt(void)const { return fSquareEvt; } ;
00083    void          SetSquareEvt(bool value){ fSquareEvt = value; } ;
00084    bool          GetBorderEvt(void) const{ return fBorderEvt; } ;
00085    void          SetBorderEvt(bool value){ fBorderEvt = value; } ;
00086    bool          GetChipEvt(void) const {return fChipEvt; } ;
00087    void          SetChipEvt(bool value){ fChipEvt = value; } ;
00088    bool          GetTimeInfo(void) const{ return fTimeInfo; } ;
00089    void          SetTimeInfo(bool value){ fTimeInfo = value; } ;
00090 
00091    std::vector<UInt_t>& GetDtCandidate()  { return fDtCandidate; }
00092 
00093    void          Clear(Option_t *option ="");
00094    static void   Reset(Option_t *option ="");
00095    void          SortChannel() { fChannels->Sort(); };
00096    void SetGlobalTriggerCounter(UInt_t value) { fGlobalTriggerCounter = value; };
00097    void SetDifTriggerCounter(UInt_t value) { fDifTriggerCounter = value; };
00098    UInt_t GetGlobalTriggerCounter(void) const { return fGlobalTriggerCounter; };
00099    UInt_t GetDifTriggerCounter(void) const { return fDifTriggerCounter; };
00100 
00101    void   AddHitForAbsTime(UInt_t boardId,UInt_t abs_time, UInt_t increment); 
00102    UInt_t  GetNbHitPerAbsTime(UInt_t boardId,UInt_t abs_time) const ;
00103    std::map< UInt_t, std::map<UInt_t, UInt_t>* > & GetNbHitPerAbsTime() { return fNbHitPerAbsTime; };
00104 
00105    bool GetCrcIsCorrect(void) const { return fCrcIsCorrect;} ;
00106    UInt_t  GetValidFlag(void) const { return fValid;} ;
00107    TString GetValidFlagString(void ) const;
00108    void SetValidFlag(UInt_t  value,bool valid=true);
00109    bool IsValid(void) const;
00110 
00111    void SetCrcIsCorrect(bool value) { fCrcIsCorrect = value; };
00112   bool IsSquare(UInt_t nbPad, UInt_t &asu, UInt_t &abs_time, UInt_t chb); //input : nbPad = threshold where we consider an event "Square"; chb = chamber ID; outputs: asu = the asu where the event is square; abs_time = the abs_time when the event is square
00113   bool IsBorder(UInt_t nbPad, UInt_t &asu, UInt_t &abs_time, UInt_t chb); //input : nbPad = threshold where we consider an event "Border"; chb = chamber ID; outputs: asu = the asu where the event is border; abs_time = the abs_time when the event is border
00114   bool IsChip(UInt_t nbPad, UInt_t &chip, UInt_t &abs_time, UInt_t chb); //input : nbPad = threshold where we consider an event "Chip"; chb = chamber ID; outputs: chip = the chip where the event is chip; abs_time = the abs_time when the event is chip
00115 
00116    void          SetDifSynchro(ULong64_t t) { fDifSynchro = t; };
00117    void          SetTemperature(Double32_t t) { fTemperature = t; };
00118    void          SetPressure(Double32_t t) { fPressure = t; };
00119    void          SetTimestamp(ULong64_t t) { fTimestamp = t; };
00120    void          SetEventId(UInt_t aId) { fEventId = aId; } ;
00121    MTChannel*    AddChannel(const ChannelHit& hit, UInt_t order);
00122    MTChannel*    AddChannel(MTChannel* aChannel) ;
00123 
00124 
00125    UInt_t        GetEventId() const { return fEventId; };
00126    UInt_t        GetId() const { return GetEventId(); };
00127    ULong64_t       GetDifSynchro() const { return fDifSynchro; } ;
00128    UInt_t        GetNchannel() const { return fNchannel; };
00129    void          SetNchannel(Int_t n) ;
00130 
00131    UInt_t        GetNchannel(UInt_t chamberId) const ;
00132    Double32_t    GetTemperature() const { return fTemperature; };
00133    ULong64_t     GetTimestamp() const {return fTimestamp;};           
00134    Double32_t    GetPressure() const { return fPressure; };
00135    TClonesArray* GetChannels() const { return fChannels; };
00136    MTChannel*    GetChannelByOrder(UInt_t order,UInt_t chamberId) const;
00137 
00138 
00139    std::map<UInt_t, std::map<UInt_t, std::map<UInt_t, Float_t>* >*  >GetMeshVoltage() const { return fMeshVoltage; };
00140    std::map<UInt_t, std::map<UInt_t, std::map<UInt_t, Float_t>* >*  >GetDriftVoltage() const { return fDriftVoltage; };
00141 
00142    Float_t GetMeshVoltage(const Int_t chamberId,Int_t difId, Int_t boardId) const ;
00143    Float_t GetDriftVoltage(const Int_t chamberId,Int_t difId, Int_t boardId) const ;
00144 
00145    void    SetMeshVoltage(const Int_t chamberId, Int_t difId, Int_t boardId,const Float_t aValue) ;
00146    void    SetDriftVoltage(const Int_t chamberId, Int_t difId, Int_t boardId,const Float_t aValue) ;
00147 
00148    void SetTemperature(UInt_t difId,Float_t asu1, Float_t asu2, Float_t dif);
00149    void SetTemperatureAsu1(UInt_t difId,Float_t asu1);
00150    void SetTemperatureAsu2(UInt_t difId,Float_t asu2);
00151    void SetTemperatureDif(UInt_t difId, Float_t dif);
00152 
00153    Float_t GetTemperatureAsu1( UInt_t difId ) const ;
00154    Float_t GetTemperatureAsu2( UInt_t difId ) const ;
00155    Float_t GetTemperatureDif( UInt_t difId ) const ;
00156 
00157    std::map<UInt_t,Float_t>GetTemperatureAsu1(void)const { return fTemperatureAsu1; } ;
00158    std::map<UInt_t,Float_t>GetTemperatureAsu2(void)const { return fTemperatureAsu2; } ;
00159    std::map<UInt_t,Float_t>GetTemperatureDif(void)const  { return fTemperatureDif; } ;
00160 
00161 
00162 
00163 private:
00164 
00165    ClassDef(MTEvent, 34)  //MTEvent structure
00166 };
00167 
00168 
00169 #endif

Generated on Mon Jan 7 13:15:20 2013 for MicromegasFramework by  doxygen 1.4.7