ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
top::ParticleLevelPhotonObjectSelector::Options Struct Reference

#include <ParticleLevelPhotonObjectSelector.h>

Collaboration diagram for top::ParticleLevelPhotonObjectSelector::Options:

Public Member Functions

 Options (double ptMin=25.e3, double etaMax=2.5, const std::string &Origin="", const std::string &Isolation="")
 

Public Attributes

double pt_min
 
double eta_max
 
std::vector< MCTruthPartClassifier::ParticleOriginorigin
 
std::string isolationVar
 
float isolationCut
 

Detailed Description

Definition at line 33 of file ParticleLevelPhotonObjectSelector.h.

Constructor & Destructor Documentation

◆ Options()

top::ParticleLevelPhotonObjectSelector::Options::Options ( double  ptMin = 25.e3,
double  etaMax = 2.5,
const std::string &  Origin = "",
const std::string &  Isolation = "" 
)

Definition at line 14 of file ParticleLevelPhotonObjectSelector.cxx.

17  :
18  pt_min(ptMin),
19  eta_max(etaMax),
20  origin(),
21  isolationVar(""),
22  isolationCut() {
23  // =========================================================
24  // Parse the TruthOrigin Configuration Parameter.
25  if (Origin == "" || Origin == " " || Origin == "False" || Origin == "None") {
26  // Deliberately Empty
27  } else {
28  // This allows us to convert from string name to enum value.
29  MCTruthPartClassifier::ParticleDef def;
30 
31  // Tokenize at comma.
32  std::vector<std::string> tokens;
33  tokenize(Origin, tokens, ",");
34 
35  while (tokens.size()) {
36  const auto& token = tokens.back();
37 
38  auto it = std::find(def.sParticleOrigin.begin(),
39  def.sParticleOrigin.end(),
40  token);
41 
42  top::check(it != def.sParticleOrigin.end(),
43  "[ParticleLevelPhotonObjectSelector] Invalid particle origin '" + token + "'");
44 
45  origin.push_back(
47  std::distance(def.sParticleOrigin.begin(),
48  it)));
49 
50  tokens.pop_back();
51  }
52  }
53 
54  // =========================================================
55  // Parse the TruthIsolation Configuration Parameter
56  if (Isolation == "" || Isolation == " " || Isolation == "False" || Isolation == "None") {
57  isolationVar = "";
58  } else {
59  // Split at space, should be exactly 2 tokens.
60  std::vector<std::string> tokens;
61  tokenize(Isolation, tokens, " ");
62  top::check(tokens.size() == 2,
63  "[ParticleLevelPhotonObjectSelector] Invalid input for isolation parameter (expected 2 tokens).");
64 
65  isolationVar = tokens.at(0);
66  isolationCut = std::stof(tokens.at(1));
67  }
68  }

Member Data Documentation

◆ eta_max

double top::ParticleLevelPhotonObjectSelector::Options::eta_max

Definition at line 40 of file ParticleLevelPhotonObjectSelector.h.

◆ isolationCut

float top::ParticleLevelPhotonObjectSelector::Options::isolationCut

Definition at line 43 of file ParticleLevelPhotonObjectSelector.h.

◆ isolationVar

std::string top::ParticleLevelPhotonObjectSelector::Options::isolationVar

Definition at line 42 of file ParticleLevelPhotonObjectSelector.h.

◆ origin

std::vector<MCTruthPartClassifier::ParticleOrigin> top::ParticleLevelPhotonObjectSelector::Options::origin

Definition at line 41 of file ParticleLevelPhotonObjectSelector.h.

◆ pt_min

double top::ParticleLevelPhotonObjectSelector::Options::pt_min

Definition at line 39 of file ParticleLevelPhotonObjectSelector.h.


The documentation for this struct was generated from the following files:
top::ParticleLevelPhotonObjectSelector::Options::origin
std::vector< MCTruthPartClassifier::ParticleOrigin > origin
Definition: ParticleLevelPhotonObjectSelector.h:41
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
top::ParticleLevelPhotonObjectSelector::Options::isolationVar
std::string isolationVar
Definition: ParticleLevelPhotonObjectSelector.h:42
top::tokenize
void tokenize(const std::string &input, Container &output, const std::string &delimiters=" ", bool trim_empty=false)
Tokenize an input string using a set of delimiters.
Definition: Tokenize.h:24
skel.it
it
Definition: skel.GENtoEVGEN.py:423
top::ParticleLevelPhotonObjectSelector::Options::pt_min
double pt_min
Definition: ParticleLevelPhotonObjectSelector.h:39
xAOD::etaMax
etaMax
Definition: HIEventShape_v2.cxx:46
beamspotman.tokens
tokens
Definition: beamspotman.py:1284
ParticleOrigin
ParticleOrigin
Definition: TruthClasses.h:51
top::ParticleLevelPhotonObjectSelector::Options::isolationCut
float isolationCut
Definition: ParticleLevelPhotonObjectSelector.h:43
top::check
void check(bool thingToCheck, const std::string &usefulFailureMessage)
Print an error message and terminate if thingToCheck is false.
Definition: EventTools.cxx:15
top::ParticleLevelPhotonObjectSelector::Options::eta_max
double eta_max
Definition: ParticleLevelPhotonObjectSelector.h:40
PhysDESDM_SmpCaloId.ptMin
ptMin
Definition: PhysDESDM_SmpCaloId.py:90
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54