CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes | Friends

pos::PixelModuleName Class Reference

This class implements.. More...

#include <interface/PixelModuleName.h>

List of all members.

Public Member Functions

int blade () const
char detsub () const
int disk () const
char HF () const
char IO () const
int ladder () const
int layer () const
int module () const
std::string modulename () const
char mp () const
const bool operator< (const PixelModuleName &aROC) const
const PixelModuleNameoperator= (const PixelModuleName &aROC)
const bool operator== (const PixelModuleName &aModule) const
int panel () const
 PixelModuleName (PixelROCName roc)
 PixelModuleName (std::ifstream &s)
 PixelModuleName (std::string rocname)
 PixelModuleName ()
int sec () const

Private Member Functions

void check (bool check, const std::string &name)
void parsename (std::string name)
void setIdBPix (char np, char LR, int sec, int layer, int ladder, char HF, int module)
void setIdFPix (char np, char LR, int disk, int blade, int panel)

Private Attributes

unsigned int id_

Friends

std::ostream & operator<< (std::ostream &s, const PixelModuleName &pixelroc)

Detailed Description

This class implements..

A longer explanation will be placed here later

Definition at line 26 of file PixelModuleName.h.


Constructor & Destructor Documentation

PixelModuleName::PixelModuleName ( )

Definition at line 19 of file PixelModuleName.cc.

                                :
    id_(0)
{}
pos::PixelModuleName::PixelModuleName ( std::string  rocname) [explicit]
PixelModuleName::PixelModuleName ( PixelROCName  roc) [explicit]

Definition at line 24 of file PixelModuleName.cc.

References pos::PixelROCName::id(), and id_.

{

  unsigned int id=roc.id();
  unsigned int idtmp=(id&0x1FFFFFFF)>>4;
  if ((id&0x80000000)==0) idtmp=(idtmp&0xFFFFFFFC);
  
  id_=idtmp|(id&0xE0000000);

}
pos::PixelModuleName::PixelModuleName ( std::ifstream &  s) [explicit]

Member Function Documentation

int pos::PixelModuleName::blade ( ) const [inline]

Definition at line 47 of file PixelModuleName.h.

References id_.

Referenced by modulename().

{assert((id_&0x80000000)==0); return (id_>>3)&0x1f;}    
void pos::PixelModuleName::check ( bool  check,
const std::string &  name 
) [private]
char pos::PixelModuleName::detsub ( ) const [inline]

Definition at line 41 of file PixelModuleName.h.

References id_.

Referenced by modulename().

{return (id_&0x80000000)?'B':'F';}    
int pos::PixelModuleName::disk ( ) const [inline]

Definition at line 46 of file PixelModuleName.h.

References id_.

Referenced by modulename(), and pos::PixelROCName::parsename().

{assert((id_&0x80000000)==0); return (id_>>8)&0x3;}    
char pos::PixelModuleName::HF ( ) const [inline]

Definition at line 54 of file PixelModuleName.h.

References id_.

Referenced by modulename(), and pos::PixelROCName::parsename().

{assert((id_&0x80000000)!=0); return id_&0x00000080?'F':'H';}
char pos::PixelModuleName::IO ( ) const [inline]

Definition at line 43 of file PixelModuleName.h.

References id_.

Referenced by modulename().

{return id_&0x20000000?'I':'O';}    
int pos::PixelModuleName::ladder ( ) const [inline]

Definition at line 53 of file PixelModuleName.h.

References id_.

Referenced by modulename(), and pos::PixelROCName::parsename().

{assert((id_&0x80000000)!=0); return (id_>>2)&0x1f;}    
int pos::PixelModuleName::layer ( ) const [inline]

Definition at line 52 of file PixelModuleName.h.

References id_.

Referenced by modulename(), and pos::PixelROCName::parsename().

{assert((id_&0x80000000)!=0); return (id_>>8)&0x3;}    
int pos::PixelModuleName::module ( ) const [inline]

Definition at line 55 of file PixelModuleName.h.

References id_.

Referenced by modulename().

{assert((id_&0x80000000)!=0); return ((id_)&0x3)+1;}    
string PixelModuleName::modulename ( ) const

Definition at line 228 of file PixelModuleName.cc.

References blade(), detsub(), disk(), HF(), IO(), ladder(), layer(), module(), mp(), panel(), alignCSCRings::s, and sec().

Referenced by pos::PixelCalibConfiguration::buildROCAndModuleLists(), pos::PixelChannel::modulename(), pos::PixelPortcardMap::PixelPortcardMap(), pos::PixelPortcardMap::PortCardAndAOHs(), pos::PixelDACSettings::writeASCII(), pos::PixelTrimAllPixels::writeASCII(), and pos::PixelMaskAllPixels::writeASCII().

                                        {

    string s;

    std::ostringstream s1;

    if (detsub()=='F') {
        s1<<"FPix"; 
        s1<<"_B";
        s1<<mp();
        s1<<IO();
        s1<<"_D";
        s1<<disk();
        s1<<"_BLD";
        s1<<blade();
        s1<<"_PNL";
        s1<<panel();

    }
    else{
        s1<<"BPix"; 
        s1<<"_B";
        s1<<mp();
        s1<<IO();
        s1<<"_SEC";
        s1<<sec();
        s1<<"_LYR";
        s1<<layer();
        s1<<"_LDR";
        s1<<ladder();
        s1<<HF();
        s1<<"_MOD";
        s1<<module();
        
    }

    s=s1.str();
   
    return s;

} 
char pos::PixelModuleName::mp ( ) const [inline]

Definition at line 42 of file PixelModuleName.h.

References id_.

Referenced by modulename().

{return id_&0x40000000?'p':'m';}    
const bool pos::PixelModuleName::operator< ( const PixelModuleName aROC) const [inline]

Definition at line 64 of file PixelModuleName.h.

References id_.

                                                           {
      return id_<aROC.id_;
    }
const PixelModuleName & PixelModuleName::operator= ( const PixelModuleName aROC)

Definition at line 283 of file PixelModuleName.cc.

References id_.

                                                                            {
    
    id_=aROC.id_;

    return *this;

}
const bool pos::PixelModuleName::operator== ( const PixelModuleName aModule) const [inline]

Definition at line 68 of file PixelModuleName.h.

References id_.

                                                               {
      return id_==aModule.id_;
    }
int pos::PixelModuleName::panel ( ) const [inline]

Definition at line 48 of file PixelModuleName.h.

References id_.

Referenced by modulename().

{assert((id_&0x80000000)==0); return ((id_>>2)&0x1)+1;} 
void pos::PixelModuleName::parsename ( std::string  name) [private]
int pos::PixelModuleName::sec ( ) const [inline]

Definition at line 51 of file PixelModuleName.h.

References id_.

Referenced by modulename(), and pos::PixelROCName::parsename().

{assert((id_&0x80000000)!=0); return ((id_>>10)&0x7)+1;} 
void PixelModuleName::setIdBPix ( char  np,
char  LR,
int  sec,
int  layer,
int  ladder,
char  HF,
int  module 
) [private]

Definition at line 69 of file PixelModuleName.cc.

References id_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by pos::PixelROCName::parsename().

                                        {

    std::string mthn = "[PixelModuleName::setIdBPix()]\t\t\t    " ;
    id_=0;

    //cout<< __LINE__ << "]\t" << mthn << "BPix ladder: " << ladder << endl;
    //cout<< __LINE__ << "]\t" << mthn << "np         : " << np     << endl;
    //cout<< __LINE__ << "]\t" << mthn << "LR         : " << LR     << endl;
    //cout<< __LINE__ << "]\t" << mthn << "disk       : " << disk   << endl;

    
    id_=0x80000000;

    if (np=='p') id_=(id_|0x40000000);
    //cout<< __LINE__ << "]\t" << mthn <<"2 id_=" << hex << id_ << dec << endl;
    if (LR=='I') id_=(id_|0x20000000);
    //cout<< __LINE__ << "]\t" << mthn <<"3 id_=" << hex << id_ << dec << endl;
    id_=(id_|((sec-1)<<10));
    //cout<< __LINE__ << "]\t" << mthn <<"4 id_=" << hex << id_ << dec << endl;
    if (HF=='F') id_=(id_|0x00000080);

    id_=(id_|(layer<<8));
    //cout<< __LINE__ << "]\t" << mthn <<"5 id_=" << hex << id_ << dec << endl;
    id_=(id_|(ladder<<2));
    //cout<< __LINE__ << "]\t" << mthn <<"6 id_=" << hex << id_ << dec << endl;
    id_=(id_|((module-1)));
    //cout<< __LINE__ << "]\t" << mthn <<"7 id_=" << hex << id_ << dec << endl;

}
void PixelModuleName::setIdFPix ( char  np,
char  LR,
int  disk,
int  blade,
int  panel 
) [private]

Definition at line 43 of file PixelModuleName.cc.

References id_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by pos::PixelROCName::parsename().

                                              {

    std::string mthn = "[PixelModuleName::setIdFPix()]\t\t\t    " ;
    id_=0;

    //cout<< __LINE__ << "]\t" << mthn << "subdet: " << subdet <<endl; 
    //cout<< __LINE__ << "]\t" << mthn << "np    : " << np     <<endl; 
    //cout<< __LINE__ << "]\t" << mthn << "LR    : " << LR     <<endl; 
    //cout<< __LINE__ << "]\t" << mthn << "disk  : " << disk   <<endl; 

    
    if (np=='p') id_=(id_|0x40000000);
    //cout<< __LINE__ << "]\t" << mthn <<"2 id_=" << hex << id_ << dec << endl;
    if (LR=='I') id_=(id_|0x20000000);
    //cout<< __LINE__ << "]\t" << mthn <<"3 id_=" << hex << id_ << dec << endl;
    id_=(id_|(disk<<8));
    //cout<< __LINE__ << "]\t" << mthn <<"4 id_=" << hex << id_ << dec << endl;
    id_=(id_|(blade<<3));
    //cout<< __LINE__ << "]\t" << mthn <<"5 id_=" << hex << id_ << dec << endl;
    id_=(id_|((panel-1)<<2));
    //cout<< __LINE__ << "]\t" << mthn <<"6 id_=" << hex << id_ << dec << endl;

}

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const PixelModuleName pixelroc 
) [friend]

Member Data Documentation

unsigned int pos::PixelModuleName::id_ [private]