#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 |
Description: <Organizes the folders for the monitoring elements of the Pixel detector. 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 15 of file SiPixelFolderOrganizer.cc.
: rootFolder("Pixel"), slash("/"), dbe_(edm::Service<DQMStore>().operator->()) { }
SiPixelFolderOrganizer::~SiPixelFolderOrganizer | ( | ) | [virtual] |
void SiPixelFolderOrganizer::getModuleFolder | ( | const uint32_t & | rawdetid, |
std::string & | path | ||
) |
Definition at line 129 of file SiPixelFolderOrganizer.cc.
References PixelEndcapName::bladeName(), PixelEndcapName::diskName(), Exception, PixelEndcapName::halfCylinder(), PixelBarrelName::ladderName(), PixelBarrelName::layerName(), PixelBarrelName::moduleName(), PixelEndcapName::pannelName(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, PixelEndcapName::plaquetteName(), rootFolder, and PixelBarrelName::shell().
Referenced by SiStripInformationExtractor::getSingleModuleHistos(), and SiPixelInformationExtractor::getTrackerMapHistos().
{ path = rootFolder; //std::cout<<"rawdetis: "<<rawdetid<<" , path= "<<path<<std::endl; if(rawdetid == 0) { return; }else if(DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) { std::string subDetectorFolder = "Barrel"; PixelBarrelName::Shell DBshell = PixelBarrelName(DetId(rawdetid)).shell(); int DBlayer = PixelBarrelName(DetId(rawdetid)).layerName(); int DBladder = PixelBarrelName(DetId(rawdetid)).ladderName(); int DBmodule = PixelBarrelName(DetId(rawdetid)).moduleName(); //char sshell[80]; sprintf(sshell, "Shell_%i", DBshell); char slayer[80]; sprintf(slayer, "Layer_%i", DBlayer); char sladder[80]; sprintf(sladder,"Ladder_%02i",DBladder); char smodule[80]; sprintf(smodule,"Module_%i", DBmodule); std::ostringstream sfolder; sfolder << rootFolder << "/" << subDetectorFolder << "/Shell_" <<DBshell << "/" << slayer << "/" << sladder; if ( PixelBarrelName(DetId(rawdetid)).isHalfModule() ) sfolder <<"H"; else sfolder <<"F"; sfolder << "/" <<smodule; path = sfolder.str().c_str(); //path = path + "/" + subDetectorFolder + "/" + sshell + "/" + slayer + "/" + sladder; //if(PixelBarrelName(DetId(rawdetid)).isHalfModule() ) // path = path + "H"; //else path = path + "F"; //path = path + "/" + smodule; }else if(DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) { std::string subDetectorFolder = "Endcap"; PixelEndcapName::HalfCylinder side = PixelEndcapName(DetId(rawdetid)).halfCylinder(); int disk = PixelEndcapName(DetId(rawdetid)).diskName(); int blade = PixelEndcapName(DetId(rawdetid)).bladeName(); int panel = PixelEndcapName(DetId(rawdetid)).pannelName(); int module = PixelEndcapName(DetId(rawdetid)).plaquetteName(); //char shc[80]; sprintf(shc, "HalfCylinder_%i",side); char sdisk[80]; sprintf(sdisk, "Disk_%i",disk); char sblade[80]; sprintf(sblade, "Blade_%02i",blade); char spanel[80]; sprintf(spanel, "Panel_%i",panel); char smodule[80];sprintf(smodule,"Module_%i",module); std::ostringstream sfolder; sfolder <<rootFolder <<"/" << subDetectorFolder << "/HalfCylinder_" << side << "/" << sdisk << "/" << sblade << "/" << spanel << "/" << smodule; path = sfolder.str().c_str(); //path = path + "/" + subDetectorFolder + "/" + shc + "/" + sdisk + "/" + sblade + "/" + spanel + "/" + smodule; }else throw cms::Exception("LogicError") << "[SiPixelFolderOrganizer::getModuleFolder] Not a Pixel detector DetId "; //std::cout<<"resulting final path name: "<<path<<std::endl; return; }
bool SiPixelFolderOrganizer::setFedFolder | ( | const uint32_t | FedId | ) |
Set folder name for a FED (used in the case of errors without detId)
Definition at line 116 of file SiPixelFolderOrganizer.cc.
References dbe_, rootFolder, and DQMStore::setCurrentFolder().
Referenced by SiPixelRawDataErrorSource::bookMEs().
{ std::string subDetectorFolder = "AdditionalPixelErrors"; char sFed[80]; sprintf(sFed, "FED_%i",FedId); std::ostringstream sfolder; sfolder << rootFolder << "/" << subDetectorFolder << "/" << sFed; dbe_->setCurrentFolder(sfolder.str().c_str()); return true; }
bool SiPixelFolderOrganizer::setModuleFolder | ( | const uint32_t & | rawdetid = 0 , |
int | type = 0 |
||
) |
Set folder name for a module or plaquette.
Pixel Barrel
Pixel Endcap
Definition at line 24 of file SiPixelFolderOrganizer.cc.
References PixelEndcapName::bladeName(), dbe_, PixelEndcapName::diskName(), Exception, PixelEndcapName::halfCylinder(), PixelBarrelName::ladderName(), PixelBarrelName::layerName(), PixelBarrelName::moduleName(), PixelEndcapName::pannelName(), PixelSubdetector::PixelBarrel, GeomDetEnumerators::PixelEndcap, PixelEndcapName::plaquetteName(), rootFolder, DQMStore::setCurrentFolder(), PixelBarrelName::shell(), and DetId::subdetId().
Referenced by SiPixelTrackResidualSource::beginRun(), SiPixelHitEfficiencySource::beginRun(), SiPixelRawDataErrorSource::bookMEs(), SiPixelDigiSource::bookMEs(), SiPixelClusterSource::bookMEs(), SiPixelRecHitSource::bookMEs(), SiPixelErrorsDigisToCalibDigis::setDQMDirectory(), and SiPixelOfflineCalibAnalysisBase::setDQMDirectory().
{ bool flag = false; if(rawdetid == 0) { dbe_->setCurrentFolder(rootFolder); flag = true; } else if(DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) { //for endcap types there is nothing to do: if(type>3 && type!=7) return true; std::string subDetectorFolder = "Barrel"; PixelBarrelName::Shell DBshell = PixelBarrelName(DetId(rawdetid)).shell(); int DBlayer = PixelBarrelName(DetId(rawdetid)).layerName(); int DBladder = PixelBarrelName(DetId(rawdetid)).ladderName(); int DBmodule = PixelBarrelName(DetId(rawdetid)).moduleName(); char slayer[80]; sprintf(slayer, "Layer_%i", DBlayer); char sladder[80]; sprintf(sladder,"Ladder_%02i",DBladder); char smodule[80]; sprintf(smodule,"Module_%i", DBmodule); std::ostringstream sfolder; sfolder << rootFolder << "/" << subDetectorFolder; if(type<4){ sfolder << "/Shell_" <<DBshell << "/" << slayer; } if(type<2){ sfolder << "/" << sladder; if ( PixelBarrelName(DetId(rawdetid)).isHalfModule() ) sfolder <<"H"; else sfolder <<"F"; } if(type==0) sfolder << "/" <<smodule; //if(type==3) sfolder << "/all_" << smodule; //std::cout<<"set barrel folder: "<<rawdetid<<" : "<<sfolder.str().c_str()<<std::endl; dbe_->setCurrentFolder(sfolder.str().c_str()); flag = true; } else if(DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) { //for barrel types there is nothing to do: if(type>0 && type < 4) return true; std::string subDetectorFolder = "Endcap"; PixelEndcapName::HalfCylinder side = PixelEndcapName(DetId(rawdetid)).halfCylinder(); int disk = PixelEndcapName(DetId(rawdetid)).diskName(); int blade = PixelEndcapName(DetId(rawdetid)).bladeName(); int panel = PixelEndcapName(DetId(rawdetid)).pannelName(); int module = PixelEndcapName(DetId(rawdetid)).plaquetteName(); char sdisk[80]; sprintf(sdisk, "Disk_%i",disk); char sblade[80]; sprintf(sblade, "Blade_%02i",blade); char spanel[80]; sprintf(spanel, "Panel_%i",panel); char smodule[80];sprintf(smodule,"Module_%i",module); std::ostringstream sfolder; sfolder <<rootFolder <<"/" << subDetectorFolder << "/HalfCylinder_" << side << "/" << sdisk; if(type==0 || type ==4){ sfolder << "/" << sblade; } if(type==0){ sfolder << "/" << spanel << "/" << smodule; } // if(type==6){ // sfolder << "/" << spanel << "_all_" << smodule; // } //std::cout<<"set endcap folder: "<<rawdetid<<" : "<<sfolder.str().c_str()<<std::endl; dbe_->setCurrentFolder(sfolder.str().c_str()); flag = true; } else throw cms::Exception("LogicError") << "[SiPixelFolderOrganizer::setModuleFolder] Not a Pixel detector DetId "; return flag; }
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.