#include <CondFormats/RPCObjects/interface/RPCReadOutMapping.h>
Public Types | |
typedef std::pair< uint32_t, int > | StripInDetUnit |
first member is DetUnit ID, second strip in DetUnit frame | |
Public Member Functions | |
void | add (const DccSpec &dcc) |
attach FED to map | |
const DccSpec * | dcc (int dccId) const |
FED identified by ID. | |
std::vector< const DccSpec * > | dccList () const |
all FEDs in map | |
std::pair< int, int > | dccNumberRange () const |
Range of FED IDs in map (min and max id). | |
virtual StripInDetUnit | detUnitFrame (const LinkBoardSpec &location, const LinkBoardPackedStrip &packedStrip) const |
convert strip location as in raw data (LB and LBchannel) to detUnit frame | |
std::vector< const LinkBoardSpec * > | getLBforChamber (const std::string &name) const |
std::pair < LinkBoardElectronicIndex, int > | getRAWSpecForCMSChamberSrip (uint32_t detId, int strip, int dccInputChannel) const |
virtual const LinkBoardSpec * | location (const LinkBoardElectronicIndex &ele) const |
conversion between electronic and detector indexing | |
std::vector< std::pair < LinkBoardElectronicIndex, LinkBoardPackedStrip > > | rawDataFrame (const StripInDetUnit &duFrame) const |
connection "paths" that lead from one digi to one strip | |
RPCReadOutMapping (const std::string &version="") | |
const std::string & | version () const |
version as string | |
virtual | ~RPCReadOutMapping () |
Private Types | |
typedef std::map< int, DccSpec > ::const_iterator | IMAP |
Private Attributes | |
std::map< int, DccSpec > | theFeds |
std::string | theVersion |
Definition at line 21 of file RPCReadOutMapping.h.
typedef std::map<int, DccSpec>::const_iterator RPCReadOutMapping::IMAP [private] |
Definition at line 67 of file RPCReadOutMapping.h.
typedef std::pair<uint32_t,int> RPCReadOutMapping::StripInDetUnit |
first member is DetUnit ID, second strip in DetUnit frame
Definition at line 25 of file RPCReadOutMapping.h.
RPCReadOutMapping::RPCReadOutMapping | ( | const std::string & | version = "" |
) |
virtual RPCReadOutMapping::~RPCReadOutMapping | ( | ) | [inline, virtual] |
attach FED to map
Definition at line 28 of file RPCReadOutMapping.cc.
References DccSpec::id(), and theFeds.
Referenced by RPCEMap::convert(), and popcon::RPCReadOutMappingSourceHandler::readCablingMap().
FED identified by ID.
Definition at line 21 of file RPCReadOutMapping.cc.
References theFeds.
Referenced by location().
00022 { 00023 IMAP im = theFeds.find(dccId); 00024 const DccSpec & ddc = (*im).second; 00025 return (im != theFeds.end()) ? &ddc : 0; 00026 }
std::vector< const DccSpec * > RPCReadOutMapping::dccList | ( | ) | const |
all FEDs in map
Definition at line 34 of file RPCReadOutMapping.cc.
References HLT_VtxMuL3::result, and theFeds.
Referenced by popcon::RPCReadOutMappingSourceHandler::Compare2Cablings(), popcon::RPCEMapSourceHandler::Compare2EMaps(), and RPCReadOutMappingWithFastSearch::init().
00035 { 00036 std::vector<const DccSpec*> result; 00037 result.reserve(theFeds.size()); 00038 for (IMAP im = theFeds.begin(); im != theFeds.end(); im++) { 00039 result.push_back( &(im->second) ); 00040 } 00041 return result; 00042 }
Range of FED IDs in map (min and max id).
Definition at line 44 of file RPCReadOutMapping.cc.
References first, prof2calltree::last, and theFeds.
Referenced by popcon::RPCReadOutMappingSourceHandler::Compare2Cablings(), and popcon::RPCEMapSourceHandler::Compare2EMaps().
00045 { 00046 00047 if (theFeds.empty()) return std::make_pair(0,-1); 00048 else { 00049 IMAP first = theFeds.begin(); 00050 IMAP last = theFeds.end(); last--; 00051 return std::make_pair(first->first, last->first); 00052 } 00053 }
RPCReadOutMapping::StripInDetUnit RPCReadOutMapping::detUnitFrame | ( | const LinkBoardSpec & | location, | |
const LinkBoardPackedStrip & | packedStrip | |||
) | const [virtual] |
convert strip location as in raw data (LB and LBchannel) to detUnit frame
Reimplemented in RPCReadOutMappingWithFastSearch.
Definition at line 137 of file RPCReadOutMapping.cc.
References ChamberStripSpec::chamberStripNumber, debug, edm::MessageDrop::debugEnabled, LinkBoardSpec::feb(), LinkBoardPackedStrip::febInLB(), edm::MessageDrop::instance(), LogDebug, LinkBoardSpec::print(), FebConnectorSpec::rawId(), FebConnectorSpec::strip(), strip(), and LinkBoardPackedStrip::stripPinInFeb().
Referenced by RPCReadOutMappingWithFastSearch::detUnitFrame(), and RPCRecordFormatter::recordUnpack().
00139 { 00140 static bool debug = edm::MessageDrop::instance()->debugEnabled; 00141 uint32_t detUnit = 0; 00142 int stripInDU = 0; 00143 int febInLB = lbstrip.febInLB(); 00144 int stripPinInFeb = lbstrip.stripPinInFeb(); 00145 00146 const FebConnectorSpec * feb = location.feb(febInLB); 00147 if (feb) { 00148 detUnit = feb->rawId(); 00149 const ChamberStripSpec * strip = feb->strip(stripPinInFeb); 00150 if (strip) { 00151 stripInDU = strip->chamberStripNumber; 00152 } else { 00153 // LogWarning("detUnitFrame")<<"problem with stip for febInLB: "<<febInLB 00154 // <<" strip pin: "<< stripPinInFeb 00155 // <<" strip pin: "<< stripPinInFeb; 00156 if (debug) { 00157 LogDebug("")<<"problem with stip for febInLB: "<<febInLB 00158 <<" strip pin: "<< stripPinInFeb 00159 <<" strip pin: "<< stripPinInFeb 00160 <<" for linkBoard: "<<location.print(3); 00161 } 00162 } 00163 } else { 00164 // LogWarning("detUnitFrame")<<"problem with detUnit for febInLB: "; 00165 if (debug) { 00166 LogDebug("") <<"problem with detUnit for febInLB: " <<febInLB 00167 <<" for linkBoard: "<<location.print(1); 00168 } 00169 } 00170 return std::make_pair(detUnit,stripInDU); 00171 }
std::vector< const LinkBoardSpec * > RPCReadOutMapping::getLBforChamber | ( | const std::string & | name | ) | const |
Definition at line 216 of file RPCReadOutMapping.cc.
References FebConnectorSpec::chamber(), ChamberLocationSpec::chamberLocationName, LinkBoardElectronicIndex::dccId, LinkBoardElectronicIndex::dccInputChannelNum, LinkBoardSpec::feb(), j, k, LinkBoardElectronicIndex::lbNumInLink, location(), and LinkBoardElectronicIndex::tbLinkInputNum.
00216 { 00217 00218 00219 std::vector<const LinkBoardSpec*> vLBforChamber; 00220 00221 LinkBoardElectronicIndex linkboard; 00222 linkboard.dccId = 790; 00223 linkboard.dccInputChannelNum = 1; 00224 linkboard.tbLinkInputNum = 1; 00225 linkboard.lbNumInLink = 0; 00226 const LinkBoardSpec *location = this->location(linkboard); 00227 00228 for(int k=0;k<18;k++){ 00229 linkboard.dccInputChannelNum = 1; 00230 linkboard.tbLinkInputNum = k; 00231 for(int j=0;j<3;j++){ 00232 linkboard.lbNumInLink = j; 00233 int febInputNum=1; 00234 location = this->location(linkboard); 00235 if (location) { 00236 //location->print(); 00237 for(int j=0;j<6;j++){ 00238 const FebConnectorSpec * feb = location->feb(febInputNum+j); 00239 if(feb){ 00240 //feb->print(); 00241 std::string chName = feb->chamber().chamberLocationName; 00242 if(chName==name){ 00243 vLBforChamber.push_back(location); 00244 //feb->chamber().print(); 00245 break; 00246 } 00247 } 00248 } 00249 } 00250 } 00251 } 00252 return vLBforChamber; 00253 }
std::pair< LinkBoardElectronicIndex, int > RPCReadOutMapping::getRAWSpecForCMSChamberSrip | ( | uint32_t | detId, | |
int | strip, | |||
int | dccInputChannel | |||
) | const |
Definition at line 180 of file RPCReadOutMapping.cc.
References ChamberStripSpec::cmsStripNumber, GenMuonPlsPt100GeV_cfg::cout, LinkBoardElectronicIndex::dccId, LinkBoardElectronicIndex::dccInputChannelNum, lat::endl(), LinkBoardSpec::feb(), i, j, k, edm::es::l(), LinkBoardElectronicIndex::lbNumInLink, location(), FebConnectorSpec::rawId(), FebConnectorSpec::strip(), and LinkBoardElectronicIndex::tbLinkInputNum.
00180 { 00181 00182 LinkBoardElectronicIndex linkboard; 00183 linkboard.dccId = 790; 00184 linkboard.dccInputChannelNum = dccInputChannel; 00185 00186 for(int k=0;k<18;k++){ 00187 linkboard.tbLinkInputNum = k; 00188 for(int j=0;j<3;j++){ 00189 linkboard.lbNumInLink = j; 00190 const LinkBoardSpec *location = this->location(linkboard); 00191 if (location) { 00192 for(int i=1;i<7;i++){ 00193 const FebConnectorSpec * feb = location->feb(i); 00194 if(feb && feb->rawId()==detId){ 00195 for(int l=1;l<17;l++){ 00196 int pin = l; 00197 const ChamberStripSpec *aStrip = feb->strip(pin); 00198 if(aStrip && aStrip->cmsStripNumber==strip){ 00199 int bitInLink = (i-1)*16+l-1; 00200 std::pair<LinkBoardElectronicIndex, int> stripInfo(linkboard,bitInLink); 00201 return stripInfo; 00202 } 00203 } 00204 } 00205 } 00206 } 00207 } 00208 } 00209 RPCDetId aDet(detId); 00210 std::cout<<"Strip: "<<strip<<" not found for detector: "<<aDet<<std::endl; 00211 std::pair<LinkBoardElectronicIndex, int> dummyStripInfo(linkboard,-99); 00212 return dummyStripInfo; 00213 }
const LinkBoardSpec * RPCReadOutMapping::location | ( | const LinkBoardElectronicIndex & | ele | ) | const [virtual] |
conversion between electronic and detector indexing
Reimplemented in RPCReadOutMappingWithFastSearch.
Definition at line 119 of file RPCReadOutMapping.cc.
References dcc(), LinkBoardElectronicIndex::dccId, LinkBoardElectronicIndex::dccInputChannelNum, LinkBoardElectronicIndex::lbNumInLink, LinkConnSpec::linkBoard(), TriggerBoardSpec::linkConn(), LinkBoardElectronicIndex::tbLinkInputNum, and DccSpec::triggerBoard().
Referenced by RPCRawSynchro::dumpDelays(), getLBforChamber(), getRAWSpecForCMSChamberSrip(), and RPCRecordFormatter::recordUnpack().
00120 { 00121 //FIXME after debugging change to dcc(ele.dccId)->triggerBoard(ele.dccInputChannelNum)->... 00122 const DccSpec *dcc = RPCReadOutMapping::dcc(ele.dccId); 00123 if (dcc) { 00124 const TriggerBoardSpec *tb = dcc->triggerBoard(ele.dccInputChannelNum); 00125 if (tb) { 00126 const LinkConnSpec *lc = tb->linkConn( ele.tbLinkInputNum); 00127 if (lc) { 00128 const LinkBoardSpec *lb = lc->linkBoard(ele.lbNumInLink); 00129 return lb; 00130 } 00131 } 00132 } 00133 return 0; 00134 }
std::vector< std::pair< LinkBoardElectronicIndex, LinkBoardPackedStrip > > RPCReadOutMapping::rawDataFrame | ( | const StripInDetUnit & | duFrame | ) | const |
connection "paths" that lead from one digi to one strip
Definition at line 57 of file RPCReadOutMapping.cc.
References ChamberStripSpec::cablePinNumber, ChamberStripSpec::chamberStripNumber, LinkBoardElectronicIndex::dccId, TriggerBoardSpec::dccInputChannelNum(), LinkBoardElectronicIndex::dccInputChannelNum, TriggerBoardSpec::enabledLinkConns(), LinkBoardSpec::febs(), DccSpec::id(), it, LinkBoardElectronicIndex::lbNumInLink, link(), FebConnectorSpec::linkBoardInputNum(), LinkBoardSpec::linkBoardNumInLink(), LinkConnSpec::linkBoards(), FebConnectorSpec::rawId(), HLT_VtxMuL3::result, strip(), FebConnectorSpec::strips(), LinkBoardElectronicIndex::tbLinkInputNum, theFeds, LinkConnSpec::triggerBoardInputNumber(), and DccSpec::triggerBoards().
Referenced by RPCRecordFormatter::recordPack().
00058 { 00059 std::vector< std::pair< LinkBoardElectronicIndex, LinkBoardPackedStrip> > result; 00060 LinkBoardElectronicIndex eleIndex = { 0,0,0,0 }; 00061 00062 const uint32_t & rawDetId = stripInDetUnit.first; 00063 const int & stripInDU = stripInDetUnit.second; 00064 00065 for (IMAP im=theFeds.begin(); im != theFeds.end(); im++) { 00066 const DccSpec & dccSpec = (*im).second; 00067 const std::vector<TriggerBoardSpec> & triggerBoards = dccSpec.triggerBoards(); 00068 for ( std::vector<TriggerBoardSpec>::const_iterator 00069 it = triggerBoards.begin(); it != triggerBoards.end(); it++) { 00070 const TriggerBoardSpec & triggerBoard = (*it); 00071 typedef std::vector<const LinkConnSpec* > LINKS; 00072 LINKS linkConns = triggerBoard.enabledLinkConns(); 00073 for ( LINKS::const_iterator ic = linkConns.begin(); ic != linkConns.end(); ic++) { 00074 00075 const LinkConnSpec & link = **ic; 00076 const std::vector<LinkBoardSpec> & boards = link.linkBoards(); 00077 for ( std::vector<LinkBoardSpec>::const_iterator 00078 ib = boards.begin(); ib != boards.end(); ib++) { 00079 00080 const LinkBoardSpec & board = (*ib); 00081 00082 eleIndex.dccId = dccSpec.id(); 00083 eleIndex.dccInputChannelNum = triggerBoard.dccInputChannelNum(); 00084 eleIndex.tbLinkInputNum = link.triggerBoardInputNumber(); 00085 eleIndex.lbNumInLink = board.linkBoardNumInLink(); 00086 00087 const std::vector<FebConnectorSpec> & febs = board.febs(); 00088 int febCheck = 0; 00089 for ( std::vector<FebConnectorSpec>::const_iterator 00090 ifc = febs.begin(); ifc != febs.end(); ifc++) { 00091 const FebConnectorSpec & febConnector = (*ifc); 00092 febCheck++; 00093 if (febConnector.rawId() != rawDetId) continue; 00094 int febInLB = febConnector.linkBoardInputNum(); 00095 /* if (febInLB != febCheck) { 00096 edm::LogError("rawDataFrame") << " problem with febInLB: " <<febInLB<<" "<<febCheck; 00097 } */ 00098 const std::vector<ChamberStripSpec> & strips = febConnector.strips(); 00099 00100 for (std::vector<ChamberStripSpec>::const_iterator 00101 is = strips.begin(); is != strips.end(); is++) { 00102 const ChamberStripSpec & strip = (*is); 00103 int stripPinInFeb = strip.cablePinNumber; 00104 // if ( strip.cmsStripNumber == stripInDU) { 00105 if ( strip.chamberStripNumber == stripInDU) { 00106 result.push_back( 00107 std::make_pair( eleIndex, LinkBoardPackedStrip( febInLB, stripPinInFeb) ) ); 00108 } 00109 } 00110 } 00111 } 00112 } 00113 } 00114 } 00115 return result; 00116 }
const std::string& RPCReadOutMapping::version | ( | ) | const [inline] |
version as string
Definition at line 44 of file RPCReadOutMapping.h.
References theVersion.
Referenced by LinkDataXMLWriter::analyze(), RPCReadOutMappingWithFastSearch::init(), RPCPackingModule::produce(), and RPCUnpackingModule::produce().
00044 { return theVersion; }
std::map<int, DccSpec> RPCReadOutMapping::theFeds [private] |
Definition at line 68 of file RPCReadOutMapping.h.
Referenced by add(), dcc(), dccList(), dccNumberRange(), and rawDataFrame().
std::string RPCReadOutMapping::theVersion [private] |
Reimplemented in RPCReadOutMappingWithFastSearch.
Definition at line 69 of file RPCReadOutMapping.h.
Referenced by version().