New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add LumiCorrections records and definitions; adding LumiInfo.h members/methods #20651
Changes from all commits
392e355
6401dd7
e727a48
4597fcc
e157e81
cae9325
8aa4315
713b775
340da85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
#include "CondCore/ESSources/interface/registration_macros.h" | ||
#include "CondFormats/Luminosity/interface/LumiSectionData.h" | ||
#include "CondFormats/DataRecord/interface/LumiSectionDataRcd.h" | ||
#include "CondFormats/Luminosity/interface/LumiCorrections.h" | ||
#include "CondFormats/DataRecord/interface/LumiCorrectionsRcd.h" | ||
|
||
|
||
REGISTER_PLUGIN(LumiSectionDataRcd, lumi::LumiSectionData); | ||
|
||
|
||
REGISTER_PLUGIN(LumiCorrectionsRcd, LumiCorrections); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef DataRecord_LumiCorrectionsRcd_h | ||
#define DataRecord_LumiCorrectionsRcd_h | ||
// -*- C++ -*- | ||
// | ||
// Package: CondFormats/DataRecord | ||
// Class : LumiCorrectionsRcd | ||
// | ||
/**\class LumiCorrectionsRcd LumiCorrectionsRcd.h CondFormats/DataRecord/interface/LumiCorrectionsRcd.h | ||
|
||
Description: [one line class summary] | ||
|
||
Usage: | ||
<usage> | ||
|
||
*/ | ||
// | ||
// Author: Sam Higginbotham | ||
// Created: Fri, 21 Jul 2017 18:15:12 GMT | ||
// | ||
|
||
#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" | ||
|
||
class LumiCorrectionsRcd : public edm::eventsetup::EventSetupRecordImplementation<LumiCorrectionsRcd> {}; | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// -*- C++ -*- | ||
// | ||
// Package: CondFormats/DataRecord | ||
// Class : LumiCorrectionsRcd | ||
// | ||
// Implementation: | ||
// [Notes on implementation] | ||
// | ||
// Author: Sam Higginbotham | ||
// Created: Fri, 21 Jul 2017 18:15:12 GMT | ||
|
||
#include "CondFormats/DataRecord/interface/LumiCorrectionsRcd.h" | ||
#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" | ||
|
||
EVENTSETUP_RECORD_REG(LumiCorrectionsRcd); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#ifndef CondFormats_Luminosity_LumiCorrections_h | ||
#define CondFormats_Luminosity_LumiCorrections_h | ||
|
||
/** | ||
* \class LumiCorrections | ||
* | ||
* \author Sam Higginbotham, Chris Palmer | ||
* | ||
* This class should contain scale factors for correcting | ||
* out-of-time pile-up per bunch crossing on rates intended | ||
* for luminosity estimates. There is the option of saving | ||
* the total scale factor on the total luminosity in | ||
* m_overallCorrection as well. | ||
*/ | ||
|
||
|
||
#include <sstream> | ||
#include <cstring> | ||
#include <vector> | ||
#include <boost/serialization/vector.hpp> | ||
#include "CondFormats/Serialization/interface/Serializable.h" | ||
|
||
class LumiCorrections { | ||
public: | ||
void setOverallCorrection(float overallCorrection){m_overallCorrection=overallCorrection;} | ||
void setType1Fraction(float type1frac){m_type1Fraction=type1frac;} | ||
void setType1Residual(float type1res){m_type1Residual=type1res;} | ||
void setType2Residual(float type2res){m_type2Residual=type2res;} | ||
void setCorrectionsBX(std::vector<float>& correctBX){m_correctionsBX.assign(correctBX.begin(),correctBX.end());} | ||
float getOverallCorrection(){return m_overallCorrection;} | ||
float getCorrectionAtBX(float bx){return m_correctionsBX[bx];} | ||
float getType1Fraction(){return m_type1Fraction;} | ||
float getType1Residual(){return m_type1Residual;} | ||
float getType2Residual(){return m_type2Residual;} | ||
const std::vector<float>& getCorrectionsBX() const{return m_correctionsBX;} | ||
private: | ||
float m_overallCorrection; | ||
float m_type1Fraction; | ||
float m_type1Residual; | ||
float m_type2Residual; | ||
std::vector<float> m_correctionsBX; | ||
COND_SERIALIZABLE; | ||
}; | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// T_EventSetup_LumiCorrections.cc | ||
|
||
#include "CondFormats/Luminosity/interface/LumiCorrections.h" | ||
#include "FWCore/Utilities/interface/typelookup.h" | ||
|
||
TYPELOOKUP_DATA_REG(LumiCorrections); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ | |
<class name="std::vector< lumi::HLTInfo >"/> | ||
<class name="std::vector< lumi::TriggerInfo >"/> | ||
<class name="std::vector< lumi::BunchCrossingInfo >"/> | ||
<class name="LumiCorrections" class_version="0"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i don't follow the need for (or lack of) class_versions here. @ggovi - is this needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know about this one. @samhiggie made this line. Where did you get it from? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, I copied the instructions almost exactly from this twiki example to register an object to the DB. https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideCondObjectsTutorial#The_object_class There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indeed, I don't know either - i asked @ggovi to provide instructions... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By the way: I also noticed it, but I did not comment because I realized that all classes in the CondFormats are have class_version="0", see Good to try to understand if it does correspond to a kind of (justified) rule. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like a lot of people were following the twiki. :) IMO this may be superfluous but shouldn't harm anything. Merging this PR shouldn't be held up by understanding this issue which is really unrelated (and ignored up to now in other places). It just looks like the twiki should be updated by someone ( @ggovi ?). I don't mind changing this, but the approval of this PR shouldn't linger for days because of this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the class version is no longer needed for the persistency since ORA disappeared ( cmssw_7_2_X ) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks @ggovi - maybe your documentation and existing class_versions can get cleaned up in a followup PR. |
||
</lcgdict> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
#include "CondFormats/Luminosity/interface/LumiSectionData.h" | ||
#include "CondFormats/Luminosity/interface/LumiCorrections.h" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
<bin file="testSerializationLuminosity.cpp"> | ||
<use name="CondFormats/Luminosity"/> | ||
</bin> | ||
<bin file="testSerializationLumiCorrections.cpp"> | ||
<use name="CondFormats/Luminosity"/> | ||
</bin> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "CondFormats/Serialization/interface/Test.h" | ||
#include "CondFormats/Luminosity/interface/LumiCorrections.h" | ||
|
||
int main() | ||
{ | ||
testSerialization<LumiCorrections>(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from the class its hard to know if one should include the overall correction together with the bx by bx correction. Please add a bit of documentation on the various meanings. It also might be useful to have an accessor to the ith bx and its length.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some comments at the top. There are use cases for only using the total correction with some luminometers and so we need it available here.