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

Constructor & Destructor Documentation

◆ ~TkAlBarycenters()

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

Definition at line 849 of file AlignmentPayloadInspectorHelper.h.

849 {}

Member Function Documentation

◆ computeBarycenters()

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

Definition at line 860 of file AlignmentPayloadInspectorHelper.h.

864  {
865  for (const auto& ali : input) {
866  if (DetId(ali.rawId()).det() != DetId::Tracker) {
867  edm::LogWarning("TkAlBarycenters::computeBarycenters")
868  << "Encountered invalid Tracker DetId:" << ali.rawId() << " " << DetId(ali.rawId()).det()
869  << " is different from " << DetId::Tracker << " - terminating ";
870  assert(DetId(ali.rawId()).det() != DetId::Tracker);
871  }
872 
873  int subid = DetId(ali.rawId()).subdetId();
874  switch (subid) {
876  Xbarycenters[PARTITION::BPIX] += (ali.translation().x());
877  Ybarycenters[PARTITION::BPIX] += (ali.translation().y());
878  Zbarycenters[PARTITION::BPIX] += (ali.translation().z());
880  break;
882 
883  // minus side
884  if (tTopo.pxfSide(DetId(ali.rawId())) == 1) {
885  Xbarycenters[PARTITION::FPIXm] += (ali.translation().x());
886  Ybarycenters[PARTITION::FPIXm] += (ali.translation().y());
887  Zbarycenters[PARTITION::FPIXm] += (ali.translation().z());
889  } // plus side
890  else {
891  Xbarycenters[PARTITION::FPIXp] += (ali.translation().x());
892  Ybarycenters[PARTITION::FPIXp] += (ali.translation().y());
893  Zbarycenters[PARTITION::FPIXp] += (ali.translation().z());
895  }
896  break;
898  Xbarycenters[PARTITION::TIB] += (ali.translation().x());
899  Ybarycenters[PARTITION::TIB] += (ali.translation().y());
900  Zbarycenters[PARTITION::TIB] += (ali.translation().z());
902  break;
904  // minus side
905  if (tTopo.tidSide(DetId(ali.rawId())) == 1) {
906  Xbarycenters[PARTITION::TIDm] += (ali.translation().x());
907  Ybarycenters[PARTITION::TIDm] += (ali.translation().y());
908  Zbarycenters[PARTITION::TIDm] += (ali.translation().z());
910  } // plus side
911  else {
912  Xbarycenters[PARTITION::TIDp] += (ali.translation().x());
913  Ybarycenters[PARTITION::TIDp] += (ali.translation().y());
914  Zbarycenters[PARTITION::TIDp] += (ali.translation().z());
916  }
917  break;
919  Xbarycenters[PARTITION::TOB] += (ali.translation().x());
920  Ybarycenters[PARTITION::TOB] += (ali.translation().y());
921  Zbarycenters[PARTITION::TOB] += (ali.translation().z());
923  break;
925  // minus side
926  if (tTopo.tecSide(DetId(ali.rawId())) == 1) {
927  Xbarycenters[PARTITION::TECm] += (ali.translation().x());
928  Ybarycenters[PARTITION::TECm] += (ali.translation().y());
929  Zbarycenters[PARTITION::TECm] += (ali.translation().z());
931  } // plus side
932  else {
933  Xbarycenters[PARTITION::TECp] += (ali.translation().x());
934  Ybarycenters[PARTITION::TECp] += (ali.translation().y());
935  Zbarycenters[PARTITION::TECp] += (ali.translation().z());
937  }
938  break;
939  default:
940  edm::LogError("TrackerAlignment_PayloadInspector") << "Unrecognized partition " << subid << std::endl;
941  break;
942  }
943  }
944 
945  for (const auto& p : PARTITIONS) {
946  Xbarycenters[p] /= nmodules[p];
947  Ybarycenters[p] /= nmodules[p];
948  Zbarycenters[p] /= nmodules[p];
949 
950  Xbarycenters[p] += GPR.at(AlignmentPI::t_x);
951  Ybarycenters[p] += GPR.at(AlignmentPI::t_y);
952  Zbarycenters[p] += GPR.at(AlignmentPI::t_z);
953 
954  COUT << p << "|"
955  << " X: " << std::right << std::setw(12) << Xbarycenters[p] << " Y: " << std::right << std::setw(12)
956  << Ybarycenters[p] << " Z: " << std::right << std::setw(12) << Zbarycenters[p] << std::endl;
957  }
958  }

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.

◆ getNModules()

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

Definition at line 808 of file AlignmentPayloadInspectorHelper.h.

808 { return nmodules[p]; };

References nmodules, and AlCaHLTBitMon_ParallelJobs::p.

◆ getPartitionAvg()

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

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

Referenced by computeBarycenters(), and getNModules().

◆ Xbarycenters

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

Definition at line 797 of file AlignmentPayloadInspectorHelper.h.

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

◆ Ybarycenters

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

Definition at line 798 of file AlignmentPayloadInspectorHelper.h.

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

◆ Zbarycenters

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

Definition at line 799 of file AlignmentPayloadInspectorHelper.h.

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

input
static const std::string input
Definition: EdmProvDump.cc:48
AlignmentPI::PARTITION::BPIX
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
TrackerTopology::pxfSide
unsigned int pxfSide(const DetId &id) const
Definition: TrackerTopology.h:192
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
AlignmentPI::t_z
Definition: AlignmentPayloadInspectorHelper.h:36
AlignmentPI::PARTITIONS
const PARTITION PARTITIONS[(int) PARTITION::LAST+1]
Definition: AlignmentPayloadInspectorHelper.h:64
cms::cuda::assert
assert(be >=bs)
AlignmentPI::PARTITION::FPIXm
AlignmentPI::PARTITION::TOB
AlignmentPI::PARTITION::TIDm
AlignmentPI::PARTITION::TIDp
AlignmentPI::t_y
Definition: AlignmentPayloadInspectorHelper.h:35
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
AlignmentPI::PARTITION::TECp
DetId
Definition: DetId.h:17
COUT
#define COUT
Definition: AlignmentPayloadInspectorHelper.h:24
StripSubdetector::TIB
static constexpr auto TIB
Definition: StripSubdetector.h:16
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
AlignmentPI::t_x
Definition: AlignmentPayloadInspectorHelper.h:34
AlignmentPI::TkAlBarycenters::Ybarycenters
std::map< AlignmentPI::PARTITION, double > Ybarycenters
Definition: AlignmentPayloadInspectorHelper.h:798
AlignmentPI::TkAlBarycenters::Zbarycenters
std::map< AlignmentPI::PARTITION, double > Zbarycenters
Definition: AlignmentPayloadInspectorHelper.h:799
AlignmentPI::TkAlBarycenters::nmodules
std::map< AlignmentPI::PARTITION, double > nmodules
Definition: AlignmentPayloadInspectorHelper.h:800
DetId::Tracker
Definition: DetId.h:25
TrackerTopology::tidSide
unsigned int tidSide(const DetId &id) const
Definition: TrackerTopology.h:190
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlignmentPI::PARTITION::FPIXp
StripSubdetector::TEC
static constexpr auto TEC
Definition: StripSubdetector.h:19
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
AlignmentPI::TkAlBarycenters::Xbarycenters
std::map< AlignmentPI::PARTITION, double > Xbarycenters
Definition: AlignmentPayloadInspectorHelper.h:797
AlignmentPI::PARTITION::TECm
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
AlignmentPI::PARTITION::TIB
TrackerTopology::tecSide
unsigned int tecSide(const DetId &id) const
Definition: TrackerTopology.h:184