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 24 of file CTPPSRPAlignmentCorrectionsData.h.

Member Typedef Documentation

◆ mapType

map: element id -> its alignment correction

Definition at line 34 of file CTPPSRPAlignmentCorrectionsData.h.

Constructor & Destructor Documentation

◆ CTPPSRPAlignmentCorrectionsData()

CTPPSRPAlignmentCorrectionsData::CTPPSRPAlignmentCorrectionsData ( )
inline

Definition at line 43 of file CTPPSRPAlignmentCorrectionsData.h.

43 { return sensors_; }

References sensors_.

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 101 of file CTPPSRPAlignmentCorrectionsData.cc.

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);

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

Referenced by StraightTrackAlignment::finish(), and CTPPSRPAlignmentCorrectionsDataESSourceXML::Merge().

◆ 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 79 of file CTPPSRPAlignmentCorrectionsData.cc.

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);

References a, and rps_.

Referenced by addCorrections(), and factorRPFromSensorCorrections().

◆ 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 90 of file CTPPSRPAlignmentCorrectionsData.cc.

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);

References a, and sensors_.

Referenced by addCorrections(), and factorRPFromSensorCorrections().

◆ clear()

void CTPPSRPAlignmentCorrectionsData::clear ( void  )

clears all alignments

Definition at line 114 of file CTPPSRPAlignmentCorrectionsData.cc.

115  {
116  rps_.clear();
117  sensors_.clear();

References rps_, and sensors_.

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

◆ 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 47 of file CTPPSRPAlignmentCorrectionsData.cc.

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;

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

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

◆ getRPCorrection() [1/2]

CTPPSRPAlignmentCorrectionData & CTPPSRPAlignmentCorrectionsData::getRPCorrection ( unsigned int  id)

returns the correction value from the RP map

Definition at line 17 of file CTPPSRPAlignmentCorrectionsData.cc.

References triggerObjects_cff::id, and rps_.

Referenced by CTPPSGeometryESModule::applyAlignments().

◆ getRPCorrection() [2/2]

CTPPSRPAlignmentCorrectionData CTPPSRPAlignmentCorrectionsData::getRPCorrection ( unsigned int  id) const

Definition at line 21 of file CTPPSRPAlignmentCorrectionsData.cc.

22  {
24  auto it = rps_.find(id);
25  if (it != rps_.end())
26  align_corr = it->second;
27  return align_corr;

References rps_.

◆ getRPMap()

const mapType& CTPPSRPAlignmentCorrectionsData::getRPMap ( ) const
inline

returns the map of RP alignment corrections

Definition at line 46 of file CTPPSRPAlignmentCorrectionsData.h.

Referenced by CTPPSGeometryESModule::produceGD().

◆ getSensorCorrection() [1/2]

CTPPSRPAlignmentCorrectionData & CTPPSRPAlignmentCorrectionsData::getSensorCorrection ( unsigned int  id)

returns the correction value from the sensor map

Definition at line 31 of file CTPPSRPAlignmentCorrectionsData.cc.

32  {
33  return sensors_[id];

References triggerObjects_cff::id, and sensors_.

◆ getSensorCorrection() [2/2]

CTPPSRPAlignmentCorrectionData CTPPSRPAlignmentCorrectionsData::getSensorCorrection ( unsigned int  id) const

Definition at line 37 of file CTPPSRPAlignmentCorrectionsData.cc.

38  {
40  auto it = sensors_.find(id);
41  if (it != sensors_.end())
42  align_corr = it->second;
43  return align_corr;

References sensors_.

◆ getSensorMap()

const mapType& CTPPSRPAlignmentCorrectionsData::getSensorMap ( ) const
inline

returns the map of sensor alignment corrections

Definition at line 49 of file CTPPSRPAlignmentCorrectionsData.h.

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 67 of file CTPPSRPAlignmentCorrectionsData.cc.

68  {
69  rps_[id] = ac;

References triggerObjects_cff::id, and rps_.

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

◆ setSensorCorrection()

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

sets the alignment correction for the given sensor

Definition at line 73 of file CTPPSRPAlignmentCorrectionsData.cc.

74  {
75  sensors_[id] = ac;

References triggerObjects_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 96 of file CTPPSRPAlignmentCorrectionsData.h.

◆ cond::serialization::access

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

Definition at line 96 of file CTPPSRPAlignmentCorrectionsData.h.

◆ StraightTrackAlignment

friend class StraightTrackAlignment
friend

Definition at line 40 of file CTPPSRPAlignmentCorrectionsData.h.

Member Data Documentation

◆ rps_

mapType CTPPSRPAlignmentCorrectionsData::rps_
private

◆ sensors_

mapType CTPPSRPAlignmentCorrectionsData::sensors_
private
CTPPSRPAlignmentCorrectionData::add
void add(const CTPPSRPAlignmentCorrectionData &, bool sumErrors=true, bool addSh=true, bool addRot=true)
Definition: CTPPSRPAlignmentCorrectionData.cc:53
year_2016_postTS2_cff.rpId
rpId
Definition: year_2016_postTS2_cff.py:23
CTPPSRPAlignmentCorrectionsData::rps_
mapType rps_
alignment correction maps
Definition: CTPPSRPAlignmentCorrectionsData.h:38
a
double a
Definition: hdecay.h:119
CTPPSDetId
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:31
CTPPSRPAlignmentCorrectionsData::addRPCorrection
void addRPCorrection(unsigned int, const CTPPSRPAlignmentCorrectionData &, bool sumErrors=true, bool addSh=true, bool addRot=true)
Definition: CTPPSRPAlignmentCorrectionsData.cc:79
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
CTPPSRPAlignmentCorrectionsData::sensors_
mapType sensors_
Definition: CTPPSRPAlignmentCorrectionsData.h:38
CTPPSRPAlignmentCorrectionData
Alignment correction for an element of the CT-PPS detector. Within the geometry description,...
Definition: CTPPSRPAlignmentCorrectionData.h:58
CTPPSRPAlignmentCorrectionsData::addSensorCorrection
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
Definition: CTPPSRPAlignmentCorrectionsData.cc:90