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));
70static const double MeV = 1.;
71static const double GeV = 1e3;
72static const double TeV = 1e6;
75 const std::string path =
77 std::ifstream i(path);
79 throw std::runtime_error(path +
" does nto exist");
86 const size_t nbins = j.at(
"fNbins").get<
size_t>();
88 auto h = std::make_unique<TH1D>(j.at(
"fName").get<std::string>().c_str(),
89 j.at(
"fTitle").get<std::string>().c_str(),
90 nbins, j.at(
"fXmin").get<
double>(),
91 j.at(
"fXmax").get<
double>());
92 const std::vector<double>
bins = j.at(
"fArray").get<std::vector<double>>();
93 if (
bins.size() != j.at(
"fNbins").get<
size_t>() + 2) {
94 throw std::runtime_error(
95 "Histogram " + j.at(
"fName").get<std::string>() +
96 " has inconsistent number of bins and fNbins (should +2) value " +
97 std::to_string(
bins.size()) +
" and " + std::to_string(nbins));
100 for (
size_t bin = 0;
bin < nbins + 2;
bin++) {
137 return StatusCode::SUCCESS;
161 for (
auto slice : *es) {
162 const static std::set fcalLayers({21, 22, 23});
163 if (fcalLayers.contains(slice->layer()))
173 for (
auto module : *zdcModules) {
174 e += calibEnergyAccessor(*module);
219 nTrk(period, tracks, vertices), variation);
231 if (ntrk < (-80 +
fcalEt * 0.6))
233 if (ntrk < (-30 +
fcalEt * 0.4))
235 if (ntrk > (100 +
fcalEt * 1.7))
239 if (ntrk < (-70 +
fcalEt * 0.6))
241 if (ntrk < (-20 +
fcalEt * 0.35))
243 if (ntrk > (100 +
fcalEt * 1.7))
247 throw std::runtime_error(std::string(
"puFCalVsNtracks for period of id ") +
255 float PreSamplerAmp_A = 0;
256 float PreSamplerAmp_C = 0;
258 for (
const auto module : *zdcModules) {
260 if (module->zdcType() != 0)
262 if (module->zdcSide() > 0)
263 PreSamplerAmp_C += accPreSampleAmp(*module);
264 if (module->zdcSide() < 0)
265 PreSamplerAmp_A += accPreSampleAmp(*module);
267 return {PreSamplerAmp_A, PreSamplerAmp_C};
282 const float peakPositionA = -56;
283 const float peakPositionC = -156;
284 const float peakWidthA = 51.8;
285 const float peakWidthC = 51.8;
293 if (presamplerA > (peakPositionA + sigma * peakWidthA) and
294 presamplerC > (peakPositionC + sigma * peakWidthC)) {
299 throw std::runtime_error(std::string(
"ZDC PreSampleAmp for period of id ") +
308 if (vertices->
size() <= 1) {
313 unsigned int nPrimary = 0;
314 unsigned int nSplit = 0;
315 unsigned int nOther = 0;
322 const double sigmaZSq = vtx_err(2, 2);
323 if (sigmaZSq >= 0.02)
333 ATH_MSG_DEBUG(
"n primary " << nPrimary <<
", nSplit " << nSplit
334 <<
", nOther " << nOther);
338 if (nSplit > 0 && nPrimary == 0) {
339 ATH_MSG_DEBUG(
"Returning true as all vertices classified as split");
343 return nPrimary == 1;
354 if (fcalEtTeV <= 1.0)
356 if (fcalEtTeV >= 4.0)
393 throw std::runtime_error(
394 std::string(
"zdcCutValue needed in FCal vs ZDC E for period of id ") +
411 uint32_t
run)
const {
413 throw std::runtime_error(std::to_string(
run) +
414 " not handled by selection tool");
430 throw std::runtime_error(std::to_string(
run) +
431 " 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
@ NoPUOOSingleVertexNominal
@ NoPUFCalVsNTrackNominal
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[])