CMS 3D CMS Logo

sipixelobjects::PixelFEDLink Class Reference

#include <CondFormats/SiPixelObjects/interface/PixelFEDLink.h>

List of all members.

Public Types

typedef std::vector< PixelROCROCs
 ROCs served be this link.

Public Member Functions

void add (const ROCs &rocs)
 add connection (defined by connection spec and ROCs)
void addItem (const PixelROC &roc)
bool checkRocNumbering () const
 check ROC in link numbering consistency, ie.
unsigned int id () const
 link id
int numberOfROCs () const
 number of ROCs in fed
 PixelFEDLink (unsigned int id=0)
 ctor with id of link and parent FED
std::string print (int depth=0) const
const PixelROCroc (unsigned int id) const
 return ROC identified by id. ROC ids are ranged [1,numberOfROCs]

Private Member Functions

std::string printForMap () const

Private Attributes

uint theId
ROCs theROCs


Detailed Description

Definition at line 18 of file PixelFEDLink.h.


Member Typedef Documentation

typedef std::vector<PixelROC> sipixelobjects::PixelFEDLink::ROCs

ROCs served be this link.

Definition at line 22 of file PixelFEDLink.h.


Constructor & Destructor Documentation

sipixelobjects::PixelFEDLink::PixelFEDLink ( unsigned int  id = 0  )  [inline]

ctor with id of link and parent FED

Definition at line 25 of file PixelFEDLink.h.

00025 : theId(id) { } 


Member Function Documentation

void PixelFEDLink::add ( const ROCs rocs  ) 

add connection (defined by connection spec and ROCs)

Definition at line 35 of file PixelFEDLink.cc.

References theROCs.

Referenced by PixelEndcapLinkMaker::links(), and PixelBarrelLinkMaker::links().

00036 {
00037   theROCs.insert( theROCs.end(), rocs.begin(), rocs.end() );
00038 }

void PixelFEDLink::addItem ( const PixelROC roc  ) 

Definition at line 12 of file PixelFEDLink.cc.

References sipixelobjects::PixelROC::idInLink(), and theROCs.

00013 {
00014   // INFO roc numbering vs vector has offset=1
00015   if(roc.idInLink() > theROCs.size() ) theROCs.resize(roc.idInLink());
00016   theROCs[roc.idInLink()-1] = roc;
00017 }

bool PixelFEDLink::checkRocNumbering (  )  const

check ROC in link numbering consistency, ie.

that ROC position in vector is the same as its id. To be called by owner

Definition at line 19 of file PixelFEDLink.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), it, HLT_VtxMuL3::result, and theROCs.

00020 {
00021   bool result = true;
00022   unsigned int idx_expected = 0;
00023   typedef ROCs::const_iterator CIR;
00024   for (CIR it = theROCs.begin(); it != theROCs.end(); it++) {
00025     idx_expected++;
00026     if (idx_expected != (*it).idInLink() ) {
00027       result = false;
00028       cout << "** PixelFEDLink, idInLink in ROC, expected: "
00029            << idx_expected <<" has: "<<(*it).idInLink() << endl;
00030     }
00031   }
00032   return result;
00033 }

unsigned int sipixelobjects::PixelFEDLink::id ( void   )  const [inline]

link id

Definition at line 31 of file PixelFEDLink.h.

References theId.

Referenced by sipixelobjects::PixelFEDCabling::addLink(), print(), and SiPixelFrameConverter::toCabling().

00031 { return theId; }

int sipixelobjects::PixelFEDLink::numberOfROCs (  )  const [inline]

number of ROCs in fed

Definition at line 34 of file PixelFEDLink.h.

References theROCs.

Referenced by SiPixelFrameConverter::hasDetUnit(), print(), and SiPixelFrameConverter::toCabling().

00034 { return theROCs.size(); }

string PixelFEDLink::print ( int  depth = 0  )  const

Definition at line 40 of file PixelFEDLink.cc.

References lat::endl(), id(), numberOfROCs(), out, printForMap(), and theROCs.

00041 {
00042   ostringstream out;
00043   if (id() < 0) return  out.str();
00044 
00045   if (depth-- >=0 ) {
00046     if(id()<10) out <<"  LNK:  "<<id(); else  out <<"  LNK: "<<id();
00047     if (depth==0) out << printForMap();
00048     else { 
00049       out << endl;
00050       typedef ROCs::const_iterator CIR;
00051       for (CIR ir = theROCs.begin(); ir != theROCs.end(); ir++) out<< (ir)->print(depth); 
00052       out <<"#  total number of ROCs: "<< numberOfROCs() << endl;
00053     }
00054   }
00055   return out.str();
00056 
00057 }

string PixelFEDLink::printForMap (  )  const [private]

Definition at line 59 of file PixelFEDLink.cc.

References GeomDetEnumerators::barrel, PixelEndcapName::bladeName(), PixelEndcapName::diskName(), lat::endl(), first, PixelEndcapName::halfCylinder(), PixelModuleName::isBarrel(), max, min, PixelEndcapName::name(), PixelBarrelName::name(), out, PixelEndcapName::pannelName(), DetId::rawId(), theROCs, and tmp.

Referenced by print().

00060 {
00061   typedef ROCs::const_iterator CIR;
00062   ostringstream out;
00063 
00064 // barrel
00065 {
00066   int minroc = 9999;
00067   int maxroc = -1;
00068   bool first = true;
00069   PixelBarrelName prev;
00070   for (CIR ir = theROCs.begin(); ir < theROCs.end(); ir++) {
00071     DetId detid = DetId(ir->rawId());
00072     bool barrel = PixelModuleName::isBarrel(detid.rawId()); if (!barrel) continue;
00073     PixelBarrelName curr( detid);
00074     if (first) prev = curr; 
00075 
00076     int idRoc = ir->idInDetUnit();
00077     if (curr==prev) {
00078       minroc = min(idRoc, minroc);
00079       maxroc = max(idRoc, maxroc);
00080     }
00081 
00082     if ( !(curr==prev) ) {
00083     out <<"    MOD: "<< prev.name() <<" ROC: "<< minroc<<", "<<maxroc<< std::endl;
00084       prev = curr;
00085       maxroc = minroc = idRoc;
00086  //     minroc = idRoc;
00087  //     maxroc = idRoc;
00088     }
00089 
00090     if ( ir==theROCs.end()-1) {
00091     out <<"    MOD: "<< curr.name() <<" ROC: "<< minroc<<", "<<maxroc<< std::endl;
00092     }
00093   }
00094 }
00095 
00096 // same for endcpap
00097 {
00098   bool first = true;
00099   PixelEndcapName prev;
00100   for (CIR ir = theROCs.begin(); ir < theROCs.end(); ir++) {
00101     DetId detid = DetId(ir->rawId());
00102     bool barrel = PixelModuleName::isBarrel(detid.rawId()); if (barrel) continue;
00103     PixelEndcapName tmp( detid);
00104     PixelEndcapName curr( tmp.halfCylinder(), tmp.diskName(), tmp.bladeName(), tmp.pannelName() );
00105     if (first) prev = curr;
00106     if ( !(curr==prev) ) out <<"    MOD: "<< prev.name() << std::endl;
00107     if ( ir==theROCs.end()-1) out <<"    MOD: "<< curr.name() << std::endl;
00108   }
00109 }
00110   return out.str();
00111 }

const PixelROC* sipixelobjects::PixelFEDLink::roc ( unsigned int  id  )  const [inline]

return ROC identified by id. ROC ids are ranged [1,numberOfROCs]

Definition at line 37 of file PixelFEDLink.h.

References theROCs.

Referenced by SiPixelInformationExtractor::findNoisyPixels(), SiPixelFrameConverter::hasDetUnit(), SiPixelSCurveCalibrationAnalysis::makeThresholdSummary(), SiPixelFrameConverter::toCabling(), and SiPixelFrameConverter::toDetector().

00038     { return (id > 0 && id <= theROCs.size() ) ?  &theROCs[id-1] : 0; }


Member Data Documentation

uint sipixelobjects::PixelFEDLink::theId [private]

Definition at line 49 of file PixelFEDLink.h.

Referenced by id().

ROCs sipixelobjects::PixelFEDLink::theROCs [private]

Definition at line 50 of file PixelFEDLink.h.

Referenced by add(), addItem(), checkRocNumbering(), numberOfROCs(), print(), printForMap(), and roc().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:52:34 2009 for CMSSW by  doxygen 1.5.4