CMS 3D CMS Logo

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
 
PixelModuleName::ModuleType moduleType () const override
 module Type More...
 
std::string name () const override
 from base class More...
 
bool operator== (const PixelModuleName &) const override
 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...
 
 ~PixelEndcapNameUpgrade () override
 
- 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

◆ HalfCylinder

Enumerator
mO 
mI 
pO 
pI 

Definition at line 18 of file PixelEndcapNameUpgrade.h.

18 { mO = 1, mI = 2, pO = 3, pI = 4 };

Constructor & Destructor Documentation

◆ PixelEndcapNameUpgrade() [1/3]

PixelEndcapNameUpgrade::PixelEndcapNameUpgrade ( const DetId id)

ctor from DetId

Definition at line 11 of file PixelEndcapNameUpgrade.cc.

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

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

◆ PixelEndcapNameUpgrade() [2/3]

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 24 of file PixelEndcapNameUpgrade.h.

25  : PixelModuleName(false), thePart(part), theDisk(disk), theBlade(blade), thePannel(pannel), thePlaquette(plaq) {}

◆ PixelEndcapNameUpgrade() [3/3]

PixelEndcapNameUpgrade::PixelEndcapNameUpgrade ( std::string  name)

ctor from name string

Definition at line 58 of file PixelEndcapNameUpgrade.cc.

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

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

◆ ~PixelEndcapNameUpgrade()

PixelEndcapNameUpgrade::~PixelEndcapNameUpgrade ( )
inlineoverride

Definition at line 30 of file PixelEndcapNameUpgrade.h.

30 {}

Member Function Documentation

◆ bladeName()

int PixelEndcapNameUpgrade::bladeName ( ) const
inline

blade id

Definition at line 41 of file PixelEndcapNameUpgrade.h.

41 { return theBlade; }

References theBlade.

Referenced by getDetId(), SiPixelFolderOrganizer::getModuleFolder(), and SiPixelFolderOrganizer::setModuleFolder().

◆ diskName()

int PixelEndcapNameUpgrade::diskName ( ) const
inline

disk id

Definition at line 38 of file PixelEndcapNameUpgrade.h.

38 { return theDisk; }

References theDisk.

Referenced by getDetId(), SiPixelFolderOrganizer::getModuleFolder(), and SiPixelFolderOrganizer::setModuleFolder().

◆ getDetId()

PXFDetId PixelEndcapNameUpgrade::getDetId ( void  )

return DetId

Definition at line 216 of file PixelEndcapNameUpgrade.cc.

216  {
217  uint32_t side = 0;
218  uint32_t disk = 0;
219  uint32_t blade = 0;
220  uint32_t panel = 0;
221  uint32_t module = 0;
222 
223  // figure out the side
224  HalfCylinder hc = halfCylinder();
225  if (hc == mO || hc == mI)
226  side = 1;
227  else if (hc == pO || hc == pI)
228  side = 2;
229 
230  // get disk/blade/panel/module numbers from PixelEndcapNameUpgrade object
231  disk = static_cast<uint32_t>(diskName());
232  uint32_t tmpBlade = static_cast<uint32_t>(bladeName());
233  panel = static_cast<uint32_t>(pannelName());
234  module = static_cast<uint32_t>(plaquetteName());
235 
236  // convert blade numbering to cmssw convention
237  bool outer = false;
238  outer = (hc == mO) || (hc == pO);
239  /*
240  //iasonas1
241  if (outer) {blade = 57 - tmpBlade;}
242  else {blade = 23 - tmpBlade;}
243 
244 */
245  //iasonas2 m/pI:1-6,18-31,49-56. m/pO:7-17,32-48.
246  if (outer) {
247  if (tmpBlade >= 7 && tmpBlade <= 17)
248  theBlade = tmpBlade + 6;
249  else if (tmpBlade >= 32 && tmpBlade <= 48)
250  theBlade = 60 - tmpBlade;
251  } else { //inner
252  if (tmpBlade <= 6)
253  theBlade = 7 - tmpBlade;
254  else if (tmpBlade >= 18 && tmpBlade <= 31)
255  theBlade = 38 - tmpBlade;
256  else if (tmpBlade >= 49 && tmpBlade <= 56)
257  theBlade = 77 - tmpBlade;
258  }
259 
260  // create and return the DetId
261  return PXFDetId(side, disk, blade, panel, module);
262 
263 } // PXFDetId PixelEndcapNameUpgrade::getDetId()

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

◆ halfCylinder()

HalfCylinder PixelEndcapNameUpgrade::halfCylinder ( ) const
inline

◆ moduleType()

PixelModuleName::ModuleType PixelEndcapNameUpgrade::moduleType ( ) const
overridevirtual

module Type

Implements PixelModuleName.

Definition at line 162 of file PixelEndcapNameUpgrade.cc.

162  {
163  ModuleType type = v2x8;
164  if (pannelName() == 1) {
165  if (plaquetteName() == 1) {
166  type = v2x8;
167  }
168  } else {
169  if (plaquetteName() == 1) {
170  type = v2x8;
171  }
172  }
173  return type;
174 }

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

◆ name()

string PixelEndcapNameUpgrade::name ( ) const
overridevirtual

from base class

Implements PixelModuleName.

Definition at line 185 of file PixelEndcapNameUpgrade.cc.

185  {
186  std::ostringstream stm;
187  stm << "FPix_B" << thePart << "_D" << theDisk << "_BLD" << theBlade << "_PNL" << thePannel << "_PLQ" << thePlaquette;
188  return stm.str();
189 }

References theBlade, theDisk, thePannel, thePart, and thePlaquette.

Referenced by config.CFG::__str__(), validation.Sample::digest(), VIDSelectorBase.VIDSelectorBase::initialize(), and PixelEndcapNameUpgrade().

◆ operator==()

bool PixelEndcapNameUpgrade::operator== ( const PixelModuleName o) const
overridevirtual

check equality of modules from datamemebers

Implements PixelModuleName.

Definition at line 176 of file PixelEndcapNameUpgrade.cc.

176  {
177  if (!o.isBarrel()) {
178  const PixelEndcapNameUpgrade* other = dynamic_cast<const PixelEndcapNameUpgrade*>(&o);
179  return (other && thePart == other->thePart && theDisk == other->theDisk && theBlade == other->theBlade &&
180  thePannel == other->thePannel && thePlaquette == other->thePlaquette);
181  } else
182  return false;
183 }

References EcalTangentSkim_cfg::o, trackingPlots::other, theBlade, theDisk, thePannel, thePart, and thePlaquette.

◆ pannelName()

int PixelEndcapNameUpgrade::pannelName ( ) const
inline

◆ plaquetteName()

int PixelEndcapNameUpgrade::plaquetteName ( ) const
inline

plaquetteId (in pannel)

Definition at line 47 of file PixelEndcapNameUpgrade.h.

47 { return thePlaquette; }

References thePlaquette.

Referenced by getDetId(), SiPixelFolderOrganizer::getModuleFolder(), moduleType(), and SiPixelFolderOrganizer::setModuleFolder().

Member Data Documentation

◆ theBlade

int PixelEndcapNameUpgrade::theBlade
private

◆ theDisk

int PixelEndcapNameUpgrade::theDisk
private

Definition at line 60 of file PixelEndcapNameUpgrade.h.

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

◆ thePannel

int PixelEndcapNameUpgrade::thePannel
private

Definition at line 60 of file PixelEndcapNameUpgrade.h.

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

◆ thePart

HalfCylinder PixelEndcapNameUpgrade::thePart
private

Definition at line 59 of file PixelEndcapNameUpgrade.h.

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

◆ thePlaquette

int PixelEndcapNameUpgrade::thePlaquette
private

Definition at line 60 of file PixelEndcapNameUpgrade.h.

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

PixelEndcapNameUpgrade::diskName
int diskName() const
disk id
Definition: PixelEndcapNameUpgrade.h:38
PixelEndcapNameUpgrade::HalfCylinder
HalfCylinder
Definition: PixelEndcapNameUpgrade.h:18
PixelEndcapNameUpgrade::thePannel
int thePannel
Definition: PixelEndcapNameUpgrade.h:60
PixelEndcapNameUpgrade::bladeName
int bladeName() const
blade id
Definition: PixelEndcapNameUpgrade.h:41
PixelEndcapNameUpgrade::mO
Definition: PixelEndcapNameUpgrade.h:18
PixelEndcapNameUpgrade
Definition: PixelEndcapNameUpgrade.h:16
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
PixelEndcapNameUpgrade::name
std::string name() const override
from base class
Definition: PixelEndcapNameUpgrade.cc:185
part
part
Definition: HCALResponse.h:20
PixelEndcapNameUpgrade::mI
Definition: PixelEndcapNameUpgrade.h:18
PixelModuleName::ModuleType
ModuleType
Definition: PixelModuleName.h:14
trackingPlots.other
other
Definition: trackingPlots.py:1460
PXFDetId
Definition: PXFDetId.h:15
PixelEndcapNameUpgrade::pO
Definition: PixelEndcapNameUpgrade.h:18
PixelEndcapNameUpgrade::thePlaquette
int thePlaquette
Definition: PixelEndcapNameUpgrade.h:60
PixelEndcapNameUpgrade::pannelName
int pannelName() const
pannel id
Definition: PixelEndcapNameUpgrade.h:44
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
PixelEndcapNameUpgrade::halfCylinder
HalfCylinder halfCylinder() const
Definition: PixelEndcapNameUpgrade.h:35
PixelEndcapNameUpgrade::theDisk
int theDisk
Definition: PixelEndcapNameUpgrade.h:60
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
PixelEndcapNameUpgrade::theBlade
int theBlade
Definition: PixelEndcapNameUpgrade.h:60
PixelEndcapNameUpgrade::thePart
HalfCylinder thePart
Definition: PixelEndcapNameUpgrade.h:59
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
PixelModuleName::v2x8
Definition: PixelModuleName.h:14
PixelEndcapNameUpgrade::plaquetteName
int plaquetteName() const
plaquetteId (in pannel)
Definition: PixelEndcapNameUpgrade.h:47
PixelEndcapNameUpgrade::pI
Definition: PixelEndcapNameUpgrade.h:18
PixelModuleName::PixelModuleName
PixelModuleName(bool isBarrel)
Definition: PixelModuleName.h:16
SurfaceOrientation::outer
Definition: Surface.h:19