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);
208 if(trk->pt()<min_pt_cut)
continue;
220 double min_pt_cut=-1;
226 nTrk(period, tracks, vertices,min_pt_cut), variation);
238 if (ntrk < (-80 +
fcalEt * 0.6))
240 if (ntrk < (-30 +
fcalEt * 0.4))
242 if (ntrk > (100 +
fcalEt * 1.7))
246 if (ntrk < (-70 +
fcalEt * 0.6))
248 if (ntrk < (-20 +
fcalEt * 0.35))
250 if (ntrk > (100 +
fcalEt * 1.7))
254 throw std::runtime_error(std::string(
"puFCalVsNtracks for period of id ") +
262 float PreSamplerAmp_A = 0;
263 float PreSamplerAmp_C = 0;
265 for (
const auto module : *zdcModules) {
267 if (module->zdcType() != 0)
269 if (module->zdcSide() > 0)
270 PreSamplerAmp_C += accPreSampleAmp(*module);
271 if (module->zdcSide() < 0)
272 PreSamplerAmp_A += accPreSampleAmp(*module);
274 return {PreSamplerAmp_A, PreSamplerAmp_C};
289 const float peakPositionA = -56;
290 const float peakPositionC = -156;
291 const float peakWidthA = 51.8;
292 const float peakWidthC = 51.8;
300 if (presamplerA > (peakPositionA + sigma * peakWidthA) and
301 presamplerC > (peakPositionC + sigma * peakWidthC)) {
306 throw std::runtime_error(std::string(
"ZDC PreSampleAmp for period of id ") +
315 if (vertices->
size() <= 1) {
320 unsigned int nPrimary = 0;
321 unsigned int nSplit = 0;
324 int num_vtx_tot=vertices->
size()-1;
328 if(vtx_counter>num_vtx_tot)
break;
332 const double sigmaZSq = vtx_err(2, 2);
333 if (sigmaZSq >= 0.02)
338 ATH_MSG_DEBUG(
"nPrimary " << nPrimary <<
", nSplit " << nSplit);
342 if (nSplit > 0 && nPrimary == 0) {
343 ATH_MSG_DEBUG(
"Returning true as all vertices classified as split");
347 return nPrimary == 1;
358 if (fcalEtTeV <= 1.0)
360 if (fcalEtTeV >= 4.0)
397 throw std::runtime_error(
398 std::string(
"zdcCutValue needed in FCal vs ZDC E for period of id ") +
415 uint32_t
run)
const {
417 throw std::runtime_error(std::to_string(
run) +
418 " not handled by selection tool");
434 throw std::runtime_error(std::to_string(
run) +
435 " 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[])