00001 #ifndef Event_h 00002 #define Event_h 00003 00004 #include <vector> 00005 #include "HecCell.h" 00006 #include "Geometry.h" 00007 #include "EmecCell.h" 00008 00009 /*! - Class Event 00010 * - Author: Ian Gable (igable@uvic.ca) 00011 * - Date: 05/10/2002 00012 * - Description: Event stores a list of HecCells in a vector. Each HecCell can be retrieved. 00013 */ 00014 class Event{ 00015 00016 public: 00017 /** The default contructor 00018 */ 00019 Event(); 00020 00021 //========HecPortion===================================== 00022 00023 /** Add adcValue to hecCell with adcNumber 00024 * @param cell a static HecCell Class 00025 */ 00026 bool addHecCell(HecCell cell); 00027 00028 /** Return a pointer to hec Cell with adcNumber 00029 * @param acdNumber The acd Number of the cell you wish to return 00030 */ 00031 HecCell* hecCell(int adcNumber); 00032 00033 //! clear the content of the cells so that new info can be loaded 00034 void clearHecCells(); 00035 00036 //! return the number of cells 00037 int numHecCells(); 00038 00039 // ! return a constant pointer to the m_hecCells vector 00040 const vector<HecCell>* hecCellsPointer(); 00041 00042 //! get event number 00043 int hecEventNumber() { return m_hecEventNumber; }; 00044 00045 //! set event number 00046 void hecEventNumber(int eventNum) {m_hecEventNumber = eventNum;}; 00047 00048 /** Set the hecTrigger. Note that the parameter MUST be an array of 00049 * 5 integers. 00050 * @param hecTriggerArray a pointer to the hecTriggerArray 00051 */ 00052 void setHecTrigger(unsigned int hecTriggerArray[5]); 00053 00054 //! Return a pointer to the HecTriggerVector 00055 vector<int>* getHecTriggerVector(){ return &m_hecTriggerVector;}; 00056 00057 //! Returns true when particle has contancted both muon detectors 00058 bool isHecMuon() { return m_isHecMuon;} 00059 00060 //! Returns true when event is a Random Trigger 00061 bool isHecRandom() { return m_isHecRandom;} 00062 00063 /** Get the trigger bit from 0 to 4 00064 * (physics,electron,muon,pion,random) 00065 * @param bit The trigger bit 0-4 will cause exit(1) if accessed outside 00066 */ 00067 int getHecTriggerBit(int bit); 00068 00069 00070 //=========EmecPortion======================= 00071 00072 /** Add adcValue to EmecCell with adcNumber 00073 * @param cell a static EmecCell Class 00074 */ 00075 bool addEmecCell(EmecCell cell); 00076 00077 /** Return a pointer to EmecCell with adcNumber 00078 * @param acdNumber The acd Number of the cell you wish to return 00079 */ 00080 EmecCell* emecCell(int adcNumber); 00081 00082 //! clear the content of the cells so that new info can be loaded 00083 void clearEmecCells(); 00084 00085 //! return the number of cells 00086 int numEmecCells(); 00087 00088 // ! return a constant pointer to the m_emecCells vector 00089 const vector<EmecCell>* emecCellsPointer(); 00090 00091 //! get event number 00092 int emecEventNumber() { return m_emecEventNumber; }; 00093 00094 //! set event number 00095 void emecEventNumber(int eventNum) {m_emecEventNumber = eventNum;}; 00096 00097 /** Set the emecTrigger. Note that the parameter MUST be an array of 00098 * 5 integers. 00099 * @param emecTriggerArray a pointer to the emecTriggerArray 00100 */ 00101 void setEmecTrigger(unsigned int emecTriggerArray[5]); 00102 00103 //! Return a pointer to the EmecTriggerVector 00104 vector<int>* getEmecTriggerVector(){ return &m_emecTriggerVector;}; 00105 00106 //! Returns true when particle has contancted both muon detectors 00107 bool isEmecMuon() { return m_isEmecMuon;} 00108 00109 //! Returns true when event is a Random Trigger 00110 bool isEmecRandom() { return m_isEmecRandom;} 00111 00112 /** Get the trigger bit from 0 to 4 00113 * (physics,electron,muon,pion,random) 00114 * @param bit The trigger bit 0-4 will cause exit(1) if accessed outside 00115 */ 00116 int getEmecTriggerBit(int bit); 00117 00118 //maybe include method to get individual elements of the Trigger Vector 00119 00120 00121 //! Get the beam chamber X Slope 00122 float beamChamberSlopeX() {return m_bcSlopeX;}; 00123 00124 //! Get the BeamChamber YSlope 00125 float beamChamberSlopeY() {return m_bcSlopeY;}; 00126 00127 //! Get the beam chamber X position at z = 0 00128 float beamChamberXatZ0() {return m_bcXatZ0; }; 00129 00130 //! Get the beam chamber y position at z = 0 00131 float beamChamberYatZ0(){ return m_bcYatZ0; }; 00132 00133 //! 00134 float beamChamberCovXatZ0() { return m_bcCovXatZ0;}; 00135 00136 //! 00137 float beamChamberCovXatSlopeX(){ return m_bcCovXatSlopeX;}; 00138 00139 //! 00140 float beamChamberCovXatZ0SlopeX(){ return m_bcCovXatZ0SlopeX;}; 00141 00142 //! 00143 float beamChamberCovYatZ0() { return m_bcCovYatZ0;}; 00144 00145 //! 00146 float beamChamberCovYatSlopeY(){ return m_bcCovYatSlopeY;}; 00147 00148 //! 00149 float beamChamberCovYatZ0SlopeY(){ return m_bcCovYatZ0SlopeY;}; 00150 00151 void setBeamChamberInfo(float slope[2], float pos0[2], float xcov[3], float ycov[3]); 00152 00153 /** Return a STL vector of floats that are are the parameters for the 00154 * beam chamber info. The order of the parameters is a0, a1, b0, b1. 00155 */ 00156 vector<float> beamChamberLine(); 00157 00158 //! tdc global time (ns) 00159 float globalTDCTime(){ return m_globalTDCTime;}; 00160 00161 //! Cubic fit global time (ns) 00162 float globalCubicTime(){ return m_globalCubicTime;}; 00163 00164 //! Cubic fit global time sigma (ns) 00165 float globalCubicTimeSigma(){ return m_globalCubicTimeSigma;}; 00166 00167 //! 00168 void setGlobalTimingInfo(float tdc_ns, float Globalcubictime, float Globalcubictimesigma); 00169 00170 private: 00171 vector<HecCell> m_hecCellVector; //! contains an array of cells 00172 void processHecTrigger(); 00173 00174 int m_hecEventNumber; //! the event number 00175 vector<int> m_hecTriggerVector; //! vector of the trigger information 00176 bool m_isHecMuon; 00177 bool m_isHecRandom; 00178 00179 vector<EmecCell> m_emecCellVector; //! contains an array of cells 00180 void processEmecTrigger(); 00181 00182 int m_emecEventNumber; //! the event number 00183 vector<int> m_emecTriggerVector; //! vector of the trigger information 00184 bool m_isEmecMuon; 00185 bool m_isEmecRandom; 00186 00187 // beam chamber info 00188 float m_bcSlopeX; 00189 float m_bcSlopeY; 00190 float m_bcXatZ0; 00191 float m_bcYatZ0; 00192 00193 float m_bcCovXatZ0; 00194 float m_bcCovXatSlopeX; 00195 float m_bcCovXatZ0SlopeX; 00196 00197 float m_bcCovYatZ0; 00198 float m_bcCovYatSlopeY; 00199 float m_bcCovYatZ0SlopeY; 00200 00201 // global time info 00202 float m_globalTDCTime; 00203 float m_globalCubicTime; 00204 float m_globalCubicTimeSigma; 00205 00206 }; 00207 #endif