CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
CTPPSRPAlignmentCorrectionsData Class Reference

Container for CTPPS RP alignment corrections. The corrections are stored on two levels - RP and sensor. For every level, there is a map: ID –> alignment correction. Sensors inherit the alignment corrections from the corresponding RP, see getFullSensorCorrection method. More...

#include <CTPPSRPAlignmentCorrectionsData.h>

Public Types

typedef std::map< unsigned int, CTPPSRPAlignmentCorrectionDatamapType
 map: element id -> its alignment correction More...
 

Public Member Functions

void addCorrections (const CTPPSRPAlignmentCorrectionsData &, bool sumErrors=true, bool addSh=true, bool addRot=true)
 adds (merges) corrections on top of the current values More...
 
void addRPCorrection (unsigned int, const CTPPSRPAlignmentCorrectionData &, bool sumErrors=true, bool addSh=true, bool addRot=true)
 
void addSensorCorrection (unsigned int, const CTPPSRPAlignmentCorrectionData &, bool sumErrors=true, bool addSh=true, bool addRot=true)
 adds (merges) a RP correction on top of the current value More...
 
void clear ()
 clears all alignments More...
 
 CTPPSRPAlignmentCorrectionsData ()
 
CTPPSRPAlignmentCorrectionData getFullSensorCorrection (unsigned int id, bool useRPErrors=false) const
 
CTPPSRPAlignmentCorrectionDatagetRPCorrection (unsigned int id)
 returns the correction value from the RP map More...
 
CTPPSRPAlignmentCorrectionData getRPCorrection (unsigned int id) const
 
const mapTypegetRPMap () const
 returns the map of RP alignment corrections More...
 
CTPPSRPAlignmentCorrectionDatagetSensorCorrection (unsigned int id)
 returns the correction value from the sensor map More...
 
CTPPSRPAlignmentCorrectionData getSensorCorrection (unsigned int id) const
 
const mapTypegetSensorMap () const
 returns the map of sensor alignment corrections More...
 
void setRPCorrection (unsigned int id, const CTPPSRPAlignmentCorrectionData &ac)
 sets the alignment correction for the given RP More...
 
void setSensorCorrection (unsigned int id, const CTPPSRPAlignmentCorrectionData &ac)
 sets the alignment correction for the given sensor More...
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

mapType rps_
 alignment correction maps More...
 
mapType sensors_
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 
class StraightTrackAlignment
 

Detailed Description

Container for CTPPS RP alignment corrections. The corrections are stored on two levels - RP and sensor. For every level, there is a map: ID –> alignment correction. Sensors inherit the alignment corrections from the corresponding RP, see getFullSensorCorrection method.

Definition at line 25 of file CTPPSRPAlignmentCorrectionsData.h.

Member Typedef Documentation

◆ mapType

map: element id -> its alignment correction

Definition at line 28 of file CTPPSRPAlignmentCorrectionsData.h.

Constructor & Destructor Documentation

◆ CTPPSRPAlignmentCorrectionsData()

CTPPSRPAlignmentCorrectionsData::CTPPSRPAlignmentCorrectionsData ( )
inline

Definition at line 37 of file CTPPSRPAlignmentCorrectionsData.h.

37 {}

Member Function Documentation

◆ addCorrections()

void CTPPSRPAlignmentCorrectionsData::addCorrections ( const CTPPSRPAlignmentCorrectionsData nac,
bool  sumErrors = true,
bool  addSh = true,
bool  addRot = true 
)

adds (merges) corrections on top of the current values

Definition at line 102 of file CTPPSRPAlignmentCorrectionsData.cc.

References addRPCorrection(), addSensorCorrection(), rps_, and sensors_.

Referenced by PPSAlignmentHarvester::dqmEndRun(), StraightTrackAlignment::finish(), and CTPPSRPAlignmentCorrectionsDataESSourceXMLCommon::Merge().

105  {
106  for (const auto& it : nac.rps_)
107  addRPCorrection(it.first, it.second, sumErrors, addSh, addRot);
108 
109  for (const auto& it : nac.sensors_)
110  addSensorCorrection(it.first, it.second, sumErrors, addSh, addRot);
111 }
void addSensorCorrection(unsigned int, const CTPPSRPAlignmentCorrectionData &, bool sumErrors=true, bool addSh=true, bool addRot=true)
adds (merges) a RP correction on top of the current value
void addRPCorrection(unsigned int, const CTPPSRPAlignmentCorrectionData &, bool sumErrors=true, bool addSh=true, bool addRot=true)
mapType rps_
alignment correction maps

◆ addRPCorrection()

void CTPPSRPAlignmentCorrectionsData::addRPCorrection ( unsigned int  id,
const CTPPSRPAlignmentCorrectionData a,
bool  sumErrors = true,
bool  addSh = true,
bool  addRot = true 
)

adds (merges) a RP correction on top of the current value

Parameters
sumErrorsif it is true, old and new alignment uncertainties are summed (in quadrature) if it is false, the uncertainties of the parameter (i.e. not the object) will be used With the add... switches one can control which corrections are added.

Definition at line 80 of file CTPPSRPAlignmentCorrectionsData.cc.

References a, and rps_.

Referenced by addCorrections(), PPSAlignmentHarvester::dqmEndRun(), factorRPFromSensorCorrections(), and PPSAlignmentHarvester::getLongIdResults().

81  {
82  auto it = rps_.find(id);
83  if (it == rps_.end())
84  rps_.insert(mapType::value_type(id, a));
85  else
86  it->second.add(a, sumErrors, addSh, addRot);
87 }
mapType rps_
alignment correction maps
double a
Definition: hdecay.h:119

◆ addSensorCorrection()

void CTPPSRPAlignmentCorrectionsData::addSensorCorrection ( unsigned int  id,
const CTPPSRPAlignmentCorrectionData a,
bool  sumErrors = true,
bool  addSh = true,
bool  addRot = true 
)

adds (merges) a RP correction on top of the current value

Definition at line 91 of file CTPPSRPAlignmentCorrectionsData.cc.

References a, and sensors_.

Referenced by addCorrections(), and factorRPFromSensorCorrections().

92  {
93  auto it = sensors_.find(id);
94  if (it == sensors_.end())
95  sensors_.insert(mapType::value_type(id, a));
96  else
97  it->second.add(a, sumErrors, addSh, addRot);
98 }
double a
Definition: hdecay.h:119

◆ clear()

void CTPPSRPAlignmentCorrectionsData::clear ( void  )

clears all alignments

Definition at line 115 of file CTPPSRPAlignmentCorrectionsData.cc.

References rps_, and sensors_.

Referenced by factorRPFromSensorCorrections(), and BeautifulSoup.Tag::setString().

115  {
116  rps_.clear();
117  sensors_.clear();
118 }
mapType rps_
alignment correction maps

◆ getFullSensorCorrection()

CTPPSRPAlignmentCorrectionData CTPPSRPAlignmentCorrectionsData::getFullSensorCorrection ( unsigned int  id,
bool  useRPErrors = false 
) const

returns the correction for the given sensor, combining the data from RP and sensor map regarding transverse shifts, uses the x and y representation, sh_r will not be corrected! by default, RP errors shall not be summed up (strong correlation).

Definition at line 48 of file CTPPSRPAlignmentCorrectionsData.cc.

References CTPPSRPAlignmentCorrectionData::add(), rps_, and sensors_.

Referenced by CTPPSGeometryESCommon::applyAlignments(), factorRPFromSensorCorrections(), and RPDisplacementGenerator::RPDisplacementGenerator().

49  {
50  // by default empty correction
52 
53  // if found, add sensor correction (with its uncertainty)
54  auto sIt = sensors_.find(id);
55  if (sIt != sensors_.end())
56  align_corr.add(sIt->second, true);
57 
58  // if found, add RP correction (depending on the flag, with or without its uncertainty)
59  auto rpIt = rps_.find(CTPPSDetId(id).rpId());
60  if (rpIt != rps_.end())
61  align_corr.add(rpIt->second, useRPErrors);
62 
63  return align_corr;
64 }
mapType rps_
alignment correction maps
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
void add(const CTPPSRPAlignmentCorrectionData &, bool sumErrors=true, bool addSh=true, bool addRot=true)
Alignment correction for an element of the CT-PPS detector. Within the geometry description, every sensor (more generally every element) is given its translation and rotation. These two quantities shall be understood in local-to-global coordinate transform. That is, if r_l is a point in local coordinate system and x_g in global, then it holds.

◆ getRPCorrection() [1/2]

CTPPSRPAlignmentCorrectionData & CTPPSRPAlignmentCorrectionsData::getRPCorrection ( unsigned int  id)

returns the correction value from the RP map

Definition at line 18 of file CTPPSRPAlignmentCorrectionsData.cc.

References l1ctLayer2EG_cff::id, and rps_.

Referenced by CTPPSGeometryESCommon::applyAlignments(), and PPSAlignmentHarvester::dqmEndRun().

18 { return rps_[id]; }
mapType rps_
alignment correction maps

◆ getRPCorrection() [2/2]

CTPPSRPAlignmentCorrectionData CTPPSRPAlignmentCorrectionsData::getRPCorrection ( unsigned int  id) const

Definition at line 22 of file CTPPSRPAlignmentCorrectionsData.cc.

References rps_.

22  {
24  auto it = rps_.find(id);
25  if (it != rps_.end())
26  align_corr = it->second;
27  return align_corr;
28 }
mapType rps_
alignment correction maps
Alignment correction for an element of the CT-PPS detector. Within the geometry description, every sensor (more generally every element) is given its translation and rotation. These two quantities shall be understood in local-to-global coordinate transform. That is, if r_l is a point in local coordinate system and x_g in global, then it holds.

◆ getRPMap()

const mapType& CTPPSRPAlignmentCorrectionsData::getRPMap ( ) const
inline

returns the map of RP alignment corrections

Definition at line 40 of file CTPPSRPAlignmentCorrectionsData.h.

References rps_.

Referenced by PPSAlignmentHarvester::getLongIdResults(), and CTPPSGeometryESModule::produceGD().

40 { return rps_; }
mapType rps_
alignment correction maps

◆ getSensorCorrection() [1/2]

CTPPSRPAlignmentCorrectionData & CTPPSRPAlignmentCorrectionsData::getSensorCorrection ( unsigned int  id)

returns the correction value from the sensor map

Definition at line 32 of file CTPPSRPAlignmentCorrectionsData.cc.

References l1ctLayer2EG_cff::id, and sensors_.

◆ getSensorCorrection() [2/2]

CTPPSRPAlignmentCorrectionData CTPPSRPAlignmentCorrectionsData::getSensorCorrection ( unsigned int  id) const

Definition at line 38 of file CTPPSRPAlignmentCorrectionsData.cc.

References sensors_.

38  {
40  auto it = sensors_.find(id);
41  if (it != sensors_.end())
42  align_corr = it->second;
43  return align_corr;
44 }
Alignment correction for an element of the CT-PPS detector. Within the geometry description, every sensor (more generally every element) is given its translation and rotation. These two quantities shall be understood in local-to-global coordinate transform. That is, if r_l is a point in local coordinate system and x_g in global, then it holds.

◆ getSensorMap()

const mapType& CTPPSRPAlignmentCorrectionsData::getSensorMap ( ) const
inline

returns the map of sensor alignment corrections

Definition at line 43 of file CTPPSRPAlignmentCorrectionsData.h.

References sensors_.

Referenced by factorRPFromSensorCorrections(), and CTPPSGeometryESModule::produceGD().

◆ serialize()

template<class Archive >
void CTPPSRPAlignmentCorrectionsData::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ setRPCorrection()

void CTPPSRPAlignmentCorrectionsData::setRPCorrection ( unsigned int  id,
const CTPPSRPAlignmentCorrectionData ac 
)

sets the alignment correction for the given RP

Definition at line 68 of file CTPPSRPAlignmentCorrectionsData.cc.

References l1ctLayer2EG_cff::id, and rps_.

Referenced by PPSAlignmentHarvester::xAlignment(), PPSAlignmentHarvester::xAlignmentRelative(), and PPSAlignmentHarvester::yAlignment().

68  {
69  rps_[id] = ac;
70 }
mapType rps_
alignment correction maps

◆ setSensorCorrection()

void CTPPSRPAlignmentCorrectionsData::setSensorCorrection ( unsigned int  id,
const CTPPSRPAlignmentCorrectionData ac 
)

sets the alignment correction for the given sensor

Definition at line 74 of file CTPPSRPAlignmentCorrectionsData.cc.

References l1ctLayer2EG_cff::id, and sensors_.

Referenced by factorRPFromSensorCorrections(), and StraightTrackAlignment::finish().

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 90 of file CTPPSRPAlignmentCorrectionsData.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 90 of file CTPPSRPAlignmentCorrectionsData.h.

◆ StraightTrackAlignment

friend class StraightTrackAlignment
friend

Definition at line 34 of file CTPPSRPAlignmentCorrectionsData.h.

Member Data Documentation

◆ rps_

mapType CTPPSRPAlignmentCorrectionsData::rps_
private

◆ sensors_

mapType CTPPSRPAlignmentCorrectionsData::sensors_
private