CMS 3D CMS Logo

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

#include <PixelEndcapName.h>

Inheritance diagram for PixelEndcapName:
PixelModuleName

Public Types

enum  HalfCylinder { mO = 1, mI = 2, pO =3, pI =4 }
 
- Public Types inherited from PixelModuleName
enum  ModuleType {
  v1x2, v1x5, v1x8, v2x3,
  v2x4, v2x5, v2x8
}
 

Public Member Functions

int bladeName () const
 blade id More...
 
int diskName () const
 disk id More...
 
PXFDetId getDetId ()
 return DetId More...
 
HalfCylinder halfCylinder () const
 
virtual PixelModuleName::ModuleType moduleType () const
 module Type More...
 
virtual std::string name () const
 from base class More...
 
virtual bool operator== (const PixelModuleName &) const
 check equality of modules from datamemebers More...
 
int pannelName () const
 pannel id More...
 
 PixelEndcapName (const DetId &)
 ctor from DetId More...
 
 PixelEndcapName (HalfCylinder part=mO, int disk=0, int blade=0, int pannel=0, int plaq=0)
 ctor for defined name More...
 
 PixelEndcapName (std::string name)
 ctor from name string More...
 
int plaquetteName () const
 plaquetteId (in pannel) More...
 
virtual ~PixelEndcapName ()
 
- Public Member Functions inherited from PixelModuleName
virtual bool isBarrel () const
 true for barrel modules More...
 
 PixelModuleName (bool isBarrel)
 
virtual ~PixelModuleName ()
 

Private Attributes

int theBlade
 
int theDisk
 
int thePannel
 
HalfCylinder thePart
 
int thePlaquette
 

Additional Inherited Members

- Static Public Member Functions inherited from PixelModuleName
static bool isBarrel (uint32_t rawDetId)
 

Detailed Description

Endcap Module name (as in PixelDatabase) for endcaps

Definition at line 16 of file PixelEndcapName.h.

Member Enumeration Documentation

Enumerator
mO 
mI 
pO 
pI 

Definition at line 19 of file PixelEndcapName.h.

Constructor & Destructor Documentation

PixelEndcapName::PixelEndcapName ( const DetId id)

ctor from DetId

Definition at line 11 of file PixelEndcapName.cc.

References PXFDetId::blade(), PXFDetId::disk(), mI, mO, PXFDetId::module(), SurfaceOrientation::outer, PXFDetId::panel(), pI, pO, PXFDetId::side(), theBlade, theDisk, thePannel, thePart, and thePlaquette.

12  : PixelModuleName(false)
13 {
14  PXFDetId cmssw_numbering(id);
15  int side = cmssw_numbering.side();
16 
17  int tmpBlade = cmssw_numbering.blade();
18  bool outer = false;
19  if (tmpBlade >= 7 && tmpBlade <= 18) {
20  outer = true;
21  theBlade = tmpBlade-6;
22  } else if( tmpBlade <=6 ) {
23  theBlade = 7-tmpBlade;
24  } else if( tmpBlade >= 19) {
25  theBlade = 31-tmpBlade;
26  }
27 
28 
29  if( side == 1 && outer ) thePart = mO;
30  else if( side == 1 && !outer ) thePart = mI;
31  else if( side == 2 && outer ) thePart = pO;
32  else if( side == 2 && !outer ) thePart = pI;
33 
34 
35  theDisk = cmssw_numbering.disk();
36  thePannel = cmssw_numbering.panel();
37  thePlaquette = cmssw_numbering.module();
38 }
PixelModuleName(bool isBarrel)
HalfCylinder thePart
PixelEndcapName::PixelEndcapName ( HalfCylinder  part = mO,
int  disk = 0,
int  blade = 0,
int  pannel = 0,
int  plaq = 0 
)
inline

ctor for defined name

Definition at line 25 of file PixelEndcapName.h.

26  : PixelModuleName(false),
27  thePart(part), theDisk(disk), theBlade(blade), thePannel(pannel), thePlaquette(plaq)
28  { }
PixelModuleName(bool isBarrel)
HalfCylinder thePart
part
Definition: HCALResponse.h:20
PixelEndcapName::PixelEndcapName ( std::string  name)

ctor from name string

Definition at line 41 of file PixelEndcapName.cc.

References mI, mO, name(), pI, pO, theBlade, theDisk, thePannel, thePart, and thePlaquette.

42  : PixelModuleName(false), thePart(mO), theDisk(0),
43  theBlade(0), thePannel(0), thePlaquette(0) {
44 
45  // parse the name string
46  // first, check to make sure this is an FPix name, should start with "FPix_"
47  // also check to make sure the needed parts are present
48  if ( (name.substr(0, 5) != "FPix_") ||
49  (name.find("_B") == string::npos) ||
50  (name.find("_D") == string::npos) ||
51  (name.find("_BLD") == string::npos) ||
52  (name.find("_PNL") == string::npos) ||
53  (name.find("_PLQ") == string::npos) ) {
54  edm::LogError ("BadNameString|SiPixel")
55  << "Bad name string in PixelEndcapName::PixelEndcapName(std::string): "
56  << name;
57  return;
58  }
59 
60  // strip off ROC part if it's there
61  if (name.find("_ROC") != string::npos)
62  name = name.substr(0, name.find("_ROC"));
63 
64  // get the half cylinder
65  string hcString = name.substr(name.find("_B")+2, name.find("_D")-name.find("_B")-2);
66  if (hcString == "mO") thePart = mO;
67  else if (hcString == "mI") thePart = mI;
68  else if (hcString == "pO") thePart = pO;
69  else if (hcString == "pI") thePart = pI;
70  else {
71  edm::LogError ("BadNameString|SiPixel")
72  << "Unable to determine half cylinder in PixelEndcapName::PixelEndcapName(std::string): "
73  << name;
74  }
75 
76  // get the disk
77  string diskString = name.substr(name.find("_D")+2, name.find("_BLD")-name.find("_D")-2);
78  if (diskString == "1") theDisk = 1;
79  else if (diskString == "2") theDisk = 2;
80  else if (diskString == "3") theDisk = 3;
81  else {
82  edm::LogError ("BadNameString|SiPixel")
83  << "Unable to determine disk number in PixelEndcapName::PixelEndcapName(std::string): "
84  << name;
85  }
86 
87  // get the blade
88  string bladeString = name.substr(name.find("_BLD")+4, name.find("_PNL")-name.find("_BLD")-4);
89  // since atoi() doesn't report errors, do it the long way
90  if (bladeString == "1") theBlade = 1;
91  else if (bladeString == "2") theBlade = 2;
92  else if (bladeString == "3") theBlade = 3;
93  else if (bladeString == "4") theBlade = 4;
94  else if (bladeString == "5") theBlade = 5;
95  else if (bladeString == "6") theBlade = 6;
96  else if (bladeString == "7") theBlade = 7;
97  else if (bladeString == "8") theBlade = 8;
98  else if (bladeString == "9") theBlade = 9;
99  else if (bladeString == "10") theBlade = 10;
100  else if (bladeString == "11") theBlade = 11;
101  else if (bladeString == "12") theBlade = 12;
102  else {
103  edm::LogError ("BadNameString|SiPixel")
104  << "Unable to determine blade number in PixelEndcapName::PixelEndcapName(std::string): "
105  << name;
106  }
107 
108  // find the panel
109  string panelString = name.substr(name.find("_PNL")+4, name.find("_PLQ")-name.find("_PNL")-4);
110  if (panelString == "1") thePannel = 1;
111  else if (panelString == "2") thePannel = 2;
112  else {
113  edm::LogError ("BadNameString|SiPixel")
114  << "Unable to determine panel number in PixelEndcapName::PixelEndcapName(std::string): "
115  << name;
116  }
117 
118  // find the plaquette
119  string plaquetteString = name.substr(name.find("_PLQ")+4, name.size()-name.find("_PLQ")-4);
120  if (plaquetteString == "1") thePlaquette = 1;
121  else if (plaquetteString == "2") thePlaquette = 2;
122  else if (plaquetteString == "3") thePlaquette = 3;
123  else if (plaquetteString == "4") thePlaquette = 4;
124  else {
125  edm::LogError ("BadNameString|SiPixel")
126  << "Unable to determine plaquette number in PixelEndcapName::PixelEndcapName(std::string): "
127  << name;
128  }
129 
130 } // PixelEndcapName::PixelEndcapName(std::string name)
PixelModuleName(bool isBarrel)
HalfCylinder thePart
virtual std::string name() const
from base class
virtual PixelEndcapName::~PixelEndcapName ( )
inlinevirtual

Definition at line 33 of file PixelEndcapName.h.

33 { }

Member Function Documentation

int PixelEndcapName::bladeName ( ) const
inline
int PixelEndcapName::diskName ( ) const
inline
PXFDetId PixelEndcapName::getDetId ( void  )

return DetId

Definition at line 183 of file PixelEndcapName.cc.

References bladeName(), diskName(), halfCylinder(), mI, mO, SurfaceOrientation::outer, pannelName(), pI, plaquetteName(), and pO.

183  {
184 
185  uint32_t side = 0;
186  uint32_t disk = 0;
187  uint32_t blade = 0;
188  uint32_t panel = 0;
189  uint32_t module = 0;
190 
191  // figure out the side
192  HalfCylinder hc = halfCylinder();
193  if (hc == mO || hc == mI) side = 1;
194  else if (hc == pO || hc == pI) side = 2;
195 
196  // get disk/blade/panel/module numbers from PixelEndcapName object
197  disk = static_cast<uint32_t>(diskName());
198  uint32_t tmpBlade = static_cast<uint32_t>(bladeName());
199  panel = static_cast<uint32_t>(pannelName());
200  module = static_cast<uint32_t>(plaquetteName());
201 
202  // convert blade numbering to cmssw convention
203  bool outer = false;
204  outer = (hc == mO) || (hc == pO);
205  if (outer) {
206  blade = tmpBlade + 6;
207  }
208  else { // inner
209  if (tmpBlade <= 6) blade = 7 - tmpBlade;
210  else if (tmpBlade <= 12) blade = 31 - tmpBlade;
211  }
212 
213  // create and return the DetId
214  return PXFDetId(side, disk, blade, panel, module);
215 
216 } // PXFDetId PixelEndcapName::getDetId()
int plaquetteName() const
plaquetteId (in pannel)
int bladeName() const
blade id
int pannelName() const
pannel id
int diskName() const
disk id
HalfCylinder halfCylinder() const
Definition: vlib.h:209
HalfCylinder PixelEndcapName::halfCylinder ( ) const
inline
PixelModuleName::ModuleType PixelEndcapName::moduleType ( ) const
virtual

module Type

Implements PixelModuleName.

Definition at line 132 of file PixelEndcapName.cc.

References pannelName(), plaquetteName(), PixelModuleName::v1x2, PixelModuleName::v1x5, PixelModuleName::v2x3, PixelModuleName::v2x4, and PixelModuleName::v2x5.

Referenced by PixelEndcapLinkMaker::links().

133 {
134  ModuleType type = v1x2;
135  if (pannelName() == 1) {
136  if (plaquetteName() == 1) { type = v1x2; }
137  else if (plaquetteName() == 2) { type = v2x3; }
138  else if (plaquetteName() == 3) { type = v2x4; }
139  else if (plaquetteName() == 4) { type = v1x5; }
140  }
141  else {
142  if (plaquetteName() == 1) { type = v2x3; }
143  else if (plaquetteName() == 2) { type = v2x4; }
144  else if (plaquetteName() == 3) { type = v2x5; }
145  }
146  return type;
147 }
int plaquetteName() const
plaquetteId (in pannel)
type
Definition: HCALResponse.h:21
int pannelName() const
pannel id
string PixelEndcapName::name ( ) const
virtual
bool PixelEndcapName::operator== ( const PixelModuleName o) const
virtual

check equality of modules from datamemebers

Implements PixelModuleName.

Definition at line 149 of file PixelEndcapName.cc.

References PixelModuleName::isBarrel(), python.connectstrParser::o, theBlade, theDisk, thePannel, thePart, and thePlaquette.

150 {
151  if (!o.isBarrel()) {
152  const PixelEndcapName * other = dynamic_cast<const PixelEndcapName *>(&o);
153  return ( other
154  && thePart == other->thePart
155  && theDisk == other->theDisk
156  && theBlade == other->theBlade
157  && thePannel == other->thePannel
158  && thePlaquette == other->thePlaquette );
159  } else return false;
160 }
HalfCylinder thePart
virtual bool isBarrel() const
true for barrel modules
int PixelEndcapName::pannelName ( ) const
inline
int PixelEndcapName::plaquetteName ( ) const
inline

Member Data Documentation

int PixelEndcapName::theBlade
private

Definition at line 64 of file PixelEndcapName.h.

Referenced by bladeName(), name(), operator==(), and PixelEndcapName().

int PixelEndcapName::theDisk
private

Definition at line 64 of file PixelEndcapName.h.

Referenced by diskName(), name(), operator==(), and PixelEndcapName().

int PixelEndcapName::thePannel
private

Definition at line 64 of file PixelEndcapName.h.

Referenced by name(), operator==(), pannelName(), and PixelEndcapName().

HalfCylinder PixelEndcapName::thePart
private

Definition at line 63 of file PixelEndcapName.h.

Referenced by halfCylinder(), name(), operator==(), and PixelEndcapName().

int PixelEndcapName::thePlaquette
private

Definition at line 64 of file PixelEndcapName.h.

Referenced by name(), operator==(), PixelEndcapName(), and plaquetteName().