#include <DQM/SiPixelCommon/interface/SiPixelFolderOrganizer.h>
Public Member Functions | |
void | getModuleFolder (const uint32_t &rawdetid, std::string &path) |
bool | setFedFolder (const uint32_t FedId) |
Set folder name for a FED (used in the case of errors without detId). | |
bool | setModuleFolder (const uint32_t &rawdetid=0, int type=0) |
Set folder name for a module or plaquette. | |
SiPixelFolderOrganizer () | |
Constructor. | |
virtual | ~SiPixelFolderOrganizer () |
Destructor. | |
Private Attributes | |
DQMStore * | dbe_ |
std::string | rootFolder |
std::string | slash |
Its methods return strings with names of folders to be created and used.>
Usage: <usage>
Definition at line 24 of file SiPixelFolderOrganizer.h.
SiPixelFolderOrganizer::SiPixelFolderOrganizer | ( | ) |
Constructor.
DQM and Framework services.
Data Formats Constructor
Definition at line 14 of file SiPixelFolderOrganizer.cc.
00014 : 00015 rootFolder("Pixel"), 00016 slash("/"), 00017 dbe_(edm::Service<DQMStore>().operator->()) 00018 { 00019 }
SiPixelFolderOrganizer::~SiPixelFolderOrganizer | ( | ) | [virtual] |
void SiPixelFolderOrganizer::getModuleFolder | ( | const uint32_t & | rawdetid, | |
std::string & | path | |||
) |
Definition at line 120 of file SiPixelFolderOrganizer.cc.
References DetId::DetId(), muonGeometry::disk, Exception, PixelSubdetector::PixelBarrel, PixelBarrelName::PixelBarrelName(), PixelSubdetector::PixelEndcap, PixelEndcapName::PixelEndcapName(), and rootFolder.
Referenced by SiPixelInformationExtractor::getTrackerMapHistos().
00121 { 00122 00123 path = rootFolder; 00124 if(rawdetid == 0) { 00125 return; 00126 }else if(DetId::DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) { 00127 std::string subDetectorFolder = "Barrel"; 00128 PixelBarrelName::Shell DBshell = PixelBarrelName::PixelBarrelName(DetId::DetId(rawdetid)).shell(); 00129 int DBlayer = PixelBarrelName::PixelBarrelName(DetId::DetId(rawdetid)).layerName(); 00130 int DBladder = PixelBarrelName::PixelBarrelName(DetId::DetId(rawdetid)).ladderName(); 00131 int DBmodule = PixelBarrelName::PixelBarrelName(DetId::DetId(rawdetid)).moduleName(); 00132 00133 char sshell[80]; sprintf(sshell, "Shell_%i", DBshell); 00134 char slayer[80]; sprintf(slayer, "Layer_%i", DBlayer); 00135 char sladder[80]; sprintf(sladder,"Ladder_%02i",DBladder); 00136 char smodule[80]; sprintf(smodule,"Module_%i", DBmodule); 00137 00138 path = path + "/" + subDetectorFolder + "/" + sshell + "/" + slayer + "/" + sladder; 00139 if(PixelBarrelName::PixelBarrelName(DetId::DetId(rawdetid)).isHalfModule() ) 00140 path = path + "H"; 00141 else path = path + "F"; 00142 path = path + smodule; 00143 }else if(DetId::DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) { 00144 std::string subDetectorFolder = "Endcap"; 00145 PixelEndcapName::HalfCylinder side = PixelEndcapName::PixelEndcapName(DetId::DetId(rawdetid)).halfCylinder(); 00146 int disk = PixelEndcapName::PixelEndcapName(DetId::DetId(rawdetid)).diskName(); 00147 int blade = PixelEndcapName::PixelEndcapName(DetId::DetId(rawdetid)).bladeName(); 00148 int panel = PixelEndcapName::PixelEndcapName(DetId::DetId(rawdetid)).pannelName(); 00149 int module = PixelEndcapName::PixelEndcapName(DetId::DetId(rawdetid)).plaquetteName(); 00150 00151 char shc[80]; sprintf(shc, "HalfCylinder_%i",side); 00152 char sdisk[80]; sprintf(sdisk, "Disk_%i",disk); 00153 char sblade[80]; sprintf(sblade, "Blade_%02i",blade); 00154 char spanel[80]; sprintf(spanel, "Panel_%i",panel); 00155 char smodule[80];sprintf(smodule,"Module_%i",module); 00156 path = path + "/" + subDetectorFolder + "/" + shc + "/" + sdisk + "/" + sblade + "/" + spanel + "/" + smodule; 00157 }else throw cms::Exception("LogicError") 00158 << "[SiPixelFolderOrganizer::getModuleFolder] Not a Pixel detector DetId "; 00159 return; 00160 }
bool SiPixelFolderOrganizer::setFedFolder | ( | const uint32_t | FedId | ) |
Set folder name for a FED (used in the case of errors without detId).
Definition at line 107 of file SiPixelFolderOrganizer.cc.
References dbe_, rootFolder, and DQMStore::setCurrentFolder().
Referenced by SiPixelRawDataErrorSource::bookMEs().
00107 { 00108 00109 std::string subDetectorFolder = "AdditionalPixelErrors"; 00110 char sFed[80]; sprintf(sFed, "FED_%i",FedId); 00111 std::ostringstream sfolder; 00112 00113 sfolder << rootFolder << "/" << subDetectorFolder << "/" << sFed; 00114 dbe_->setCurrentFolder(sfolder.str().c_str()); 00115 00116 return true; 00117 00118 }
Set folder name for a module or plaquette.
Pixel Barrel
Pixel Endcap
Definition at line 23 of file SiPixelFolderOrganizer.cc.
References dbe_, DetId::DetId(), muonGeometry::disk, Exception, PixelSubdetector::PixelBarrel, PixelBarrelName::PixelBarrelName(), PixelSubdetector::PixelEndcap, PixelEndcapName::PixelEndcapName(), rootFolder, and DQMStore::setCurrentFolder().
Referenced by SiPixelTrackResidualSource::beginJob(), SiPixelRawDataErrorSource::bookMEs(), SiPixelDigiSource::bookMEs(), SiPixelClusterSource::bookMEs(), SiPixelRecHitSource::bookMEs(), SiPixelErrorsDigisToCalibDigis::setDQMDirectory(), and SiPixelOfflineCalibAnalysisBase::setDQMDirectory().
00023 { 00024 00025 bool flag = false; 00026 00027 if(rawdetid == 0) { 00028 dbe_->setCurrentFolder(rootFolder); 00029 flag = true; 00030 } 00034 else if(DetId::DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) { 00035 00036 //for endcap types there is nothing to do: 00037 if(type>3) return true; 00038 00039 std::string subDetectorFolder = "Barrel"; 00040 PixelBarrelName::Shell DBshell = PixelBarrelName::PixelBarrelName(DetId::DetId(rawdetid)).shell(); 00041 int DBlayer = PixelBarrelName::PixelBarrelName(DetId::DetId(rawdetid)).layerName(); 00042 int DBladder = PixelBarrelName::PixelBarrelName(DetId::DetId(rawdetid)).ladderName(); 00043 int DBmodule = PixelBarrelName::PixelBarrelName(DetId::DetId(rawdetid)).moduleName(); 00044 00045 char slayer[80]; sprintf(slayer, "Layer_%i", DBlayer); 00046 char sladder[80]; sprintf(sladder,"Ladder_%02i",DBladder); 00047 char smodule[80]; sprintf(smodule,"Module_%i", DBmodule); 00048 00049 std::ostringstream sfolder; 00050 00051 sfolder << rootFolder << "/" << subDetectorFolder << "/Shell_" <<DBshell 00052 << "/" << slayer; 00053 if(type<2){ 00054 sfolder << "/" << sladder; 00055 if ( PixelBarrelName::PixelBarrelName(DetId::DetId(rawdetid)).isHalfModule() ) sfolder <<"H"; 00056 else sfolder <<"F"; 00057 } 00058 if(type==0) sfolder << "/" <<smodule; 00059 //if(type==3) sfolder << "/all_" << smodule; 00060 00061 dbe_->setCurrentFolder(sfolder.str().c_str()); 00062 flag = true; 00063 } 00067 else if(DetId::DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) { 00068 00069 //for barrel types there is nothing to do: 00070 if(type>0 && type < 4) return true; 00071 00072 std::string subDetectorFolder = "Endcap"; 00073 PixelEndcapName::HalfCylinder side = PixelEndcapName::PixelEndcapName(DetId::DetId(rawdetid)).halfCylinder(); 00074 int disk = PixelEndcapName::PixelEndcapName(DetId::DetId(rawdetid)).diskName(); 00075 int blade = PixelEndcapName::PixelEndcapName(DetId::DetId(rawdetid)).bladeName(); 00076 int panel = PixelEndcapName::PixelEndcapName(DetId::DetId(rawdetid)).pannelName(); 00077 int module = PixelEndcapName::PixelEndcapName(DetId::DetId(rawdetid)).plaquetteName(); 00078 00079 char sdisk[80]; sprintf(sdisk, "Disk_%i",disk); 00080 char sblade[80]; sprintf(sblade, "Blade_%02i",blade); 00081 char spanel[80]; sprintf(spanel, "Panel_%i",panel); 00082 char smodule[80];sprintf(smodule,"Module_%i",module); 00083 00084 std::ostringstream sfolder; 00085 00086 sfolder <<rootFolder <<"/" << subDetectorFolder << 00087 "/HalfCylinder_" << side << "/" << sdisk; 00088 if(type==0 || type ==4){ 00089 sfolder << "/" << sblade; 00090 } 00091 if(type==0){ 00092 sfolder << "/" << spanel << "/" << smodule; 00093 } 00094 // if(type==6){ 00095 // sfolder << "/" << spanel << "_all_" << smodule; 00096 // } 00097 dbe_->setCurrentFolder(sfolder.str().c_str()); 00098 flag = true; 00099 00100 } else throw cms::Exception("LogicError") 00101 << "[SiPixelFolderOrganizer::setModuleFolder] Not a Pixel detector DetId "; 00102 00103 return flag; 00104 00105 }
DQMStore* SiPixelFolderOrganizer::dbe_ [private] |
Definition at line 47 of file SiPixelFolderOrganizer.h.
Referenced by setFedFolder(), and setModuleFolder().
std::string SiPixelFolderOrganizer::rootFolder [private] |
Definition at line 45 of file SiPixelFolderOrganizer.h.
Referenced by getModuleFolder(), setFedFolder(), and setModuleFolder().
std::string SiPixelFolderOrganizer::slash [private] |
Definition at line 46 of file SiPixelFolderOrganizer.h.