7#include <nlohmann/json.hpp>
13 case HI::IonDataType::_N: \
26 return std::string(
"UNKNOWN HI DATA TAKING PERIOD ") +
27 std::to_string(
static_cast<uint8_t
>(period));
34 case HI::PileupVariation::_N: \
42 return std::string(
"UNKNOWN PU VARIATION ") +
43 std::to_string(
static_cast<uint8_t
>(variation));
50 case HI::SelectionMask::_N: \
64 return std::string(
"UNKNOWN mask bit ") +
65 std::to_string(
static_cast<unsigned int>(m));
71 const std::string path =
73 std::ifstream i(path);
75 throw std::runtime_error(path +
" does nto exist");
82 const size_t nbins = j.at(
"fNbins").get<
size_t>();
84 auto h = std::make_unique<TH1D>(j.at(
"fName").get<std::string>().c_str(),
85 j.at(
"fTitle").get<std::string>().c_str(),
86 nbins, j.at(
"fXmin").get<
double>(),
87 j.at(
"fXmax").get<
double>());
88 const std::vector<double>
bins = j.at(
"fArray").get<std::vector<double>>();
89 if (
bins.size() != j.at(
"fNbins").get<
size_t>() + 2) {
90 throw std::runtime_error(
91 "Histogram " + j.at(
"fName").get<std::string>() +
92 " has inconsistent number of bins and fNbins (should +2) value " +
93 std::to_string(
bins.size()) +
" and " + std::to_string(nbins));
96 for (
size_t bin = 0;
bin < nbins + 2;
bin++) {
125 return StatusCode::SUCCESS;
149 for (
auto slice : *es) {
150 const static std::set fcalLayers({21, 22, 23});
151 if (fcalLayers.contains(slice->layer()))
161 for (
auto module : *zdcModules) {
162 e += calibEnergyAccessor(*module);
218 if (ntrk < (-80 +
fcalEt * 600))
220 if (ntrk < (-30 +
fcalEt * 400))
222 if (ntrk > (100 +
fcalEt * 1700))
226 if (ntrk < (-70 +
fcalEt * 600))
228 if (ntrk < (-20 +
fcalEt * 350))
230 if (ntrk > (100 +
fcalEt * 1700))
240 float PreSamplerAmp_A = 0;
241 float PreSamplerAmp_C = 0;
243 for (
const auto module : *zdcModules) {
244 if (module->zdcType() != 0)
246 if (module->zdcSide() > 0)
247 PreSamplerAmp_C += accPreSampleAmp(*module);
248 if (module->zdcSide() < 0)
249 PreSamplerAmp_A += accPreSampleAmp(*module);
251 return puZDCPresampler(period, PreSamplerAmp_A, PreSamplerAmp_C, variation);
262 const float peakPositionA = -56;
263 const float peakPositionC = -156;
264 const float peakWidthA = 51.8;
265 const float peakWidthC = 51.8;
273 if (presamplerA > (peakPositionA + sigma * peakWidthA) and
274 presamplerC > (peakPositionC + sigma * peakWidthC)) {
286 if (vertices->
size() <= 1) {
291 unsigned int nPrimary = 0;
292 unsigned int nSplit = 0;
293 unsigned int nOther = 0;
300 const double sigmaZSq = vtx_err(2, 2);
301 if (sigmaZSq >= 0.02)
311 ATH_MSG_DEBUG(
"n primary " << nPrimary <<
", nSplit " << nSplit
312 <<
", nOther " << nOther);
316 if (nSplit > 0 && nPrimary == 0) {
317 ATH_MSG_DEBUG(
"Returning true as all vertices classified as split");
321 return nPrimary == 1;
327 throw std::runtime_error(
329 " the energy that is given to zdcCutValue is well above 100 TeV?, "
330 "likely you call it not converting energy to TeV");
334 auto cutFunction = [](
float et) {
335 const static double a = 334.29, b = -20.39,
337 return a + b *
et + c *
et *
et;
340 float cut = cutFunction(
fcalEt);
342 cut = cutFunction(1.0);
344 cut = cutFunction(4.0);
381 throw std::runtime_error(std::string(
"period of id ") +
HI::toString(period) +
382 " is not handled (yet)");
398 uint32_t
run)
const {
400 throw std::runtime_error(std::to_string(
run) +
401 " not handled by selection tool");
417 throw std::runtime_error(std::to_string(
run) +
418 " not handled by selection tool");
#define ATH_CHECK
Evaluate an expression and check for errors.
#define AmgSymMatrix(dim)
static const std::vector< std::string > bins
Header file for AthHistogramAlgorithm.
size_type size() const noexcept
Returns the number of elements in the collection.
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
Helper class to provide constant type-safe access to aux data.
@ Tile
The Tile calorimeter.
@ Pixel
The pixel tracker.
@ LAr
The LAr calorimeter.
@ Error
The sub-detector issued an error.
uint32_t runNumber() const
The current event's run number.
EventFlagErrorState errorState(EventFlagSubDet subDet) const
Get the error state for a particular sub-detector.
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
@ PUOOSingleVertexNominal
std::string toString(IonDataType)
ZdcModuleContainer_v1 ZdcModuleContainer
EventInfo_v1 EventInfo
Definition of the latest event info version.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
HIEventShapeContainer_v2 HIEventShapeContainer
Define the latest version of the container.
Extra patterns decribing particle interation process.
int run(int argc, char *argv[])