Skip to content

Commit c6a2524

Browse files
authored
Merge pull request #45024 from stahlleiton/dEdxCond_CMSSW_14_1_X
Add new dEdx calibration condition format
2 parents 0e55364 + f2d610d commit c6a2524

File tree

14 files changed

+227
-0
lines changed

14 files changed

+227
-0
lines changed

CondCore/PhysicsToolsPlugins/src/plugin.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include "CondFormats/DataRecord/interface/SiStripDeDxKaon_3D_Rcd.h"
1818
#include "CondFormats/DataRecord/interface/SiStripDeDxElectron_3D_Rcd.h"
1919

20+
#include "CondFormats/DataRecord/interface/DeDxCalibrationRcd.h"
21+
#include "CondFormats/PhysicsToolsObjects/interface/DeDxCalibration.h"
2022
#include "CondFormats/DataRecord/interface/PhysicsTFormulaPayloadRcd.h"
2123
#include "CondFormats/PhysicsToolsObjects/interface/PhysicsTFormulaPayload.h"
2224
#include "CondFormats/DataRecord/interface/PhysicsTGraphPayloadRcd.h"
@@ -29,6 +31,7 @@
2931

3032
REGISTER_PLUGIN(DropBoxMetadataRcd, DropBoxMetadata);
3133

34+
REGISTER_PLUGIN(DeDxCalibrationRcd, DeDxCalibration);
3235
REGISTER_PLUGIN(SiStripDeDxMipRcd, PhysicsTools::Calibration::HistogramD2D);
3336
REGISTER_PLUGIN(SiStripDeDxMip_3D_Rcd, PhysicsTools::Calibration::HistogramD3D);
3437
REGISTER_PLUGIN_NO_SERIAL(SiStripDeDxProton_3D_Rcd, PhysicsTools::Calibration::HistogramD3D);

CondCore/Utilities/plugins/Module_2XML.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ PAYLOAD_2XML_MODULE(pluginUtilities_payload2xml) {
4646
PAYLOAD_2XML_CLASS(CastorRecoParams);
4747
PAYLOAD_2XML_CLASS(CastorSaturationCorrs);
4848
PAYLOAD_2XML_CLASS(CentralityTable);
49+
PAYLOAD_2XML_CLASS(DeDxCalibration);
4950
PAYLOAD_2XML_CLASS(DTCCBConfig);
5051
PAYLOAD_2XML_CLASS(DTDeadFlag);
5152
PAYLOAD_2XML_CLASS(DTHVStatus);

CondCore/Utilities/src/CondDBFetch.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ namespace cond {
7070
FETCH_PAYLOAD_CASE(CastorRecoParams)
7171
FETCH_PAYLOAD_CASE(CastorSaturationCorrs)
7272
FETCH_PAYLOAD_CASE(CentralityTable)
73+
FETCH_PAYLOAD_CASE(DeDxCalibration)
7374
FETCH_PAYLOAD_CASE(DTCCBConfig)
7475
FETCH_PAYLOAD_CASE(DTDeadFlag)
7576
FETCH_PAYLOAD_CASE(DTHVStatus)

CondCore/Utilities/src/CondDBImport.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ namespace cond {
9090
IMPORT_PAYLOAD_CASE(CastorRecoParams)
9191
IMPORT_PAYLOAD_CASE(CastorSaturationCorrs)
9292
IMPORT_PAYLOAD_CASE(CentralityTable)
93+
IMPORT_PAYLOAD_CASE(DeDxCalibration)
9394
IMPORT_PAYLOAD_CASE(DTCCBConfig)
9495
IMPORT_PAYLOAD_CASE(DTDeadFlag)
9596
IMPORT_PAYLOAD_CASE(DTHVStatus)

CondCore/Utilities/src/CondFormats.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@
282282
#include "CondFormats/L1TObjects/interface/L1TriggerKeyList.h"
283283
#include "CondFormats/L1TObjects/interface/L1TriggerKeyExt.h"
284284
#include "CondFormats/L1TObjects/interface/L1TriggerKeyListExt.h"
285+
#include "CondFormats/PhysicsToolsObjects/interface/DeDxCalibration.h"
285286
#include "CondFormats/PhysicsToolsObjects/interface/Histogram3D.h"
286287
#include "CondFormats/PhysicsToolsObjects/interface/PerformancePayload.h"
287288
#include "CondFormats/PhysicsToolsObjects/interface/PerformancePayloadFromTFormula.h"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef CondFormats_DataRecord_DeDxCalibrationRcd_h
2+
#define CondFormats_DataRecord_DeDxCalibrationRcd_h
3+
4+
#include "FWCore/Framework/interface/EventSetupRecordImplementation.h"
5+
class DeDxCalibrationRcd : public edm::eventsetup::EventSetupRecordImplementation<DeDxCalibrationRcd> {};
6+
#endif
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#include "CondFormats/DataRecord/interface/DeDxCalibrationRcd.h"
2+
#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h"
3+
4+
EVENTSETUP_RECORD_REG(DeDxCalibrationRcd);
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#ifndef CondFormats_PhysicsToolsObjects_DeDxCalibration_h
2+
#define CondFormats_PhysicsToolsObjects_DeDxCalibration_h
3+
#include "CondFormats/Serialization/interface/Serializable.h"
4+
5+
#include <vector>
6+
class DeDxCalibration {
7+
public:
8+
DeDxCalibration();
9+
virtual ~DeDxCalibration() {}
10+
11+
typedef std::pair<uint32_t, unsigned char> ChipId;
12+
DeDxCalibration(const std::vector<double>& thr,
13+
const std::vector<double>& alpha,
14+
const std::vector<double>& sigma,
15+
const std::map<ChipId, float>& gain)
16+
: thr_(thr), alpha_(alpha), sigma_(sigma), gain_(gain){};
17+
18+
const std::vector<double>& thr() const { return thr_; }
19+
const std::vector<double>& alpha() const { return alpha_; }
20+
const std::vector<double>& sigma() const { return sigma_; }
21+
const std::map<ChipId, float>& gain() const { return gain_; }
22+
23+
void setThr(const std::vector<double>& v) { thr_ = v; }
24+
void setAlpha(const std::vector<double>& v) { alpha_ = v; }
25+
void setSigma(const std::vector<double>& v) { sigma_ = v; }
26+
void setGain(const std::map<ChipId, float>& v) { gain_ = v; }
27+
28+
private:
29+
std::vector<double> thr_;
30+
std::vector<double> alpha_;
31+
std::vector<double> sigma_;
32+
std::map<ChipId, float> gain_;
33+
34+
COND_SERIALIZABLE;
35+
};
36+
#endif
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include "CondFormats/PhysicsToolsObjects/interface/DeDxCalibration.h"
2+
DeDxCalibration::DeDxCalibration() {
3+
thr_.reserve(5);
4+
alpha_.reserve(5);
5+
sigma_.reserve(5);
6+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#include "FWCore/Utilities/interface/typelookup.h"
2+
3+
#include "CondFormats/PhysicsToolsObjects/interface/DeDxCalibration.h"
4+
TYPELOOKUP_DATA_REG(DeDxCalibration);

0 commit comments

Comments
 (0)