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

Constructor & Destructor Documentation

sipixelobjects::PixelROC::PixelROC ( )
inline

dummy

Definition at line 28 of file PixelROC.h.

28 : theDetUnit(0), theIdDU(0), theIdLk(0) {}
unsigned int theIdLk
Definition: PixelROC.h:86
unsigned int theIdDU
Definition: PixelROC.h:86
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.

References initFrameConversion().

14  : theDetUnit(du), theIdDU(idDU), theIdLk(idLk) {
16 }
unsigned int theIdLk
Definition: PixelROC.h:86
unsigned int theIdDU
Definition: PixelROC.h:86

Member Function Documentation

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 145 of file PixelROC.cc.

Referenced by initFrameConversionPhase1(), and toGlobal().

145  {
147  const unsigned int layerStartBit_= 20;
148  //const unsigned int ladderStartBit_= 12;
149  //const unsigned int moduleStartBit_= 2;
151  const unsigned int layerMask_= 0xF;
152  //const unsigned int ladderMask_= 0xFF;
153  //const unsigned int moduleMask_= 0x3FF;
154 
156  unsigned int layer = (rawId>>layerStartBit_) & layerMask_;
158  //unsigned int ladder = (rawId>>ladderStartBit_) & ladderMask_;
160  //unsigned int module = (rawId>>moduleStartBit_)& moduleMask_;
161 
162  //if(module<5) side=-1; // modules 1-4 are on -z
163  return layer;
164 }
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
Definition: PixelROC.h:37
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 102 of file PixelROC.cc.

Referenced by toGlobal().

102  {
103  int side = 1;
105  //const unsigned int layerStartBit_= 16;
106  //const unsigned int ladderStartBit_= 8;
107  const unsigned int moduleStartBit_= 2;
109  //const unsigned int layerMask_= 0xF;
110  //const unsigned int ladderMask_= 0xFF;
111  const unsigned int moduleMask_= 0x3F;
112 
114  //unsigned int layer = (rawId>>layerStartBit_) & layerMask_;
116  //unsigned int ladder = (rawId>>ladderStartBit_) & ladderMask_;
118  unsigned int module = (rawId>>moduleStartBit_)& moduleMask_;
119 
120  if(module<5) side=-1; // modules 1-4 are on -z
121  return side;
122 }
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
Definition: PixelROC.h:37
Definition: vlib.h:208
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 123 of file PixelROC.cc.

Referenced by initFrameConversionPhase1(), initFrameConversionPhase1_CMSSW_9_0_X(), and toGlobal().

123  {
124  int side = 1;
125 
127  //const unsigned int layerStartBit_= 20;
128  //const unsigned int ladderStartBit_= 12;
129  const unsigned int moduleStartBit_= 2;
131  //const unsigned int layerMask_= 0xF;
132  //const unsigned int ladderMask_= 0xFF;
133  const unsigned int moduleMask_= 0x3FF;
134 
136  //unsigned int layer = (rawId>>layerStartBit_) & layerMask_;
138  //unsigned int ladder = (rawId>>ladderStartBit_) & ladderMask_;
140  unsigned int module = (rawId>>moduleStartBit_)& moduleMask_;
141 
142  if(module<5) side=-1; // modules 1-4 are on -z
143  return side;
144 }
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
Definition: PixelROC.h:37
Definition: vlib.h:208
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 166 of file PixelROC.cc.

Referenced by toGlobal().

166  {
167  int side = 1;
168 
170  //const unsigned int sideStartBit_= 23;
171  //const unsigned int diskStartBit_= 16;
172  //const unsigned int bladeStartBit_= 10;
173  const unsigned int panelStartBit_= 8;
174  //const unsigned int moduleStartBit_= 2;
176 
177  //const unsigned int sideMask_= 0x3;
178  //const unsigned int diskMask_= 0xF;
179  //const unsigned int bladeMask_= 0x3F;
180  const unsigned int panelMask_= 0x3;
181  //const unsigned int moduleMask_= 0x3F;
182 
184  //unsigned int sides = int((rawId>>sideStartBit_) & sideMask_);
186  //unsigned int disk = int((rawId>>diskStartBit_) & diskMask_);
188  //unsigned int blade = ((rawId>>bladeStartBit_) & bladeMask_);
190  unsigned int panel = ((rawId>>panelStartBit_) & panelMask_);
192  //unsigned int module = ((rawId>>moduleStartBit_) & moduleMask_);
193 
194  if(panel==1) side=-1; // panel 1 faces -z (is this true for all disks?)
195  return side;
196 }
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
Definition: PixelROC.h:37
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 197 of file PixelROC.cc.

Referenced by initFrameConversionPhase1(), initFrameConversionPhase1_CMSSW_9_0_X(), and toGlobal().

197  {
198  int side = 1;
199 
201  //const unsigned int sideStartBit_= 23;
202  //const unsigned int diskStartBit_= 18;
203  //const unsigned int bladeStartBit_= 12;
204  const unsigned int panelStartBit_= 10;
205  //const unsigned int moduleStartBit_= 2;
207 
208  //const unsigned int sideMask_= 0x3;
209  //const unsigned int diskMask_= 0xF;
210  //const unsigned int bladeMask_= 0x3F;
211  const unsigned int panelMask_= 0x3;
212  //const unsigned int moduleMask_= 0xFF;
213 
215  //unsigned int sides = int((rawId>>sideStartBit_) & sideMask_);
217  //unsigned int disk = int((rawId>>diskStartBit_) & diskMask_);
218 
220  //unsigned int blade = ((rawId>>bladeStartBit_) & bladeMask_);
221 
223  unsigned int panel = ((rawId>>panelStartBit_) & panelMask_);
224 
226  //unsigned int module = ((rawId>>moduleStartBit_) & moduleMask_);
227 
228  if(panel==1) side=-1; // panel 1 faces -z (is this true for all disks?)
229  return side;
230 }
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
Definition: PixelROC.h:37
unsigned int sipixelobjects::PixelROC::idInDetUnit ( ) const
inline
unsigned int sipixelobjects::PixelROC::idInLink ( ) const
inline

id of this ROC in parent Link.

Definition at line 43 of file PixelROC.h.

References theIdLk.

Referenced by sipixelobjects::PixelFEDLink::addItem(), SiPixelFrameReverter::findRocInLink(), and SiPixelFedCablingTree::pathToDetUnit().

43 { return theIdLk; }
unsigned int theIdLk
Definition: PixelROC.h:86
void PixelROC::initFrameConversion ( )

Definition at line 87 of file PixelROC.cc.

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

Referenced by PixelROC(), and toGlobal().

87  {
88 
90  PixelBarrelName barrelName(theDetUnit);
92  } else {
93  PixelEndcapName endcapName(theDetUnit);
95  }
96 
97 }
FrameConversion theFrameConverter
Definition: PixelROC.h:87
unsigned int theIdDU
Definition: PixelROC.h:86
virtual bool isBarrel() const
true for barrel modules
void PixelROC::initFrameConversionPhase1 ( )

Definition at line 71 of file PixelROC.cc.

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

Referenced by toGlobal().

71  {
72  int side = 0;
73  int layer = 0;
75  if(isBarrel) {
76  side = bpixSidePhase1(theDetUnit); // find the side for phase1
77  layer = bpixLayerPhase1(theDetUnit);
78  } else {
79  side = fpixSidePhase1(theDetUnit);
80  }
81 
82  theFrameConverter = FrameConversion(isBarrel, side, layer, theIdDU);
83 
84 }
int fpixSidePhase1(uint32_t rawId) const
Definition: PixelROC.cc:197
FrameConversion theFrameConverter
Definition: PixelROC.h:87
unsigned int theIdDU
Definition: PixelROC.h:86
virtual bool isBarrel() const
true for barrel modules
static int bpixLayerPhase1(uint32_t rawId)
Definition: PixelROC.cc:145
int bpixSidePhase1(uint32_t rawId) const
Definition: PixelROC.cc:123
void PixelROC::initFrameConversionPhase1_CMSSW_9_0_X ( )

Definition at line 57 of file PixelROC.cc.

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

Referenced by toGlobal().

57  {
58  int side = 0;
60  if(isBarrel) {
61  side = bpixSidePhase1(theDetUnit); // find the side for phase1
62  } else {
63  side = fpixSidePhase1(theDetUnit);
64  }
65 
66  theFrameConverter = FrameConversion(isBarrel,side, theIdDU);
67 
68 }
int fpixSidePhase1(uint32_t rawId) const
Definition: PixelROC.cc:197
FrameConversion theFrameConverter
Definition: PixelROC.h:87
unsigned int theIdDU
Definition: PixelROC.h:86
virtual bool isBarrel() const
true for barrel modules
int bpixSidePhase1(uint32_t rawId) const
Definition: PixelROC.cc:123
string PixelROC::print ( int  depth = 0) const

printout for debug

Definition at line 233 of file PixelROC.cc.

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

Referenced by toGlobal().

233  {
234 
235  ostringstream out;
237  DetId detId(theDetUnit);
238  if (depth-- >=0 ) {
239  out <<"======== PixelROC ";
240  //out <<" unit: ";
241  //if (barrel) out << PixelBarrelName(detId).name();
242  //else out << PixelEndcapName(detId).name();
243  if (barrel) out << " barrel ";
244  else out << " endcap ";
245  out <<" ("<<theDetUnit<<")"
246  <<" idInDU: "<<theIdDU
247  <<" idInLk: "<<theIdLk
248 // <<" frame: "<<theRowOffset<<","<<theRowSlopeSign<<","<<theColOffset<<","<<theColSlopeSign
249 // <<" frame: "<<*theFrameConverter
250  <<endl;
251  }
252  return out.str();
253 }
unsigned int theIdLk
Definition: PixelROC.h:86
unsigned int theIdDU
Definition: PixelROC.h:86
virtual bool isBarrel() const
true for barrel modules
Definition: DetId.h:18
uint32_t sipixelobjects::PixelROC::rawId ( ) const
inline
template<class Archive >
void sipixelobjects::PixelROC::serialize ( Archive &  ar,
const unsigned int  version 
)
private
GlobalPixel sipixelobjects::PixelROC::toGlobal ( const LocalPixel loc) const
inline

converts LocalPixel in ROC to DU coordinates. LocalPixel must be inside ROC. Otherwise result is meaningless

Definition at line 59 of file PixelROC.h.

References bpixLayerPhase1(), bpixSidePhase0(), bpixSidePhase1(), sipixelobjects::GlobalPixel::col, sipixelobjects::FrameConversion::collumn(), sipixelobjects::LinearConversion::convert(), particleFlowClusterECALTimeSelected_cfi::depth, fpixSidePhase0(), fpixSidePhase1(), initFrameConversion(), initFrameConversionPhase1(), initFrameConversionPhase1_CMSSW_9_0_X(), print(), rawId(), mps_fire::result, sipixelobjects::LocalPixel::rocCol(), sipixelobjects::LocalPixel::rocRow(), sipixelobjects::GlobalPixel::row, sipixelobjects::FrameConversion::row(), AlCaHLTBitMon_QueryRunRegistry::string, and theFrameConverter.

Referenced by SiPixelQuality::getBadRocPositions(), PixelDataFormatter::interpretRawData(), Phase2TrackerDigitizerAlgorithm::module_killing_DB(), SiPixelDigitizerAlgorithm::module_killing_DB(), and MeasurementTrackerEventProducer::updatePixels().

59  {
60  GlobalPixel result;
61  result.col = theFrameConverter.collumn().convert(loc.rocCol());
62  result.row = theFrameConverter.row().convert(loc.rocRow());
63  return result;
64  }
const sipixelobjects::LinearConversion & row() const
const sipixelobjects::LinearConversion & collumn() const
FrameConversion theFrameConverter
Definition: PixelROC.h:87
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 48 of file PixelROC.h.

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

Referenced by SiPixelFrameReverter::findLinkInFed(), SiPixelFrameReverter::findPixelInRoc(), SiPixelFrameReverter::findRocInDet(), SiPixelFrameReverter::findRocInLink(), SiPixelFrameReverter::toCabling(), and SiPixelFrameConverter::toCabling().

48  {
49  int rocRow = theFrameConverter.row().inverse(glo.row);
50  int rocCol = theFrameConverter.collumn().inverse(glo.col);
51 
52  LocalPixel::RocRowCol rocRowCol = {rocRow, rocCol};
53  return LocalPixel(rocRowCol);
54 
55  }
const sipixelobjects::LinearConversion & row() const
const sipixelobjects::LinearConversion & collumn() const
FrameConversion theFrameConverter
Definition: PixelROC.h:87

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 90 of file PixelROC.h.

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

Definition at line 90 of file PixelROC.h.

Member Data Documentation

uint32_t sipixelobjects::PixelROC::theDetUnit
private
FrameConversion sipixelobjects::PixelROC::theFrameConverter
private
unsigned int sipixelobjects::PixelROC::theIdDU
private
unsigned int sipixelobjects::PixelROC::theIdLk
private

Definition at line 86 of file PixelROC.h.

Referenced by idInLink(), and print().