CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

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

Definition at line 851 of file AlignmentPayloadInspectorHelper.h.

851 {}

Member Function Documentation

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, 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
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 tidSide(const DetId &id) const
std::map< AlignmentPI::PARTITION, double > Zbarycenters
static constexpr auto TOB
Definition: DetId.h:17
static constexpr auto TIB
std::map< AlignmentPI::PARTITION, double > Ybarycenters
std::map< AlignmentPI::PARTITION, double > nmodules
unsigned int pxfSide(const DetId &id) const
std::map< AlignmentPI::PARTITION, double > Xbarycenters
Log< level::Warning, false > LogWarning
static constexpr auto TID
unsigned int tecSide(const DetId &id) const
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
GlobalPoint AlignmentPI::TkAlBarycenters::getPartitionAvg ( AlignmentPI::PARTITION  p)
inline

Definition at line 855 of file AlignmentPayloadInspectorHelper.h.

References 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
const std::array<double, 6> AlignmentPI::TkAlBarycenters::getX ( )
inline
const std::array<double, 6> AlignmentPI::TkAlBarycenters::getY ( )
inline
const std::array<double, 6> AlignmentPI::TkAlBarycenters::getZ ( )
inline
void AlignmentPI::TkAlBarycenters::init ( )

Member Data Documentation

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

Definition at line 802 of file AlignmentPayloadInspectorHelper.h.

Referenced by computeBarycenters(), and getNModules().

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

Definition at line 799 of file AlignmentPayloadInspectorHelper.h.

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

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

Definition at line 800 of file AlignmentPayloadInspectorHelper.h.

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

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

Definition at line 801 of file AlignmentPayloadInspectorHelper.h.

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