CMS 3D CMS Logo

FebConnectorSpec.cc

Go to the documentation of this file.
00001 #include "CondFormats/RPCObjects/interface/FebConnectorSpec.h"
00002 #include "CondFormats/RPCObjects/interface/DBSpecToDetUnit.h"
00003 #include "DataFormats/MuonDetId/interface/RPCDetId.h"
00004 #include <iostream>
00005 
00006 FebConnectorSpec::FebConnectorSpec(
00007     int num, const ChamberLocationSpec & chamber, const FebLocationSpec & feb)
00008   : theLinkBoardInputNum(num),
00009     theChamber(chamber),
00010     theFeb(feb),
00011     theRawId(0)
00012 { }
00013 
00014 void FebConnectorSpec::add(const ChamberStripSpec & strip)
00015 {
00016   theStrips.push_back(strip);
00017 }
00018 
00019 const ChamberStripSpec * FebConnectorSpec::strip( int pinNumber) const
00020 {
00021   //FIXME - temporary implementaion, to be replace by LUT (in preparation)
00022   typedef std::vector<ChamberStripSpec>::const_iterator IT;
00023   for (IT it=theStrips.begin(); it != theStrips.end(); it++) {
00024     if(pinNumber==it->cablePinNumber) return &(*it);
00025   }
00026   return 0;
00027 }
00028 
00029 const uint32_t & FebConnectorSpec::rawId() const
00030 {
00031   DBSpecToDetUnit toDU;
00032   if (!theRawId)  theRawId = toDU(theChamber, theFeb);
00033   return theRawId;
00034 }
00035 
00036 
00037 std::string FebConnectorSpec::print(int depth) const
00038 {
00039   std::ostringstream str;
00040   str << "FebConnectorSpec in LinkBoardNum ="<<linkBoardInputNum()
00041       <<" rawId: " << rawId() <<std::endl;
00042   RPCDetId aDet(rawId());
00043   str<<aDet<<std::endl;
00044   str << theChamber.print(depth)<< std::endl << theFeb.print(depth) ;
00045   depth--;
00046   if (depth >=0) {
00047     typedef std::vector<ChamberStripSpec>::const_iterator IT;
00048     for (IT it=theStrips.begin(); it != theStrips.end(); it++) str << (*it).print(depth); 
00049   }
00050   return str.str();
00051 }

Generated on Tue Jun 9 17:26:45 2009 for CMSSW by  doxygen 1.5.4