Skip to content
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

LHC Info code review PR #62

Draft
wants to merge 29 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
abb7c23
Implement a LHCInfo inspired class with just a few variables needed f…
wpcarvalho Feb 25, 2022
cade95d
Merged pps_lhcInfo from repository wpcarvalho with cms-merge-topic
JanChyczynski Jul 13, 2022
0f20d39
renamed LHCInfoForPPS to LHCInfoPerLS
JanChyczynski Jul 13, 2022
b820dfc
moved LHCInfoPerLS from PPS to RunInfo
JanChyczynski Jul 13, 2022
3fda01a
split betaStar and crossingAngle for x and y
JanChyczynski Jul 13, 2022
698c472
LHCInfoPerFill class implemented
JanChyczynski Jul 13, 2022
a09b1b6
other files for LHCInfoPerFill condtions object definition aded/modified
JanChyczynski Jul 13, 2022
3a30c89
moved vectorized fields handling to a new class LHCInfoVectorizedFields
JanChyczynski Jul 18, 2022
f34c528
exctracted common code to LHCInfoVectorizedFields, added empty m_time…
JanChyczynski Jul 19, 2022
7b5b102
removed explicit values in enums
JanChyczynski Jul 19, 2022
2bfe104
changed throwing std::out_of_range to cond::Exception
JanChyczynski Jul 19, 2022
11b7d3d
added setup READMY.md
JanChyczynski Jul 19, 2022
d59bfd6
added fields definitions to classes_def.xml
JanChyczynski Jul 21, 2022
552bea1
simple tests: writing and retrieving objects of new classes in sqlite DB
JanChyczynski Jul 22, 2022
7e07683
improved tests data and removed old commented code
JanChyczynski Jul 26, 2022
6f9f141
Added new CondFormats to Module_2XML.cc and CondFormats.h
JanChyczynski Aug 1, 2022
6a2e73e
fixed PopCon lumisection query limit
JanChyczynski Aug 10, 2022
6b3501c
added fill number field to LHCInfoPerLS
JanChyczynski Aug 12, 2022
190a475
added run number field to LHCInfoPerLS
JanChyczynski Aug 16, 2022
10cbd4a
created perLS PopCon: cloned old one, removed irrelevant code and adj…
JanChyczynski Aug 18, 2022
821d773
populating crossing angle Y and beta* Y
JanChyczynski Aug 18, 2022
dc39517
populating run number
JanChyczynski Aug 19, 2022
89aa690
implemented startFill mode of perLS PopCon
JanChyczynski Aug 29, 2022
b7820e8
implemented perFill PopCon
JanChyczynski Sep 1, 2022
0df2189
removed unused code, made some debug info be printed only in debug mode
JanChyczynski Sep 2, 2022
acc22e4
moved populating run number from getLumiData to getCTPSData
JanChyczynski Sep 5, 2022
d001950
added payload at start of SB in perFill endfill PopCon, removed 1 cas…
JanChyczynski Sep 5, 2022
d2d4366
added greater or equal and less or equal filters to OMSServiceQuery
JanChyczynski Sep 5, 2022
7cf8bac
fixed perFill and perLS PopCons skipping fills
JanChyczynski Sep 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CondCore/RunInfoPlugins/src/plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@
#include "CondFormats/RunInfo/interface/FillInfo.h"
#include "CondFormats/DataRecord/interface/LHCInfoRcd.h"
#include "CondFormats/RunInfo/interface/LHCInfo.h"
#include "CondFormats/DataRecord/interface/LHCInfoPerLSRcd.h"
#include "CondFormats/RunInfo/interface/LHCInfoPerLS.h"
#include "CondFormats/DataRecord/interface/LHCInfoPerFillRcd.h"
#include "CondFormats/RunInfo/interface/LHCInfoPerFill.h"

REGISTER_PLUGIN(RunSummaryRcd, RunSummary);
REGISTER_PLUGIN(RunInfoRcd, RunInfo);
REGISTER_PLUGIN(L1TriggerScalerRcd, L1TriggerScaler);
REGISTER_PLUGIN(MixingRcd, MixingModuleConfig);
REGISTER_PLUGIN(FillInfoRcd, FillInfo);
REGISTER_PLUGIN(LHCInfoRcd, LHCInfo);
REGISTER_PLUGIN(LHCInfoPerLSRcd, LHCInfoPerLS);
REGISTER_PLUGIN(LHCInfoPerFillRcd, LHCInfoPerFill);
25 changes: 25 additions & 0 deletions CondFormats/DataRecord/interface/LHCInfoPerFillRcd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#ifndef LHCInfoPerFillRcd_LHCInfoPerFillRcd_h
#define LHCInfoPerFillRcd_LHCInfoPerFillRcd_h
// -*- C++ -*-
//
// Package: CondFormats/DataRecord
// Class : LHCInfoPerFillRcd
//
/**\class LHCInfoPerFillRcd LHCInfoPerFillRcd.h CondFormats/DataRecord/interface/LHCInfoPerFillRcd.h

Description: [one line class summary]

Usage:
<usage>

*/
//
// Author: Jan Krzysztof Chyczynski
// Created: Wed, 13 Jul 2022 16:36:24 GMT
//

#include "FWCore/Framework/interface/EventSetupRecordImplementation.h"

class LHCInfoPerFillRcd : public edm::eventsetup::EventSetupRecordImplementation<LHCInfoPerFillRcd> {};

#endif
26 changes: 26 additions & 0 deletions CondFormats/DataRecord/interface/LHCInfoPerLSRcd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef DataRecord_LHCInfoPerLSRcd_h
#define DataRecord_LHCInfoPerLSRcd_h
// -*- C++ -*-
//
// Package: DataRecord
// Class : LHCInfoPerLSRcd
//
/**\class LHCInfoPerLSRcd LHCInfoPerLSRcd.h CondFormats/DataRecord/interface/LHCInfoPerLSRcd.h

Description: [one line class summary]

Usage:
<usage>

*/
//
// Author:
// Created: Tue Feb 15 2022
// $Id$
//

#include "FWCore/Framework/interface/EventSetupRecordImplementation.h"

class LHCInfoPerLSRcd : public edm::eventsetup::EventSetupRecordImplementation<LHCInfoPerLSRcd> {};

#endif
15 changes: 15 additions & 0 deletions CondFormats/DataRecord/src/LHCInfoPerFillRcd.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// -*- C++ -*-
//
// Package: CondFormats/DataRecord
// Class : LHCInfoPerFillRcd
//
// Implementation:
// [Notes on implementation]
//
// Author: Jan Krzysztof Chyczynski
// Created: Wed, 13 Jul 2022 16:36:24 GMT

#include "CondFormats/DataRecord/interface/LHCInfoPerFillRcd.h"
#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h"

EVENTSETUP_RECORD_REG(LHCInfoPerFillRcd);
16 changes: 16 additions & 0 deletions CondFormats/DataRecord/src/LHCInfoPerLSRcd.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// -*- C++ -*-
//
// Package: DataRecord
// Class : LHCInfoPerLSRcd
//
// Implementation:
// [Notes on implementation]
//
// Author:
// Created: Tue Feb 15 2022
// $Id$

#include "CondFormats/DataRecord/interface/LHCInfoPerLSRcd.h"
#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h"

EVENTSETUP_RECORD_REG(LHCInfoPerLSRcd);
1 change: 1 addition & 0 deletions CondFormats/RunInfo/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<use name="CondFormats/Common"/>
<use name="CondFormats/Serialization"/>
<use name="CondCore/CondDB"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/Utilities"/>
<use name="CoralBase"/>
Expand Down
255 changes: 255 additions & 0 deletions CondFormats/RunInfo/interface/LHCInfoPerFill.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
#ifndef CondFormats_RunInfo_LHCInfoPerFill_H
#define CondFormats_RunInfo_LHCInfoPerFill_H

#include "CondFormats/Serialization/interface/Serializable.h"
#include "CondFormats/RunInfo/interface/LHCInfoVectorizedFields.h"
#include "CondFormats/Common/interface/Time.h"
#include <bitset>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>

class LHCInfoPerFill : public LHCInfoVectorizedFields {
public:
enum FillType { UNKNOWN = 0, PROTONS, IONS, COSMICS, GAP };
enum ParticleType { NONE = 0, PROTON, PB82, AR18, D, XE54 };

enum IntParamIndex {
LHC_FILL = 0,
BUNCHES_1,
BUNCHES_2,
COLLIDING_BUNCHES,
TARGET_BUNCHES,
FILL_TYPE,
PARTICLES_1,
PARTICLES_2,
ISIZE
};
enum FloatParamIndex {
INTENSITY_1 = 0,
INTENSITY_2,
ENERGY,
DELIV_LUMI,
REC_LUMI,
LUMI_PER_B,
BEAM1_VC,
BEAM2_VC,
BEAM1_RF,
BEAM2_RF,
INST_LUMI,
INST_LUMI_ERR,
FSIZE
};
enum TimeParamIndex {
CREATE_TIME = 0,
BEGIN_TIME,
END_TIME,
TSIZE
};
enum StringParamIndex {
INJECTION_SCHEME = 0,
LHC_STATE,
LHC_COMMENT,
CTPPS_STATUS,
SSIZE
};

typedef FillType FillTypeId;
typedef ParticleType ParticleTypeId;
LHCInfoPerFill();

LHCInfoPerFill* cloneFill() const;

//constant static unsigned integer hosting the maximum number of LHC bunch slots
static size_t const bunchSlots = 3564;

//constant static unsigned integer hosting the available number of LHC bunch slots
static size_t const availableBunchSlots = 2808;

void setFillNumber(unsigned short lhcFill);

//getters
unsigned short const fillNumber() const;

unsigned short const bunchesInBeam1() const;

unsigned short const bunchesInBeam2() const;

unsigned short const collidingBunches() const;

unsigned short const targetBunches() const;

FillTypeId const fillType() const;

ParticleTypeId const particleTypeForBeam1() const;

ParticleTypeId const particleTypeForBeam2() const;

float const intensityForBeam1() const;

float const intensityForBeam2() const;

float const energy() const;

float const delivLumi() const;

float const recLumi() const;

float const instLumi() const;

float const instLumiError() const;

cond::Time_t const createTime() const;

cond::Time_t const beginTime() const;

cond::Time_t const endTime() const;

std::string const& injectionScheme() const;

std::vector<float> const& lumiPerBX() const;

std::string const& lhcState() const;

std::string const& lhcComment() const;

std::string const& ctppsStatus() const;

std::vector<float> const& beam1VC() const;

std::vector<float> const& beam2VC() const;

std::vector<float> const& beam1RF() const;

std::vector<float> const& beam2RF() const;

std::vector<float>& beam1VC();

std::vector<float>& beam2VC();

std::vector<float>& beam1RF();

std::vector<float>& beam2RF();

//returns a boolean, true if the injection scheme has a leading 25ns
//TODO: parse the circulating bunch configuration, instead of the string.
bool is25nsBunchSpacing() const;

//returns a boolean, true if the bunch slot number is in the circulating bunch configuration
bool isBunchInBeam1(size_t const& bunch) const;

bool isBunchInBeam2(size_t const& bunch) const;

//member functions returning *by value* a vector with all filled bunch slots
std::vector<unsigned short> bunchConfigurationForBeam1() const;

std::vector<unsigned short> bunchConfigurationForBeam2() const;

//setters
void setBunchesInBeam1(unsigned short const& bunches);

void setBunchesInBeam2(unsigned short const& bunches);

void setCollidingBunches(unsigned short const& collidingBunches);

void setTargetBunches(unsigned short const& targetBunches);

void setFillType(FillTypeId const& fillType);

void setParticleTypeForBeam1(ParticleTypeId const& particleType);

void setParticleTypeForBeam2(ParticleTypeId const& particleType);

void setIntensityForBeam1(float const& intensity);

void setIntensityForBeam2(float const& intensity);

void setEnergy(float const& energy);

void setDelivLumi(float const& delivLumi);

void setRecLumi(float const& recLumi);

void setInstLumi(float const& instLumi);

void setInstLumiError(float const& instLumiError);

void setCreationTime(cond::Time_t const& createTime);

void setBeginTime(cond::Time_t const& beginTime);

void setEndTime(cond::Time_t const& endTime);

void setInjectionScheme(std::string const& injectionScheme);

void setLumiPerBX(std::vector<float> const& lumiPerBX);

void setLhcState(std::string const& lhcState);

void setLhcComment(std::string const& lhcComment);

void setCtppsStatus(std::string const& ctppsStatus);

void setBeam1VC(std::vector<float> const& beam1VC);

void setBeam2VC(std::vector<float> const& beam2VC);

void setBeam1RF(std::vector<float> const& beam1RF);

void setBeam2RF(std::vector<float> const& beam2RF);

//sets all values in one go
void setInfo(unsigned short const& bunches1,
unsigned short const& bunches2,
unsigned short const& collidingBunches,
unsigned short const& targetBunches,
FillTypeId const& fillType,
ParticleTypeId const& particleType1,
ParticleTypeId const& particleType2,
float const& intensity1,
float const& intensity2,
float const& energy,
float const& delivLumi,
float const& recLumi,
float const& instLumi,
float const& instLumiError,
cond::Time_t const& createTime,
cond::Time_t const& beginTime,
cond::Time_t const& endTime,
std::string const& scheme,
std::vector<float> const& lumiPerBX,
std::string const& lhcState,
std::string const& lhcComment,
std::string const& ctppsStatus,
std::vector<float> const& beam1VC,
std::vector<float> const& beam2VC,
std::vector<float> const& beam1RF,
std::vector<float> const& beam2RF,
std::bitset<bunchSlots + 1> const& bunchConf1,
std::bitset<bunchSlots + 1> const& bunchConf2);

bool equals(const LHCInfoPerFill& rhs) const;

bool empty() const;

//dumping values on output stream
void print(std::stringstream& ss) const;

std::bitset<bunchSlots + 1> const& bunchBitsetForBeam1() const;

std::bitset<bunchSlots + 1> const& bunchBitsetForBeam2() const;

void setBunchBitsetForBeam1(std::bitset<bunchSlots + 1> const& bunchConfiguration);

void setBunchBitsetForBeam2(std::bitset<bunchSlots + 1> const& bunchConfiguration);

private:
std::bitset<bunchSlots + 1> m_bunchConfiguration1, m_bunchConfiguration2;

COND_SERIALIZABLE;
};

std::ostream& operator<<(std::ostream&, LHCInfoPerFill lhcInfoPerFill);

#endif // CondFormats_RunInfo_LHCInfoPerFill_H
Loading