Skip to content

Commit ab9de14

Browse files
Refactor includes and error handling in nucleiUtils.h
1 parent 10fdb68 commit ab9de14

1 file changed

Lines changed: 26 additions & 28 deletions

File tree

PWGLF/Utils/nucleiUtils.h

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,23 @@
1212
#ifndef PWGLF_UTILS_NUCLEIUTILS_H_
1313
#define PWGLF_UTILS_NUCLEIUTILS_H_
1414

15-
#include "Common/CCDB/EventSelectionParams.h"
1615
#include "Common/DataModel/Centrality.h"
16+
#include "Common/DataModel/EventSelection.h"
1717
#include "Common/DataModel/PIDResponseITS.h"
18+
#include "Common/DataModel/PIDResponseTOF.h"
19+
#include "Common/TableProducer/PID/pidTOFBase.h"
1820

19-
#include <CommonConstants/MathConstants.h>
20-
#include <CommonConstants/PhysicsConstants.h>
21-
#include <DetectorsBase/MatLayerCylSet.h>
22-
#include <Framework/Array2D.h>
23-
#include <Framework/HistogramRegistry.h>
24-
#include <Framework/HistogramSpec.h>
25-
#include <Framework/Logger.h>
26-
#include <MathUtils/BetheBlochAleph.h>
27-
#include <PID/PIDTOF.h>
28-
#include <ReconstructionDataFormats/PID.h>
21+
#include "DetectorsBase/GeometryManager.h"
22+
#include "DetectorsBase/Propagator.h"
23+
#include "Framework/HistogramRegistry.h"
24+
#include "Framework/HistogramSpec.h"
25+
#include "MathUtils/BetheBlochAleph.h"
2926

30-
#include <TH1.h>
31-
#include <TMCProcess.h>
32-
#include <TPDGCode.h>
33-
34-
#include <fmt/format.h>
35-
#include <sys/types.h>
36-
37-
#include <Rtypes.h>
27+
#include "TMCProcess.h"
3828

3929
#include <algorithm>
40-
#include <array>
41-
#include <cmath>
42-
#include <cstddef>
43-
#include <cstdint>
44-
#include <cstdlib>
4530
#include <memory>
46-
#include <stdexcept>
4731
#include <string>
48-
#include <string_view>
4932
#include <vector>
5033

5134
struct NucleusCandidate {
@@ -148,6 +131,21 @@ enum Flags {
148131
kIsSecondaryFromWeakDecay = BIT(11) /// the last 4 bits are reserved for the PID in tracking
149132
};
150133

134+
enum QcFlags {
135+
kQcHasReconstructedCollision = BIT(0),
136+
kQcPlaceholder0 = BIT(1), /// placeholdedrs
137+
kQcPlaceholder1 = BIT(2), /// placeholdedrs
138+
kQcPlaceholder2 = BIT(3), /// placeholdedrs
139+
kQcPlaceholder3 = BIT(4), /// placeholdedrs
140+
kQcHasTOF = BIT(5),
141+
kQcHasTRD = BIT(6),
142+
kQcIsAmbiguous = BIT(7), /// just a placeholder now
143+
kQcITSrof = BIT(8),
144+
kQcIsPhysicalPrimary = BIT(9), /// MC flags starting from the second half of the short
145+
kQcIsSecondaryFromMaterial = BIT(10),
146+
kQcIsSecondaryFromWeakDecay = BIT(11) /// the last 4 bits are reserved for the PID in tracking
147+
};
148+
151149
constexpr int getSpeciesFromPdg(int pdg)
152150
{
153151
switch (std::abs(pdg)) {
@@ -419,7 +417,7 @@ void createHistogramRegistryNucleus(o2::framework::HistogramRegistry& registry)
419417

420418
constexpr int index = iSpecies;
421419
if (!checkSpeciesValidity(index)) {
422-
std::runtime_error("species contains invalid nucleus index");
420+
throw std::runtime_error("species contains invalid nucleus index");
423421
}
424422

425423
registry.add(fmt::format("{}/hTrackSelections", cNames[index]).c_str(), (fmt::format("{} track selections;", cNames[index]) + std::string("Selection step; Counts")).c_str(), o2::framework::HistType::kTH1D, {{trackSelection::kNtrackSelections, -0.5f, static_cast<float>(trackSelection::kNtrackSelections) - 0.5f}});
@@ -457,7 +455,7 @@ class PidManager
457455
: mSpecies(species)
458456
{
459457
if (!checkSpeciesValidity(species)) {
460-
std::runtime_error("species contains invalid nucleus index");
458+
throw std::runtime_error("species contains invalid nucleus index");
461459
}
462460

463461
if (!tpcBetheBlochParams) {

0 commit comments

Comments
 (0)