/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/include/event/Event.hh

Go to the documentation of this file.
00001 /* @version $Revision: 1767 $ * @modifiedby $Author: lcdet $ * @lastmodified $Date: 2012-06-08 15:44:25 +0200 (Fri, 08 Jun 2012) $ */
00002 #ifndef EVENT_HH
00003 #define EVENT_HH
00004 //////////////////////////////////////////////////////////////////////////
00005 //                                                                      //
00006 // Event  for MICROMEGAS READOUT                                        //
00007 //                                                                      //
00008 //////////////////////////////////////////////////////////////////////////
00009 #include "event/ChannelHit.hh"
00010 #include "slowControl/BoardSlowControl.hh"
00011 #include "mTypes.h"
00012 #include <set>
00013 #include <map>
00014 
00015 
00016 
00017 class SlowControlEntry;
00018 class Chamber;
00019 class Channel;
00020 class Run;
00021 
00022 struct sorter
00023 {
00024    bool operator() (const ChannelHit * lhs, const ChannelHit * rhs) const
00025    {
00026     return lhs->getAnalogValue() > rhs->getAnalogValue();
00027    }
00028 };
00029 
00030 
00031 class Chamber;
00032 
00033 
00034 ;
00035 
00036 //////////////////////////////////////////////////////////////////////////
00037 ///     CLASS EVENT                                                     //
00038 //////////////////////////////////////////////////////////////////////////
00039 class Event {
00040    friend std::ostream& operator <<(std::ostream &out, const Event &x);
00041 
00042 public:
00043    Event(Run &aRun);
00044    Event(Run&, i64 aTimestamp, i32 aId);
00045 
00046    ~Event();
00047    std::ostream& operator <<(std::ostream &out) const;
00048 
00049    inline const Run& getRun(void) const { return run; }
00050    inline i32 getId(void) const   { return id; }
00051    void setId(i32 aId)      { id = aId; }
00052    inline const i64 getTimeStamp(void) const { return timestamp; }
00053    inline const i32 getDifSynchro(void) const { return difSynchro; }
00054    void setTimeStamp(i64 aTimestamp) { timestamp = aTimestamp; }
00055    void setDifSyncrho(i32 aDifSynchro) { difSynchro = aDifSynchro; }
00056 
00057    inline ui64 getChannelHitSize(ui32 chamberId) const{ return channelHits.find(chamberId)->second->size(); }
00058    ui64 getChannelHitSize() const;
00059    std::map<ui16, std::multiset<ChannelHit*,sorter>* >& getChannelHits() { return channelHits; } ;
00060 
00061    const ChannelHit& getChannelHitByOrder( ui64 order ,const Chamber& aChamber)  ;
00062    const ChannelHit& getChannelHitByOrder( ui64 order ,const Chamber& aChamber, i16 aThreshold)  ;
00063 
00064    void insertHit(  Chamber&, ChannelHit *);
00065 
00066    const std::multiset<ChannelHit*,sorter>& getChannelHitVector(const Chamber& aChamber) const ;
00067    void print(void) const;
00068 
00069    void setSlowControlParam(const SlowControlEntry* params);
00070 
00071    const float getPressure() const  ;
00072    const float getTemperature() const ;
00073    inline const  SlowControlEntry* getSlowControlEntry() { return slowControlEntry;};
00074    const float getBoardDriftVolt(const ui32 chamberId,const ui32 difId, const ui32 boardId) const ;
00075    const float getBoardMeshVolt(const ui32 chamberId,const ui32 difId, const ui32 boardId)  const;
00076    const BoardSlowControl& getBoardSlowControl(const ui32 chamberId,const ui32 difId, const ui32 boardId) const;
00077 
00078 
00079    void setGlobalTriggerCounter(ui32 value) { globalTriggerCounter = value; };
00080    void setDifTriggerCounter(ui32 value) { difTriggerCounter = value; };
00081    ui32 getGlobalTriggerCounter(void) const { return globalTriggerCounter; };
00082    ui32 getDifTriggerCounter(void) const { return difTriggerCounter; };
00083    bool getCrcIsCorrect(void) const { return crcIsCorrect;} ;
00084    void setCrcIsCorrect(bool value) { crcIsCorrect = value; }; 
00085    ui16 getValidFlag(void) const { return valid;} ;
00086    void setValidFlag(ui16 value) { valid = valid+value; }; 
00087    bool isValid(void);
00088 
00089    void setTemperature(ui16 difId, float asu1, float asu2, float dif);
00090    float getTemperatureAsu1( ui16 difId ) const ;
00091    float getTemperatureAsu2( ui16 difId )  const  ;
00092    float getTemperatureDif( ui16 difId ) const   ;
00093 
00094     
00095    std::map<unsigned int,float>getTemperatureAsu1(void) const { return temperatureAsu1; } ;
00096    std::map<unsigned int,float>getTemperatureAsu2(void) const{ return temperatureAsu2; } ;
00097    std::map<unsigned int,float>getTemperatureDif(void)  const { return temperatureDif; } ;
00098 
00099 
00100   // lcio::LCEventImpl* getLcioImpl();
00101 
00102 
00103 private:
00104   void initChannelHitVector(void);
00105 
00106 private:
00107    i32 id;
00108    const Run &run;
00109    i64 timestamp;
00110    i32 difSynchro;
00111    std::map<ui16, std::multiset<ChannelHit*,sorter>* > channelHits; // defined a multiset container per chamber map key is chamber id
00112    const SlowControlEntry *slowControlEntry;
00113          ui32 globalTriggerCounter; // increment at each trigger
00114          ui32 difTriggerCounter;    // increment on trigger only if dif store data
00115    bool crcIsCorrect; 
00116    ui16 valid; 
00117 
00118    std::map<unsigned int,float> temperatureAsu1;   // Key is difId
00119    std::map<unsigned int,float>  temperatureAsu2;  // Key is difId
00120    std::map<unsigned int,float>  temperatureDif;   // Key is difId
00121    
00122 
00123 };
00124 
00125 #endif
00126 

Generated on Mon Jun 11 16:55:44 2012 for MicromegasFramework by  doxygen 1.4.7