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 ()
 
 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:84
unsigned int theIdDU
Definition: PixelROC.h:84
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:84
unsigned int theIdDU
Definition: PixelROC.h:84

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

Referenced by toGlobal().

128  {
130  const unsigned int layerStartBit_= 20;
131  //const unsigned int ladderStartBit_= 12;
132  //const unsigned int moduleStartBit_= 2;
134  const unsigned int layerMask_= 0xF;
135  //const unsigned int ladderMask_= 0xFF;
136  //const unsigned int moduleMask_= 0x3FF;
137 
139  unsigned int layer = (rawId>>layerStartBit_) & layerMask_;
141  //unsigned int ladder = (rawId>>ladderStartBit_) & ladderMask_;
143  //unsigned int module = (rawId>>moduleStartBit_)& moduleMask_;
144 
145  //if(module<5) side=-1; // modules 1-4 are on -z
146  return layer;
147 }
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 85 of file PixelROC.cc.

Referenced by toGlobal().

85  {
86  int side = 1;
88  //const unsigned int layerStartBit_= 16;
89  //const unsigned int ladderStartBit_= 8;
90  const unsigned int moduleStartBit_= 2;
92  //const unsigned int layerMask_= 0xF;
93  //const unsigned int ladderMask_= 0xFF;
94  const unsigned int moduleMask_= 0x3F;
95 
97  //unsigned int layer = (rawId>>layerStartBit_) & layerMask_;
99  //unsigned int ladder = (rawId>>ladderStartBit_) & ladderMask_;
101  unsigned int module = (rawId>>moduleStartBit_)& moduleMask_;
102 
103  if(module<5) side=-1; // modules 1-4 are on -z
104  return side;
105 }
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 106 of file PixelROC.cc.

Referenced by initFrameConversionPhase1(), and toGlobal().

106  {
107  int side = 1;
108 
110  //const unsigned int layerStartBit_= 20;
111  //const unsigned int ladderStartBit_= 12;
112  const unsigned int moduleStartBit_= 2;
114  //const unsigned int layerMask_= 0xF;
115  //const unsigned int ladderMask_= 0xFF;
116  const unsigned int moduleMask_= 0x3FF;
117 
119  //unsigned int layer = (rawId>>layerStartBit_) & layerMask_;
121  //unsigned int ladder = (rawId>>ladderStartBit_) & ladderMask_;
123  unsigned int module = (rawId>>moduleStartBit_)& moduleMask_;
124 
125  if(module<5) side=-1; // modules 1-4 are on -z
126  return side;
127 }
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 149 of file PixelROC.cc.

Referenced by toGlobal().

149  {
150  int side = 1;
151 
153  //const unsigned int sideStartBit_= 23;
154  //const unsigned int diskStartBit_= 16;
155  //const unsigned int bladeStartBit_= 10;
156  const unsigned int panelStartBit_= 8;
157  //const unsigned int moduleStartBit_= 2;
159 
160  //const unsigned int sideMask_= 0x3;
161  //const unsigned int diskMask_= 0xF;
162  //const unsigned int bladeMask_= 0x3F;
163  const unsigned int panelMask_= 0x3;
164  //const unsigned int moduleMask_= 0x3F;
165 
167  //unsigned int sides = int((rawId>>sideStartBit_) & sideMask_);
169  //unsigned int disk = int((rawId>>diskStartBit_) & diskMask_);
171  //unsigned int blade = ((rawId>>bladeStartBit_) & bladeMask_);
173  unsigned int panel = ((rawId>>panelStartBit_) & panelMask_);
175  //unsigned int module = ((rawId>>moduleStartBit_) & moduleMask_);
176 
177  if(panel==1) side=-1; // panel 1 faces -z (is this true for all disks?)
178  return side;
179 }
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 180 of file PixelROC.cc.

Referenced by initFrameConversionPhase1(), and toGlobal().

180  {
181  int side = 1;
182 
184  //const unsigned int sideStartBit_= 23;
185  //const unsigned int diskStartBit_= 18;
186  //const unsigned int bladeStartBit_= 12;
187  const unsigned int panelStartBit_= 10;
188  //const unsigned int moduleStartBit_= 2;
190 
191  //const unsigned int sideMask_= 0x3;
192  //const unsigned int diskMask_= 0xF;
193  //const unsigned int bladeMask_= 0x3F;
194  const unsigned int panelMask_= 0x3;
195  //const unsigned int moduleMask_= 0xFF;
196 
198  //unsigned int sides = int((rawId>>sideStartBit_) & sideMask_);
200  //unsigned int disk = int((rawId>>diskStartBit_) & diskMask_);
201 
203  //unsigned int blade = ((rawId>>bladeStartBit_) & bladeMask_);
204 
206  unsigned int panel = ((rawId>>panelStartBit_) & panelMask_);
207 
209  //unsigned int module = ((rawId>>moduleStartBit_) & moduleMask_);
210 
211  if(panel==1) side=-1; // panel 1 faces -z (is this true for all disks?)
212  return side;
213 }
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:84
void PixelROC::initFrameConversion ( )

Definition at line 70 of file PixelROC.cc.

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

Referenced by PixelROC(), and toGlobal().

70  {
71 
73  PixelBarrelName barrelName(theDetUnit);
75  } else {
76  PixelEndcapName endcapName(theDetUnit);
78  }
79 
80 }
FrameConversion theFrameConverter
Definition: PixelROC.h:85
unsigned int theIdDU
Definition: PixelROC.h:84
virtual bool isBarrel() const
true for barrel modules
void PixelROC::initFrameConversionPhase1 ( )

Definition at line 56 of file PixelROC.cc.

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

Referenced by toGlobal().

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 
65  theFrameConverter = FrameConversion(isBarrel,side, theIdDU);
66 
67 }
int fpixSidePhase1(uint32_t rawId) const
Definition: PixelROC.cc:180
FrameConversion theFrameConverter
Definition: PixelROC.h:85
unsigned int theIdDU
Definition: PixelROC.h:84
virtual bool isBarrel() const
true for barrel modules
int bpixSidePhase1(uint32_t rawId) const
Definition: PixelROC.cc:106
string PixelROC::print ( int  depth = 0) const

printout for debug

Definition at line 216 of file PixelROC.cc.

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

Referenced by toGlobal().

216  {
217 
218  ostringstream out;
220  DetId detId(theDetUnit);
221  if (depth-- >=0 ) {
222  out <<"======== PixelROC ";
223  //out <<" unit: ";
224  //if (barrel) out << PixelBarrelName(detId).name();
225  //else out << PixelEndcapName(detId).name();
226  if (barrel) out << " barrel ";
227  else out << " endcap ";
228  out <<" ("<<theDetUnit<<")"
229  <<" idInDU: "<<theIdDU
230  <<" idInLk: "<<theIdLk
231 // <<" frame: "<<theRowOffset<<","<<theRowSlopeSign<<","<<theColOffset<<","<<theColSlopeSign
232 // <<" frame: "<<*theFrameConverter
233  <<endl;
234  }
235  return out.str();
236 }
unsigned int theIdLk
Definition: PixelROC.h:84
unsigned int theIdDU
Definition: PixelROC.h:84
virtual bool isBarrel() const
true for barrel modules
Definition: DetId.h:18
uint32_t sipixelobjects::PixelROC::rawId ( ) const
inline

return the DetUnit to which this ROC belongs to.

Definition at line 37 of file PixelROC.h.

References theDetUnit.

Referenced by PixelDataFormatter::interpretRawData(), SiPixelFedCablingTree::pathToDetUnit(), SiPixelFrameReverter::toCabling(), SiPixelFrameConverter::toCabling(), and toGlobal().

37 { return theDetUnit; }
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(), 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(), and SiPixelDigitizerAlgorithm::module_killing_DB().

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:85
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:85

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 88 of file PixelROC.h.

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

Definition at line 88 of file PixelROC.h.

Member Data Documentation

uint32_t sipixelobjects::PixelROC::theDetUnit
private

Definition at line 83 of file PixelROC.h.

Referenced by initFrameConversion(), initFrameConversionPhase1(), print(), and rawId().

FrameConversion sipixelobjects::PixelROC::theFrameConverter
private

Definition at line 85 of file PixelROC.h.

Referenced by initFrameConversion(), initFrameConversionPhase1(), toGlobal(), and toLocal().

unsigned int sipixelobjects::PixelROC::theIdDU
private

Definition at line 84 of file PixelROC.h.

Referenced by idInDetUnit(), initFrameConversion(), initFrameConversionPhase1(), and print().

unsigned int sipixelobjects::PixelROC::theIdLk
private

Definition at line 84 of file PixelROC.h.

Referenced by idInLink(), and print().