CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
SiPixelFolderOrganizer Class Reference

#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) More...
 
bool setModuleFolder (const uint32_t &rawdetid=0, int type=0)
 Set folder name for a module or plaquette. More...
 
 SiPixelFolderOrganizer ()
 Constructor. More...
 
virtual ~SiPixelFolderOrganizer ()
 Destructor. More...
 

Private Attributes

DQMStoredbe_
 
std::string rootFolder
 
std::string slash
 

Detailed Description

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.

Constructor & Destructor Documentation

SiPixelFolderOrganizer::SiPixelFolderOrganizer ( )

Constructor.

DQM and Framework services.

Data Formats Constructor

Definition at line 15 of file SiPixelFolderOrganizer.cc.

SiPixelFolderOrganizer::~SiPixelFolderOrganizer ( )
virtual

Destructor.

Definition at line 22 of file SiPixelFolderOrganizer.cc.

22 {}

Member Function Documentation

void SiPixelFolderOrganizer::getModuleFolder ( const uint32_t &  rawdetid,
std::string &  path 
)

Definition at line 129 of file SiPixelFolderOrganizer.cc.

References PixelEndcapName::bladeName(), PixelEndcapName::diskName(), edm::hlt::Exception, PixelEndcapName::halfCylinder(), PixelBarrelName::ladderName(), PixelBarrelName::layerName(), PixelBarrelName::moduleName(), PixelEndcapName::pannelName(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, PixelEndcapName::plaquetteName(), rootFolder, and PixelBarrelName::shell().

Referenced by SiPixelInformationExtractor::getSingleModuleHistos(), and SiPixelInformationExtractor::getTrackerMapHistos().

130  {
131 
132  path = rootFolder;
133  //std::cout<<"rawdetis: "<<rawdetid<<" , path= "<<path<<std::endl;
134  if(rawdetid == 0) {
135  return;
136  }else if(DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) {
137  std::string subDetectorFolder = "Barrel";
138  PixelBarrelName::Shell DBshell = PixelBarrelName(DetId(rawdetid)).shell();
139  int DBlayer = PixelBarrelName(DetId(rawdetid)).layerName();
140  int DBladder = PixelBarrelName(DetId(rawdetid)).ladderName();
141  int DBmodule = PixelBarrelName(DetId(rawdetid)).moduleName();
142 
143  //char sshell[80]; sprintf(sshell, "Shell_%i", DBshell);
144  char slayer[80]; sprintf(slayer, "Layer_%i", DBlayer);
145  char sladder[80]; sprintf(sladder,"Ladder_%02i",DBladder);
146  char smodule[80]; sprintf(smodule,"Module_%i", DBmodule);
147 
148  std::ostringstream sfolder;
149  sfolder << rootFolder << "/" << subDetectorFolder << "/Shell_" <<DBshell << "/" << slayer << "/" << sladder;
150  if ( PixelBarrelName(DetId(rawdetid)).isHalfModule() ) sfolder <<"H";
151  else sfolder <<"F";
152  sfolder << "/" <<smodule;
153  path = sfolder.str().c_str();
154 
155  //path = path + "/" + subDetectorFolder + "/" + sshell + "/" + slayer + "/" + sladder;
156  //if(PixelBarrelName(DetId(rawdetid)).isHalfModule() )
157  // path = path + "H";
158  //else path = path + "F";
159  //path = path + "/" + smodule;
160 
161  }else if(DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) {
162  std::string subDetectorFolder = "Endcap";
164  int disk = PixelEndcapName(DetId(rawdetid)).diskName();
165  int blade = PixelEndcapName(DetId(rawdetid)).bladeName();
166  int panel = PixelEndcapName(DetId(rawdetid)).pannelName();
167  int module = PixelEndcapName(DetId(rawdetid)).plaquetteName();
168 
169  //char shc[80]; sprintf(shc, "HalfCylinder_%i",side);
170  char sdisk[80]; sprintf(sdisk, "Disk_%i",disk);
171  char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
172  char spanel[80]; sprintf(spanel, "Panel_%i",panel);
173  char smodule[80];sprintf(smodule,"Module_%i",module);
174 
175  std::ostringstream sfolder;
176  sfolder <<rootFolder <<"/" << subDetectorFolder << "/HalfCylinder_" << side << "/" << sdisk << "/" << sblade << "/" << spanel << "/" << smodule;
177  path = sfolder.str().c_str();
178 
179  //path = path + "/" + subDetectorFolder + "/" + shc + "/" + sdisk + "/" + sblade + "/" + spanel + "/" + smodule;
180 
181  }else throw cms::Exception("LogicError")
182  << "[SiPixelFolderOrganizer::getModuleFolder] Not a Pixel detector DetId ";
183 
184  //std::cout<<"resulting final path name: "<<path<<std::endl;
185 
186  return;
187 }
int plaquetteName() const
plaquetteId (in pannel)
int moduleName() const
module id (index in z)
int bladeName() const
blade id
list path
Definition: scaleCards.py:51
Definition: DetId.h:20
int ladderName() const
ladder id (index in phi)
int layerName() const
layer id
Shell shell() const
int pannelName() const
pannel id
int diskName() const
disk id
HalfCylinder halfCylinder() const
Definition: vlib.h:209
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().

116  {
117 
118  std::string subDetectorFolder = "AdditionalPixelErrors";
119  char sFed[80]; sprintf(sFed, "FED_%i",FedId);
120  std::ostringstream sfolder;
121 
122  sfolder << rootFolder << "/" << subDetectorFolder << "/" << sFed;
123  dbe_->setCurrentFolder(sfolder.str().c_str());
124 
125  return true;
126 
127 }
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
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(), edm::hlt::Exception, PixelEndcapName::halfCylinder(), PixelBarrelName::ladderName(), PixelBarrelName::layerName(), PixelBarrelName::moduleName(), PixelEndcapName::pannelName(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, PixelEndcapName::plaquetteName(), rootFolder, DQMStore::setCurrentFolder(), PixelBarrelName::shell(), and DetId::subdetId().

Referenced by SiPixelHitEfficiencySource::beginRun(), SiPixelTrackResidualSource::beginRun(), SiPixelDigiSource::bookMEs(), SiPixelRawDataErrorSource::bookMEs(), SiPixelRecHitSource::bookMEs(), SiPixelClusterSource::bookMEs(), SiPixelErrorsDigisToCalibDigis::setDQMDirectory(), and SiPixelOfflineCalibAnalysisBase::setDQMDirectory().

24  {
25 
26  bool flag = false;
27 
28  if(rawdetid == 0) {
30  flag = true;
31  }
35  else if(DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) {
36 
37  //for endcap types there is nothing to do:
38  if(type>3 && type!=7) return true;
39 
40  std::string subDetectorFolder = "Barrel";
41  PixelBarrelName::Shell DBshell = PixelBarrelName(DetId(rawdetid)).shell();
42  int DBlayer = PixelBarrelName(DetId(rawdetid)).layerName();
43  int DBladder = PixelBarrelName(DetId(rawdetid)).ladderName();
44  int DBmodule = PixelBarrelName(DetId(rawdetid)).moduleName();
45 
46  char slayer[80]; sprintf(slayer, "Layer_%i", DBlayer);
47  char sladder[80]; sprintf(sladder,"Ladder_%02i",DBladder);
48  char smodule[80]; sprintf(smodule,"Module_%i", DBmodule);
49 
50  std::ostringstream sfolder;
51 
52  sfolder << rootFolder << "/" << subDetectorFolder;
53  if(type<4){
54  sfolder << "/Shell_" <<DBshell
55  << "/" << slayer;
56  }
57  if(type<2){
58  sfolder << "/" << sladder;
59  if ( PixelBarrelName(DetId(rawdetid)).isHalfModule() ) sfolder <<"H";
60  else sfolder <<"F";
61  }
62  if(type==0) sfolder << "/" <<smodule;
63  //if(type==3) sfolder << "/all_" << smodule;
64 
65  //std::cout<<"set barrel folder: "<<rawdetid<<" : "<<sfolder.str().c_str()<<std::endl;
66 
67  dbe_->setCurrentFolder(sfolder.str().c_str());
68  flag = true;
69  }
73  else if(DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) {
74 
75  //for barrel types there is nothing to do:
76  if(type>0 && type < 4) return true;
77 
78  std::string subDetectorFolder = "Endcap";
80  int disk = PixelEndcapName(DetId(rawdetid)).diskName();
81  int blade = PixelEndcapName(DetId(rawdetid)).bladeName();
82  int panel = PixelEndcapName(DetId(rawdetid)).pannelName();
83  int module = PixelEndcapName(DetId(rawdetid)).plaquetteName();
84 
85  char sdisk[80]; sprintf(sdisk, "Disk_%i",disk);
86  char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
87  char spanel[80]; sprintf(spanel, "Panel_%i",panel);
88  char smodule[80];sprintf(smodule,"Module_%i",module);
89 
90  std::ostringstream sfolder;
91 
92  sfolder <<rootFolder <<"/" << subDetectorFolder <<
93  "/HalfCylinder_" << side << "/" << sdisk;
94  if(type==0 || type ==4){
95  sfolder << "/" << sblade;
96  }
97  if(type==0){
98  sfolder << "/" << spanel << "/" << smodule;
99  }
100 // if(type==6){
101 // sfolder << "/" << spanel << "_all_" << smodule;
102 // }
103 
104  //std::cout<<"set endcap folder: "<<rawdetid<<" : "<<sfolder.str().c_str()<<std::endl;
105 
106  dbe_->setCurrentFolder(sfolder.str().c_str());
107  flag = true;
108 
109  } else throw cms::Exception("LogicError")
110  << "[SiPixelFolderOrganizer::setModuleFolder] Not a Pixel detector DetId ";
111 
112  return flag;
113 
114 }
int plaquetteName() const
plaquetteId (in pannel)
type
Definition: HCALResponse.h:22
long int flag
Definition: mlp_lapack.h:47
int moduleName() const
module id (index in z)
int bladeName() const
blade id
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
Definition: DetId.h:20
int ladderName() const
ladder id (index in phi)
int layerName() const
layer id
Shell shell() const
int pannelName() const
pannel id
int diskName() const
disk id
HalfCylinder halfCylinder() const
Definition: vlib.h:209
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429

Member Data Documentation

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.