Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions addons/FastJet/JetClustering.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
#include "fastjet/ClusterSequence.hh"
#include "fastjet/ClusterSequenceArea.hh"
#include "fastjet/JetDefinition.hh"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#include "fastjet/EECambridgePlugin.hh"
#include "fastjet/JadePlugin.hh"
#pragma GCC diagnostic pop

#include "FastJet/ValenciaPlugin.h"

Expand Down
1 change: 1 addition & 0 deletions addons/FastJet/ValenciaPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh

/// copy constructor
ValenciaPlugin(const ValenciaPlugin &plugin) { *this = plugin; }
ValenciaPlugin &operator=(const ValenciaPlugin &) = default;

// the things that are required by base class
virtual std::string description() const;
Expand Down
29 changes: 11 additions & 18 deletions addons/FastJet/src/JetClustering.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ namespace JetClustering {
// initialize recombination scheme
_recombScheme = FCCAnalyses::JetClusteringUtils::recomb_scheme(_recombination);

//define the clustering sequence and jet definition
fastjet::ClusterSequence _cs;
// define the clustering sequence and jet definition
_def = fastjet::JetDefinition(_jetAlgorithm, _radius, _recombScheme);
if (_recombScheme == fastjet::RecombinationScheme::external_scheme)
_def.set_recombiner(new ExternalRecombiner(_recombination));
Expand Down Expand Up @@ -64,8 +63,7 @@ namespace JetClustering {
// initialize recombination scheme
_recombScheme = FCCAnalyses::JetClusteringUtils::recomb_scheme(_recombination);

//define the clustering sequence and jet definition
fastjet::ClusterSequence _cs;
// define the clustering sequence and jet definition
_def = fastjet::JetDefinition(_jetAlgorithm, _radius, _recombScheme);
if (_recombScheme == fastjet::RecombinationScheme::external_scheme)
_def.set_recombiner(new ExternalRecombiner(_recombination));
Expand Down Expand Up @@ -104,8 +102,7 @@ namespace JetClustering {
// initialize recombination scheme
_recombScheme = FCCAnalyses::JetClusteringUtils::recomb_scheme(_recombination);

//define the clustering sequence and jet definition
fastjet::ClusterSequence _cs;
// define the clustering sequence and jet definition
_def = fastjet::JetDefinition(_jetAlgorithm, _radius, _recombScheme);
if (_recombScheme == fastjet::RecombinationScheme::external_scheme)
_def.set_recombiner(new ExternalRecombiner(_recombination));
Expand Down Expand Up @@ -140,8 +137,7 @@ namespace JetClustering {
// initialize recombination scheme
_recombScheme = FCCAnalyses::JetClusteringUtils::recomb_scheme(_recombination);

//define the clustering sequence and jet definition
fastjet::ClusterSequence _cs;
// define the clustering sequence and jet definition
_def = fastjet::JetDefinition(_jetAlgorithm, _recombScheme);
if (_recombScheme == fastjet::RecombinationScheme::external_scheme)
_def.set_recombiner(new ExternalRecombiner(_recombination));
Expand Down Expand Up @@ -179,8 +175,7 @@ namespace JetClustering {
// initialize recombination scheme
_recombScheme = FCCAnalyses::JetClusteringUtils::recomb_scheme(_recombination);

//define the clustering sequence and jet definition
fastjet::ClusterSequence _cs;
// define the clustering sequence and jet definition
_def = fastjet::JetDefinition(_jetAlgorithm, _radius, _exponent, _recombScheme);
if (_recombScheme == fastjet::RecombinationScheme::external_scheme)
_def.set_recombiner(new ExternalRecombiner(_recombination));
Expand Down Expand Up @@ -218,8 +213,7 @@ namespace JetClustering {
// initialize recombination scheme
_recombScheme = FCCAnalyses::JetClusteringUtils::recomb_scheme(_recombination);

//define the clustering sequence and jet definition
fastjet::ClusterSequence _cs;
// define the clustering sequence and jet definition
_def = fastjet::JetDefinition(_jetAlgorithm, _radius, _exponent, _recombScheme);
if (_recombScheme == fastjet::RecombinationScheme::external_scheme)
_def.set_recombiner(new ExternalRecombiner(_recombination));
Expand Down Expand Up @@ -263,8 +257,7 @@ namespace JetClustering {
// initialize recombination scheme
_recombScheme = FCCAnalyses::JetClusteringUtils::recomb_scheme(_recombination);

//define the clustering sequence and jet definition
fastjet::ClusterSequence _cs;
// define the clustering sequence and jet definition
_def = fastjet::JetDefinition(_jetAlgorithm);
_def.set_recombination_scheme(_recombScheme);
if (_recombScheme == fastjet::RecombinationScheme::external_scheme)
Expand Down Expand Up @@ -300,12 +293,12 @@ namespace JetClustering {
_jetAlgorithm = new fastjet::JadePlugin();

// initialize recombination scheme
fastjet::RecombinationScheme _recombScheme = FCCAnalyses::JetClusteringUtils::recomb_scheme(_recombination);
fastjet::RecombinationScheme recombScheme =
FCCAnalyses::JetClusteringUtils::recomb_scheme(_recombination);

fastjet::ClusterSequence _cs;
_def = fastjet::JetDefinition(_jetAlgorithm);
_def.set_recombination_scheme(_recombScheme);
if (_recombScheme == fastjet::RecombinationScheme::external_scheme)
_def.set_recombination_scheme(recombScheme);
if (recombScheme == fastjet::RecombinationScheme::external_scheme)
_def.set_recombiner(new ExternalRecombiner(_recombination));
}

Expand Down
4 changes: 3 additions & 1 deletion addons/ONNXRuntime/WeaverInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ class WeaverInterface {
size_t min_length{0}, max_length{0};
std::vector<std::string> var_names;
std::unordered_map<std::string, VarInfo> var_info_map;
VarInfo info(const std::string& name) const { return var_info_map.at(name); }
VarInfo info(const std::string &variableName) const {
return var_info_map.at(variableName);
}
void dumpVars() const;
};
std::vector<float> center_norm_pad(const rv::RVec<float>& input,
Expand Down
2 changes: 1 addition & 1 deletion addons/ONNXRuntime/src/ONNXRuntime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ ONNXRuntime::Tensor<T> ONNXRuntime::run(Tensor<T>& input,
} else {
input_dims = input_shapes[input_pos];
// rely on the given input_shapes to set the batch size
if (input_dims[0] != batch_size)
if (static_cast<unsigned long long>(input_dims[0]) != batch_size)
throw std::runtime_error("The first element of `input_shapes` (" + std::to_string(input_dims[0]) +
") does not match the given `batch_size` (" + std::to_string(batch_size) + ")");
}
Expand Down
6 changes: 4 additions & 2 deletions addons/TMVAHelper/src/TMVAHelper.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "TMVAHelper/TMVAHelper.h"

#include <cstddef>

#include "RVersion.h"

tmva_helper_xgb::tmva_helper_xgb(const std::string &filename,
Expand All @@ -20,8 +22,8 @@ tmva_helper_xgb::tmva_helper_xgb(const std::string &filename,

ROOT::VecOps::RVec<float>
tmva_helper_xgb::operator()(const ROOT::VecOps::RVec<float> vars) {
auto const tbb_slot =
std::max(tbb::this_task_arena::current_thread_index(), 0);
const auto tbb_slot = static_cast<std::size_t>(
std::max(tbb::this_task_arena::current_thread_index(), 0));
if (tbb_slot >= m_interpreters.size()) {
throw std::runtime_error(
"Not enough interpreters allocated for number of tbb threads");
Expand Down
9 changes: 3 additions & 6 deletions analyzers/dataframe/FCCAnalyses/myUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ namespace myUtils{
ROOT::VecOps::RVec<int> pvindex);
};



struct build_tau23pi {
build_tau23pi( float arg_masslow, float arg_masshigh, float arg_p, float arg_angle, bool arg_rho);
struct sel_tau23pi {
sel_tau23pi(float arg_masslow, float arg_masshigh, float arg_p,
float arg_angle, bool arg_rho);
float m_masslow=0.05;
float m_masshigh=3.0;
float m_p=1.;
Expand All @@ -62,8 +61,6 @@ namespace myUtils{
ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> recop);
};



struct sel_PV {
sel_PV(bool arg_closest);
bool m_closest;
Expand Down
66 changes: 34 additions & 32 deletions analyzers/dataframe/src/Algorithms.cc
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#include "FCCAnalyses/Algorithms.h"
#include "FCCAnalyses/Utils.h"
#include <cstddef>

#include "Math/Minimizer.h"
#include "Math/IFunction.h"
#include "Math/Factory.h"
#include "Math/Functor.h"
#include "Math/IFunction.h"
#include "Math/Minimizer.h"
#include <algorithm>
#include <array>
#include <iostream>
#include <numeric>
#include <vector>

#include "Math/IFunction.h"
#include "Math/Factory.h"
Expand Down Expand Up @@ -197,13 +200,14 @@ ROOT::VecOps::RVec<float> Algorithms::calculate_thrust::operator()(

// Array to store x, y, z and magnitude squared of the particles.
// 0 -- magnitude squared, 1 -- x, 2 -- y, 3 -- z
float pArr[nParticles][4];
std::vector<std::array<float, 4>> pArr(nParticles);
float pSum = 0.;
for (size_t i = 0; i < nParticles; ++i) {
pArr[i][1] = px[i];
pArr[i][2] = py[i];
pArr[i][3] = pz[i];
mag2(pArr[i]);
pArr[i][0] = pArr[i][1] * pArr[i][1] + pArr[i][2] * pArr[i][2] +
pArr[i][3] * pArr[i][3];
pSum += std::sqrt(pArr[i][0]);
}

Expand All @@ -214,7 +218,7 @@ ROOT::VecOps::RVec<float> Algorithms::calculate_thrust::operator()(
for (size_t i = 0; i < nParticles - 1; ++i) {
for (size_t j = i + 1; j < nParticles; ++j) {
float nRef[4];
cross(nRef, pArr[i], pArr[j]);
cross(nRef, pArr[i].data(), pArr[j].data());
mag2(nRef);
unit(nRef);

Expand All @@ -224,29 +228,29 @@ ROOT::VecOps::RVec<float> Algorithms::calculate_thrust::operator()(
continue;
}

if (dot(nRef, pArr[k]) > 0.) {
plus(pPart, pPart, pArr[k]);
if (dot(nRef, pArr[k].data()) > 0.) {
plus(pPart, pPart, pArr[k].data());
} else {
minus(pPart, pPart, pArr[k]);
minus(pPart, pPart, pArr[k].data());
}
}

float pFullArr[4][4];
// pPart + pArr[i] + pArr[j]
plus(pFullArr[0], pPart, pArr[i]);
plus(pFullArr[0], pFullArr[0], pArr[j]);
plus(pFullArr[0], pPart, pArr[i].data());
plus(pFullArr[0], pFullArr[0], pArr[j].data());

// pPart + pArr[i] - pArr[j]
plus(pFullArr[1], pPart, pArr[i]);
minus(pFullArr[1], pFullArr[1], pArr[j]);
plus(pFullArr[1], pPart, pArr[i].data());
minus(pFullArr[1], pFullArr[1], pArr[j].data());

// pPart - pArr[i] + pArr[j]
minus(pFullArr[2], pPart, pArr[i]);
plus(pFullArr[2], pFullArr[2], pArr[j]);
minus(pFullArr[2], pPart, pArr[i].data());
plus(pFullArr[2], pFullArr[2], pArr[j].data());

// pPart - pArr[i] - pArr[j]
minus(pFullArr[3], pPart, pArr[i]);
minus(pFullArr[3], pFullArr[3], pArr[j]);
minus(pFullArr[3], pPart, pArr[i].data());
minus(pFullArr[3], pFullArr[3], pArr[j].data());

for (size_t k = 0; k < 4; ++k) {
mag2(pFullArr[k]);
Expand Down Expand Up @@ -487,24 +491,22 @@ JetClustering::FCCAnalysesJet jets_TwoHemispheres::operator() (
float pz_minus=0;
float e_minus=0;

for ( int i=0; i < RP_costheta.size(); i++) {
if ( RP_costheta[i] > 0 ) {
constituents_JetPlus.push_back( i );
px_plus += RP_px[i];
py_plus += RP_py[i];
pz_plus += RP_pz[i];
e_plus += RP_e[i];
}
else {
constituents_JetMimus.push_back( i );
px_minus += RP_px[i];
py_minus += RP_py[i];
pz_minus += RP_pz[i];
e_minus += RP_e[i];
}
for (std::size_t i = 0; i < RP_costheta.size(); i++) {
if (RP_costheta[i] > 0) {
constituents_JetPlus.push_back(i);
px_plus += RP_px[i];
py_plus += RP_py[i];
pz_plus += RP_pz[i];
e_plus += RP_e[i];
} else {
constituents_JetMimus.push_back(i);
px_minus += RP_px[i];
py_minus += RP_py[i];
pz_minus += RP_pz[i];
e_minus += RP_e[i];
}
}


float pt_plus = sqrt( pow( px_plus,2) + pow( py_plus,2) + pow( pz_plus, 2) ) ;
float pt_minus = sqrt( pow( px_minus, 2) + pow( py_minus, 2) + pow( pz_minus, 2) ) ;

Expand Down
Loading
Loading