CMS 3D CMS Logo

Public Member Functions | Private Attributes

rpcdqm::utils Class Reference

#include <utils.h>

List of all members.

Public Member Functions

std::string detId2ChamberLabel (const RPCDetId &_id)
int detId2ChamberNr (const RPCDetId &_id)
int detId2RollNr (const RPCDetId &_id)
void doEndcapLabeling (bool useRollInfo)
void dolabeling (bool useRollInfo)
void fillvect ()
void labelXAxisSector (MonitorElement *myMe)
void labelXAxisSegment (MonitorElement *myMe)
void labelYAxisRing (MonitorElement *myMe, int numberOfRings, bool useRollInfo)
void labelYAxisRoll (MonitorElement *myMe, int region, int ring, bool useRollInfo)
std::vector< int > SectorStrips1 ()
std::vector< int > SectorStrips2 ()
std::string YLabel (int i)

Private Attributes

int _cnr
int ch
std::string ChLabel
std::vector< std::string > endcapYLabels_
std::vector< int > Wvector1
std::vector< int > Wvector2
std::string ylabel [22]

Detailed Description

Definition at line 16 of file utils.h.


Member Function Documentation

std::string rpcdqm::utils::detId2ChamberLabel ( const RPCDetId _id) [inline]

Definition at line 387 of file utils.h.

References ChLabel, RPCDetId::layer(), RPCDetId::region(), RPCDetId::sector(), RPCDetId::station(), and RPCDetId::subsector().

                                                  {
      if(_id.region()==0){//Barrel
        if( _id.station() ==1) {// Station1
          if(_id.layer() ==1) {
           
            ChLabel="RB1in";
            
          } else {
            ChLabel="RB1out";
          }

        }else if (_id.station()==2) {//Station 2        
          if(_id.layer()==1) {
            
            ChLabel="RB2in";
          }else{
            
            ChLabel="RB2out";
          }
        }else  if(_id.station()==3){//Station 3
          if(_id.subsector()==1){
            ChLabel="RB3+";
          } else {

            ChLabel="RB3-";
          }
        } else if(_id.station()==4) {//Station 4
          if (_id.sector()== 4) {         
            if ( _id.subsector()==1){
              
              ChLabel="RB4-";
              
            }else if (_id.subsector()==2){
              ChLabel="RB4+";
            }else  if ( _id.subsector()==3) {
              ChLabel="RB4--";
            }else if ( _id.subsector()==4){
              ChLabel="RB4++";
            }
          } else {
            if(_id.subsector()==1) ChLabel="RB4-";
            else ChLabel="RB4-";
          } 
        }
      }else{//Endcap
      }
        return ChLabel;
    }
int rpcdqm::utils::detId2ChamberNr ( const RPCDetId _id) [inline]

Definition at line 335 of file utils.h.

References ch, RPCDetId::layer(), RPCDetId::region(), RPCDetId::sector(), RPCDetId::station(), and RPCDetId::subsector().

                                             {
      if(_id.region()==0){//Barrel
        if( _id.station() ==1) {// Station1
          if(_id.layer() ==1) {
            
            ch=1; //RB1in
            
          } else {
            ch=2; //RB1out
          }

        }else if (_id.station()==2) {//Station 2        
          if(_id.layer()==1) {
            
              ch=3;//RB2in
          }else{
            
            ch=4; //RB2out
          }
        }else  if(_id.station()==3){//Station 3
          if(_id.subsector()==1){
            ch=5; //RB3+
          } else {

            ch=6; //RB3-
          }
        } else if(_id.station()==4) {//Station 4
          if (_id.sector()== 4) {         
            if ( _id.subsector()==1){
              
              ch=7; //RB4-
              
            }else if (_id.subsector()==2){
              ch=8; //RB4+
            }else  if ( _id.subsector()==3) {
              ch=9; //RB4--
            }else if ( _id.subsector()==4){
              ch=10; //RB4++
            }
          } else {
            if(_id.subsector()==1) ch= 7; //RB4-
            else ch= 8; //RB4+
          } 
        }
      }else{//Endcap
      }
        return ch;
    }
int rpcdqm::utils::detId2RollNr ( const RPCDetId _id) [inline]

Definition at line 18 of file utils.h.

References _cnr, RPCDetId::layer(), RPCDetId::region(), RPCDetId::ring(), RPCDetId::roll(), RPCDetId::sector(), RPCDetId::station(), and RPCDetId::subsector().

Referenced by RPCDBPopConAnalyzer::analyze(), RPCDeadChannelTest::clientOperation(), RPCClusterSizeTest::clientOperation(), RPCEfficiencySecond::endRun(), RPCNoisyStripTest::fillGlobalME(), RPCMultiplicityTest::fillGlobalME(), RPCOccupancyTest::fillGlobalME(), and RPCMonitorDigi::performSourceOperation().

                                          {
      if(_id.region()==0){//Barrel
        if( _id.station() ==1) {// Station1
          if(_id.layer() ==1) { //in
            if(_id.roll()==1) //forward
              _cnr = 1;//RB1inF
            else //backward
              _cnr = 2;//RB1inB
          } else {//out
            if(_id.roll()==1) 
              _cnr = 3;//RB1outF
            else 
              _cnr = 4;//RB1outB 
          }
        }else if (_id.station()==2) {//Station 2        
          if(_id.layer()==1) {
            if(_id.roll()==1)
              _cnr = 5;//RB2inB
            else if(_id.roll()==3)
              _cnr=6;//RB2inF
            else if(_id.roll()==2)
              _cnr=7;//RB2inM
          }else{
            if(_id.roll()==2)
              _cnr=7;//RB2outM
            else if(_id.roll()==1)
              _cnr=8;//RB2outB
            else if(_id.roll()==3)
              _cnr=9;//RB2outF 
          }
        }else  if(_id.station()==3){//Station 3
          if(_id.subsector()==1){
            if(_id.roll()==1)
              _cnr=10;//RB3-B
            else 
              _cnr=11;//RB3-F
          } else {
            if(_id.roll()==1)
              _cnr=12;//RB3+B
            else
              _cnr=13;//RB3+F
          }
        } else if(_id.station()==4) {//Station 4
          if (_id.sector()== 4) {         
            if ( _id.subsector()==2){//RB4--
              if(_id.roll()==1)
                _cnr=14;
              else
                _cnr=15;
            }else if (_id.subsector()==3){//RB4-
              if(_id.roll()==1)
                _cnr=16;
              else
                _cnr=17;
            }else  if ( _id.subsector()==1) {//RB4+
              if(_id.roll()==1)
                _cnr=18;
              else
                _cnr=19;
            }else if ( _id.subsector()==4){//RB4++
              if(_id.roll()==1)
                _cnr=20;
              else
                _cnr=21;
            }
          } else {
            if(_id.subsector()==1) {
              if(_id.roll()==1)
                _cnr=14;
              else 
                _cnr=15;
            } else {
              if(_id.roll()==1)
                _cnr=16;
              else
                _cnr=17;
            } 
          } 
        }
      }else{//Endcap
        int nsub=6;
        if ( _id.ring()==1 &&  _id.station() > 1) {
          nsub=3;
        }
          _cnr = (_id.subsector()-1)*3+_id.roll()+(_id.ring()-1)*nsub*3; 
      }
        return _cnr;
    }
void rpcdqm::utils::doEndcapLabeling ( bool  useRollInfo) [inline]

Definition at line 208 of file utils.h.

References ch, endcapYLabels_, alignCSCRings::r, relativeConstraints::ring, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by labelYAxisRoll().

                                           {          

      std::string rolls[3];
      rolls[0]="A";
      rolls[1]="B";
      rolls[2]="C";

      endcapYLabels_.clear();
      std::stringstream myLabel;

      for(int ring = 1 ; ring <=3; ring ++){
        for(int ch = 1; ch<=6; ch++){
          for(int r=0; r<3; r++){
            myLabel.str("");
            myLabel<<"R"<<ring<<"_C"<<ch<<"_"<<rolls[r];
            endcapYLabels_.push_back(myLabel.str());
          }
        }
      }
    }
void rpcdqm::utils::dolabeling ( bool  useRollInfo) [inline]

Definition at line 147 of file utils.h.

References ylabel.

Referenced by labelYAxisRoll().

                                       {

      if(useRollInfo){
      ylabel[1] = "RB1in_B";
      ylabel[2] = "RB1in_F";
      ylabel[3] = "RB1out_B";
      ylabel[4] = "RB1out_F";
      ylabel[5] = "RB2in_B";
      ylabel[6] = "RB2in_F";
      
      ylabel[7] = "RB2in_M";
      ylabel[0] = "RB2out_M";
      
      ylabel[8] = "RB2out_B";
      ylabel[9] = "RB2out_F";
      ylabel[10] = "RB3-_B";
      ylabel[11] = "RB3-_F";
      ylabel[12] = "RB3+_B";
      ylabel[13] = "RB3+_F";
      ylabel[14] = "RB4,-_B";
      ylabel[15] = "RB4,-_F";
      ylabel[16] = "RB4+_B";
      ylabel[17] = "RB4+_F";
      ylabel[18] = "RB4--_B";
      ylabel[19] = "RB4--_F";
      ylabel[20] = "RB4++_B";
      ylabel[21] = "RB4++_F";
      }else{
        ylabel[1] = "RB1in";
        ylabel[2] = "";
        ylabel[3] = "RB1out";
        ylabel[4] = "";
        ylabel[5] = "RB2in";
        ylabel[6] = "";
        
        ylabel[7] = "";
        ylabel[0] = "";
        
        ylabel[8] = "RB2out";
        ylabel[9] = "";
        ylabel[10] = "RB3-";
        ylabel[11] = "";
        ylabel[12] = "RB3+";
        ylabel[13] = "";
        ylabel[14] = "RB4,-";
        ylabel[15] = "";
        ylabel[16] = "RB4+";
        ylabel[17] = "";
        ylabel[18] = "RB4--";
        ylabel[19] = "";
        ylabel[20] = "RB4++";
        ylabel[21] = "";
      }





    }
void rpcdqm::utils::fillvect ( ) [inline]

Definition at line 107 of file utils.h.

References Wvector1, and Wvector2.

                    {
      Wvector2.push_back(0);    //Sec 0 - doen't exist ;)
      Wvector2.push_back(1140); //Sec1
      Wvector2.push_back(1140); //Sec2
      Wvector2.push_back(1140); //Sec3
      Wvector2.push_back(1236); //Sec4
      Wvector2.push_back(1140); //Sec5
      Wvector2.push_back(1140); //Sec6
      Wvector2.push_back(1140); //Sec7
      Wvector2.push_back(1116); //Sec8
      Wvector2.push_back(1044); //Sec9
      Wvector2.push_back(1188); //Sec10
      Wvector2.push_back(1044); //Sec11
      Wvector2.push_back(1166); //Sec12

      Wvector1.push_back(0);       //Sec 0 - doen't exist ;) 
      Wvector1.push_back(1146); //Sec1
      Wvector1.push_back(1146); //Sec2
      Wvector1.push_back(1146); //Sec3
      Wvector1.push_back(1242); //Sec4
      Wvector1.push_back(1146); //Sec5
      Wvector1.push_back(1146); //Sec6
      Wvector1.push_back(1146); //Sec7
      Wvector1.push_back(1122); //Sec8
      Wvector1.push_back(1050); //Sec9
      Wvector1.push_back(1194); //Sec10
      Wvector1.push_back(1050); //Sec11
      Wvector1.push_back(1122); //Sec12
      
    }
void rpcdqm::utils::labelXAxisSector ( MonitorElement myMe) [inline]

Definition at line 236 of file utils.h.

References MonitorElement::getNbinsX(), MonitorElement::setBinLabel(), and x.

Referenced by RPCMon_SS_Dbx_Global::analyze(), RPCEfficiencySecond::beginRun(), RPCOccupancyTest::beginRun(), RPCMultiplicityTest::beginRun(), RPCChamberQuality::beginRun(), RPCDeadChannelTest::beginRun(), RPCClusterSizeTest::beginRun(), RPCNoisyStripTest::beginRun(), and RPCMonitorDigi::bookWheelDiskME().

                                                {
      //before do some checks
      if (!myMe) return;

      std::stringstream xLabel;

      for(int x = 1; x<= myMe->getNbinsX(); x++){
        xLabel.str("");
        xLabel<<"Sec"<<x;
        myMe->setBinLabel(x, xLabel.str(), 1);
      }
      
    }
void rpcdqm::utils::labelXAxisSegment ( MonitorElement myMe) [inline]

Definition at line 251 of file utils.h.

References MonitorElement::getNbinsX(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), and x.

Referenced by RPCMon_SS_Dbx_Global::analyze(), RPCEfficiencySecond::beginRun(), RPCOccupancyTest::beginRun(), RPCMultiplicityTest::beginRun(), RPCChamberQuality::beginRun(), RPCDeadChannelTest::beginRun(), RPCClusterSizeTest::beginRun(), RPCNoisyStripTest::beginRun(), and RPCMonitorDigi::bookWheelDiskME().

                                                 {
      //before do some checks
      if (!myMe) return;

      std::stringstream xLabel;

      myMe->setAxisTitle("Segments", 1);

      for(int x = 1; x<= myMe->getNbinsX(); x++){
        xLabel.str("");
        xLabel<<x;
        myMe->setBinLabel(x, xLabel.str(), 1);
      }
      
    }
void rpcdqm::utils::labelYAxisRing ( MonitorElement myMe,
int  numberOfRings,
bool  useRollInfo 
) [inline]

Definition at line 296 of file utils.h.

References MonitorElement::getNbinsY(), reco_calib_source_client_cfg::labels, MonitorElement::setBinLabel(), AlCaHLTBitMon_QueryRunRegistry::string, and detailsBasic3DVector::y.

Referenced by RPCMon_SS_Dbx_Global::analyze(), RPCOccupancyTest::beginRun(), RPCEfficiencySecond::beginRun(), RPCMultiplicityTest::beginRun(), RPCDeadChannelTest::beginRun(), RPCChamberQuality::beginRun(), RPCClusterSizeTest::beginRun(), RPCNoisyStripTest::beginRun(), and RPCMonitorDigi::bookWheelDiskME().

                                                                                   {
  
      //before do some checks
      if (!myMe) return;
      std::string labels[9];
      if(useRollInfo){
        labels[0]= "C";
        labels[1]= "Ring1 B";
        labels[2]= "A";
        labels[3]= "C";
        labels[4]= "Ring2 B";
        labels[5]= "A";
        labels[6]= "C";
        labels[7]= "Ring3 B";
        labels[8]= "A";
      }else{
        labels[0]= "";
        labels[1]= "Ring1";
        labels[2]= "";
        labels[3]= "";
        labels[4]= "Ring2";
        labels[5]= "";
        labels[6]= "";
        labels[7]= "Ring3";
        labels[8]= "";
        
      }
        int startBin ;
        (numberOfRings == 2 ? startBin = 3: startBin = 0);
        
        //set bin labels
        for(int y =1 ;y<= myMe->getNbinsY() && y<=9; y++ ){
          myMe->setBinLabel(y,labels[y-1+startBin],2);
          
        }
    }
void rpcdqm::utils::labelYAxisRoll ( MonitorElement myMe,
int  region,
int  ring,
bool  useRollInfo 
) [inline]

Definition at line 269 of file utils.h.

References doEndcapLabeling(), dolabeling(), endcapYLabels_, MonitorElement::getNbinsY(), MonitorElement::setBinLabel(), detailsBasic3DVector::y, and ylabel.

Referenced by RPCMon_SS_Dbx_Global::analyze(), RPCOccupancyTest::beginRun(), RPCEfficiencySecond::beginRun(), RPCMultiplicityTest::beginRun(), RPCDeadChannelTest::beginRun(), RPCChamberQuality::beginRun(), RPCClusterSizeTest::beginRun(), RPCNoisyStripTest::beginRun(), RPCMonitorDigi::bookSectorRingME(), and RPCMonitorDigi::bookWheelDiskME().

                                                                                      {
  
      //before do some checks
      if (!myMe) return;
  
      //set bin labels
      if(region == 0){
  
        //initialize label vector
        this->dolabeling(useRollInfo);  
        if(ring == -2 || ring == 2) ylabel[7]=ylabel[0];
  
        for(int y = 1; y<= myMe->getNbinsY() && y<22; y++)        
          myMe->setBinLabel(y, ylabel[y], 2);
        
      }else{//Endcap
   
        this->doEndcapLabeling(useRollInfo);
   
        for(int y = 1; y<= myMe->getNbinsY() && y<(int)endcapYLabels_.size(); y++)        
          myMe->setBinLabel(y, endcapYLabels_[y], 2);
   
      }
    }
std::vector<int> rpcdqm::utils::SectorStrips1 ( ) [inline]

Definition at line 142 of file utils.h.

References Wvector1.

                                  {
      return Wvector1;
    }
std::vector<int> rpcdqm::utils::SectorStrips2 ( ) [inline]

Definition at line 138 of file utils.h.

References Wvector2.

                                  {
      return Wvector2;
    }
std::string rpcdqm::utils::YLabel ( int  i) [inline]

Definition at line 229 of file utils.h.

References i, and ylabel.

                            {

      return ylabel[i];
      
    }

Member Data Documentation

int rpcdqm::utils::_cnr [private]

Definition at line 439 of file utils.h.

Referenced by detId2RollNr().

int rpcdqm::utils::ch [private]

Definition at line 440 of file utils.h.

Referenced by detId2ChamberNr(), and doEndcapLabeling().

std::string rpcdqm::utils::ChLabel [private]

Definition at line 442 of file utils.h.

Referenced by detId2ChamberLabel().

std::vector<std::string> rpcdqm::utils::endcapYLabels_ [private]

Definition at line 441 of file utils.h.

Referenced by doEndcapLabeling(), and labelYAxisRoll().

std::vector<int> rpcdqm::utils::Wvector1 [private]

Definition at line 444 of file utils.h.

Referenced by fillvect(), and SectorStrips1().

std::vector<int> rpcdqm::utils::Wvector2 [private]

Definition at line 443 of file utils.h.

Referenced by fillvect(), and SectorStrips2().

std::string rpcdqm::utils::ylabel[22] [private]

Definition at line 445 of file utils.h.

Referenced by dolabeling(), labelYAxisRoll(), and YLabel().