Skip to content

Commit 55cba4e

Browse files
authored
Merge pull request #43186 from francescobrivio/alca-add_SimBeamSpotHLLHCObjects
Add new SimBeamSpotHLLHC CondFormat
2 parents b0e21f2 + 17721fb commit 55cba4e

28 files changed

+1304
-152
lines changed

CondCore/BeamSpotPlugins/interface/BeamSpotPayloadInspectorHelper.h

Lines changed: 468 additions & 1 deletion
Large diffs are not rendered by default.

CondCore/BeamSpotPlugins/plugins/BuildFile.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@
1515
<use name="CondCore/CondDB"/>
1616
<use name="boost_python"/>
1717
</library>
18+
19+
<library file="SimBeamSpotHLLHC_PayloadInspector.cc" name="SimBeamSpotHLLHC_PayloadInspector">
20+
<use name="CondCore/Utilities"/>
21+
<use name="CondCore/CondDB"/>
22+
<use name="boost_python"/>
23+
</library>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#include "CondCore/BeamSpotPlugins/interface/BeamSpotPayloadInspectorHelper.h"
2+
#include "CondCore/CondDB/interface/Time.h"
3+
#include "CondCore/Utilities/interface/PayloadInspector.h"
4+
#include "CondCore/Utilities/interface/PayloadInspectorModule.h"
5+
#include "CondFormats/BeamSpotObjects/interface/SimBeamSpotHLLHCObjects.h"
6+
7+
namespace {
8+
9+
/************************************************
10+
Display of Sim Beam Spot HL-LHC parameters
11+
*************************************************/
12+
13+
typedef simBeamSpotHLLHCPI::DisplayParameters<SimBeamSpotHLLHCObjects> SimBeamSpotHLLHCParameters;
14+
15+
/*********************************************************
16+
Display of Sim Beam Spot HL-LHC parameters Differences
17+
**********************************************************/
18+
19+
typedef simBeamSpotHLLHCPI::DisplayParametersDiff<SimBeamSpotHLLHCObjects, cond::payloadInspector::MULTI_IOV, 1>
20+
SimBeamSpotHLLHCParametersDiffSingleTag;
21+
typedef simBeamSpotHLLHCPI::DisplayParametersDiff<SimBeamSpotHLLHCObjects, cond::payloadInspector::SINGLE_IOV, 2>
22+
SimBeamSpotHLLHCParametersDiffTwoTags;
23+
24+
} // namespace
25+
26+
PAYLOAD_INSPECTOR_MODULE(SimBeamSpotHLLHC) {
27+
PAYLOAD_INSPECTOR_CLASS(SimBeamSpotHLLHCParameters);
28+
PAYLOAD_INSPECTOR_CLASS(SimBeamSpotHLLHCParametersDiffSingleTag);
29+
PAYLOAD_INSPECTOR_CLASS(SimBeamSpotHLLHCParametersDiffTwoTags);
30+
}
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
#include "CondCore/ESSources/interface/registration_macros.h"
2+
#include "CondFormats/BeamSpotObjects/interface/BeamSpotObjects.h"
3+
#include "CondFormats/BeamSpotObjects/interface/BeamSpotOnlineObjects.h"
4+
#include "CondFormats/BeamSpotObjects/interface/SimBeamSpotObjects.h"
5+
#include "CondFormats/BeamSpotObjects/interface/SimBeamSpotHLLHCObjects.h"
26
#include "CondFormats/DataRecord/interface/BeamSpotObjectsRcd.h"
3-
#include "CondFormats/DataRecord/interface/SimBeamSpotObjectsRcd.h"
47
#include "CondFormats/DataRecord/interface/BeamSpotOnlineHLTObjectsRcd.h"
58
#include "CondFormats/DataRecord/interface/BeamSpotOnlineLegacyObjectsRcd.h"
6-
#include "CondFormats/BeamSpotObjects/interface/BeamSpotObjects.h"
7-
#include "CondFormats/BeamSpotObjects/interface/SimBeamSpotObjects.h"
8-
#include "CondFormats/BeamSpotObjects/interface/BeamSpotOnlineObjects.h"
9+
#include "CondFormats/DataRecord/interface/SimBeamSpotObjectsRcd.h"
10+
#include "CondFormats/DataRecord/interface/SimBeamSpotHLLHCObjectsRcd.h"
911

1012
REGISTER_PLUGIN(BeamSpotObjectsRcd, BeamSpotObjects);
11-
REGISTER_PLUGIN(SimBeamSpotObjectsRcd, SimBeamSpotObjects);
1213
REGISTER_PLUGIN(BeamSpotOnlineHLTObjectsRcd, BeamSpotOnlineObjects);
1314
REGISTER_PLUGIN_NO_SERIAL(BeamSpotOnlineLegacyObjectsRcd, BeamSpotOnlineObjects);
15+
REGISTER_PLUGIN(SimBeamSpotObjectsRcd, SimBeamSpotObjects);
16+
REGISTER_PLUGIN(SimBeamSpotHLLHCObjectsRcd, SimBeamSpotHLLHCObjects);

CondCore/BeamSpotPlugins/test/testBeamSpotPayloadInspector.cpp

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#include <iostream>
22
#include <sstream>
3-
#include "CondCore/Utilities/interface/PayloadInspector.h"
4-
#include "CondCore/BeamSpotPlugins/plugins/SimBeamSpot_PayloadInspector.cc"
53
#include "CondCore/BeamSpotPlugins/plugins/BeamSpot_PayloadInspector.cc"
64
#include "CondCore/BeamSpotPlugins/plugins/BeamSpotOnline_PayloadInspector.cc"
5+
#include "CondCore/BeamSpotPlugins/plugins/SimBeamSpot_PayloadInspector.cc"
6+
#include "CondCore/BeamSpotPlugins/plugins/SimBeamSpotHLLHC_PayloadInspector.cc"
7+
#include "CondCore/Utilities/interface/PayloadInspector.h"
78
#include "FWCore/MessageLogger/interface/MessageLogger.h"
89
#include "FWCore/PluginManager/interface/PluginManager.h"
910
#include "FWCore/PluginManager/interface/standard.h"
@@ -106,5 +107,26 @@ int main(int argc, char** argv) {
106107
histoSimParametersDiffTwoTags.process(prepConnectionString, PI::mk_input(tag1, start, start, tag2, start, start));
107108
edm::LogPrint("testBeamSpotPayloadInspector") << histoSimParametersDiffTwoTags.data() << std::endl;
108109

110+
// SimBeamSpotHLLHC
111+
tag = "SimBeamSpotHLLHC_test_tag_1_v0";
112+
113+
edm::LogPrint("testBeamSpotPayloadInspector") << "## Exercising SimBeamSpotHLLHC plots " << std::endl;
114+
115+
SimBeamSpotHLLHCParameters histoSimHLLHCParameters;
116+
histoSimHLLHCParameters.process(prepConnectionString, PI::mk_input(tag, start, start));
117+
edm::LogPrint("testBeamSpotPayloadInspector") << histoSimHLLHCParameters.data() << std::endl;
118+
119+
SimBeamSpotHLLHCParametersDiffSingleTag histoSimHLLHCParametersDiff;
120+
histoSimHLLHCParametersDiff.process(prepConnectionString, PI::mk_input(tag, start, end));
121+
edm::LogPrint("testBeamSpotPayloadInspector") << histoSimHLLHCParametersDiff.data() << std::endl;
122+
123+
tag1 = "SimBeamSpotHLLHC_test_tag_1_v0";
124+
tag2 = "SimBeamSpotHLLHC_test_tag_2_v0";
125+
126+
SimBeamSpotHLLHCParametersDiffTwoTags histoSimHLLHCParametersDiffTwoTags;
127+
histoSimHLLHCParametersDiffTwoTags.process(prepConnectionString,
128+
PI::mk_input(tag1, start, start, tag2, start, start));
129+
edm::LogPrint("testBeamSpotPayloadInspector") << histoSimHLLHCParametersDiffTwoTags.data() << std::endl;
130+
109131
Py_Finalize();
110132
}

CondCore/Utilities/plugins/Module_2XML.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ PAYLOAD_2XML_MODULE(pluginUtilities_payload2xml) {
266266
PAYLOAD_2XML_CLASS(RecoIdealGeometry);
267267
PAYLOAD_2XML_CLASS(RunInfo);
268268
PAYLOAD_2XML_CLASS(SimBeamSpotObjects);
269+
PAYLOAD_2XML_CLASS(SimBeamSpotHLLHCObjects);
269270
PAYLOAD_2XML_CLASS(SiPhase2OuterTrackerLorentzAngle);
270271
PAYLOAD_2XML_CLASS(SiPixel2DTemplateDBObject);
271272
PAYLOAD_2XML_CLASS(SiPixelCPEGenericErrorParm);

CondCore/Utilities/src/CondDBFetch.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ namespace cond {
287287
FETCH_PAYLOAD_CASE(RecoIdealGeometry)
288288
FETCH_PAYLOAD_CASE(RunInfo)
289289
FETCH_PAYLOAD_CASE(SimBeamSpotObjects)
290+
FETCH_PAYLOAD_CASE(SimBeamSpotHLLHCObjects)
290291
FETCH_PAYLOAD_CASE(SiPhase2OuterTrackerLorentzAngle)
291292
FETCH_PAYLOAD_CASE(SiPixelCalibConfiguration)
292293
FETCH_PAYLOAD_CASE(SiPixelCPEGenericErrorParm)

CondCore/Utilities/src/CondDBImport.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ namespace cond {
313313
IMPORT_PAYLOAD_CASE(RecoIdealGeometry)
314314
IMPORT_PAYLOAD_CASE(RunInfo)
315315
IMPORT_PAYLOAD_CASE(SimBeamSpotObjects)
316+
IMPORT_PAYLOAD_CASE(SimBeamSpotHLLHCObjects)
316317
IMPORT_PAYLOAD_CASE(SiPhase2OuterTrackerLorentzAngle)
317318
IMPORT_PAYLOAD_CASE(SiPixelCalibConfiguration)
318319
IMPORT_PAYLOAD_CASE(SiPixelCPEGenericErrorParm)

CondCore/Utilities/src/CondFormats.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "CondFormats/BeamSpotObjects/interface/BeamSpotObjects.h"
1010
#include "CondFormats/BeamSpotObjects/interface/BeamSpotOnlineObjects.h"
1111
#include "CondFormats/BeamSpotObjects/interface/SimBeamSpotObjects.h"
12+
#include "CondFormats/BeamSpotObjects/interface/SimBeamSpotHLLHCObjects.h"
1213
#include "CondFormats/CastorObjects/interface/CastorElectronicsMap.h"
1314
#include "CondFormats/CastorObjects/interface/CastorSaturationCorrs.h"
1415
#include "CondFormats/HIObjects/interface/CentralityTable.h"
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#ifndef CondFormats_BeamSpotObjects_SimBeamSpotHLLHCObjects_h
2+
#define CondFormats_BeamSpotObjects_SimBeamSpotHLLHCObjects_h
3+
4+
/** \class SimBeamSpotHLLHCObjects
5+
*
6+
* Provide the vertex smearing parameters from DB
7+
*
8+
* This Object contains the parameters needed by the HLLHCEvtVtxGenerator generator:
9+
* Parameters used:
10+
* - fMeanX, fMeanY, fMeanZ
11+
* - fEProton, fCrabFrequency, fRF800
12+
* - fCrossingAngle
13+
* - fCrabbingAngleCrossing, fCrabbingAngleSeparation
14+
* - fBetaCrossingPlane, fBetaSeparationPlane
15+
* - fHorizontalEmittance, fVerticalEmittance
16+
* - fBunchLength
17+
* - fTimeOffset
18+
*
19+
*/
20+
21+
#include "CondFormats/Serialization/interface/Serializable.h"
22+
23+
#include <sstream>
24+
25+
class SimBeamSpotHLLHCObjects {
26+
public:
27+
/// default constructor
28+
SimBeamSpotHLLHCObjects() {
29+
fMeanX = 0.0;
30+
fMeanY = 0.0;
31+
fMeanZ = 0.0;
32+
fEProton = 0.0;
33+
fCrabFrequency = 0.0;
34+
fRF800 = 0.0;
35+
fCrossingAngle = 0.0;
36+
fCrabbingAngleCrossing = 0.0;
37+
fCrabbingAngleSeparation = 0.0;
38+
fBetaCrossingPlane = 0.0;
39+
fBetaSeparationPlane = 0.0;
40+
fHorizontalEmittance = 0.0;
41+
fVerticalEmittance = 0.0;
42+
fBunchLength = 0.0;
43+
fTimeOffset = 0.0;
44+
};
45+
46+
virtual ~SimBeamSpotHLLHCObjects(){};
47+
48+
/// set meanX, meanY, meanZ
49+
void setMeanX(double val) { fMeanX = val; }
50+
void setMeanY(double val) { fMeanY = val; }
51+
void setMeanZ(double val) { fMeanZ = val; }
52+
/// set EProton, fCrabFrequency, RF800
53+
void setEProton(double val) { fEProton = val; }
54+
void setCrabFrequency(double val) { fCrabFrequency = val; }
55+
void setRF800(double val) { fRF800 = val; }
56+
/// set Crossing and Crabbing angles
57+
void setCrossingAngle(double val) { fCrossingAngle = val; }
58+
void setCrabbingAngleCrossing(double val) { fCrabbingAngleCrossing = val; }
59+
void setCrabbingAngleSeparation(double val) { fCrabbingAngleSeparation = val; }
60+
/// set BetaStar and Emittance
61+
void setBetaCrossingPlane(double val) { fBetaCrossingPlane = val; }
62+
void setBetaSeparationPlane(double val) { fBetaSeparationPlane = val; }
63+
void setHorizontalEmittance(double val) { fHorizontalEmittance = val; }
64+
void setVerticalEmittance(double val) { fVerticalEmittance = val; }
65+
/// set BunchLength and TimeOffset
66+
void setBunchLength(double val) { fBunchLength = val; }
67+
void setTimeOffset(double val) { fTimeOffset = val; }
68+
69+
/// get meanX, meanY, meanZ position
70+
double meanX() const { return fMeanX; }
71+
double meanY() const { return fMeanY; }
72+
double meanZ() const { return fMeanZ; }
73+
/// get EProton, fCrabFrequency, RF800
74+
double eProton() const { return fEProton; }
75+
double crabFrequency() const { return fCrabFrequency; }
76+
double rf800() const { return fRF800; }
77+
/// set Crossing and Crabbing angles
78+
double crossingAngle() const { return fCrossingAngle; }
79+
double crabbingAngleCrossing() const { return fCrabbingAngleCrossing; }
80+
double crabbingAngleSeparation() const { return fCrabbingAngleSeparation; }
81+
/// get BetaStar and Emittance
82+
double betaCrossingPlane() const { return fBetaCrossingPlane; }
83+
double betaSeparationPlane() const { return fBetaSeparationPlane; }
84+
double horizontalEmittance() const { return fHorizontalEmittance; }
85+
double verticalEmittance() const { return fVerticalEmittance; }
86+
/// get BunchLength and TimeOffset
87+
double bunchLenght() const { return fBunchLength; }
88+
double timeOffset() const { return fTimeOffset; }
89+
90+
/// print sim beam spot parameters
91+
void print(std::stringstream& ss) const;
92+
93+
private:
94+
double fMeanX, fMeanY, fMeanZ;
95+
double fEProton, fCrabFrequency, fRF800;
96+
double fCrossingAngle, fCrabbingAngleCrossing, fCrabbingAngleSeparation;
97+
double fBetaCrossingPlane, fBetaSeparationPlane;
98+
double fHorizontalEmittance, fVerticalEmittance;
99+
double fBunchLength, fTimeOffset;
100+
101+
COND_SERIALIZABLE;
102+
};
103+
104+
std::ostream& operator<<(std::ostream&, SimBeamSpotHLLHCObjects beam);
105+
106+
#endif

0 commit comments

Comments
 (0)