CMS 3D CMS Logo

Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes

SiStripFolderOrganizer Class Reference

#include <DQM/SiStripCommon/interface/SiStripFolderOrganizer.h>

List of all members.

Public Member Functions

void getFolderName (int32_t rawdetid, std::string &lokal_folder)
void getLayerFolderName (std::stringstream &ss, uint32_t rawdetid, bool ring_flag=0)
std::string getSiStripControlFolder (unsigned short slot=all_, unsigned short ring=all_, unsigned short addr=all_, unsigned short chan=all_)
std::string getSiStripFolder ()
std::string getSiStripTopControlFolder ()
std::pair< std::string, int32_t > GetSubDetAndLayer (const uint32_t &detid, bool ring_flag=0)
void getSubDetFolder (const uint32_t &detid, std::string &folder_name)
std::pair< std::string,
std::string > 
getSubDetFolderAndTag (const uint32_t &detid)
void getSubDetLayerFolderName (std::stringstream &ss, SiStripDetId::SubDetector subDet, uint32_t layer, uint32_t side=0)
void setDetectorFolder (uint32_t rawdetid=0)
void setLayerFolder (uint32_t rawdetid=0, int32_t layer=0, bool ring_flag=0)
void setSiStripControlFolder (unsigned short slot=all_, unsigned short ring=all_, unsigned short addr=all_, unsigned short chan=all_)
void setSiStripFolder ()
void setSiStripFolderName (std::string name)
void setSiStripTopControlFolder ()
 SiStripFolderOrganizer ()
virtual ~SiStripFolderOrganizer ()

Static Public Attributes

static unsigned short const all_ = 65535

Private Member Functions

const SiStripFolderOrganizeroperator= (const SiStripFolderOrganizer &)
 SiStripFolderOrganizer (const SiStripFolderOrganizer &)

Private Attributes

DQMStoredbe_
std::string TopFolderName

Detailed Description

Description: <Organizes the folders for the monitoring elements of the SiStrip Tracker. Its methods return strings with names of folders to be created and used.>

Usage: <usage>

Definition at line 29 of file SiStripFolderOrganizer.h.


Constructor & Destructor Documentation

SiStripFolderOrganizer::SiStripFolderOrganizer ( )

Definition at line 34 of file SiStripFolderOrganizer.cc.

References dbe_, cmsCodeRules::cppFunctionSkipper::operator, and TopFolderName.

{
  TopFolderName="SiStrip";
  // get a pointer to DQMStore
  dbe_  = edm::Service<DQMStore>().operator->();
}
SiStripFolderOrganizer::~SiStripFolderOrganizer ( ) [virtual]

Definition at line 42 of file SiStripFolderOrganizer.cc.

{
}
SiStripFolderOrganizer::SiStripFolderOrganizer ( const SiStripFolderOrganizer ) [private]

Member Function Documentation

void SiStripFolderOrganizer::getFolderName ( int32_t  rawdetid,
std::string &  lokal_folder 
)

Definition at line 178 of file SiStripFolderOrganizer.cc.

References getSubDetLayerFolderName(), TECDetId::isBackPetal(), TIBDetId::isExternalString(), TIDDetId::isStereo(), TECDetId::isStereo(), TOBDetId::isZMinusSide(), TIBDetId::isZMinusSide(), TOBDetId::layerNumber(), TIBDetId::layerNumber(), TECDetId::petalNumber(), TIDDetId::ring(), TECDetId::ringNumber(), TOBDetId::rodNumber(), SEP, TIDDetId::side(), TECDetId::side(), TIBDetId::stringNumber(), SiStripDetId::subDetector(), sistripsummary::TEC, sistripsummary::TIB, sistripsummary::TID, sistripsummary::TOB, TIDDetId::wheel(), and TECDetId::wheel().

Referenced by SiStripInformationExtractor::getCondDBHistos(), SiStripInformationExtractor::getTrackerMapHistos(), and setDetectorFolder().

                                                                                   {
  lokal_folder = ""; 
  if(rawdetid == 0 ){ // just top MechanicalFolder if rawdetid==0;
    return;
  }
  std::stringstream rest;
  SiStripDetId stripdet = SiStripDetId(rawdetid);
  
  if (stripdet.subDetector() == SiStripDetId::TIB){
  // ---------------------------  TIB  --------------------------- //
    TIBDetId tib = TIBDetId(rawdetid);
    getSubDetLayerFolderName(rest,stripdet.subDetector(),tib.layerNumber());
    if (tib.isZMinusSide())      rest << "backward_strings" << SEP;
    else                         rest << "forward_strings"  << SEP;
    if (tib.isExternalString())  rest << "external_strings" << SEP;
    else                         rest << "internal_strings" << SEP;
    rest << "string_" << tib.stringNumber() << SEP << "module_" << rawdetid;
  } else if(stripdet.subDetector() == SiStripDetId::TID){
  // ---------------------------  TID  --------------------------- //
    TIDDetId tid = TIDDetId(rawdetid);
    getSubDetLayerFolderName(rest,stripdet.subDetector(),tid.wheel(),tid.side());
    rest<< "ring_"  << tid.ring() << SEP;

    if (tid.isStereo()) rest << "stereo_modules" << SEP;
    else                rest << "mono_modules" << SEP;
    rest  << "module_" << rawdetid;
  } else if( stripdet.subDetector() == SiStripDetId::TOB){
  // ---------------------------  TOB  --------------------------- //
    TOBDetId tob = TOBDetId(rawdetid);
    getSubDetLayerFolderName(rest,stripdet.subDetector(),tob.layerNumber());
    if (tob.isZMinusSide()) rest << "backward_rods" << SEP;
    else                    rest << "forward_rods" << SEP;
    rest << "rod_" << tob.rodNumber() << SEP<< "module_" << rawdetid;
  }else if(stripdet.subDetector() == SiStripDetId::TEC){
  // ---------------------------  TEC  --------------------------- //
    TECDetId tec = TECDetId(rawdetid);
    getSubDetLayerFolderName(rest,stripdet.subDetector(),tec.wheel(),tec.side());
    if (tec.isBackPetal()) rest << "backward_petals" << SEP;
    else                   rest << "forward_petals" << SEP;

    rest << "petal_" << tec.petalNumber() << SEP
         << "ring_"<< tec.ringNumber() << SEP;

    if (tec.isStereo())    rest << "stereo_modules" << SEP;
    else                   rest << "mono_modules" << SEP;

    rest << "module_" << rawdetid;
  }else{
     // ---------------------------  ???  --------------------------- //
    edm::LogWarning("SiStripTkDQM|WrongInput")<<"no such subdetector type :"<<stripdet.subDetector() <<" no folder set!"<<std::endl;
    return;
  }
  lokal_folder += rest.str();

}
void SiStripFolderOrganizer::getLayerFolderName ( std::stringstream &  ss,
uint32_t  rawdetid,
bool  ring_flag = 0 
)

Definition at line 315 of file SiStripFolderOrganizer.cc.

References TIBDetId::layer(), TOBDetId::layer(), MECHANICAL_FOLDER_NAME, TIDDetId::ring(), TECDetId::ring(), SEP, TIDDetId::side(), TECDetId::side(), SiStripDetId::subDetector(), sistripsummary::TEC, sistripsummary::TIB, sistripsummary::TID, sistripsummary::TOB, TopFolderName, TIDDetId::wheel(), and TECDetId::wheel().

Referenced by SiStripMonitorDigi::createMEs().

                                                                                                    {
  ss << TopFolderName + SEP + MECHANICAL_FOLDER_NAME;
  if(rawdetid == 0 ){ // just top MechanicalFolder if rawdetid==0;
    return;
  }

  SiStripDetId stripdet = SiStripDetId(rawdetid);
  if(stripdet.subDetector() == SiStripDetId::TIB ){
  // ---------------------------  TIB  --------------------------- //
    TIBDetId tib1 = TIBDetId(rawdetid);
    ss<<SEP<<"TIB"<<SEP<<"layer_"<<tib1.layer();
  }else if(stripdet.subDetector() == SiStripDetId::TID){
  // ---------------------------  TID  --------------------------- //
    TIDDetId tid1 = TIDDetId(rawdetid);
    if(ring_flag){
      ss<<SEP<<"TID"<<SEP<<"side_"<<tid1.side()<<SEP<<"ring_"<<tid1.ring();
    }else{
      ss<<SEP<<"TID"<<SEP<<"side_"<<tid1.side()<<SEP<<"wheel_"<<tid1.wheel();
    }
  }else if(stripdet.subDetector() == SiStripDetId::TOB){
  // ---------------------------  TOB  --------------------------- //
    TOBDetId tob1 = TOBDetId(rawdetid);
    ss<<SEP<<"TOB"<<SEP<<"layer_"<<tob1.layer();
  }else if( stripdet.subDetector() == SiStripDetId::TEC){
  // ---------------------------  TEC  --------------------------- //
    TECDetId tec1 = TECDetId(rawdetid);
    if(ring_flag){
      ss<<SEP<<"TEC"<<SEP<<"side_"<<tec1.side()<<SEP<<"ring_"<<tec1.ring();
    }else{
      ss<<SEP<<"TEC"<<SEP<<"side_"<<tec1.side()<<SEP<<"wheel_"<<tec1.wheel();
    }
  }else{
  // ---------------------------  ???  --------------------------- //
    edm::LogWarning("SiStripTkDQM|WrongInput")<<"no such subdetector type :"<<stripdet.subDetector()<<" no folder set!"<<std::endl;
    return;
  }
}
std::string SiStripFolderOrganizer::getSiStripControlFolder ( unsigned short  slot = all_,
unsigned short  ring = all_,
unsigned short  addr = all_,
unsigned short  chan = all_ 
)

Definition at line 74 of file SiStripFolderOrganizer.cc.

References all_, getSiStripTopControlFolder(), relativeConstraints::ring, and SEP.

Referenced by setSiStripControlFolder().

                                     {
  std::stringstream lokal_folder;
  lokal_folder << getSiStripTopControlFolder();
  //   if ( crate != all_ ) {// if ==all_ then remain in top control folder
  //     lokal_folder << SEP << "FecCrate" << crate;
  if ( slot != all_ ) {
    lokal_folder << SEP << "FecSlot" << slot;
    if ( ring != all_ ) {
      lokal_folder << SEP << "FecRing" << ring;
      if ( addr != all_ ) {
        lokal_folder << SEP << "CcuAddr" << addr;
        if ( chan != all_ ) {
          lokal_folder << SEP << "CcuChan" << chan;
          //        if ( i2c != all_ ) {
          //          lokal_folder << SEP << "I2cAddr" << i2c;
          //        }
        }
      }
    }
  }
  //   }
  std::string folder_name = lokal_folder.str(); 
  return folder_name;
}
std::string SiStripFolderOrganizer::getSiStripFolder ( )

Definition at line 50 of file SiStripFolderOrganizer.cc.

References TopFolderName.

                                                  {
   return TopFolderName;
}
std::string SiStripFolderOrganizer::getSiStripTopControlFolder ( )

Definition at line 61 of file SiStripFolderOrganizer.cc.

References CONTROL_FOLDER_NAME, and TopFolderName.

Referenced by getSiStripControlFolder().

                                                            {
   std::string lokal_folder = TopFolderName + CONTROL_FOLDER_NAME;
   return lokal_folder;
}
std::pair< std::string, int32_t > SiStripFolderOrganizer::GetSubDetAndLayer ( const uint32_t &  detid,
bool  ring_flag = 0 
)

Definition at line 120 of file SiStripFolderOrganizer.cc.

References TIBDetId::layer(), TOBDetId::layer(), TIDDetId::ring(), TECDetId::ring(), TIDDetId::side(), TECDetId::side(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, TIDDetId::wheel(), and TECDetId::wheel().

Referenced by MonitorTrackResiduals::analyze(), MonitorTrackResiduals::beginRun(), SiStripMonitorTrack::book(), SiStripBaseCondObjDQM::bookSummaryCumulMEs(), SiStripBaseCondObjDQM::bookSummaryMEs(), SiStripBaseCondObjDQM::bookSummaryProfileMEs(), SiStripMonitorCluster::createMEs(), SiStripMonitorDigi::createMEs(), MonitorTrackResiduals::createMEs(), SiStripMonitorTrack::fillMEs(), and SiStripCertificationInfo::fillSiStripCertificationMEs().

                                                                                                         {
  std::string cSubDet;
  int32_t layer=0;
  switch(StripSubdetector::SubDetector(StripSubdetector(detid).subdetId()))
    {
    case StripSubdetector::TIB:
      cSubDet="TIB";
      layer=TIBDetId(detid).layer();
      break;
    case StripSubdetector::TOB:
      cSubDet="TOB";
      layer=TOBDetId(detid).layer();
      break;
    case StripSubdetector::TID:
      cSubDet="TID";
      if(ring_flag)
        layer=TIDDetId(detid).ring() * ( TIDDetId(detid).side()==1 ? -1 : +1);
      else
        layer=TIDDetId(detid).wheel() * ( TIDDetId(detid).side()==1 ? -1 : +1);
      break;
    case StripSubdetector::TEC:
      cSubDet="TEC";
      if(ring_flag)
        layer=TECDetId(detid).ring() * ( TECDetId(detid).side()==1 ? -1 : +1);
      else
        layer=TECDetId(detid).wheel() * ( TECDetId(detid).side()==1 ? -1 : +1);
      break;
    default:
      edm::LogWarning("SiStripMonitorTrack") << "WARNING!!! this detid does not belong to tracker" << std::endl;
    }
  return std::make_pair(cSubDet,layer);
}
void SiStripFolderOrganizer::getSubDetFolder ( const uint32_t &  detid,
std::string &  folder_name 
)

Definition at line 307 of file SiStripFolderOrganizer.cc.

References getSubDetFolderAndTag().

Referenced by SiStripQualityChecker::fillFaultyModuleStatus(), SiStripDaqInfo::findExcludedModule(), and SiStripTrackerMapCreator::getDetectorFlagAndComment().

                                                                                         {

  std::pair<std::string, std::string> subdet_and_tag = getSubDetFolderAndTag(detid); 
  folder_name = subdet_and_tag.first;
}
std::pair< std::string, std::string > SiStripFolderOrganizer::getSubDetFolderAndTag ( const uint32_t &  detid)

Definition at line 355 of file SiStripFolderOrganizer.cc.

References MECHANICAL_FOLDER_NAME, query::result, SEP, StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, and TopFolderName.

Referenced by SiStripMonitorCluster::analyze(), SiStripMonitorDigi::analyze(), SiStripMonitorTrack::book(), SiStripMonitorTrack::clusterInfos(), SiStripMonitorCluster::createMEs(), SiStripMonitorDigi::createMEs(), SiStripMonitorTrack::fillMEs(), and getSubDetFolder().

                                                                                                 {
  std::pair<std::string, std::string> result;
  result.first = TopFolderName + SEP MECHANICAL_FOLDER_NAME SEP;
  std::string subdet_folder;
  switch(StripSubdetector::SubDetector(StripSubdetector(detid).subdetId()))
    {
    case StripSubdetector::TIB:
      subdet_folder = "TIB";
      result.second = subdet_folder;
      break;
    case StripSubdetector::TOB:
      subdet_folder = "TOB";
      result.second = subdet_folder;
      break;
    case StripSubdetector::TID:
      if (TIDDetId(detid).side() == 2) {
        subdet_folder = "TID/side_2";
        result.second = "TID__side__2";
      } else if (TIDDetId(detid).side() == 1) {
        subdet_folder = "TID/side_1";
        result.second = "TID__side__1";
      }
      break;
    case StripSubdetector::TEC:
      if (TECDetId(detid).side() == 2) {
        subdet_folder = "TEC/side_2";
        result.second = "TEC__side__2";
      } else if (TECDetId(detid).side() == 1) {
        subdet_folder = "TEC/side_1";
        result.second = "TEC__side__1";
      }
      break;
    default:
      {
        edm::LogWarning("SiStripCommon") << "WARNING!!! this detid does not belong to tracker" << std::endl;
        subdet_folder = "";
      }
    }
  result.first += subdet_folder;
  return result; 
}
void SiStripFolderOrganizer::getSubDetLayerFolderName ( std::stringstream &  ss,
SiStripDetId::SubDetector  subDet,
uint32_t  layer,
uint32_t  side = 0 
)

Definition at line 160 of file SiStripFolderOrganizer.cc.

References MECHANICAL_FOLDER_NAME, SEP, SiStripDetId::TEC, SiStripDetId::TIB, SiStripDetId::TID, SiStripDetId::TOB, and TopFolderName.

Referenced by SiStripMonitorMuonHLT::createMEs(), TkHistoMap::folderDefinition(), and getFolderName().

                                                                                                                                       {
  ss << TopFolderName << SEP << MECHANICAL_FOLDER_NAME;

  if(subDet == SiStripDetId::TIB){
    ss << SEP << "TIB" << SEP << "layer_" << layer << SEP;
  } else if(subDet == SiStripDetId::TID){
    ss << SEP << "TID" << SEP << "side_" << side << SEP << "wheel_" << layer << SEP;
  } else if( subDet == SiStripDetId::TOB){
    ss << SEP << "TOB" << SEP << "layer_" << layer << SEP;
  }else if(subDet == SiStripDetId::TEC){
    ss << SEP << "TEC" << SEP << "side_" << side << SEP << "wheel_" << layer << SEP;
  }else{
    // ---------------------------  ???  --------------------------- //
    edm::LogWarning("SiStripTkDQM|WrongInput")<<"no such SubDet :"<< subDet <<" no folder set!"<<std::endl;
  }
}
const SiStripFolderOrganizer& SiStripFolderOrganizer::operator= ( const SiStripFolderOrganizer ) [private]
void SiStripFolderOrganizer::setDetectorFolder ( uint32_t  rawdetid = 0)
void SiStripFolderOrganizer::setLayerFolder ( uint32_t  rawdetid = 0,
int32_t  layer = 0,
bool  ring_flag = 0 
)

Definition at line 234 of file SiStripFolderOrganizer.cc.

References abs, dbe_, TIBDetId::layer(), TOBDetId::layer(), MECHANICAL_FOLDER_NAME, TIDDetId::ring(), TECDetId::ring(), SEP, DQMStore::setCurrentFolder(), TIDDetId::side(), TECDetId::side(), SiStripDetId::subDetector(), sistripsummary::TEC, sistripsummary::TIB, sistripsummary::TID, sistripsummary::TOB, TopFolderName, TIDDetId::wheel(), and TECDetId::wheel().

Referenced by SiStripMonitorTrack::book(), SiStripBaseCondObjDQM::bookSummaryCumulMEs(), SiStripBaseCondObjDQM::bookSummaryMEs(), SiStripBaseCondObjDQM::bookSummaryProfileMEs(), SiStripMonitorCluster::createMEs(), SiStripMonitorDigi::createMEs(), and MonitorTrackResiduals::createMEs().

                                                                                           {
  std::string lokal_folder = TopFolderName + SEP + MECHANICAL_FOLDER_NAME;
  if(rawdetid == 0 ){ // just top MechanicalFolder if rawdetid==0;
    dbe_->setCurrentFolder(lokal_folder);
    return;
  }

  std::ostringstream rest;
  SiStripDetId stripdet = SiStripDetId(rawdetid);
  if(stripdet.subDetector() == SiStripDetId::TIB ){
  // ---------------------------  TIB  --------------------------- //
    TIBDetId tib1 = TIBDetId(rawdetid);
    int tib_layer = tib1.layer();
    if (abs(layer)  != tib_layer) {
      edm::LogWarning("SiStripTkDQM|Layer mismatch!!!")<< " expect "<<  abs(layer) << " but getting " << tib1.layer() <<std::endl;
      return;
    }
    rest<<SEP<<"TIB"<<SEP<<"layer_"<<tib1.layer();
  }else if(stripdet.subDetector() == SiStripDetId::TID){
  // ---------------------------  TID  --------------------------- //
    TIDDetId tid1 = TIDDetId(rawdetid);
    int tid_ring = tid1.ring();
    if(ring_flag){
      if(abs(layer) != tid_ring) {
        edm::LogWarning("SiStripTkDQM|Layer mismatch!!!")<< " expect "<<  abs(layer) << " but getting " << tid1.ring() <<std::endl;
        return;
      }
      rest<<SEP<<"TID"<<SEP<<"side_"<<tid1.side()<<SEP<<"ring_"<<tid1.ring();
    }else{
      int tid_wheel = tid1.wheel();
      if (abs(layer)  != tid_wheel) {
        edm::LogWarning("SiStripTkDQM|Layer mismatch!!!")<< " expect "<<  abs(layer) << " but getting " << tid1.wheel() <<std::endl;
        return;
      }
      rest<<SEP<<"TID"<<SEP<<"side_"<<tid1.side()<<SEP<<"wheel_"<<tid1.wheel();
    }
  }else if(stripdet.subDetector() == SiStripDetId::TOB){
  // ---------------------------  TOB  --------------------------- //
    TOBDetId tob1 = TOBDetId(rawdetid);
    int tob_layer = tob1.layer();
    if (abs(layer)  != tob_layer) {
      edm::LogWarning("SiStripTkDQM|Layer mismatch!!!")<< " expect "<<  abs(layer) << " but getting " << tob1.layer() <<std::endl;
      return;
    }
    rest<<SEP<<"TOB"<<SEP<<"layer_"<<tob1.layer();
  }else if( stripdet.subDetector() == SiStripDetId::TEC){
  // ---------------------------  TEC  --------------------------- //
    TECDetId tec1 = TECDetId(rawdetid);
    if(ring_flag){
      int tec_ring = tec1.ring(); 
      if (abs(layer)  != tec_ring) {
        edm::LogWarning("SiStripTkDQM|Layer mismatch!!!")<< " expect "<<  abs(layer) << " but getting " << tec1.ring() <<std::endl;
        return;
      }
      rest<<SEP<<"TEC"<<SEP<<"side_"<<tec1.side()<<SEP<<"ring_"<<tec1.ring();
    }else{
      int tec_wheel = tec1.wheel();
      if (abs(layer)  != tec_wheel) {
        edm::LogWarning("SiStripTkDQM|Layer mismatch!!!")<< " expect "<<  abs(layer) << " but getting " << tec1.wheel() <<std::endl;
        return;
      }
      rest<<SEP<<"TEC"<<SEP<<"side_"<<tec1.side()<<SEP<<"wheel_"<<tec1.wheel();
    }
  }else{
  // ---------------------------  ???  --------------------------- //
    edm::LogWarning("SiStripTkDQM|WrongInput")<<"no such subdetector type :"<<stripdet.subDetector()<<" no folder set!"<<std::endl;
    return;
  }

  lokal_folder += rest.str();
  dbe_->setCurrentFolder(lokal_folder);
}
void SiStripFolderOrganizer::setSiStripControlFolder ( unsigned short  slot = all_,
unsigned short  ring = all_,
unsigned short  addr = all_,
unsigned short  chan = all_ 
)

Definition at line 107 of file SiStripFolderOrganizer.cc.

References dbe_, getSiStripControlFolder(), and DQMStore::setCurrentFolder().

                                     {
 std::string lokal_folder = getSiStripControlFolder(slot, ring, addr, chan);
 dbe_->setCurrentFolder(lokal_folder);
 return;
}
void SiStripFolderOrganizer::setSiStripFolder ( )
void SiStripFolderOrganizer::setSiStripFolderName ( std::string  name)
void SiStripFolderOrganizer::setSiStripTopControlFolder ( )

Definition at line 67 of file SiStripFolderOrganizer.cc.

References CONTROL_FOLDER_NAME, dbe_, DQMStore::setCurrentFolder(), and TopFolderName.

                                                       {
   std::string lokal_folder = TopFolderName + CONTROL_FOLDER_NAME;
   dbe_->setCurrentFolder(lokal_folder);
   return;
}

Member Data Documentation

unsigned short const SiStripFolderOrganizer::all_ = 65535 [static]

Definition at line 33 of file SiStripFolderOrganizer.h.

Referenced by getSiStripControlFolder().