CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DQMBarycenter::TkAlBarycenters Class Reference

#include <SiPixelBarycenterHelper.h>

Public Member Functions

void computeBarycenters (const std::vector< AlignTransform > &input, const TrackerTopology &tTopo, const std::map< DQMBarycenter::coordinate, float > &GPR)
 
const std::array< double, 9 > getX ()
 
const std::array< double, 9 > getY ()
 
const std::array< double, 9 > getZ ()
 
void init ()
 
virtual ~TkAlBarycenters ()
 

Private Attributes

std::map< DQMBarycenter::PARTITION, double > nmodules
 
std::map< DQMBarycenter::PARTITION, double > Xbarycenters
 
std::map< DQMBarycenter::PARTITION, double > Ybarycenters
 
std::map< DQMBarycenter::PARTITION, double > Zbarycenters
 

Detailed Description

Definition at line 62 of file SiPixelBarycenterHelper.h.

Constructor & Destructor Documentation

◆ ~TkAlBarycenters()

virtual DQMBarycenter::TkAlBarycenters::~TkAlBarycenters ( )
inlinevirtual

Definition at line 115 of file SiPixelBarycenterHelper.h.

115 {}

Member Function Documentation

◆ computeBarycenters()

void DQMBarycenter::TkAlBarycenters::computeBarycenters ( const std::vector< AlignTransform > &  input,
const TrackerTopology tTopo,
const std::map< DQMBarycenter::coordinate, float > &  GPR 
)
inline

Definition at line 118 of file SiPixelBarycenterHelper.h.

122  {
123  for (const auto& ali : input) {
124  if (DetId(ali.rawId()).det() != DetId::Tracker) {
125  edm::LogWarning("SiPixelBarycenters::computeBarycenters")
126  << "Encountered invalid Tracker DetId:" << ali.rawId() << " " << DetId(ali.rawId()).det()
127  << " is different from " << DetId::Tracker << " - terminating ";
128  assert(DetId(ali.rawId()).det() != DetId::Tracker);
129  }
130 
131  const auto& tns = align::TrackerNameSpace(&tTopo);
132  int subid = DetId(ali.rawId()).subdetId();
133  if (subid == PixelSubdetector::PixelBarrel || subid == PixelSubdetector::PixelEndcap) { // use only pixel
134  switch (subid) { // Separate BPIX, FPIX_zp and FPIX_zm
136  Xbarycenters[PARTITION::BPIX] += (ali.translation().x());
137  Ybarycenters[PARTITION::BPIX] += (ali.translation().y());
138  Zbarycenters[PARTITION::BPIX] += (ali.translation().z());
140  break;
142  // minus side
143  if (tns.tpe().endcapNumber(ali.rawId()) == 1) {
144  Xbarycenters[PARTITION::FPIX_zm] += (ali.translation().x());
145  Ybarycenters[PARTITION::FPIX_zm] += (ali.translation().y());
146  Zbarycenters[PARTITION::FPIX_zm] += (ali.translation().z());
148  } // plus side
149  else {
150  Xbarycenters[PARTITION::FPIX_zp] += (ali.translation().x());
151  Ybarycenters[PARTITION::FPIX_zp] += (ali.translation().y());
152  Zbarycenters[PARTITION::FPIX_zp] += (ali.translation().z());
154  }
155  break;
156  default:
157  edm::LogError("PixelDQM") << "Unrecognized partition for barycenter computation " << subid << std::endl;
158  break;
159  }
160 
161  switch (subid) { // Separate following the PCL HLS
163  if ((PixelBarrelName(DetId(ali.rawId()), true).shell() == PixelBarrelName::mO) ||
164  (PixelBarrelName(DetId(ali.rawId()), true).shell() == PixelBarrelName::pO)) { // BPIX x-
165  Xbarycenters[PARTITION::BPIX_xm] += (ali.translation().x());
166  Ybarycenters[PARTITION::BPIX_xm] += (ali.translation().y());
167  Zbarycenters[PARTITION::BPIX_xm] += (ali.translation().z());
169  } else { // BPIX x+
170  Xbarycenters[PARTITION::BPIX_xp] += (ali.translation().x());
171  Ybarycenters[PARTITION::BPIX_xp] += (ali.translation().y());
172  Zbarycenters[PARTITION::BPIX_xp] += (ali.translation().z());
174  }
175  break;
177  if (PixelEndcapName(DetId(ali.rawId()), true).halfCylinder() == PixelEndcapName::mO) { //FPIX z- x-
178  Xbarycenters[PARTITION::FPIX_zm_xm] += (ali.translation().x());
179  Ybarycenters[PARTITION::FPIX_zm_xm] += (ali.translation().y());
180  Zbarycenters[PARTITION::FPIX_zm_xm] += (ali.translation().z());
182  } else if (PixelEndcapName(DetId(ali.rawId()), true).halfCylinder() ==
183  PixelEndcapName::mI) { //FPIX z- x+
184  Xbarycenters[PARTITION::FPIX_zm_xp] += (ali.translation().x());
185  Ybarycenters[PARTITION::FPIX_zm_xp] += (ali.translation().y());
186  Zbarycenters[PARTITION::FPIX_zm_xp] += (ali.translation().z());
188  } else if (PixelEndcapName(DetId(ali.rawId()), true).halfCylinder() ==
189  PixelEndcapName::pO) { //FPIX z+ x-
190  Xbarycenters[PARTITION::FPIX_zp_xm] += (ali.translation().x());
191  Ybarycenters[PARTITION::FPIX_zp_xm] += (ali.translation().y());
192  Zbarycenters[PARTITION::FPIX_zp_xm] += (ali.translation().z());
194  } else if (PixelEndcapName(DetId(ali.rawId()), true).halfCylinder() ==
195  PixelEndcapName::pI) { //FPIX z+ x+
196  Xbarycenters[PARTITION::FPIX_zp_xp] += (ali.translation().x());
197  Ybarycenters[PARTITION::FPIX_zp_xp] += (ali.translation().y());
198  Zbarycenters[PARTITION::FPIX_zp_xp] += (ali.translation().z());
200  } else {
201  edm::LogError("PixelDQM") << "Unrecognized partition for barycenter computation " << subid << std::endl;
202  }
203  break;
204  default:
205  edm::LogError("PixelDQM") << "Unrecognized partition for barycenter computation " << subid << std::endl;
206  break;
207  }
208  }
209  }
210 
211  for (const auto& p : PARTITIONS) {
212  Xbarycenters[p] /= nmodules[p];
213  Ybarycenters[p] /= nmodules[p];
214  Zbarycenters[p] /= nmodules[p];
215 
216  Xbarycenters[p] += GPR.at(DQMBarycenter::t_x);
217  Ybarycenters[p] += GPR.at(DQMBarycenter::t_y);
218  Zbarycenters[p] += GPR.at(DQMBarycenter::t_z);
219  }
220  }

References cms::cuda::assert(), DQMBarycenter::BPIX, DQMBarycenter::BPIX_xm, DQMBarycenter::BPIX_xp, DQMBarycenter::FPIX_zm, DQMBarycenter::FPIX_zm_xm, DQMBarycenter::FPIX_zm_xp, DQMBarycenter::FPIX_zp, DQMBarycenter::FPIX_zp_xm, DQMBarycenter::FPIX_zp_xp, PixelEndcapName::halfCylinder(), input, PixelEndcapName::mI, PixelEndcapName::mO, PixelBarrelName::mO, nmodules, AlCaHLTBitMon_ParallelJobs::p, DQMBarycenter::PARTITIONS, PixelEndcapName::pI, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, PixelBarrelName::pO, PixelEndcapName::pO, PixelBarrelName::shell(), DQMBarycenter::t_x, DQMBarycenter::t_y, DQMBarycenter::t_z, DetId::Tracker, Xbarycenters, Ybarycenters, and Zbarycenters.

Referenced by SiPixelBarycenter::fillBarycenterHistograms().

◆ getX()

const std::array<double, 9> DQMBarycenter::TkAlBarycenters::getX ( )
inline

◆ getY()

const std::array<double, 9> DQMBarycenter::TkAlBarycenters::getY ( )
inline

◆ getZ()

const std::array<double, 9> DQMBarycenter::TkAlBarycenters::getZ ( )
inline

◆ init()

void DQMBarycenter::TkAlBarycenters::init ( )
inline

Member Data Documentation

◆ nmodules

std::map<DQMBarycenter::PARTITION, double> DQMBarycenter::TkAlBarycenters::nmodules
private

Definition at line 66 of file SiPixelBarycenterHelper.h.

Referenced by computeBarycenters().

◆ Xbarycenters

std::map<DQMBarycenter::PARTITION, double> DQMBarycenter::TkAlBarycenters::Xbarycenters
private

Definition at line 63 of file SiPixelBarycenterHelper.h.

Referenced by computeBarycenters(), and getX().

◆ Ybarycenters

std::map<DQMBarycenter::PARTITION, double> DQMBarycenter::TkAlBarycenters::Ybarycenters
private

Definition at line 64 of file SiPixelBarycenterHelper.h.

Referenced by computeBarycenters(), and getY().

◆ Zbarycenters

std::map<DQMBarycenter::PARTITION, double> DQMBarycenter::TkAlBarycenters::Zbarycenters
private

Definition at line 65 of file SiPixelBarycenterHelper.h.

Referenced by computeBarycenters(), and getZ().

PixelEndcapName::mO
Definition: PixelEndcapName.h:18
DQMBarycenter::PARTITION::BPIX_xp
PixelBarrelName::pO
Definition: PixelBarrelName.h:18
input
static const std::string input
Definition: EdmProvDump.cc:48
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
DQMBarycenter::PARTITION::BPIX_xm
DQMBarycenter::TkAlBarycenters::Xbarycenters
std::map< DQMBarycenter::PARTITION, double > Xbarycenters
Definition: SiPixelBarycenterHelper.h:63
DQMBarycenter::PARTITION::FPIX_zp_xp
PixelBarrelName
Definition: PixelBarrelName.h:16
cms::cuda::assert
assert(be >=bs)
DQMBarycenter::t_x
Definition: SiPixelBarycenterHelper.h:16
PixelEndcapName::halfCylinder
HalfCylinder halfCylinder() const
Definition: PixelEndcapName.h:42
PixelBarrelName::mO
Definition: PixelBarrelName.h:18
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
align::TrackerNameSpace
Definition: TrackerNameSpace.h:10
DQMBarycenter::TkAlBarycenters::nmodules
std::map< DQMBarycenter::PARTITION, double > nmodules
Definition: SiPixelBarycenterHelper.h:66
DQMBarycenter::PARTITIONS
const PARTITION PARTITIONS[(int) PARTITION::LAST+1]
Definition: SiPixelBarycenterHelper.h:50
DetId
Definition: DetId.h:17
PixelEndcapName
Definition: PixelEndcapName.h:16
DQMBarycenter::PARTITION::FPIX_zm
DQMBarycenter::PARTITION::BPIX
DQMBarycenter::t_y
Definition: SiPixelBarycenterHelper.h:17
PixelEndcapName::mI
Definition: PixelEndcapName.h:18
DQMBarycenter::TkAlBarycenters::Ybarycenters
std::map< DQMBarycenter::PARTITION, double > Ybarycenters
Definition: SiPixelBarycenterHelper.h:64
DetId::Tracker
Definition: DetId.h:25
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
DQMBarycenter::PARTITION::FPIX_zp_xm
PixelBarrelName::shell
Shell shell() const
Definition: PixelBarrelName.h:40
DQMBarycenter::PARTITION::FPIX_zm_xm
DQMBarycenter::PARTITION::FPIX_zm_xp
DQMBarycenter::t_z
Definition: SiPixelBarycenterHelper.h:18
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
PixelEndcapName::pO
Definition: PixelEndcapName.h:18
DQMBarycenter::TkAlBarycenters::Zbarycenters
std::map< DQMBarycenter::PARTITION, double > Zbarycenters
Definition: SiPixelBarycenterHelper.h:65
PixelEndcapName::pI
Definition: PixelEndcapName.h:18
DQMBarycenter::PARTITION::FPIX_zp