CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PixelROC.cc
Go to the documentation of this file.
2 
6 
7 #include <sstream>
8 #include <algorithm>
9 using namespace std;
10 using namespace sipixelobjects;
11 
12 PixelROC::PixelROC(uint32_t du, int idDU, int idLk)
13  : theDetUnit(du), theIdDU(idDU), theIdLk(idLk), theFrameConverter(0)
14 {}
15 
17  : theDetUnit(o.theDetUnit), theIdDU(o.theIdDU), theIdLk(o.theIdLk),theFrameConverter(0)
18 {
20 }
21 
23 {
24  delete theFrameConverter;
25 }
26 
27 const PixelROC&
29 {
30  PixelROC temp(iRHS);
31  this->swap(temp);
32  return *this;
33 }
34 
35 void
37 {
39  std::swap(theIdDU,iOther.theIdDU);
40  std::swap(theIdLk,iOther.theIdLk);
42 }
43 
45 {
48  result.col = theFrameConverter->collumn().convert(loc.rocCol());
49  result.row = theFrameConverter->row().convert(loc.rocRow());
50  return result;
51 }
52 
53 
55 {
57  int rocRow = theFrameConverter->row().inverse(glo.row);
58  int rocCol = theFrameConverter->collumn().inverse(glo.col);
59 
60  LocalPixel::RocRowCol rocRowCol = {rocRow, rocCol};
61  return LocalPixel(rocRowCol);
62 }
63 
65 {
67  PixelBarrelName barrelName(theDetUnit);
68  theFrameConverter = new FrameConversion(barrelName, theIdDU);
69  } else {
70  PixelEndcapName endcapName(theDetUnit);
71  theFrameConverter = new FrameConversion(endcapName, theIdDU);
72  }
73 }
74 
75 string PixelROC::print(int depth) const
76 {
78 
79  ostringstream out;
81  DetId detId(theDetUnit);
82  if (depth-- >=0 ) {
83  out <<"======== PixelROC ";
84  out <<" unit: ";
85  if (barrel) out << PixelBarrelName(detId).name();
86  else out << PixelEndcapName(detId).name();
87  out <<" ("<<theDetUnit<<")"
88  <<" idInDU: "<<theIdDU
89  <<" idInLk: "<<theIdLk
90 // <<" frame: "<<theRowOffset<<","<<theRowSlopeSign<<","<<theColOffset<<","<<theColSlopeSign
91 // <<" frame: "<<*theFrameConverter
92  <<endl;
93  }
94  return out.str();
95 }
96 
GlobalPixel toGlobal(const LocalPixel &loc) const
Definition: PixelROC.cc:44
const PixelROC & operator=(const PixelROC &)
Definition: PixelROC.cc:28
const sipixelobjects::LinearConversion & row() const
identify pixel inside single ROC
Definition: LocalPixel.h:7
std::string print(int depth=0) const
printout for debug
Definition: PixelROC.cc:75
global coordinates (row and column in DetUnit, as in PixelDigi)
Definition: GlobalPixel.h:6
const sipixelobjects::LinearConversion & collumn() const
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
void swap(PixelROC &)
Definition: PixelROC.cc:36
LocalPixel toLocal(const GlobalPixel &gp) const
Definition: PixelROC.cc:54
tuple result
Definition: query.py:137
unsigned int theIdLk
Definition: PixelROC.h:65
unsigned int theIdDU
Definition: PixelROC.h:65
tuple out
Definition: dbtoconf.py:99
FrameConversion * clone() const
virtual bool isBarrel() const
true for barrel modules
Definition: DetId.h:20
virtual std::string name() const
from base class
const FrameConversion * theFrameConverter
Definition: PixelROC.h:66
row and collumn in ROC representation
Definition: LocalPixel.h:15
virtual std::string name() const
from base class
void initFrameConversion() const
Definition: PixelROC.cc:64