CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Public Attributes | Private Member Functions | Friends
RPCEMap Class Reference

#include <RPCEMap.h>

Classes

struct  dccItem
 
struct  febItem
 
struct  lbItem
 
struct  linkItem
 
struct  tbItem
 

Public Member Functions

RPCReadOutMapping const * convert () const
 
 RPCEMap (const std::string &version="")
 
virtual ~RPCEMap ()
 

Public Attributes

std::vector< dccItemtheDccs
 
std::vector< febItemtheFebs
 
std::vector< lbItemtheLBs
 
std::vector< linkItemtheLinks
 
std::vector< tbItemtheTBs
 
std::string theVersion
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 13 of file RPCEMap.h.

Constructor & Destructor Documentation

◆ RPCEMap()

RPCEMap::RPCEMap ( const std::string &  version = "")
inline

Definition at line 15 of file RPCEMap.h.

15 : theVersion(version) {}
std::string theVersion
Definition: RPCEMap.h:19

◆ ~RPCEMap()

virtual RPCEMap::~RPCEMap ( )
inlinevirtual

Definition at line 17 of file RPCEMap.h.

17 {}

Member Function Documentation

◆ convert()

RPCReadOutMapping const* RPCEMap::convert ( ) const
inline

Definition at line 64 of file RPCEMap.h.

References LinkConnSpec::add(), DccSpec::add(), LinkBoardSpec::add(), TriggerBoardSpec::add(), RPCReadOutMapping::add(), FebConnectorSpec::addStrips(), relativeConstraints::chamber, phase1PixelTopology::layer, theDccs, theFebs, theLBs, theLinks, theTBs, and theVersion.

Referenced by RPCUnpackingModule::beginRun(), popcon::RPCEMapSourceHandler::Compare2EMaps(), RPCMonitorLinkSynchro::dqmBeginRun(), omtf::RpcPacker::initCabling(), omtf::RpcUnpacker::initCabling(), and RPCPackingModule::produce().

64  {
66  int diskOffset = 4;
67  int year = atoi(theVersion.substr(6, 4).c_str());
68  int month = atoi(theVersion.substr(3, 2).c_str());
69  if (year < 2012 || (year == 2012 && month < 11))
70  diskOffset = 3;
71  int lastTB = 0;
72  int lastLink = 0;
73  int lastLB = 0;
74  int lastFeb = 0;
75  for (unsigned int idcc = 0; idcc < theDccs.size(); idcc++) {
76  DccSpec dcc(theDccs[idcc].theId);
77  for (int itb = lastTB; itb < lastTB + theDccs[idcc].nTBs; itb++) {
78  TriggerBoardSpec tb(theTBs[itb].theNum);
79  for (int ilink = lastLink; ilink < lastLink + theTBs[itb].nLinks; ilink++) {
80  LinkConnSpec lc(theLinks[ilink].theTriggerBoardInputNumber);
81  for (int ilb = lastLB; ilb < lastLB + theLinks[ilink].nLBs; ilb++) {
82  LinkBoardSpec lb(theLBs[ilb].theMaster, theLBs[ilb].theLinkBoardNumInLink, theLBs[ilb].theCode);
83  for (int ifeb = lastFeb; ifeb < lastFeb + theLBs[ilb].nFebs; ifeb++) {
84  int sector = (theFebs[ifeb].theChamber) % 100;
85  char subsector = ((theFebs[ifeb].theChamber) / 100) % 10 - 2;
86  char febZRadOrnt = ((theFebs[ifeb].theChamber) / 1000) % 5;
87  char febZOrnt = ((theFebs[ifeb].theChamber) / 5000) % 2;
88  char diskOrWheel = ((theFebs[ifeb].theChamber) / 10000) % 10 - diskOffset;
89  char layer = ((theFebs[ifeb].theChamber) / 100000) % 10;
90  char barrelOrEndcap = (theFebs[ifeb].theChamber) / 1000000;
92  diskOrWheel, layer, sector, subsector, febZOrnt, febZRadOrnt, barrelOrEndcap};
93  char cmsEtaPartition = (theFebs[ifeb].thePartition) / 1000;
94  char positionInCmsEtaPartition = ((theFebs[ifeb].thePartition) % 1000) / 100;
95  char localEtaPartition = ((theFebs[ifeb].thePartition) % 100) / 10;
96  char positionInLocalEtaPartition = (theFebs[ifeb].thePartition) % 10;
97  FebLocationSpec afeb = {
98  cmsEtaPartition, positionInCmsEtaPartition, localEtaPartition, positionInLocalEtaPartition};
99  FebConnectorSpec febConnector(theFebs[ifeb].theLinkBoardInputNum, chamber, afeb);
100  febConnector.addStrips(theFebs[ifeb].theAlgo);
101  lb.add(febConnector);
102  // std::cout<<"End of FEB"<<std::endl;
103  }
104  lc.add(lb);
105  lastFeb += theLBs[ilb].nFebs;
106  }
107  tb.add(lc);
108  lastLB += theLinks[ilink].nLBs;
109  }
110  dcc.add(tb);
111  lastLink += theTBs[itb].nLinks;
112  }
113  cabling->add(dcc);
114  lastTB += theDccs[idcc].nTBs;
115  }
116  return cabling;
117  };
std::vector< tbItem > theTBs
Definition: RPCEMap.h:59
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< dccItem > theDccs
Definition: RPCEMap.h:58
std::vector< febItem > theFebs
Definition: RPCEMap.h:62
void add(const DccSpec &dcc)
attach FED to map
std::vector< linkItem > theLinks
Definition: RPCEMap.h:60
std::vector< lbItem > theLBs
Definition: RPCEMap.h:61
std::string theVersion
Definition: RPCEMap.h:19

◆ serialize()

template<class Archive >
void RPCEMap::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 120 of file RPCEMap.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 120 of file RPCEMap.h.

Member Data Documentation

◆ theDccs

std::vector<dccItem> RPCEMap::theDccs

Definition at line 58 of file RPCEMap.h.

Referenced by convert().

◆ theFebs

std::vector<febItem> RPCEMap::theFebs

Definition at line 62 of file RPCEMap.h.

Referenced by convert().

◆ theLBs

std::vector<lbItem> RPCEMap::theLBs

Definition at line 61 of file RPCEMap.h.

Referenced by convert().

◆ theLinks

std::vector<linkItem> RPCEMap::theLinks

Definition at line 60 of file RPCEMap.h.

Referenced by convert().

◆ theTBs

std::vector<tbItem> RPCEMap::theTBs

Definition at line 59 of file RPCEMap.h.

Referenced by convert().

◆ theVersion

std::string RPCEMap::theVersion

Definition at line 19 of file RPCEMap.h.

Referenced by convert().