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
PixelEndcapNameUpgrade Class Reference

#include <PixelEndcapNameUpgrade.h>

Inheritance diagram for PixelEndcapNameUpgrade:
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...
 
 PixelEndcapNameUpgrade (const DetId &)
 ctor from DetId More...
 
 PixelEndcapNameUpgrade (HalfCylinder part=mO, int disk=0, int blade=0, int pannel=0, int plaq=0)
 ctor for defined name More...
 
 PixelEndcapNameUpgrade (std::string name)
 ctor from name string More...
 
int plaquetteName () const
 plaquetteId (in pannel) More...
 
virtual ~PixelEndcapNameUpgrade ()
 
- 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 PixelEndcapNameUpgrade.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

PixelEndcapNameUpgrade::PixelEndcapNameUpgrade ( const DetId id)

ctor from DetId

Definition at line 14 of file PixelEndcapNameUpgrade.cc.

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

15  : PixelModuleName(false)
16 {
17  PXFDetId cmssw_numbering(id);
18  int side = cmssw_numbering.side();
19  int tmpBlade = cmssw_numbering.blade();
20  bool outer = false;
21 
22 /*
23  // iasonas1-with this we determine inner-outer ring, NOT x-direction
24  if (tmpBlade >= 23 && tmpBlade <= 56) { //23-56-->outer ring
25  outer = true;
26  theBlade = 57-tmpBlade;
27  } else if( tmpBlade <= 22 ) { //1-22-->inner ring
28  theBlade = 23-tmpBlade;
29  } // iasonas1-end
30 
31 */
32  // iasonas2-with this we determine inner-outer x-position (x>0-x<0), NOT ring
33  // m/pI:1-6,18-31,49-56. m/pO:7-17,32-48.
34  if (tmpBlade>=7 && tmpBlade<=17) {
35  outer = true;
36  theBlade = tmpBlade-6; //7...17-->1...11
37  } else if (tmpBlade>=32 && tmpBlade<=48) {
38  outer = true;
39  theBlade = 60-tmpBlade; //32...48-->28...12
40  } else if( tmpBlade<=6 ) {
41  theBlade = 7-tmpBlade; //1...6-->6...1
42  } else if( tmpBlade>=18 && tmpBlade<=31 ) {
43  theBlade = 38-tmpBlade; //18...31-->20...7
44  } else if( tmpBlade>=49 && tmpBlade<=56 ) {
45  theBlade = 77-tmpBlade; //49...56-->28...21
46  } // iasonas2-end
47 
48  if( side == 1 && outer ) thePart = mO;
49  else if( side == 1 && !outer ) thePart = mI;
50  else if( side == 2 && outer ) thePart = pO;
51  else if( side == 2 && !outer ) thePart = pI;
52 
53  theDisk = cmssw_numbering.disk();
54  thePannel = cmssw_numbering.panel();
55  thePlaquette = cmssw_numbering.module();
56 
57 }
PixelModuleName(bool isBarrel)
PixelEndcapNameUpgrade::PixelEndcapNameUpgrade ( 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 PixelEndcapNameUpgrade.h.

PixelEndcapNameUpgrade::PixelEndcapNameUpgrade ( std::string  name)

ctor from name string

Definition at line 61 of file PixelEndcapNameUpgrade.cc.

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

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

Definition at line 33 of file PixelEndcapNameUpgrade.h.

33 { }

Member Function Documentation

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

return DetId

Definition at line 195 of file PixelEndcapNameUpgrade.cc.

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

195  {
196 
197  uint32_t side = 0;
198  uint32_t disk = 0;
199  uint32_t blade = 0;
200  uint32_t panel = 0;
201  uint32_t module = 0;
202 
203  // figure out the side
205  if (hc == mO || hc == mI) side = 1;
206  else if (hc == pO || hc == pI) side = 2;
207 
208  // get disk/blade/panel/module numbers from PixelEndcapNameUpgrade object
209  disk = static_cast<uint32_t>(diskName());
210  uint32_t tmpBlade = static_cast<uint32_t>(bladeName());
211  panel = static_cast<uint32_t>(pannelName());
212  module = static_cast<uint32_t>(plaquetteName());
213 
214  // convert blade numbering to cmssw convention
215  bool outer = false;
216  outer = (hc == mO) || (hc == pO);
217 /*
218  //iasonas1
219  if (outer) {blade = 57 - tmpBlade;}
220  else {blade = 23 - tmpBlade;}
221 
222 */
223  //iasonas2 m/pI:1-6,18-31,49-56. m/pO:7-17,32-48.
224  if (outer) {
225  if (tmpBlade>=7 && tmpBlade<=17) theBlade = tmpBlade+6;
226  else if (tmpBlade>=32 && tmpBlade<=48) theBlade = 60-tmpBlade;
227  } else { //inner
228  if (tmpBlade<=6 ) theBlade = 7-tmpBlade;
229  else if (tmpBlade>=18 && tmpBlade<=31) theBlade = 38-tmpBlade;
230  else if (tmpBlade>=49 && tmpBlade<=56) theBlade = 77-tmpBlade;
231  }
232 
233  // create and return the DetId
234  return PXFDetId(side, disk, blade, panel, module);
235 
236 } // PXFDetId PixelEndcapNameUpgrade::getDetId()
int plaquetteName() const
plaquetteId (in pannel)
int bladeName() const
blade id
int diskName() const
disk id
susybsm::HSCParticleCollection hc
Definition: classes.h:25
HalfCylinder halfCylinder() const
int pannelName() const
pannel id
Definition: vlib.h:208
HalfCylinder PixelEndcapNameUpgrade::halfCylinder ( ) const
inline
PixelModuleName::ModuleType PixelEndcapNameUpgrade::moduleType ( ) const
virtual

module Type

Implements PixelModuleName.

Definition at line 148 of file PixelEndcapNameUpgrade.cc.

References pannelName(), plaquetteName(), and PixelModuleName::v2x8.

149 {
150  ModuleType type = v2x8;
151  if (pannelName() == 1) {
152  if (plaquetteName() == 1) { type = v2x8; }
153  }
154  else {
155  if (plaquetteName() == 1) { type = v2x8; }
156  }
157  return type;
158 }
type
Definition: HCALResponse.h:21
int plaquetteName() const
plaquetteId (in pannel)
int pannelName() const
pannel id
string PixelEndcapNameUpgrade::name ( ) const
virtual
bool PixelEndcapNameUpgrade::operator== ( const PixelModuleName o) const
virtual

check equality of modules from datamemebers

Implements PixelModuleName.

Definition at line 161 of file PixelEndcapNameUpgrade.cc.

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

162 {
163  if (!o.isBarrel()) {
164  const PixelEndcapNameUpgrade * other = dynamic_cast<const PixelEndcapNameUpgrade *>(&o);
165  return ( other
166  && thePart == other->thePart
167  && theDisk == other->theDisk
168  && theBlade == other->theBlade
169  && thePannel == other->thePannel
170  && thePlaquette == other->thePlaquette );
171  } else return false;
172 }
virtual bool isBarrel() const
true for barrel modules
int PixelEndcapNameUpgrade::pannelName ( ) const
inline
int PixelEndcapNameUpgrade::plaquetteName ( ) const
inline

Member Data Documentation

int PixelEndcapNameUpgrade::theBlade
private
int PixelEndcapNameUpgrade::theDisk
private

Definition at line 64 of file PixelEndcapNameUpgrade.h.

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

int PixelEndcapNameUpgrade::thePannel
private

Definition at line 64 of file PixelEndcapNameUpgrade.h.

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

HalfCylinder PixelEndcapNameUpgrade::thePart
private

Definition at line 63 of file PixelEndcapNameUpgrade.h.

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

int PixelEndcapNameUpgrade::thePlaquette
private

Definition at line 64 of file PixelEndcapNameUpgrade.h.

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