CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends
sipixelobjects::PixelROC Class Reference

#include <PixelROC.h>

Public Member Functions

int bpixSidePhase0 (uint32_t rawId) const
 
int bpixSidePhase1 (uint32_t rawId) const
 
int fpixSidePhase0 (uint32_t rawId) const
 
int fpixSidePhase1 (uint32_t rawId) const
 
unsigned int idInDetUnit () const
 id of this ROC in DetUnit etermined by token path More...
 
unsigned int idInLink () const
 id of this ROC in parent Link. More...
 
void initFrameConversion ()
 
void initFrameConversionPhase1 ()
 
void initFrameConversionPhase1_CMSSW_9_0_X ()
 
 PixelROC ()
 dummy More...
 
 PixelROC (uint32_t du, int idInDU, int idLk)
 
std::string print (int depth=0) const
 printout for debug More...
 
uint32_t rawId () const
 return the DetUnit to which this ROC belongs to. More...
 
GlobalPixel toGlobal (const LocalPixel &loc) const
 
LocalPixel toLocal (const GlobalPixel &glo) const
 

Static Public Member Functions

static int bpixLayerPhase1 (uint32_t rawId)
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

uint32_t theDetUnit
 
FrameConversion theFrameConverter
 
unsigned int theIdDU
 
unsigned int theIdLk
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 23 of file PixelROC.h.

Constructor & Destructor Documentation

◆ PixelROC() [1/2]

sipixelobjects::PixelROC::PixelROC ( )
inline

dummy

Definition at line 26 of file PixelROC.h.

26 : theDetUnit(0), theIdDU(0), theIdLk(0) {}

◆ PixelROC() [2/2]

PixelROC::PixelROC ( uint32_t  du,
int  idInDU,
int  idLk 
)

ctor with DetUnit id, ROC number in DU (given by token passage), ROC number in Link (given by token passage),

Definition at line 13 of file PixelROC.cc.

13  : theDetUnit(du), theIdDU(idDU), theIdLk(idLk) {
15 }

References initFrameConversion().

Member Function Documentation

◆ bpixLayerPhase1()

int PixelROC::bpixLayerPhase1 ( uint32_t  rawId)
static

two bits would be enough, but we could use the number "0" as a wildcard

two bits would be enough, but we could use the number "0" as a wildcard

layer id

ladder id

det id

Definition at line 142 of file PixelROC.cc.

142  {
144  const unsigned int layerStartBit_ = 20;
145  //const unsigned int ladderStartBit_= 12;
146  //const unsigned int moduleStartBit_= 2;
148  const unsigned int layerMask_ = 0xF;
149  //const unsigned int ladderMask_= 0xFF;
150  //const unsigned int moduleMask_= 0x3FF;
151 
153  unsigned int layer = (rawId >> layerStartBit_) & layerMask_;
155  //unsigned int ladder = (rawId>>ladderStartBit_) & ladderMask_;
157  //unsigned int module = (rawId>>moduleStartBit_)& moduleMask_;
158 
159  //if(module<5) side=-1; // modules 1-4 are on -z
160  return layer;
161 }

References phase1PixelTopology::layer, and rawId().

Referenced by initFrameConversionPhase1().

◆ bpixSidePhase0()

int PixelROC::bpixSidePhase0 ( uint32_t  rawId) const

two bits would be enough, but we could use the number "0" as a wildcard

two bits would be enough, but we could use the number "0" as a wildcard

layer id

ladder id

det id

Definition at line 97 of file PixelROC.cc.

97  {
98  int side = 1;
100  //const unsigned int layerStartBit_= 16;
101  //const unsigned int ladderStartBit_= 8;
102  const unsigned int moduleStartBit_ = 2;
104  //const unsigned int layerMask_= 0xF;
105  //const unsigned int ladderMask_= 0xFF;
106  const unsigned int moduleMask_ = 0x3F;
107 
109  //unsigned int layer = (rawId>>layerStartBit_) & layerMask_;
111  //unsigned int ladder = (rawId>>ladderStartBit_) & ladderMask_;
113  unsigned int module = (rawId >> moduleStartBit_) & moduleMask_;
114 
115  if (module < 5)
116  side = -1; // modules 1-4 are on -z
117  return side;
118 }

References callgraph::module, and rawId().

◆ bpixSidePhase1()

int PixelROC::bpixSidePhase1 ( uint32_t  rawId) const

two bits would be enough, but we could use the number "0" as a wildcard

two bits would be enough, but we could use the number "0" as a wildcard

layer id

ladder id

det id

Definition at line 119 of file PixelROC.cc.

119  {
120  int side = 1;
121 
123  //const unsigned int layerStartBit_= 20;
124  //const unsigned int ladderStartBit_= 12;
125  const unsigned int moduleStartBit_ = 2;
127  //const unsigned int layerMask_= 0xF;
128  //const unsigned int ladderMask_= 0xFF;
129  const unsigned int moduleMask_ = 0x3FF;
130 
132  //unsigned int layer = (rawId>>layerStartBit_) & layerMask_;
134  //unsigned int ladder = (rawId>>ladderStartBit_) & ladderMask_;
136  unsigned int module = (rawId >> moduleStartBit_) & moduleMask_;
137 
138  if (module < 5)
139  side = -1; // modules 1-4 are on -z
140  return side;
141 }

References callgraph::module, and rawId().

Referenced by initFrameConversionPhase1(), and initFrameConversionPhase1_CMSSW_9_0_X().

◆ fpixSidePhase0()

int PixelROC::fpixSidePhase0 ( uint32_t  rawId) const

two bits would be enough, but we could use the number "0" as a wildcard

two bits would be enough, but we could use the number "0" as a wildcard

positive or negative id

disk id

blade id

panel id

det id

Definition at line 163 of file PixelROC.cc.

163  {
164  int side = 1;
165 
167  //const unsigned int sideStartBit_= 23;
168  //const unsigned int diskStartBit_= 16;
169  //const unsigned int bladeStartBit_= 10;
170  const unsigned int panelStartBit_ = 8;
171  //const unsigned int moduleStartBit_= 2;
173 
174  //const unsigned int sideMask_= 0x3;
175  //const unsigned int diskMask_= 0xF;
176  //const unsigned int bladeMask_= 0x3F;
177  const unsigned int panelMask_ = 0x3;
178  //const unsigned int moduleMask_= 0x3F;
179 
181  //unsigned int sides = int((rawId>>sideStartBit_) & sideMask_);
183  //unsigned int disk = int((rawId>>diskStartBit_) & diskMask_);
185  //unsigned int blade = ((rawId>>bladeStartBit_) & bladeMask_);
187  unsigned int panel = ((rawId >> panelStartBit_) & panelMask_);
189  //unsigned int module = ((rawId>>moduleStartBit_) & moduleMask_);
190 
191  if (panel == 1)
192  side = -1; // panel 1 faces -z (is this true for all disks?)
193  return side;
194 }

References rawId().

◆ fpixSidePhase1()

int PixelROC::fpixSidePhase1 ( uint32_t  rawId) const

two bits would be enough, but we could use the number "0" as a wildcard

two bits would be enough, but we could use the number "0" as a wildcard

positive or negative id

disk id

blade id

panel id 1 or 2

det id

Definition at line 195 of file PixelROC.cc.

195  {
196  int side = 1;
197 
199  //const unsigned int sideStartBit_= 23;
200  //const unsigned int diskStartBit_= 18;
201  //const unsigned int bladeStartBit_= 12;
202  const unsigned int panelStartBit_ = 10;
203  //const unsigned int moduleStartBit_= 2;
205 
206  //const unsigned int sideMask_= 0x3;
207  //const unsigned int diskMask_= 0xF;
208  //const unsigned int bladeMask_= 0x3F;
209  const unsigned int panelMask_ = 0x3;
210  //const unsigned int moduleMask_= 0xFF;
211 
213  //unsigned int sides = int((rawId>>sideStartBit_) & sideMask_);
215  //unsigned int disk = int((rawId>>diskStartBit_) & diskMask_);
216 
218  //unsigned int blade = ((rawId>>bladeStartBit_) & bladeMask_);
219 
221  unsigned int panel = ((rawId >> panelStartBit_) & panelMask_);
222 
224  //unsigned int module = ((rawId>>moduleStartBit_) & moduleMask_);
225 
226  if (panel == 1)
227  side = -1; // panel 1 faces -z (is this true for all disks?)
228  return side;
229 }

References rawId().

Referenced by initFrameConversionPhase1(), and initFrameConversionPhase1_CMSSW_9_0_X().

◆ idInDetUnit()

unsigned int sipixelobjects::PixelROC::idInDetUnit ( ) const
inline

◆ idInLink()

unsigned int sipixelobjects::PixelROC::idInLink ( ) const
inline

id of this ROC in parent Link.

Definition at line 40 of file PixelROC.h.

40 { return theIdLk; }

References theIdLk.

◆ initFrameConversion()

void PixelROC::initFrameConversion ( )

Definition at line 84 of file PixelROC.cc.

84  {
86  PixelBarrelName barrelName(theDetUnit);
88  } else {
89  PixelEndcapName endcapName(theDetUnit);
91  }
92 }

References PixelModuleName::isBarrel(), theDetUnit, theFrameConverter, and theIdDU.

Referenced by PixelROC().

◆ initFrameConversionPhase1()

void PixelROC::initFrameConversionPhase1 ( )

Definition at line 69 of file PixelROC.cc.

69  {
70  int side = 0;
71  int layer = 0;
73  if (isBarrel) {
74  side = bpixSidePhase1(theDetUnit); // find the side for phase1
76  } else {
77  side = fpixSidePhase1(theDetUnit);
78  }
79 
81 }

References bpixLayerPhase1(), bpixSidePhase1(), fpixSidePhase1(), PixelPluginsPhase0_cfi::isBarrel, PixelModuleName::isBarrel(), phase1PixelTopology::layer, theDetUnit, theFrameConverter, and theIdDU.

◆ initFrameConversionPhase1_CMSSW_9_0_X()

void PixelROC::initFrameConversionPhase1_CMSSW_9_0_X ( )

Definition at line 56 of file PixelROC.cc.

56  {
57  int side = 0;
59  if (isBarrel) {
60  side = bpixSidePhase1(theDetUnit); // find the side for phase1
61  } else {
62  side = fpixSidePhase1(theDetUnit);
63  }
64 
66 }

References bpixSidePhase1(), fpixSidePhase1(), PixelPluginsPhase0_cfi::isBarrel, PixelModuleName::isBarrel(), theDetUnit, theFrameConverter, and theIdDU.

◆ print()

string PixelROC::print ( int  depth = 0) const

printout for debug

Definition at line 231 of file PixelROC.cc.

231  {
232  ostringstream out;
234  DetId detId(theDetUnit);
235  if (depth-- >= 0) {
236  out << "======== PixelROC ";
237  //out <<" unit: ";
238  //if (barrel) out << PixelBarrelName(detId).name();
239  //else out << PixelEndcapName(detId).name();
240  if (barrel)
241  out << " barrel ";
242  else
243  out << " endcap ";
244  out << " (" << theDetUnit << ")"
245  << " idInDU: " << theIdDU << " idInLk: "
246  << theIdLk
247  // <<" frame: "<<theRowOffset<<","<<theRowSlopeSign<<","<<theColOffset<<","<<theColSlopeSign
248  // <<" frame: "<<*theFrameConverter
249  << endl;
250  }
251  return out.str();
252 }

References Reference_intrackfit_cff::barrel, LEDCalibrationChannels::depth, PixelModuleName::isBarrel(), MillePedeFileConverter_cfg::out, theDetUnit, theIdDU, and theIdLk.

◆ rawId()

uint32_t sipixelobjects::PixelROC::rawId ( ) const
inline

◆ serialize()

template<class Archive >
void sipixelobjects::PixelROC::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ toGlobal()

GlobalPixel sipixelobjects::PixelROC::toGlobal ( const LocalPixel loc) const
inline

◆ toLocal()

LocalPixel sipixelobjects::PixelROC::toLocal ( const GlobalPixel glo) const
inline

converts DU position to local. If GlobalPixel is outside ROC the resulting LocalPixel is not inside ROC. (call to inside(..) recommended)

Definition at line 45 of file PixelROC.h.

45  {
46  int rocRow = theFrameConverter.row().inverse(glo.row);
47  int rocCol = theFrameConverter.collumn().inverse(glo.col);
48 
49  LocalPixel::RocRowCol rocRowCol = {rocRow, rocCol};
50  return LocalPixel(rocRowCol);
51  }

References sipixelobjects::GlobalPixel::col, sipixelobjects::FrameConversion::collumn(), sipixelobjects::LinearConversion::inverse(), sipixelobjects::GlobalPixel::row, sipixelobjects::FrameConversion::row(), and theFrameConverter.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 85 of file PixelROC.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 85 of file PixelROC.h.

Member Data Documentation

◆ theDetUnit

uint32_t sipixelobjects::PixelROC::theDetUnit
private

◆ theFrameConverter

FrameConversion sipixelobjects::PixelROC::theFrameConverter
private

◆ theIdDU

unsigned int sipixelobjects::PixelROC::theIdDU
private

◆ theIdLk

unsigned int sipixelobjects::PixelROC::theIdLk
private

Definition at line 82 of file PixelROC.h.

Referenced by idInLink(), and print().

Reference_intrackfit_cff.barrel
list barrel
Definition: Reference_intrackfit_cff.py:37
sipixelobjects::LinearConversion::inverse
int inverse(int item) const
Definition: LinearConversion.h:10
sipixelobjects::PixelROC::theIdDU
unsigned int theIdDU
Definition: PixelROC.h:82
sipixelobjects::PixelROC::theFrameConverter
FrameConversion theFrameConverter
Definition: PixelROC.h:83
PixelBarrelName
Definition: PixelBarrelName.h:16
sipixelobjects::FrameConversion::row
const sipixelobjects::LinearConversion & row() const
Definition: FrameConversion.h:25
DetId
Definition: DetId.h:17
PixelEndcapName
Definition: PixelEndcapName.h:16
sipixelobjects::PixelROC::fpixSidePhase1
int fpixSidePhase1(uint32_t rawId) const
Definition: PixelROC.cc:195
sipixelobjects::PixelROC::rawId
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
Definition: PixelROC.h:34
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
sipixelobjects::LinearConversion::convert
int convert(int item) const
Definition: LinearConversion.h:9
sipixelobjects::FrameConversion
Definition: FrameConversion.h:12
sipixelobjects::PixelROC::bpixLayerPhase1
static int bpixLayerPhase1(uint32_t rawId)
Definition: PixelROC.cc:142
sipixelobjects::PixelROC::bpixSidePhase1
int bpixSidePhase1(uint32_t rawId) const
Definition: PixelROC.cc:119
sipixelobjects::FrameConversion::collumn
const sipixelobjects::LinearConversion & collumn() const
Definition: FrameConversion.h:26
callgraph.module
module
Definition: callgraph.py:61
sipixelobjects::PixelROC::theIdLk
unsigned int theIdLk
Definition: PixelROC.h:82
PixelModuleName::isBarrel
virtual bool isBarrel() const
true for barrel modules
Definition: PixelModuleName.h:20
sipixelobjects::PixelROC::theDetUnit
uint32_t theDetUnit
Definition: PixelROC.h:81
sipixelobjects::PixelROC::initFrameConversion
void initFrameConversion()
Definition: PixelROC.cc:84
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
mps_fire.result
result
Definition: mps_fire.py:311