-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25616 from CTPPS/pps_rpalign_db_10_4_X
PPS Alignment corrections object for condDB
- Loading branch information
Showing
71 changed files
with
2,566 additions
and
1,207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
CondFormats/AlignmentRecord/interface/CTPPSRPAlignmentCorrectionsDataRcd.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef CTPPSRPAlignmentCorrectionsDataRcd_CTPPSRPAlignmentCorrectionsDataRcd_h | ||
#define CTPPSRPAlignmentCorrectionsDataRcd_CTPPSRPAlignmentCorrectionsDataRcd_h | ||
// -*- C++ -*- | ||
// | ||
// Package: CondFormats/DataAlignmentRecord | ||
// Class : CTPPSRPAlignmentCorrectionsDataRcd | ||
// | ||
/**\class CTPPSRPAlignmentCorrectionsDataRcd CTPPSRPAlignmentCorrectionsDataRcd.h CondFormats/AlignmentRecord/interface/CTPPSRPAlignmentCorrectionsDataRcd.h | ||
Description: [one line class summary] | ||
Usage: | ||
<usage> | ||
*/ | ||
// | ||
// Author: Helena Brandao Malbouisson | ||
// Created: Thu, 05 Apr 2018 17:34:31 GMT | ||
// | ||
|
||
#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" | ||
|
||
class CTPPSRPAlignmentCorrectionsDataRcd : public edm::eventsetup::EventSetupRecordImplementation<CTPPSRPAlignmentCorrectionsDataRcd> {}; | ||
|
||
#endif |
15 changes: 15 additions & 0 deletions
15
CondFormats/AlignmentRecord/src/CTPPSRPAlignmentCorrectionsDataRcd.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// -*- C++ -*- | ||
// | ||
// Package: CondFormats/AlignmentRecord | ||
// Class : CTPPSRPAlignmentCorrectionsDataRcd | ||
// | ||
// Implementation: | ||
// [Notes on implementation] | ||
// | ||
// Author: Helena Brandao Malbouisson | ||
// Created: Thu, 05 Apr 2018 17:34:31 GMT | ||
|
||
#include "CondFormats/AlignmentRecord/interface/CTPPSRPAlignmentCorrectionsDataRcd.h" | ||
#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" | ||
|
||
EVENTSETUP_RECORD_REG(CTPPSRPAlignmentCorrectionsDataRcd); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
/**************************************************************************** | ||
* | ||
* This is a part of TOTEM offline software. | ||
* This is a part of CMS-TOTEM PPS offline software. | ||
* Authors: | ||
* Jan Kašpar ([email protected]) | ||
* Jan Kašpar ([email protected]) | ||
* Helena Malbouisson | ||
* Clemencia Mora Herrera | ||
* | ||
****************************************************************************/ | ||
|
||
#ifndef DataFormats_CTPPSAlignment_RPAlignmentCorrectionData | ||
#define DataFormats_CTPPSAlignment_RPAlignmentCorrectionData | ||
#ifndef CondFormats_CTPPSReadoutObjects_CTPPSRPAlignmentCorrectionData | ||
#define CondFormats_CTPPSReadoutObjects_CTPPSRPAlignmentCorrectionData | ||
|
||
#include "CondFormats/Serialization/interface/Serializable.h" | ||
|
||
#include "DataFormats/Math/interface/Vector3D.h" | ||
#include <Math/Rotation3D.h> | ||
|
@@ -52,7 +56,7 @@ | |
| 0 sin r_x cos r_x | |-sin r_y 0 cos r_y | | 0 0 1 | | ||
\endverbatim | ||
**/ | ||
class RPAlignmentCorrectionData | ||
class CTPPSRPAlignmentCorrectionData | ||
{ | ||
protected: | ||
/// shift in mm; in global XYZ frame, which is not affected by (alignment) rotations! | ||
|
@@ -67,11 +71,11 @@ class RPAlignmentCorrectionData | |
|
||
public: | ||
/// full constructor, shifts in mm, rotations in rad | ||
RPAlignmentCorrectionData(double _sh_x, double _sh_x_u, double _sh_y, double _sh_y_u, double _sh_z, double _sh_z_u, | ||
CTPPSRPAlignmentCorrectionData(double _sh_x, double _sh_x_u, double _sh_y, double _sh_y_u, double _sh_z, double _sh_z_u, | ||
double _rot_x, double _rot_x_u, double _rot_y, double _rot_y_u, double _rot_z, double _rot_z_u); | ||
|
||
/// no uncertainty constructor, shifts in mm, rotation in rad | ||
RPAlignmentCorrectionData(double _sh_x = 0., double _sh_y = 0., double _sh_z = 0., | ||
CTPPSRPAlignmentCorrectionData(double _sh_x = 0., double _sh_y = 0., double _sh_z = 0., | ||
double _rot_x = 0., double _rot_y = 0., double rot_z = 0.); | ||
|
||
|
||
|
@@ -133,9 +137,11 @@ class RPAlignmentCorrectionData | |
/// \param sumErrors if 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. | ||
void add(const RPAlignmentCorrectionData&, bool sumErrors=true, bool addSh=true, bool addRot=true); | ||
void add(const CTPPSRPAlignmentCorrectionData&, bool sumErrors=true, bool addSh=true, bool addRot=true); | ||
|
||
COND_SERIALIZABLE; | ||
}; | ||
|
||
std::ostream& operator<<(std::ostream& s, const RPAlignmentCorrectionData &corr); | ||
std::ostream& operator<<(std::ostream& s, const CTPPSRPAlignmentCorrectionData &corr); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
/**************************************************************************** | ||
* | ||
* This is a part of TOTEM offline software. | ||
* This is a part of CMS-TOTEM PPS offline software. | ||
* Authors: | ||
* Jan Kašpar ([email protected]) | ||
* Jan Kašpar ([email protected]) | ||
* Helena Malbouisson | ||
* Clemencia Mora Herrera | ||
* | ||
****************************************************************************/ | ||
|
||
#ifndef DataFormats_CTPPSAlignment_RPAlignmentCorrectionsData | ||
#define DataFormats_CTPPSAlignment_RPAlignmentCorrectionsData | ||
#ifndef CondFormats_CTPPSReadoutObjects_CTPPSRPAlignmentCorrectionsData | ||
#define CondFormats_CTPPSReadoutObjects_CTPPSRPAlignmentCorrectionsData | ||
|
||
#include "DataFormats/CTPPSAlignment/interface/RPAlignmentCorrectionData.h" | ||
#include "CondFormats/CTPPSReadoutObjects/interface/CTPPSRPAlignmentCorrectionData.h" | ||
|
||
#include <map> | ||
|
||
|
@@ -20,11 +22,11 @@ | |
* alignment corrections from the corresponding RP, see getFullSensorCorrection | ||
* method. | ||
**/ | ||
class RPAlignmentCorrectionsData | ||
class CTPPSRPAlignmentCorrectionsData | ||
{ | ||
public: | ||
/// map: element id -> its alignment correction | ||
typedef std::map<unsigned int, RPAlignmentCorrectionData> mapType; | ||
typedef std::map<unsigned int, CTPPSRPAlignmentCorrectionData> mapType; | ||
|
||
private: | ||
/// alignment correction maps | ||
|
@@ -33,7 +35,7 @@ class RPAlignmentCorrectionsData | |
friend class StraightTrackAlignment; | ||
|
||
public: | ||
RPAlignmentCorrectionsData() {} | ||
CTPPSRPAlignmentCorrectionsData() {} | ||
|
||
/// returns the map of RP alignment corrections | ||
const mapType& getRPMap() const { return rps_; } | ||
|
@@ -42,40 +44,42 @@ class RPAlignmentCorrectionsData | |
const mapType& getSensorMap() const { return sensors_; } | ||
|
||
/// returns the correction value from the RP map | ||
RPAlignmentCorrectionData& getRPCorrection( unsigned int id ); | ||
RPAlignmentCorrectionData getRPCorrection( unsigned int id ) const; | ||
CTPPSRPAlignmentCorrectionData& getRPCorrection( unsigned int id ); | ||
CTPPSRPAlignmentCorrectionData getRPCorrection( unsigned int id ) const; | ||
|
||
/// returns the correction value from the sensor map | ||
RPAlignmentCorrectionData& getSensorCorrection( unsigned int id ); | ||
RPAlignmentCorrectionData getSensorCorrection( unsigned int id ) const; | ||
CTPPSRPAlignmentCorrectionData& getSensorCorrection( unsigned int id ); | ||
CTPPSRPAlignmentCorrectionData getSensorCorrection( unsigned int id ) 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). | ||
RPAlignmentCorrectionData getFullSensorCorrection( unsigned int id, bool useRPErrors = false ) const; | ||
CTPPSRPAlignmentCorrectionData getFullSensorCorrection( unsigned int id, bool useRPErrors = false ) const; | ||
|
||
/// sets the alignment correction for the given RP | ||
void setRPCorrection( unsigned int id, const RPAlignmentCorrectionData& ac ); | ||
void setRPCorrection( unsigned int id, const CTPPSRPAlignmentCorrectionData& ac ); | ||
|
||
/// sets the alignment correction for the given sensor | ||
void setSensorCorrection( unsigned int id, const RPAlignmentCorrectionData& ac ); | ||
void setSensorCorrection( unsigned int id, const CTPPSRPAlignmentCorrectionData& ac ); | ||
|
||
/// adds (merges) a RP correction on top of the current value | ||
/// \param sumErrors if 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. | ||
void addRPCorrection( unsigned int, const RPAlignmentCorrectionData&, bool sumErrors=true, bool addSh=true, bool addRot=true ); | ||
void addRPCorrection( 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 addSensorCorrection( unsigned int, const RPAlignmentCorrectionData&, 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) corrections on top of the current values | ||
void addCorrections( const RPAlignmentCorrectionsData &, bool sumErrors=true, bool addSh=true, bool addRot=true ); | ||
void addCorrections( const CTPPSRPAlignmentCorrectionsData &, bool sumErrors=true, bool addSh=true, bool addRot=true ); | ||
|
||
/// clears all alignments | ||
void clear(); | ||
|
||
COND_SERIALIZABLE; | ||
}; | ||
|
||
std::ostream& operator<<(std::ostream& s, const RPAlignmentCorrectionsData &corr); | ||
std::ostream& operator<<(std::ostream& s, const CTPPSRPAlignmentCorrectionsData &corr); | ||
|
||
#endif |
34 changes: 34 additions & 0 deletions
34
CondFormats/CTPPSReadoutObjects/interface/CTPPSRPAlignmentCorrectionsDataSequence.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/**************************************************************************** | ||
* | ||
* This is a part of TOTEM offline software. | ||
* Authors: | ||
* Jan Kašpar ([email protected]) | ||
* | ||
****************************************************************************/ | ||
|
||
#ifndef CondFormats_CTPPSReadoutObjects_CTPPSRPAlignmentCorrectionsDataSequence | ||
#define CondFormats_CTPPSReadoutObjects_CTPPSRPAlignmentCorrectionsDataSequence | ||
|
||
#include <vector> | ||
|
||
#include "FWCore/Framework/interface/ValidityInterval.h" | ||
|
||
#include "CondFormats/CTPPSReadoutObjects/interface/CTPPSRPAlignmentCorrectionsData.h" | ||
|
||
/** | ||
*\brief Time sequence of alignment corrections. | ||
* I/O methods have been factored out to: | ||
* CondFormats/CTPPSReadoutObjects/interface/CTPPSRPAlignmentCorrectionsMethods.h | ||
*/ | ||
class CTPPSRPAlignmentCorrectionsDataSequence : public std::vector< std::pair<edm::ValidityInterval, CTPPSRPAlignmentCorrectionsData> > | ||
{ | ||
public: | ||
CTPPSRPAlignmentCorrectionsDataSequence() {} | ||
|
||
void insert(const edm::ValidityInterval &iov, const CTPPSRPAlignmentCorrectionsData &data) | ||
{ | ||
emplace_back(iov, data); | ||
} | ||
}; | ||
|
||
#endif |
63 changes: 63 additions & 0 deletions
63
CondFormats/CTPPSReadoutObjects/interface/CTPPSRPAlignmentCorrectionsMethods.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/**************************************************************************** | ||
* | ||
* This is a part of TOTEM offline software. | ||
* Authors: | ||
* Jan Kaspar | ||
* Helena Malbouisson | ||
* Clemencia Mora Herrera | ||
* | ||
****************************************************************************/ | ||
|
||
#ifndef CondFormats_CTPPSReadoutObjects_CTPPSRPAlignmentCorrectionsMethods | ||
#define CondFormats_CTPPSReadoutObjects_CTPPSRPAlignmentCorrectionsMethods | ||
|
||
#include "CondFormats/CTPPSReadoutObjects/interface/CTPPSRPAlignmentCorrectionData.h" | ||
#include "CondFormats/CTPPSReadoutObjects/interface/CTPPSRPAlignmentCorrectionsData.h" | ||
#include "CondFormats/CTPPSReadoutObjects/interface/CTPPSRPAlignmentCorrectionsDataSequence.h" | ||
|
||
#include <xercesc/dom/DOM.hpp> | ||
|
||
//---------------------------------------------------------------------------------------------------- | ||
|
||
class CTPPSRPAlignmentCorrectionsMethods | ||
{ | ||
public: | ||
CTPPSRPAlignmentCorrectionsMethods() {} | ||
|
||
/// loads sequence of alignment corrections from XML file | ||
static CTPPSRPAlignmentCorrectionsDataSequence loadFromXML( const std::string& fileName ); | ||
|
||
/// writes sequence of alignment corrections into a single XML file | ||
static void writeToXML( const CTPPSRPAlignmentCorrectionsDataSequence &seq, const std::string& fileName, | ||
bool precise = false, bool wrErrors = true, | ||
bool wrSh_xy=true, bool wrSh_z=false, bool wrRot_xy=false, bool wrRot_z=true ); | ||
|
||
/// writes alignment corrections into a single XML file, assigning infinite interval of validity | ||
static void writeToXML( const CTPPSRPAlignmentCorrectionsData &ad, const std::string& fileName, | ||
bool precise = false, bool wrErrors = true, | ||
bool wrSh_xy=true, bool wrSh_z=false, bool wrRot_xy=false, bool wrRot_z=true ) | ||
{ | ||
const edm::ValidityInterval iov(edm::IOVSyncValue::beginOfTime(), edm::IOVSyncValue::endOfTime()); | ||
CTPPSRPAlignmentCorrectionsDataSequence s; | ||
s.insert(iov, ad); | ||
writeToXML(s, fileName, precise, wrErrors, wrSh_xy, wrSh_z, wrRot_xy, wrRot_z); | ||
} | ||
|
||
static edm::IOVSyncValue stringToIOVValue(const std::string &); | ||
|
||
static std::string iovValueToString(const edm::IOVSyncValue &); | ||
|
||
protected: | ||
/// load corrections data corresponding to one IOV | ||
static CTPPSRPAlignmentCorrectionsData getCorrectionsData( xercesc::DOMNode* ); | ||
|
||
/// writes data of a correction in XML format | ||
static void writeXML( const CTPPSRPAlignmentCorrectionData& data, FILE* f, bool precise, bool wrErrors, | ||
bool wrSh_xy, bool wrSh_z, bool wrRot_xy, bool wrRot_z ); | ||
|
||
/// writes a block of corrections into a file | ||
static void writeXMLBlock( const CTPPSRPAlignmentCorrectionsData&, FILE*, bool precise = false, bool wrErrors = true, | ||
bool wrSh_xy=true, bool wrSh_z=false, bool wrRot_xy=false, bool wrRot_z=true ); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.