CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/CalibFormats/SiStripObjects/interface/SiStripFecCabling.h

Go to the documentation of this file.
00001 // Last commit: $Id: SiStripFecCabling.h,v 1.18 2008/02/06 16:40:42 bainbrid Exp $
00002 
00003 #ifndef CalibFormats_SiStripObjects_SiStripFecCabling_H
00004 #define CalibFormats_SiStripObjects_SiStripFecCabling_H
00005 
00006 #include "CondFormats/SiStripObjects/interface/SiStripFedCabling.h"
00007 #include "CalibFormats/SiStripObjects/interface/NumberOfDevices.h"
00008 #include "CalibFormats/SiStripObjects/interface/SiStripFecCrate.h"
00009 #include "CondFormats/SiStripObjects/interface/FedChannelConnection.h"
00010 #include <boost/cstdint.hpp>
00011 #include <sstream>
00012 #include <ostream>
00013 #include <vector>
00014 
00015 class SiStripFecCabling;
00016 
00018 std::ostream& operator<< ( std::ostream&, const SiStripFecCabling& );
00019 
00020 /* 
00021    @class SiStripFecCabling
00022    @author R.Bainbridge
00023    @brief FEC cabling object for the strip tracker.
00024 */
00025 class SiStripFecCabling {
00026   
00027  public:
00028 
00029   // ---------- Constructors, destructors ----------
00030   
00032   SiStripFecCabling( const SiStripFedCabling& );
00034   SiStripFecCabling() {;}
00036   ~SiStripFecCabling() {;} //@@ needs implementation!!
00037   
00038   // ---------- Methods to retrieve connection info ----------
00039   
00041   inline const std::vector<SiStripFecCrate>& crates() const;
00043   inline const std::vector<SiStripFec>& fecs() const; //@@ TEMPORARY: to maintain backward compatibility!
00045   void connections( std::vector<FedChannelConnection>& ) const;
00047   const SiStripModule& module( const FedChannelConnection& conn ) const;
00049   const SiStripModule& module( const uint32_t& dcu_id ) const;
00051   NumberOfDevices countDevices() const;
00053   void print( std::stringstream& ) const;
00055   void terse( std::stringstream& ) const;
00056 
00057   // ---------- Methods used to build FEC cabling ----------
00058 
00060   void buildFecCabling( const SiStripFedCabling& ); 
00062   void addDevices( const FedChannelConnection& conn );
00064   inline void dcuId( const FedChannelConnection& conn );
00066   inline void detId( const FedChannelConnection& conn );
00068   inline void nApvPairs( const FedChannelConnection& conn );
00069   
00070  private:
00071 
00073   std::vector<SiStripFecCrate> crates_;
00074   
00075 };
00076 
00077 // ---------- Inline methods ----------
00078 
00079 const std::vector<SiStripFecCrate>& SiStripFecCabling::crates() const { return crates_; }
00080 
00081 // TEMPORARY method to maintain backward compatibility!
00082 const std::vector<SiStripFec>& SiStripFecCabling::fecs() const { 
00083   static std::vector<SiStripFec> my_fecs;
00084   if ( !crates_.empty() ) { return crates_[0].fecs(); }
00085   else { return my_fecs; }
00086 }
00087 
00088 void SiStripFecCabling::dcuId( const FedChannelConnection& conn ) { 
00089   const_cast<SiStripModule&>(module(conn)).dcuId(conn.dcuId()); 
00090 }
00091 
00092 void SiStripFecCabling::detId( const FedChannelConnection& conn ) { 
00093   const_cast<SiStripModule&>(module(conn)).detId(conn.detId()); 
00094 }
00095 
00096 void SiStripFecCabling::nApvPairs( const FedChannelConnection& conn ) { 
00097   const_cast<SiStripModule&>(module(conn)).nApvPairs(conn.nApvPairs()); 
00098 }
00099 
00100 #endif // CalibTracker_SiStripObjects_SiStripFecCabling_H
00101 
00102 /*
00103 
00104 inline void fedCh( const FedChannelConnection& conn ); //@@ needs to be implemented
00105 
00106 void SiStripFecCabling::fedCh( const FedChannelConnection& conn ) {  
00107   module(conn).detId(conn.fedId());  
00108   module(conn).detId(conn.fedCh());  
00109 }
00110 
00111 */