CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
AlignmentPI::TkAlBarycenters Struct Reference

#include <AlignmentPayloadInspectorHelper.h>

Public Member Functions

void computeBarycenters (const std::vector< AlignTransform > &input, const TrackerTopology &tTopo, const std::map< AlignmentPI::coordinate, float > &GPR)
 
const double getNModules (AlignmentPI::PARTITION p)
 
GlobalPoint getPartitionAvg (AlignmentPI::PARTITION p)
 
const std::array< double, 6 > getX ()
 
const std::array< double, 6 > getY ()
 
const std::array< double, 6 > getZ ()
 
void init ()
 
virtual ~TkAlBarycenters ()
 

Public Attributes

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

Detailed Description

Definition at line 798 of file AlignmentPayloadInspectorHelper.h.

Constructor & Destructor Documentation

◆ ~TkAlBarycenters()

virtual AlignmentPI::TkAlBarycenters::~TkAlBarycenters ( )
inlinevirtual

Definition at line 851 of file AlignmentPayloadInspectorHelper.h.

851 {}

Member Function Documentation

◆ computeBarycenters()

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

Definition at line 862 of file AlignmentPayloadInspectorHelper.h.

References cms::cuda::assert(), AlignmentPI::BPIX, COUT, AlignmentPI::FPIXm, AlignmentPI::FPIXp, input, nmodules, AlCaHLTBitMon_ParallelJobs::p, AlignmentPI::PARTITIONS, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, TrackerTopology::pxfSide(), AlignmentPI::t_x, AlignmentPI::t_y, AlignmentPI::t_z, StripSubdetector::TEC, AlignmentPI::TECm, AlignmentPI::TECp, TrackerTopology::tecSide(), StripSubdetector::TIB, AlignmentPI::TIB, StripSubdetector::TID, AlignmentPI::TIDm, AlignmentPI::TIDp, TrackerTopology::tidSide(), StripSubdetector::TOB, AlignmentPI::TOB, DetId::Tracker, Xbarycenters, Ybarycenters, and Zbarycenters.

866  {
867  for (const auto& ali : input) {
868  if (DetId(ali.rawId()).det() != DetId::Tracker) {
869  edm::LogWarning("TkAlBarycenters::computeBarycenters")
870  << "Encountered invalid Tracker DetId:" << ali.rawId() << " " << DetId(ali.rawId()).det()
871  << " is different from " << DetId::Tracker << " - terminating ";
872  assert(DetId(ali.rawId()).det() != DetId::Tracker);
873  }
874 
875  int subid = DetId(ali.rawId()).subdetId();
876  switch (subid) {
878  Xbarycenters[PARTITION::BPIX] += (ali.translation().x());
879  Ybarycenters[PARTITION::BPIX] += (ali.translation().y());
880  Zbarycenters[PARTITION::BPIX] += (ali.translation().z());
882  break;
884 
885  // minus side
886  if (tTopo.pxfSide(DetId(ali.rawId())) == 1) {
887  Xbarycenters[PARTITION::FPIXm] += (ali.translation().x());
888  Ybarycenters[PARTITION::FPIXm] += (ali.translation().y());
889  Zbarycenters[PARTITION::FPIXm] += (ali.translation().z());
891  } // plus side
892  else {
893  Xbarycenters[PARTITION::FPIXp] += (ali.translation().x());
894  Ybarycenters[PARTITION::FPIXp] += (ali.translation().y());
895  Zbarycenters[PARTITION::FPIXp] += (ali.translation().z());
897  }
898  break;
900  Xbarycenters[PARTITION::TIB] += (ali.translation().x());
901  Ybarycenters[PARTITION::TIB] += (ali.translation().y());
902  Zbarycenters[PARTITION::TIB] += (ali.translation().z());
904  break;
906  // minus side
907  if (tTopo.tidSide(DetId(ali.rawId())) == 1) {
908  Xbarycenters[PARTITION::TIDm] += (ali.translation().x());
909  Ybarycenters[PARTITION::TIDm] += (ali.translation().y());
910  Zbarycenters[PARTITION::TIDm] += (ali.translation().z());
912  } // plus side
913  else {
914  Xbarycenters[PARTITION::TIDp] += (ali.translation().x());
915  Ybarycenters[PARTITION::TIDp] += (ali.translation().y());
916  Zbarycenters[PARTITION::TIDp] += (ali.translation().z());
918  }
919  break;
921  Xbarycenters[PARTITION::TOB] += (ali.translation().x());
922  Ybarycenters[PARTITION::TOB] += (ali.translation().y());
923  Zbarycenters[PARTITION::TOB] += (ali.translation().z());
925  break;
927  // minus side
928  if (tTopo.tecSide(DetId(ali.rawId())) == 1) {
929  Xbarycenters[PARTITION::TECm] += (ali.translation().x());
930  Ybarycenters[PARTITION::TECm] += (ali.translation().y());
931  Zbarycenters[PARTITION::TECm] += (ali.translation().z());
933  } // plus side
934  else {
935  Xbarycenters[PARTITION::TECp] += (ali.translation().x());
936  Ybarycenters[PARTITION::TECp] += (ali.translation().y());
937  Zbarycenters[PARTITION::TECp] += (ali.translation().z());
939  }
940  break;
941  default:
942  edm::LogError("TrackerAlignment_PayloadInspector") << "Unrecognized partition " << subid << std::endl;
943  break;
944  }
945  }
946 
947  for (const auto& p : PARTITIONS) {
948  Xbarycenters[p] /= nmodules[p];
949  Ybarycenters[p] /= nmodules[p];
950  Zbarycenters[p] /= nmodules[p];
951 
952  Xbarycenters[p] += GPR.at(AlignmentPI::t_x);
953  Ybarycenters[p] += GPR.at(AlignmentPI::t_y);
954  Zbarycenters[p] += GPR.at(AlignmentPI::t_z);
955 
956  COUT << p << "|"
957  << " X: " << std::right << std::setw(12) << Xbarycenters[p] << " Y: " << std::right << std::setw(12)
958  << Ybarycenters[p] << " Z: " << std::right << std::setw(12) << Zbarycenters[p] << std::endl;
959  }
960  }
static constexpr auto TEC
unsigned int tidSide(const DetId &id) const
const PARTITION PARTITIONS[(int) PARTITION::LAST+1]
Log< level::Error, false > LogError
assert(be >=bs)
static std::string const input
Definition: EdmProvDump.cc:47
unsigned int tecSide(const DetId &id) const
std::map< AlignmentPI::PARTITION, double > Zbarycenters
static constexpr auto TOB
Definition: DetId.h:17
unsigned int pxfSide(const DetId &id) const
static constexpr auto TIB
std::map< AlignmentPI::PARTITION, double > Ybarycenters
std::map< AlignmentPI::PARTITION, double > nmodules
std::map< AlignmentPI::PARTITION, double > Xbarycenters
Log< level::Warning, false > LogWarning
static constexpr auto TID

◆ getNModules()

const double AlignmentPI::TkAlBarycenters::getNModules ( AlignmentPI::PARTITION  p)
inline

Definition at line 810 of file AlignmentPayloadInspectorHelper.h.

References nmodules, and AlCaHLTBitMon_ParallelJobs::p.

810 { return nmodules[p]; };
std::map< AlignmentPI::PARTITION, double > nmodules

◆ getPartitionAvg()

GlobalPoint AlignmentPI::TkAlBarycenters::getPartitionAvg ( AlignmentPI::PARTITION  p)
inline

Definition at line 855 of file AlignmentPayloadInspectorHelper.h.

References AlCaHLTBitMon_ParallelJobs::p, Xbarycenters, Ybarycenters, and Zbarycenters.

857  {
859  }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::map< AlignmentPI::PARTITION, double > Zbarycenters
std::map< AlignmentPI::PARTITION, double > Ybarycenters
std::map< AlignmentPI::PARTITION, double > Xbarycenters

◆ getX()

const std::array<double, 6> AlignmentPI::TkAlBarycenters::getX ( )
inline

◆ getY()

const std::array<double, 6> AlignmentPI::TkAlBarycenters::getY ( )
inline

◆ getZ()

const std::array<double, 6> AlignmentPI::TkAlBarycenters::getZ ( )
inline

◆ init()

void AlignmentPI::TkAlBarycenters::init ( )

Member Data Documentation

◆ nmodules

std::map<AlignmentPI::PARTITION, double> AlignmentPI::TkAlBarycenters::nmodules

Definition at line 802 of file AlignmentPayloadInspectorHelper.h.

Referenced by computeBarycenters(), and getNModules().

◆ Xbarycenters

std::map<AlignmentPI::PARTITION, double> AlignmentPI::TkAlBarycenters::Xbarycenters

Definition at line 799 of file AlignmentPayloadInspectorHelper.h.

Referenced by computeBarycenters(), getPartitionAvg(), and getX().

◆ Ybarycenters

std::map<AlignmentPI::PARTITION, double> AlignmentPI::TkAlBarycenters::Ybarycenters

Definition at line 800 of file AlignmentPayloadInspectorHelper.h.

Referenced by computeBarycenters(), getPartitionAvg(), and getY().

◆ Zbarycenters

std::map<AlignmentPI::PARTITION, double> AlignmentPI::TkAlBarycenters::Zbarycenters

Definition at line 801 of file AlignmentPayloadInspectorHelper.h.

Referenced by computeBarycenters(), getPartitionAvg(), and getZ().