CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/DataFormats/SiStripCommon/interface/SiStripEventSummary.h

Go to the documentation of this file.
00001 // Last commit: $Id: SiStripEventSummary.h,v 1.10 2008/06/09 12:55:03 delaer Exp $
00002 
00003 #ifndef DataFormats_SiStripEventSummary_SiStripEventSummary_H
00004 #define DataFormats_SiStripEventSummary_SiStripEventSummary_H
00005 
00006 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
00007 #include <sstream>
00008 #include <vector>
00009 
00010 class SiStripEventSummary;
00011 
00013 std::ostream& operator<< ( std::ostream&, const SiStripEventSummary& );
00014 
00023 class SiStripEventSummary {
00024 
00025  public:
00026 
00027   // ---------- Constructors, destructors ----------
00028   
00030   SiStripEventSummary();
00031   
00033   ~SiStripEventSummary() {;}
00034   
00035   // ---------- General information ----------
00036   
00039   inline bool valid() const;
00040   
00042   inline uint16_t triggerFed() const;
00043 
00045   inline bool isSet() const;
00046   
00047   // ---------- Run and event-related info ----------
00048   
00050   inline const sistrip::RunType& runType() const;
00051 
00053   inline const uint32_t& event() const;
00054 
00056   inline const uint32_t& bx() const;
00057   
00058   // ---------- Hardware-related info ----------
00059 
00061   inline const sistrip::FedReadoutMode& fedReadoutMode() const;
00062 
00064   inline const sistrip::ApvReadoutMode& apvReadoutMode() const;
00065 
00067   inline const uint16_t& apveAddress() const;
00068 
00070   inline const uint32_t& nApvsInSync() const;
00071 
00073   inline const uint32_t& nApvsOutOfSync() const;
00074 
00076   inline const uint32_t& nApvsErrors() const;
00077   
00078   // ---------- Commissioning info ----------
00079 
00081   inline bool nullParams() const; 
00082 
00084   inline const std::vector<uint32_t>& params() const; 
00085   
00087   inline const uint32_t& binNumber() const; 
00088 
00090   inline const uint32_t& pllCoarse() const; 
00091   
00093   inline const uint32_t& pllFine() const; 
00094 
00096   inline const uint32_t& latency() const;
00097   
00099   inline const uint32_t& calChan() const;
00100   
00102   inline const uint32_t& calSel() const;
00103   
00105   inline const uint32_t& isha() const;
00106   
00108   inline const uint32_t& vfs() const;
00109   
00111   inline const uint32_t& ttcrx() const;
00112   
00114   inline const uint32_t& vpsp() const;
00115   
00117   inline const uint32_t& vpspCcuChan() const;
00118   
00120   inline const uint32_t& lldGain() const;
00121 
00123   inline const uint32_t& lldBias() const;
00124   
00126   inline const uint32_t& deviceId() const;
00127   
00129   inline const uint32_t& processId() const;
00130   
00132   inline const uint32_t& processIp() const;
00133   
00135   inline const uint32_t& dcuId() const;
00136   
00138   inline const uint32_t& layerScanned() const;
00139 
00140   // ---------- Setter methods ----------
00141   
00143   void commissioningInfo( const uint32_t* const buffer,
00144                           const uint32_t& event );
00145 
00147   void commissioningInfo( const uint32_t& daq_register1,
00148                           const uint32_t& daq_register2 );
00149   
00151   inline void triggerFed( const int16_t& );
00152   
00154   void fedReadoutMode( const uint16_t& );
00155   
00157   inline void event( const uint32_t& );
00158 
00160   inline void bx( const uint32_t& );
00161 
00162   inline void apveAddress( uint16_t& addr );
00163   inline void nApvsInSync( uint32_t& napvs_in_sync );
00164   inline void nApvsOutOfSync( uint32_t& napvs_out_of_sync );
00165   inline void nApvsErrors( uint32_t& napvs_with_errors );
00166   
00167  private:
00168 
00169   // ---------- General info ----------
00170 
00172   bool valid_;
00173 
00175   uint16_t triggerFed_;
00176 
00177 
00178   // ---------- Run- and event-related info ----------
00179   
00181   sistrip::RunType runType_;
00182 
00184   uint32_t event_;
00185   
00187   uint32_t bx_;
00188 
00190   uint32_t spillNumber_;
00191 
00193   uint32_t nDataSenders_;
00194   
00195   // ---------- Hardware-related info ----------
00196 
00198   sistrip::FedReadoutMode fedReadoutMode_;
00199 
00201   sistrip::ApvReadoutMode apvReadoutMode_;
00202 
00204   uint16_t apveAddress_;
00205 
00207   uint32_t nApvsInSync_;
00208 
00210   uint32_t nApvsOutOfSync_;
00211 
00213   uint32_t nApvsErrors_;
00214 
00216   std::vector<uint32_t> params_;
00217 
00218 };
00219 
00220 // ---------- inline methods ----------
00221 
00222 bool SiStripEventSummary::valid() const { return valid_; }
00223 uint16_t SiStripEventSummary::triggerFed() const { return triggerFed_; }
00224 bool SiStripEventSummary::isSet() const { return ( /* triggerFed_ > 0 && */ runType_ != sistrip::UNDEFINED_RUN_TYPE ); }  
00225 
00226 const sistrip::RunType& SiStripEventSummary::runType() const { return runType_; }
00227 const uint32_t& SiStripEventSummary::event() const { return event_; }
00228 const uint32_t& SiStripEventSummary::bx() const { return bx_; }
00229 
00230 const sistrip::FedReadoutMode& SiStripEventSummary::fedReadoutMode() const { return fedReadoutMode_; }
00231 const sistrip::ApvReadoutMode& SiStripEventSummary::apvReadoutMode() const { return apvReadoutMode_; }
00232 
00233 const uint16_t& SiStripEventSummary::apveAddress() const { return apveAddress_; }
00234 const uint32_t& SiStripEventSummary::nApvsInSync() const { return nApvsInSync_; }
00235 const uint32_t& SiStripEventSummary::nApvsOutOfSync() const { return nApvsOutOfSync_; }
00236 const uint32_t& SiStripEventSummary::nApvsErrors() const { return nApvsErrors_; }
00237 
00238 bool SiStripEventSummary::nullParams() const { return ( !params_[0] && !params_[1] && !params_[2] && !params_[3] ); } 
00239 const std::vector<uint32_t>& SiStripEventSummary::params() const { return params_; } 
00240 const uint32_t& SiStripEventSummary::binNumber() const { return params_[0]; }
00241 const uint32_t& SiStripEventSummary::pllCoarse() const { return params_[0]; }
00242 const uint32_t& SiStripEventSummary::pllFine() const { return params_[1]; }
00243 const uint32_t& SiStripEventSummary::latency() const { return params_[0]; }
00244 const uint32_t& SiStripEventSummary::calChan() const { return params_[1]; }
00245 const uint32_t& SiStripEventSummary::calSel() const { return params_[2]; }
00246 const uint32_t& SiStripEventSummary::isha() const { return params_[3]; }
00247 const uint32_t& SiStripEventSummary::vfs() const { return params_[4]; }
00248 const uint32_t& SiStripEventSummary::ttcrx() const { return params_[2]; }
00249 const uint32_t& SiStripEventSummary::vpsp() const { return params_[0]; }
00250 const uint32_t& SiStripEventSummary::vpspCcuChan() const { return params_[1]; }
00251 const uint32_t& SiStripEventSummary::lldGain() const { return params_[0]; }
00252 const uint32_t& SiStripEventSummary::lldBias() const { return params_[1]; }
00253 const uint32_t& SiStripEventSummary::deviceId() const { return params_[0]; }
00254 const uint32_t& SiStripEventSummary::processId() const { return params_[1]; }
00255 const uint32_t& SiStripEventSummary::processIp() const { return params_[2]; }
00256 const uint32_t& SiStripEventSummary::dcuId() const { return params_[3]; }
00257 const uint32_t& SiStripEventSummary::layerScanned() const { return params_[3]; }
00258 
00259 void SiStripEventSummary::triggerFed( const int16_t& fed ) { fed < 0 ? triggerFed_ = 0 : triggerFed_ = fed; }
00260 void SiStripEventSummary::event( const uint32_t& event ) { event_ = event; }
00261 void SiStripEventSummary::bx( const uint32_t& bx ) { bx_ = bx; }
00262 
00263 void SiStripEventSummary::apveAddress( uint16_t& addr ) { apveAddress_ = addr; }
00264 void SiStripEventSummary::nApvsInSync( uint32_t& napvs_in_sync ) { nApvsInSync_ = napvs_in_sync; }
00265 void SiStripEventSummary::nApvsOutOfSync( uint32_t& napvs_out_of_sync ) { nApvsOutOfSync_ = napvs_out_of_sync; }
00266 void SiStripEventSummary::nApvsErrors( uint32_t& napvs_with_errors ) { nApvsErrors_ = napvs_with_errors; }
00267 
00268 #endif // DataFormats_SiStripEventSummary_SiStripEventSummary_H
00269 
00270 
00271