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.

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().

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  }
std::map< DQMBarycenter::PARTITION, double > Xbarycenters
std::map< DQMBarycenter::PARTITION, double > Ybarycenters
std::map< DQMBarycenter::PARTITION, double > nmodules
Log< level::Error, false > LogError
assert(be >=bs)
static std::string const input
Definition: EdmProvDump.cc:50
std::map< DQMBarycenter::PARTITION, double > Zbarycenters
HalfCylinder halfCylinder() const
Shell shell() const
Definition: DetId.h:17
const PARTITION PARTITIONS[(int) PARTITION::LAST+1]
Log< level::Warning, false > LogWarning

◆ 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().