CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/L1Trigger/DTBti/interface/DTBtiHit.h

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00019 //
00020 //--------------------------------------------------
00021 #ifndef DT_BTI_HIT_H
00022 #define DT_BTI_HIT_H
00023 
00024 //------------------------------------
00025 // Collaborating Class Declarations --
00026 //------------------------------------
00027 class DTDigi;
00028 
00029 //----------------------
00030 // Base Class Headers --
00031 //----------------------
00032 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfig.h"
00033 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigBti.h"
00034 
00035 //---------------
00036 // C++ Headers --
00037 //---------------
00038 #include<cmath>
00039 #include<string>
00040 
00041 
00042 //              ---------------------
00043 //              -- Class Interface --
00044 //              ---------------------
00045 
00046 
00047 class DTBtiHit {
00048 
00049   public:
00050 
00052   DTBtiHit(const DTDigi*, DTConfigBti*);
00053 
00055   DTBtiHit(int clockTime , DTConfigBti*);
00056                       
00058   DTBtiHit(const DTBtiHit&);
00059   
00061   ~DTBtiHit();
00062 
00064   DTBtiHit & operator=(const DTBtiHit&);
00065   
00067   inline void stepDownTime() { //_curTime-=_stepTime; 
00068                                _clockTime-=1; 
00069                               }
00070 
00072   inline const DTDigi* hitDigi() const { return _hitdigi; }
00073 
00075 
00079   inline float curTime() const { return _curTime; }
00080   inline int clockTime() const { return _clockTime; }
00081 
00083   inline int isDrifting() const { //return _curTime>=0 && _curTime<4000; 
00084                                   return _clockTime>1 && _clockTime<400; 
00085   }
00086 
00088   //SV jtrig()=_config->ST() added: is for tdrift==0
00089   inline int isInsideReg() const {
00090     //return _curTime<0 && jtrig()<=_config->ST();
00091     return ( _clockTime<=0 && jtrig()<=_config->ST() );      //SV bug fix 17XII03
00092   }
00093 
00095   inline int jtrig() const { 
00096                              //return (int)(fabs(_curTime)/_stepTime); 
00097                               return -_clockTime;
00098                             }
00099   //inline float jtrig() const { return fabs(_curTime)/_stepTime; } //prova SV
00100   //SV 13/XI/02 half-int simulation added
00101   /*inline float jtrig() const {  
00102         int idt = int(fabs(_curTime/_stepTime));
00103         float rest = fmod( fabs(_curTime), _stepTime );
00104         int irest = 0;
00105         if(rest==0.0)
00106           irest = 1;
00107         else
00108           irest = int( rest / (_stepTime*0.5) );
00109         float jtrig_int4 = float(idt) + float(irest)*0.5;
00110         return jtrig_int4;  
00111   }
00112 */
00113 
00114 public:
00115   static const float _stepTime;
00116   static const float _stepTimeTdc;
00117   static std::string t0envFlag;
00118 
00119 private:
00120   const DTDigi* _hitdigi;
00121   DTConfigBti* _config;
00122   float _curTime;
00123   int _clockTime;
00124 };
00125 
00126 #endif