Skip to content

Commit

Permalink
code format
Browse files Browse the repository at this point in the history
  • Loading branch information
swertz committed Jan 11, 2023
1 parent 8dae4bc commit c2ff4e1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
14 changes: 8 additions & 6 deletions PhysicsTools/NanoAOD/interface/SimpleFlatTableProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,10 @@ class SimpleFlatTableProducerBase : public edm::stream::EDProducer<> {
edm::ParameterSetDescription variable;
variable.add<std::string>("expr")->setComment("a function to define the content of the branch in the flat table");
variable.add<std::string>("doc")->setComment("few words description of the branch content");
variable.ifValue(edm::ParameterDescription<std::string>(
"type", "int", true, edm::Comment("the c++ type of the branch in the flat table")),
edm::allowedValues<std::string>("int", "uint", "float", "double", "int8", "uint8", "int16", "uint16", "bool"));
variable.ifValue(
edm::ParameterDescription<std::string>(
"type", "int", true, edm::Comment("the c++ type of the branch in the flat table")),
edm::allowedValues<std::string>("int", "uint", "float", "double", "int8", "uint8", "int16", "uint16", "bool"));
variable.addOptionalNode(
edm::ParameterDescription<int>(
"precision", true, edm::Comment("the precision with which to store the value in the flat table")) xor
Expand Down Expand Up @@ -279,9 +280,10 @@ class SimpleFlatTableProducer : public SimpleFlatTableProducerBase<T, edm::View<
edm::ParameterSetDescription extvariable;
extvariable.add<edm::InputTag>("src")->setComment("valuemap input collection to fill the flat table");
extvariable.add<std::string>("doc")->setComment("few words description of the branch content");
extvariable.ifValue(edm::ParameterDescription<std::string>(
"type", "int", true, edm::Comment("the c++ type of the branch in the flat table")),
edm::allowedValues<std::string>("int", "uint", "float", "double", "int8", "uint8", "int16", "uint16", "bool"));
extvariable.ifValue(
edm::ParameterDescription<std::string>(
"type", "int", true, edm::Comment("the c++ type of the branch in the flat table")),
edm::allowedValues<std::string>("int", "uint", "float", "double", "int8", "uint8", "int16", "uint16", "bool"));
extvariable.addOptionalNode(
edm::ParameterDescription<int>(
"precision", true, edm::Comment("the precision with which to store the value in the flat table")) xor
Expand Down
3 changes: 2 additions & 1 deletion PhysicsTools/NanoAOD/plugins/LumiOutputBranches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ void LumiOutputBranches::fill(const edm::LuminosityBlockForOutput &iLumi, TTree
// ROOT native array size branches may only be signed integers,
// until this is changed we need to make sure the vector sizes do not exceed that
if (size > std::numeric_limits<CounterType>::max()) {
throw cms::Exception("Table " + tab.name() + " size is " + std::to_string(size) + ", is too large for ROOT native array branch");
throw cms::Exception("Table " + tab.name() + " size is " + std::to_string(size) +
", is too large for ROOT native array branch");
}
m_counter = size;
m_singleton = tab.singleton();
Expand Down
22 changes: 10 additions & 12 deletions PhysicsTools/NanoAOD/plugins/TableOutputBranches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,14 @@ void TableOutputBranches::branch(TTree &tree) {
}
}
std::string varsize = m_singleton ? "" : "[n" + m_baseName + "]";
for (std::vector<NamedBranchPtr> *branches :
{
&m_int8Branches,
&m_uint8Branches,
&m_int16Branches,
&m_uint16Branches,
&m_int32Branches,
&m_uint32Branches,
&m_floatBranches,
&m_doubleBranches
}) {
for (std::vector<NamedBranchPtr> *branches : {&m_int8Branches,
&m_uint8Branches,
&m_int16Branches,
&m_uint16Branches,
&m_int32Branches,
&m_uint32Branches,
&m_floatBranches,
&m_doubleBranches}) {
for (auto &pair : *branches) {
std::string branchName = makeBranchName(m_baseName, pair.name);
pair.branch =
Expand All @@ -98,7 +95,8 @@ void TableOutputBranches::fill(const edm::OccurrenceForOutput &iWhatever, TTree
// ROOT native array size branches may only be signed integers,
// until this is changed we need to make sure the vector sizes do not exceed that
if (size > std::numeric_limits<CounterType>::max()) {
throw cms::Exception("Table " + tab.name() + " size is " + std::to_string(size) + ", is too large for ROOT native array branch");
throw cms::Exception("Table " + tab.name() + " size is " + std::to_string(size) +
", is too large for ROOT native array branch");
}
m_counter = size;
m_singleton = tab.singleton();
Expand Down

0 comments on commit c2ff4e1

Please sign in to comment.