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 823 of file AlignmentPayloadInspectorHelper.h.

Constructor & Destructor Documentation

◆ ~TkAlBarycenters()

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

Definition at line 876 of file AlignmentPayloadInspectorHelper.h.

876 {}

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 887 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.

891  {
892  // zero in the n. modules per partition...
893  for (const auto& p : PARTITIONS) {
894  nmodules[p] = 0.;
895  }
896 
897  for (const auto& ali : input) {
898  if (DetId(ali.rawId()).det() != DetId::Tracker) {
899  edm::LogWarning("TkAlBarycenters::computeBarycenters")
900  << "Encountered invalid Tracker DetId:" << ali.rawId() << " " << DetId(ali.rawId()).det()
901  << " is different from " << DetId::Tracker << " - terminating ";
902  assert(DetId(ali.rawId()).det() != DetId::Tracker);
903  }
904 
905  int subid = DetId(ali.rawId()).subdetId();
906  switch (subid) {
908  Xbarycenters[PARTITION::BPIX] += (ali.translation().x());
909  Ybarycenters[PARTITION::BPIX] += (ali.translation().y());
910  Zbarycenters[PARTITION::BPIX] += (ali.translation().z());
912  break;
914 
915  // minus side
916  if (tTopo.pxfSide(DetId(ali.rawId())) == 1) {
917  Xbarycenters[PARTITION::FPIXm] += (ali.translation().x());
918  Ybarycenters[PARTITION::FPIXm] += (ali.translation().y());
919  Zbarycenters[PARTITION::FPIXm] += (ali.translation().z());
921  } // plus side
922  else {
923  Xbarycenters[PARTITION::FPIXp] += (ali.translation().x());
924  Ybarycenters[PARTITION::FPIXp] += (ali.translation().y());
925  Zbarycenters[PARTITION::FPIXp] += (ali.translation().z());
927  }
928  break;
930  Xbarycenters[PARTITION::TIB] += (ali.translation().x());
931  Ybarycenters[PARTITION::TIB] += (ali.translation().y());
932  Zbarycenters[PARTITION::TIB] += (ali.translation().z());
934  break;
936  // minus side
937  if (tTopo.tidSide(DetId(ali.rawId())) == 1) {
938  Xbarycenters[PARTITION::TIDm] += (ali.translation().x());
939  Ybarycenters[PARTITION::TIDm] += (ali.translation().y());
940  Zbarycenters[PARTITION::TIDm] += (ali.translation().z());
942  } // plus side
943  else {
944  Xbarycenters[PARTITION::TIDp] += (ali.translation().x());
945  Ybarycenters[PARTITION::TIDp] += (ali.translation().y());
946  Zbarycenters[PARTITION::TIDp] += (ali.translation().z());
948  }
949  break;
951  Xbarycenters[PARTITION::TOB] += (ali.translation().x());
952  Ybarycenters[PARTITION::TOB] += (ali.translation().y());
953  Zbarycenters[PARTITION::TOB] += (ali.translation().z());
955  break;
957  // minus side
958  if (tTopo.tecSide(DetId(ali.rawId())) == 1) {
959  Xbarycenters[PARTITION::TECm] += (ali.translation().x());
960  Ybarycenters[PARTITION::TECm] += (ali.translation().y());
961  Zbarycenters[PARTITION::TECm] += (ali.translation().z());
963  } // plus side
964  else {
965  Xbarycenters[PARTITION::TECp] += (ali.translation().x());
966  Ybarycenters[PARTITION::TECp] += (ali.translation().y());
967  Zbarycenters[PARTITION::TECp] += (ali.translation().z());
969  }
970  break;
971  default:
972  edm::LogError("TrackerAlignment_PayloadInspector") << "Unrecognized partition " << subid << std::endl;
973  break;
974  }
975  }
976 
977  for (const auto& p : PARTITIONS) {
978  // take the arithmetic mean
979  Xbarycenters[p] /= nmodules[p];
980  Ybarycenters[p] /= nmodules[p];
981  Zbarycenters[p] /= nmodules[p];
982 
983  // add the Tracker Global Position Record
984  Xbarycenters[p] += GPR.at(AlignmentPI::t_x);
985  Ybarycenters[p] += GPR.at(AlignmentPI::t_y);
986  Zbarycenters[p] += GPR.at(AlignmentPI::t_z);
987 
988  COUT << "Partition: " << p << " n. modules: " << nmodules[p] << "|"
989  << " X: " << std::right << std::setw(12) << Xbarycenters[p] << " Y: " << std::right << std::setw(12)
990  << Ybarycenters[p] << " Z: " << std::right << std::setw(12) << Zbarycenters[p] << std::endl;
991  }
992  }
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:50
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 835 of file AlignmentPayloadInspectorHelper.h.

References nmodules, and AlCaHLTBitMon_ParallelJobs::p.

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

◆ getPartitionAvg()

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

Definition at line 880 of file AlignmentPayloadInspectorHelper.h.

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

882  {
884  }
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 827 of file AlignmentPayloadInspectorHelper.h.

Referenced by computeBarycenters(), and getNModules().

◆ Xbarycenters

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

Definition at line 824 of file AlignmentPayloadInspectorHelper.h.

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

◆ Ybarycenters

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

Definition at line 825 of file AlignmentPayloadInspectorHelper.h.

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

◆ Zbarycenters

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

Definition at line 826 of file AlignmentPayloadInspectorHelper.h.

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