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...
 
bool operator== (const PixelEndcapNameUpgrade &other) const
 
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

Constructor & Destructor Documentation

◆ PixelEndcapNameUpgrade() [1/3]

PixelEndcapNameUpgrade::PixelEndcapNameUpgrade ( const DetId id)

ctor from DetId

Definition at line 11 of file PixelEndcapNameUpgrade.cc.

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

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 }
PixelModuleName(bool isBarrel)

◆ 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.

◆ PixelEndcapNameUpgrade() [3/3]

PixelEndcapNameUpgrade::PixelEndcapNameUpgrade ( std::string  name)

ctor from name string

Definition at line 58 of file PixelEndcapNameUpgrade.cc.

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

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)
PixelModuleName(bool isBarrel)
Log< level::Error, false > LogError
std::string name() const override
from base class

◆ ~PixelEndcapNameUpgrade()

PixelEndcapNameUpgrade::~PixelEndcapNameUpgrade ( )
inlineoverride

Definition at line 30 of file PixelEndcapNameUpgrade.h.

30 {}

Member Function Documentation

◆ bladeName()

int PixelEndcapNameUpgrade::bladeName ( ) const
inline

◆ diskName()

int PixelEndcapNameUpgrade::diskName ( ) const
inline

◆ getDetId()

PXFDetId PixelEndcapNameUpgrade::getDetId ( void  )

return DetId

Definition at line 211 of file PixelEndcapNameUpgrade.cc.

References bladeName(), diskName(), halfCylinder(), mI, mO, SurfaceOrientation::outer, pannelName(), pI, plaquetteName(), pO, ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::side(), and theBlade.

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

◆ 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.

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

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 }
int pannelName() const
pannel id
int plaquetteName() const
plaquetteId (in pannel)

◆ name()

string PixelEndcapNameUpgrade::name ( ) const
overridevirtual

from base class

Implements PixelModuleName.

Definition at line 180 of file PixelEndcapNameUpgrade.cc.

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

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

180  {
181  std::ostringstream stm;
182  stm << "FPix_B" << thePart << "_D" << theDisk << "_BLD" << theBlade << "_PNL" << thePannel << "_PLQ" << thePlaquette;
183  return stm.str();
184 }

◆ operator==() [1/2]

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

check equality of modules from datamemebers

Implements PixelModuleName.

Definition at line 176 of file PixelEndcapNameUpgrade.cc.

References funct::false, and trackingPlots::other.

176  {
177  return other.isBarrel() ? false : (dynamic_cast<const PixelEndcapNameUpgrade&>(other) == *this);
178 }

◆ operator==() [2/2]

bool PixelEndcapNameUpgrade::operator== ( const PixelEndcapNameUpgrade other) const
inline

Definition at line 57 of file PixelEndcapNameUpgrade.h.

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

57  {
58  return (thePart == other.thePart && theDisk == other.theDisk && theBlade == other.theBlade &&
59  thePannel == other.thePannel && thePlaquette == other.thePlaquette);
60  }

◆ pannelName()

int PixelEndcapNameUpgrade::pannelName ( ) const
inline

◆ plaquetteName()

int PixelEndcapNameUpgrade::plaquetteName ( ) const
inline

Member Data Documentation

◆ theBlade

int PixelEndcapNameUpgrade::theBlade
private

◆ theDisk

int PixelEndcapNameUpgrade::theDisk
private

Definition at line 64 of file PixelEndcapNameUpgrade.h.

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

◆ thePannel

int PixelEndcapNameUpgrade::thePannel
private

Definition at line 64 of file PixelEndcapNameUpgrade.h.

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

◆ thePart

HalfCylinder PixelEndcapNameUpgrade::thePart
private

Definition at line 63 of file PixelEndcapNameUpgrade.h.

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

◆ thePlaquette

int PixelEndcapNameUpgrade::thePlaquette
private

Definition at line 64 of file PixelEndcapNameUpgrade.h.

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