CMS 3D CMS Logo

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 isUpgrade)
 
bool setFedFolder (const uint32_t FedId)
 Set folder name for a FED (used in the case of errors without detId) More...
 
bool setFedFolder (DQMStore::IBooker &, const uint32_t FedId)
 
bool setModuleFolder (const uint32_t &rawdetid=0, int type=0, bool isUpgrade=false)
 Set folder name for a module or plaquette. More...
 
bool setModuleFolder (DQMStore::IBooker &, const uint32_t &rawdetid=0, int type=0, bool isUpgrade=false)
 
 SiPixelFolderOrganizer (bool getStore=true)
 Constructor - getStore should be called false from multi-thread DQM applications. More...
 
virtual ~SiPixelFolderOrganizer ()
 Destructor. More...
 

Private Attributes

DQMStoredbe_
 
std::string topFolderName
 

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 23 of file SiPixelFolderOrganizer.h.

Constructor & Destructor Documentation

SiPixelFolderOrganizer::SiPixelFolderOrganizer ( bool  getStore = true)

Constructor - getStore should be called false from multi-thread DQM applications.

DQM and Framework services.

Data Formats Constructor

Definition at line 17 of file SiPixelFolderOrganizer.cc.

References dbe_, and Utilities::operator.

17  :
18  topFolderName("Pixel")
19 {
20  //Not allowed in multithread framework, but can still be called by other modules not from DQM.
21  if (getStore) dbe_ = edm::Service<DQMStore>().operator->();
22 }
SiPixelFolderOrganizer::~SiPixelFolderOrganizer ( )
virtual

Destructor.

Definition at line 24 of file SiPixelFolderOrganizer.cc.

24 {}

Member Function Documentation

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

Definition at line 386 of file SiPixelFolderOrganizer.cc.

References PixelEndcapNameUpgrade::bladeName(), PixelEndcapName::bladeName(), PixelEndcapNameUpgrade::diskName(), PixelEndcapName::diskName(), Exception, PixelEndcapNameUpgrade::halfCylinder(), PixelEndcapName::halfCylinder(), PixelBarrelNameUpgrade::ladderName(), PixelBarrelName::ladderName(), PixelBarrelNameUpgrade::layerName(), PixelBarrelName::layerName(), PixelBarrelNameUpgrade::moduleName(), PixelBarrelName::moduleName(), PixelEndcapNameUpgrade::pannelName(), PixelEndcapName::pannelName(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, PixelEndcapNameUpgrade::plaquetteName(), PixelEndcapName::plaquetteName(), PixelBarrelNameUpgrade::shell(), PixelBarrelName::shell(), AlCaHLTBitMon_QueryRunRegistry::string, and topFolderName.

388  {
389 
391  if(rawdetid == 0) {
392  return;
393  }else if( (DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) && (!isUpgrade) ) {
394  std::string subDetectorFolder = "Barrel";
395  PixelBarrelName::Shell DBshell = PixelBarrelName(DetId(rawdetid)).shell();
396  int DBlayer = PixelBarrelName(DetId(rawdetid)).layerName();
397  int DBladder = PixelBarrelName(DetId(rawdetid)).ladderName();
398  int DBmodule = PixelBarrelName(DetId(rawdetid)).moduleName();
399 
400  //char sshell[80]; sprintf(sshell, "Shell_%i", DBshell);
401  char slayer[80]; sprintf(slayer, "Layer_%i", DBlayer);
402  char sladder[80]; sprintf(sladder,"Ladder_%02i",DBladder);
403  char smodule[80]; sprintf(smodule,"Module_%i", DBmodule);
404 
405  std::ostringstream sfolder;
406  sfolder << topFolderName << "/" << subDetectorFolder << "/Shell_" <<DBshell << "/" << slayer << "/" << sladder;
407  if ( PixelBarrelName(DetId(rawdetid)).isHalfModule() ) sfolder <<"H";
408  else sfolder <<"F";
409  sfolder << "/" <<smodule;
410  path = sfolder.str().c_str();
411 
412  //path = path + "/" + subDetectorFolder + "/" + sshell + "/" + slayer + "/" + sladder;
413  //if(PixelBarrelName(DetId(rawdetid)).isHalfModule() )
414  // path = path + "H";
415  //else path = path + "F";
416  //path = path + "/" + smodule;
417 
418  }else if( (DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) && (isUpgrade) ) {
419  std::string subDetectorFolder = "Barrel";
421  int DBlayer = PixelBarrelNameUpgrade(DetId(rawdetid)).layerName();
422  int DBladder = PixelBarrelNameUpgrade(DetId(rawdetid)).ladderName();
423  int DBmodule = PixelBarrelNameUpgrade(DetId(rawdetid)).moduleName();
424 
425  //char sshell[80]; sprintf(sshell, "Shell_%i", DBshell);
426  char slayer[80]; sprintf(slayer, "Layer_%i", DBlayer);
427  char sladder[80]; sprintf(sladder,"Ladder_%02i",DBladder);
428  char smodule[80]; sprintf(smodule,"Module_%i", DBmodule);
429 
430  std::ostringstream sfolder;
431  sfolder << topFolderName << "/" << subDetectorFolder << "/Shell_" <<DBshell << "/" << slayer << "/" << sladder;
432  if ( PixelBarrelNameUpgrade(DetId(rawdetid)).isHalfModule() ) sfolder <<"H";
433  else sfolder <<"F";
434  sfolder << "/" <<smodule;
435  path = sfolder.str().c_str();
436 
437  //path = path + "/" + subDetectorFolder + "/" + sshell + "/" + slayer + "/" + sladder;
438  //if(PixelBarrelNameUpgrade(DetId(rawdetid)).isHalfModule() )
439  // path = path + "H";
440  //else path = path + "F";
441  //path = path + "/" + smodule;
442 
443  } else if( (DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) && (!isUpgrade) ) {
444  std::string subDetectorFolder = "Endcap";
446  int disk = PixelEndcapName(DetId(rawdetid)).diskName();
447  int blade = PixelEndcapName(DetId(rawdetid)).bladeName();
448  int panel = PixelEndcapName(DetId(rawdetid)).pannelName();
449  int module = PixelEndcapName(DetId(rawdetid)).plaquetteName();
450 
451  //char shc[80]; sprintf(shc, "HalfCylinder_%i",side);
452  char sdisk[80]; sprintf(sdisk, "Disk_%i",disk);
453  char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
454  char spanel[80]; sprintf(spanel, "Panel_%i",panel);
455  char smodule[80];sprintf(smodule,"Module_%i",module);
456 
457  std::ostringstream sfolder;
458  sfolder <<topFolderName <<"/" << subDetectorFolder << "/HalfCylinder_" << side << "/" << sdisk << "/" << sblade << "/" << spanel << "/" << smodule;
459  path = sfolder.str().c_str();
460 
461  //path = path + "/" + subDetectorFolder + "/" + shc + "/" + sdisk + "/" + sblade + "/" + spanel + "/" + smodule;
462 
463  } else if( (DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) && (isUpgrade) ) {
464  std::string subDetectorFolder = "Endcap";
466  int disk = PixelEndcapNameUpgrade(DetId(rawdetid)).diskName();
467  int blade = PixelEndcapNameUpgrade(DetId(rawdetid)).bladeName();
468  int panel = PixelEndcapNameUpgrade(DetId(rawdetid)).pannelName();
469  int module = PixelEndcapNameUpgrade(DetId(rawdetid)).plaquetteName();
470 
471  //char shc[80]; sprintf(shc, "HalfCylinder_%i",side);
472  char sdisk[80]; sprintf(sdisk, "Disk_%i",disk);
473  char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
474  char spanel[80]; sprintf(spanel, "Panel_%i",panel);
475  char smodule[80];sprintf(smodule,"Module_%i",module);
476 
477  std::ostringstream sfolder;
478  sfolder <<topFolderName <<"/" << subDetectorFolder << "/HalfCylinder_" << side << "/" << sdisk << "/" << sblade << "/" << spanel << "/" << smodule;
479  path = sfolder.str().c_str();
480 
481  //path = path + "/" + subDetectorFolder + "/" + shc + "/" + sdisk + "/" + sblade + "/" + spanel + "/" + smodule;
482 
483  }else throw cms::Exception("LogicError")
484  << "[SiPixelFolderOrganizer::getModuleFolder] Not a Pixel detector DetId ";
485 
486  //std::cout<<"resulting final path name: "<<path<<std::endl;
487 
488  return;
489 }
int plaquetteName() const
plaquetteId (in pannel)
int moduleName() const
module id (index in z)
int plaquetteName() const
plaquetteId (in pannel)
int bladeName() const
blade id
int bladeName() const
blade id
int diskName() const
disk id
Definition: DetId.h:18
int ladderName() const
ladder id (index in phi)
int ladderName() const
ladder id (index in phi)
int moduleName() const
module id (index in z)
int layerName() const
layer id
Shell shell() const
int pannelName() const
pannel id
int diskName() const
disk id
HalfCylinder halfCylinder() const
HalfCylinder halfCylinder() const
int pannelName() const
pannel id
Definition: vlib.h:208
int layerName() const
layer id
bool SiPixelFolderOrganizer::setFedFolder ( const uint32_t  FedId)

Set folder name for a FED (used in the case of errors without detId)

Definition at line 359 of file SiPixelFolderOrganizer.cc.

References dbe_, DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and topFolderName.

Referenced by SiPixelRawDataErrorSource::bookMEs().

359  {
360 
361  std::string subDetectorFolder = "AdditionalPixelErrors";
362  char sFed[80]; sprintf(sFed, "FED_%i",FedId);
363  std::ostringstream sfolder;
364 
365  sfolder << topFolderName << "/" << subDetectorFolder << "/" << sFed;
366  dbe_->setCurrentFolder(sfolder.str().c_str());
367 
368  return true;
369 
370 }
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:740
bool SiPixelFolderOrganizer::setFedFolder ( DQMStore::IBooker iBooker,
const uint32_t  FedId 
)

Definition at line 373 of file SiPixelFolderOrganizer.cc.

References DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and topFolderName.

373  {
374 
375  std::string subDetectorFolder = "AdditionalPixelErrors";
376  char sFed[80]; sprintf(sFed, "FED_%i",FedId);
377  std::ostringstream sfolder;
378 
379  sfolder << topFolderName << "/" << subDetectorFolder << "/" << sFed;
380  iBooker.setCurrentFolder(sfolder.str().c_str());
381 
382  return true;
383 
384 }
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
bool SiPixelFolderOrganizer::setModuleFolder ( const uint32_t &  rawdetid = 0,
int  type = 0,
bool  isUpgrade = false 
)

Set folder name for a module or plaquette.

Pixel Barrel

Pixel Endcap

Definition at line 27 of file SiPixelFolderOrganizer.cc.

References PixelEndcapNameUpgrade::bladeName(), PixelEndcapName::bladeName(), dbe_, PixelEndcapNameUpgrade::diskName(), PixelEndcapName::diskName(), Exception, RemoveAddSevLevel::flag, PixelEndcapNameUpgrade::halfCylinder(), PixelEndcapName::halfCylinder(), PixelBarrelNameUpgrade::ladderName(), PixelBarrelName::ladderName(), PixelBarrelNameUpgrade::layerName(), PixelBarrelName::layerName(), PixelBarrelNameUpgrade::moduleName(), PixelBarrelName::moduleName(), PixelEndcapNameUpgrade::pannelName(), PixelEndcapName::pannelName(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, PixelEndcapNameUpgrade::plaquetteName(), PixelEndcapName::plaquetteName(), DQMStore::setCurrentFolder(), PixelBarrelNameUpgrade::shell(), PixelBarrelName::shell(), AlCaHLTBitMon_QueryRunRegistry::string, DetId::subdetId(), and topFolderName.

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

27  {
28 
29  bool flag = false;
30 
31  if(rawdetid == 0) {
33  flag = true;
34  }
38  else if(DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) {
39 
40  if (!isUpgrade) {
41  //for endcap types there is nothing to do:
42  if(type>3 && type!=7) return true;
43 
44  std::string subDetectorFolder = "Barrel";
45  PixelBarrelName::Shell DBshell = PixelBarrelName(DetId(rawdetid)).shell();
46  int DBlayer = PixelBarrelName(DetId(rawdetid)).layerName();
47  int DBladder = PixelBarrelName(DetId(rawdetid)).ladderName();
48  int DBmodule = PixelBarrelName(DetId(rawdetid)).moduleName();
49 
50  char slayer[80]; sprintf(slayer, "Layer_%i", DBlayer);
51  char sladder[80]; sprintf(sladder,"Ladder_%02i",DBladder);
52  char smodule[80]; sprintf(smodule,"Module_%i", DBmodule);
53 
54  std::ostringstream sfolder;
55 
56  sfolder << topFolderName << "/" << subDetectorFolder;
57  if(type<4){
58  sfolder << "/Shell_" <<DBshell
59  << "/" << slayer;
60  }
61  if(type<2){
62  sfolder << "/" << sladder;
63  if ( PixelBarrelName(DetId(rawdetid)).isHalfModule() ) sfolder <<"H";
64  else sfolder <<"F";
65  }
66  if(type==0) sfolder << "/" <<smodule;
67  //if(type==3) sfolder << "/all_" << smodule;
68 
69  //std::cout<<"set barrel folder: "<<rawdetid<<" : "<<sfolder.str().c_str()<<std::endl;
70 
71  dbe_->setCurrentFolder(sfolder.str().c_str());
72  flag = true;
73  } else if (isUpgrade) {
74  //for endcap types there is nothing to do:
75  if(type>3 && type!=7) return true;
76 
77  std::string subDetectorFolder = "Barrel";
79  int DBlayer = PixelBarrelNameUpgrade(DetId(rawdetid)).layerName();
80  int DBladder = PixelBarrelNameUpgrade(DetId(rawdetid)).ladderName();
81  int DBmodule = PixelBarrelNameUpgrade(DetId(rawdetid)).moduleName();
82 
83  char slayer[80]; sprintf(slayer, "Layer_%i", DBlayer);
84  char sladder[80]; sprintf(sladder,"Ladder_%02i",DBladder);
85  char smodule[80]; sprintf(smodule,"Module_%i", DBmodule);
86 
87  std::ostringstream sfolder;
88 
89  sfolder << topFolderName << "/" << subDetectorFolder;
90  if(type<4){
91  sfolder << "/Shell_" <<DBshell
92  << "/" << slayer;
93  }
94  if(type<2){
95  sfolder << "/" << sladder;
96  if ( PixelBarrelNameUpgrade(DetId(rawdetid)).isHalfModule() ) sfolder <<"H";
97  else sfolder <<"F";
98  }
99  if(type==0) sfolder << "/" <<smodule;
100  //if(type==3) sfolder << "/all_" << smodule;
101 
102  //std::cout<<"set barrel folder: "<<rawdetid<<" : "<<sfolder.str().c_str()<<std::endl;
103 
104  dbe_->setCurrentFolder(sfolder.str().c_str());
105  flag = true;
106  }//endif(isUpgrade)
107  }
108 
112  else if(DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) {
113 
114  if (!isUpgrade) {
115  //for barrel types there is nothing to do:
116  if(type>0 && type < 4) return true;
117 
118  std::string subDetectorFolder = "Endcap";
120  int disk = PixelEndcapName(DetId(rawdetid)).diskName();
121  int blade = PixelEndcapName(DetId(rawdetid)).bladeName();
122  int panel = PixelEndcapName(DetId(rawdetid)).pannelName();
123  int module = PixelEndcapName(DetId(rawdetid)).plaquetteName();
124 
125  char sdisk[80]; sprintf(sdisk, "Disk_%i",disk);
126  char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
127  char spanel[80]; sprintf(spanel, "Panel_%i",panel);
128  char smodule[80];sprintf(smodule,"Module_%i",module);
129 
130  std::ostringstream sfolder;
131 
132  sfolder <<topFolderName <<"/" << subDetectorFolder <<
133  "/HalfCylinder_" << side << "/" << sdisk;
134  if(type==0 || type ==4){
135  sfolder << "/" << sblade;
136  }
137  if(type==0){
138  sfolder << "/" << spanel << "/" << smodule;
139  }
140 // if(type==6){
141 // sfolder << "/" << spanel << "_all_" << smodule;
142 // }
143 
144  //std::cout<<"set endcap folder: "<<rawdetid<<" : "<<sfolder.str().c_str()<<std::endl;
145 
146  dbe_->setCurrentFolder(sfolder.str().c_str());
147  flag = true;
148 
149  } else if (isUpgrade) {
150  //for barrel types there is nothing to do:
151  if(type>0 && type < 4) return true;
152 
153  std::string subDetectorFolder = "Endcap";
155  int disk = PixelEndcapNameUpgrade(DetId(rawdetid)).diskName();
156  int blade = PixelEndcapNameUpgrade(DetId(rawdetid)).bladeName();
157  int panel = PixelEndcapNameUpgrade(DetId(rawdetid)).pannelName();
158  int module = PixelEndcapNameUpgrade(DetId(rawdetid)).plaquetteName();
159 
160 
161  char sdisk[80]; sprintf(sdisk, "Disk_%i",disk);
162  char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
163  char spanel[80]; sprintf(spanel, "Panel_%i",panel);
164  char smodule[80];sprintf(smodule,"Module_%i",module);
165 
166  std::ostringstream sfolder;
167 
168  sfolder <<topFolderName <<"/" << subDetectorFolder <<
169  "/HalfCylinder_" << side << "/" << sdisk;
170  if(type==0 || type ==4){
171  sfolder << "/" << sblade;
172  }
173  if(type==0){
174  sfolder << "/" << spanel << "/" << smodule;
175  }
176 // if(type==6){
177 // sfolder << "/" << spanel << "_all_" << smodule;
178 // }
179 
180  //std::cout<<"set endcap folder: "<<rawdetid<<" : "<<sfolder.str().c_str()<<std::endl;
181 
182  dbe_->setCurrentFolder(sfolder.str().c_str());
183  flag = true;
184  }//endifendcap&&isUpgrade
185  } else throw cms::Exception("LogicError")
186  << "[SiPixelFolderOrganizer::setModuleFolder] Not a Pixel detector DetId ";
187 
188  return flag;
189 
190 }
int plaquetteName() const
plaquetteId (in pannel)
type
Definition: HCALResponse.h:21
int moduleName() const
module id (index in z)
int plaquetteName() const
plaquetteId (in pannel)
int bladeName() const
blade id
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:37
int diskName() const
disk id
Definition: DetId.h:18
int ladderName() const
ladder id (index in phi)
int ladderName() const
ladder id (index in phi)
int moduleName() const
module id (index in z)
int layerName() const
layer id
Shell shell() const
int pannelName() const
pannel id
int diskName() const
disk id
HalfCylinder halfCylinder() const
HalfCylinder halfCylinder() const
int pannelName() const
pannel id
Definition: vlib.h:208
int layerName() const
layer id
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:740
bool SiPixelFolderOrganizer::setModuleFolder ( DQMStore::IBooker iBooker,
const uint32_t &  rawdetid = 0,
int  type = 0,
bool  isUpgrade = false 
)

Pixel Barrel

Pixel Endcap

Definition at line 193 of file SiPixelFolderOrganizer.cc.

References PixelEndcapNameUpgrade::bladeName(), PixelEndcapName::bladeName(), PixelEndcapNameUpgrade::diskName(), PixelEndcapName::diskName(), Exception, RemoveAddSevLevel::flag, PixelEndcapNameUpgrade::halfCylinder(), PixelEndcapName::halfCylinder(), PixelBarrelNameUpgrade::ladderName(), PixelBarrelName::ladderName(), PixelBarrelNameUpgrade::layerName(), PixelBarrelName::layerName(), PixelBarrelNameUpgrade::moduleName(), PixelBarrelName::moduleName(), PixelEndcapNameUpgrade::pannelName(), PixelEndcapName::pannelName(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, PixelEndcapNameUpgrade::plaquetteName(), PixelEndcapName::plaquetteName(), DQMStore::IBooker::setCurrentFolder(), PixelBarrelNameUpgrade::shell(), PixelBarrelName::shell(), AlCaHLTBitMon_QueryRunRegistry::string, DetId::subdetId(), and topFolderName.

193  {
194 
195  bool flag = false;
196 
197  if(rawdetid == 0) {
199  flag = true;
200  }
204  else if(DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) {
205 
206  if (!isUpgrade) {
207  //for endcap types there is nothing to do:
208  if(type>3 && type!=7) return true;
209 
210  std::string subDetectorFolder = "Barrel";
211  PixelBarrelName::Shell DBshell = PixelBarrelName(DetId(rawdetid)).shell();
212  int DBlayer = PixelBarrelName(DetId(rawdetid)).layerName();
213  int DBladder = PixelBarrelName(DetId(rawdetid)).ladderName();
214  int DBmodule = PixelBarrelName(DetId(rawdetid)).moduleName();
215 
216  char slayer[80]; sprintf(slayer, "Layer_%i", DBlayer);
217  char sladder[80]; sprintf(sladder,"Ladder_%02i",DBladder);
218  char smodule[80]; sprintf(smodule,"Module_%i", DBmodule);
219 
220  std::ostringstream sfolder;
221 
222  sfolder << topFolderName << "/" << subDetectorFolder;
223  if(type<4){
224  sfolder << "/Shell_" <<DBshell
225  << "/" << slayer;
226  }
227  if(type<2){
228  sfolder << "/" << sladder;
229  if ( PixelBarrelName(DetId(rawdetid)).isHalfModule() ) sfolder <<"H";
230  else sfolder <<"F";
231  }
232  if(type==0) sfolder << "/" <<smodule;
233  //if(type==3) sfolder << "/all_" << smodule;
234 
235  //std::cout<<"set barrel folder: "<<rawdetid<<" : "<<sfolder.str().c_str()<<std::endl;
236 
237  iBooker.setCurrentFolder(sfolder.str().c_str());
238  flag = true;
239  } else if (isUpgrade) {
240  //for endcap types there is nothing to do:
241  if(type>3 && type!=7) return true;
242 
243  std::string subDetectorFolder = "Barrel";
245  int DBlayer = PixelBarrelNameUpgrade(DetId(rawdetid)).layerName();
246  int DBladder = PixelBarrelNameUpgrade(DetId(rawdetid)).ladderName();
247  int DBmodule = PixelBarrelNameUpgrade(DetId(rawdetid)).moduleName();
248 
249  char slayer[80]; sprintf(slayer, "Layer_%i", DBlayer);
250  char sladder[80]; sprintf(sladder,"Ladder_%02i",DBladder);
251  char smodule[80]; sprintf(smodule,"Module_%i", DBmodule);
252 
253  std::ostringstream sfolder;
254 
255  sfolder << topFolderName << "/" << subDetectorFolder;
256  if(type<4){
257  sfolder << "/Shell_" <<DBshell
258  << "/" << slayer;
259  }
260  if(type<2){
261  sfolder << "/" << sladder;
262  if ( PixelBarrelNameUpgrade(DetId(rawdetid)).isHalfModule() ) sfolder <<"H";
263  else sfolder <<"F";
264  }
265  if(type==0) sfolder << "/" <<smodule;
266  //if(type==3) sfolder << "/all_" << smodule;
267 
268  //std::cout<<"set barrel folder: "<<rawdetid<<" : "<<sfolder.str().c_str()<<std::endl;
269 
270  iBooker.setCurrentFolder(sfolder.str().c_str());
271  flag = true;
272  }//endif(isUpgrade)
273  }
274 
278  else if(DetId(rawdetid).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) {
279 
280  if (!isUpgrade) {
281  //for barrel types there is nothing to do:
282  if(type>0 && type < 4) return true;
283 
284  std::string subDetectorFolder = "Endcap";
286  int disk = PixelEndcapName(DetId(rawdetid)).diskName();
287  int blade = PixelEndcapName(DetId(rawdetid)).bladeName();
288  int panel = PixelEndcapName(DetId(rawdetid)).pannelName();
289  int module = PixelEndcapName(DetId(rawdetid)).plaquetteName();
290 
291  char sdisk[80]; sprintf(sdisk, "Disk_%i",disk);
292  char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
293  char spanel[80]; sprintf(spanel, "Panel_%i",panel);
294  char smodule[80];sprintf(smodule,"Module_%i",module);
295 
296  std::ostringstream sfolder;
297 
298  sfolder <<topFolderName <<"/" << subDetectorFolder <<
299  "/HalfCylinder_" << side << "/" << sdisk;
300  if(type==0 || type ==4){
301  sfolder << "/" << sblade;
302  }
303  if(type==0){
304  sfolder << "/" << spanel << "/" << smodule;
305  }
306 // if(type==6){
307 // sfolder << "/" << spanel << "_all_" << smodule;
308 // }
309 
310  //std::cout<<"set endcap folder: "<<rawdetid<<" : "<<sfolder.str().c_str()<<std::endl;
311 
312  iBooker.setCurrentFolder(sfolder.str().c_str());
313  flag = true;
314 
315  } else if (isUpgrade) {
316  //for barrel types there is nothing to do:
317  if(type>0 && type < 4) return true;
318 
319  std::string subDetectorFolder = "Endcap";
321  int disk = PixelEndcapNameUpgrade(DetId(rawdetid)).diskName();
322  int blade = PixelEndcapNameUpgrade(DetId(rawdetid)).bladeName();
323  int panel = PixelEndcapNameUpgrade(DetId(rawdetid)).pannelName();
324  int module = PixelEndcapNameUpgrade(DetId(rawdetid)).plaquetteName();
325 
326 
327  char sdisk[80]; sprintf(sdisk, "Disk_%i",disk);
328  char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
329  char spanel[80]; sprintf(spanel, "Panel_%i",panel);
330  char smodule[80];sprintf(smodule,"Module_%i",module);
331 
332  std::ostringstream sfolder;
333 
334  sfolder <<topFolderName <<"/" << subDetectorFolder <<
335  "/HalfCylinder_" << side << "/" << sdisk;
336  if(type==0 || type ==4){
337  sfolder << "/" << sblade;
338  }
339  if(type==0){
340  sfolder << "/" << spanel << "/" << smodule;
341  }
342 // if(type==6){
343 // sfolder << "/" << spanel << "_all_" << smodule;
344 // }
345 
346  //std::cout<<"set endcap folder: "<<rawdetid<<" : "<<sfolder.str().c_str()<<std::endl;
347 
348  iBooker.setCurrentFolder(sfolder.str().c_str());
349  flag = true;
350  }//endifendcap&&isUpgrade
351  } else throw cms::Exception("LogicError")
352  << "[SiPixelFolderOrganizer::setModuleFolder] Not a Pixel detector DetId ";
353 
354  return flag;
355 
356 }
int plaquetteName() const
plaquetteId (in pannel)
type
Definition: HCALResponse.h:21
int moduleName() const
module id (index in z)
int plaquetteName() const
plaquetteId (in pannel)
int bladeName() const
blade id
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:37
int diskName() const
disk id
Definition: DetId.h:18
int ladderName() const
ladder id (index in phi)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
int ladderName() const
ladder id (index in phi)
int moduleName() const
module id (index in z)
int layerName() const
layer id
Shell shell() const
int pannelName() const
pannel id
int diskName() const
disk id
HalfCylinder halfCylinder() const
HalfCylinder halfCylinder() const
int pannelName() const
pannel id
Definition: vlib.h:208
int layerName() const
layer id

Member Data Documentation

DQMStore* SiPixelFolderOrganizer::dbe_
private

Definition at line 48 of file SiPixelFolderOrganizer.h.

Referenced by setFedFolder(), setModuleFolder(), and SiPixelFolderOrganizer().

std::string SiPixelFolderOrganizer::topFolderName
private

Definition at line 47 of file SiPixelFolderOrganizer.h.

Referenced by getModuleFolder(), setFedFolder(), and setModuleFolder().