ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Trig::TrigBtagEmulationChain Class Reference

#include <TrigBtagEmulationChain.h>

Inheritance diagram for Trig::TrigBtagEmulationChain:
Collaboration diagram for Trig::TrigBtagEmulationChain:

Public Member Functions

 TrigBtagEmulationChain (const std::string &name, const std::vector< std::string > &definition)
 Constructors and Destructor. More...
 
virtual ~TrigBtagEmulationChain ()=default
 
const std::string & name () const
 Name. More...
 
const std::string & l1_requirement () const
 
const std::vector< std::string > & chainPartName () const
 
const std::vector< int > & jet_multiplicity () const
 
const std::vector< double > & jet_pt () const
 
const std::vector< double > & jet_eta_min () const
 
const std::vector< double > & jet_eta_max () const
 
const std::vector< double > & jvt () const
 
const std::vector< bool > & is_PFlow () const
 
const std::vector< std::string > & tagger () const
 
const std::vector< std::string > & jet_presel () const
 
const std::string & dijetmass () const
 
int shared_idx () const
 
bool msgLvl (const MSG::Level lvl) const
 Test the output level. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Private Member Functions

void parseChainDefinition (const std::vector< std::string > &definition)
 
void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

std::string m_name
 
std::string m_l1_requirement = ""
 
std::vector< std::string > m_chainPartName {}
 
std::vector< int > m_jet_multiplicity {}
 
std::vector< double > m_jet_pt {}
 
std::vector< double > m_jet_eta_min {}
 
std::vector< double > m_jet_eta_max {}
 
std::vector< double > m_jvt {}
 
std::vector< bool > m_is_PFlow {}
 
std::vector< std::string > m_tagger {}
 
std::vector< std::string > m_jet_presel {}
 
std::string m_dijetmass = ""
 
int m_shared_idx = 0
 
std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

Detailed Description

Definition at line 17 of file TrigBtagEmulationChain.h.

Constructor & Destructor Documentation

◆ TrigBtagEmulationChain()

Trig::TrigBtagEmulationChain::TrigBtagEmulationChain ( const std::string &  name,
const std::vector< std::string > &  definition 
)

Constructors and Destructor.

Definition at line 17 of file TrigBtagEmulationChain.cxx.

19  : AthMessaging("TrigBtagEmulationChain." + name),
20  m_name( name )
21 {
22  parseChainDefinition(definition);
23 }

◆ ~TrigBtagEmulationChain()

virtual Trig::TrigBtagEmulationChain::~TrigBtagEmulationChain ( )
virtualdefault

Member Function Documentation

◆ chainPartName()

const std::vector< std::string > & Trig::TrigBtagEmulationChain::chainPartName ( ) const
inline

Definition at line 61 of file TrigBtagEmulationChain.h.

61 { return m_chainPartName; }

◆ dijetmass()

const std::string & Trig::TrigBtagEmulationChain::dijetmass ( ) const
inline

Definition at line 70 of file TrigBtagEmulationChain.h.

70 { return m_dijetmass; }

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ is_PFlow()

const std::vector< bool > & Trig::TrigBtagEmulationChain::is_PFlow ( ) const
inline

Definition at line 67 of file TrigBtagEmulationChain.h.

67 { return m_is_PFlow; }

◆ jet_eta_max()

const std::vector< double > & Trig::TrigBtagEmulationChain::jet_eta_max ( ) const
inline

Definition at line 65 of file TrigBtagEmulationChain.h.

65 { return m_jet_eta_max; }

◆ jet_eta_min()

const std::vector< double > & Trig::TrigBtagEmulationChain::jet_eta_min ( ) const
inline

Definition at line 64 of file TrigBtagEmulationChain.h.

64 { return m_jet_eta_min; }

◆ jet_multiplicity()

const std::vector< int > & Trig::TrigBtagEmulationChain::jet_multiplicity ( ) const
inline

Definition at line 62 of file TrigBtagEmulationChain.h.

62 { return m_jet_multiplicity; }

◆ jet_presel()

const std::vector< std::string > & Trig::TrigBtagEmulationChain::jet_presel ( ) const
inline

Definition at line 69 of file TrigBtagEmulationChain.h.

69 { return m_jet_presel; }

◆ jet_pt()

const std::vector< double > & Trig::TrigBtagEmulationChain::jet_pt ( ) const
inline

Definition at line 63 of file TrigBtagEmulationChain.h.

63 { return m_jet_pt; }

◆ jvt()

const std::vector< double > & Trig::TrigBtagEmulationChain::jvt ( ) const
inline

Definition at line 66 of file TrigBtagEmulationChain.h.

66 { return m_jvt; }

◆ l1_requirement()

const std::string & Trig::TrigBtagEmulationChain::l1_requirement ( ) const
inline

Definition at line 60 of file TrigBtagEmulationChain.h.

60 { return m_l1_requirement; }

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 164 of file AthMessaging.h.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level  lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 179 of file AthMessaging.h.

180 { return msg() << lvl; }

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152 {
153  if (!m_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

◆ name()

const std::string & Trig::TrigBtagEmulationChain::name ( ) const
inline

Name.

Definition at line 59 of file TrigBtagEmulationChain.h.

59 { return m_name; }

◆ parseChainDefinition()

void Trig::TrigBtagEmulationChain::parseChainDefinition ( const std::vector< std::string > &  definition)
private

Definition at line 25 of file TrigBtagEmulationChain.cxx.

26 {
27  if (definition.size() == 0) {
28  ATH_MSG_ERROR( "Chain definition has not been provided" );
29  return;
30  }
31 
32  if (definition.size() == 1) {
33  ATH_MSG_ERROR( "Couldn't parse chain definition: " << definition[0] );
34  return;
35  }
36 
37  m_l1_requirement = definition[0].substr(7); // 7 -> strlen("L1item:")
38  ATH_MSG_DEBUG( name() << ":");
39  ATH_MSG_DEBUG( " - L1 item: " << m_l1_requirement);
40 
41  std::size_t n_def_size = definition.size();
42  m_chainPartName.reserve(n_def_size);
43  m_jet_multiplicity.reserve(n_def_size);
44  m_jet_pt.reserve(n_def_size);
45  m_jet_eta_min.reserve(n_def_size);
46  m_jet_eta_max.reserve(n_def_size);
47  m_jvt.reserve(n_def_size);
48  m_tagger.reserve(n_def_size);
49  m_is_PFlow.reserve(n_def_size);
50 
51  for(size_t chainPart_idx = 1; chainPart_idx < definition.size(); chainPart_idx++) {
52  // L1threshold:J20_multiplicity:1_threshold:45_etaRange:0eta290_tagger:bdl1r70_isPFlow:True
53  std::string chainPart = definition[chainPart_idx];
54  ATH_MSG_DEBUG( " > " << chainPart);
55 
56  std::string L1threshold = CHAINPART_VARIABLE(chainPart, "L1threshold");
57  int jet_multiplicity = std::stoi(CHAINPART_VARIABLE(chainPart, "multiplicity"));
58  std::string chainPartName = CHAINPART_VARIABLE(chainPart, "name");
59  double jet_pt = static_cast<double>( std::stoi(CHAINPART_VARIABLE(chainPart, "threshold")) * 1e3 );
60  std::string etaRange = CHAINPART_VARIABLE(chainPart, "etaRange");
61  double jvt = std::stod(CHAINPART_VARIABLE(chainPart, "jvt")) / 1e2;
62  std::string tagger = (CHAINPART_VARIABLE(chainPart, "tagger")).size() ? (CHAINPART_VARIABLE(chainPart, "tagger")).substr(1) : "";
63  std::string jetpresel = (CHAINPART_VARIABLE(chainPart, "jetpresel")).size() ? (CHAINPART_VARIABLE(chainPart, "jetpresel")).substr(6) : "";
64  std::string dijetmass = (CHAINPART_VARIABLE(chainPart, "dijetmass")).size() ? CHAINPART_VARIABLE(chainPart, "dijetmass") : "";
65  bool is_PFlow = (CHAINPART_VARIABLE(chainPart, "isPFlow") == "True");
66  bool is_shared = (CHAINPART_VARIABLE(chainPart, "isShared") == "True");
67 
68  double jet_eta_min = static_cast<double>( std::stoi(etaRange) / 100. );
69  double jet_eta_max = static_cast<double>( std::stoi(etaRange.substr(etaRange.find("eta") + 3)) / 100. ); // 3 -> strlen("eta")
70 
71  // jet preselection parsing
72  if(jetpresel == "el") { // nopresel (got cut to "el" by substr(6))
73  jetpresel = "";
74  }
75  else {
76  auto presel_separator = jetpresel.find("XX");
77  while(presel_separator != std::string::npos) {
78  m_jet_presel.push_back(jetpresel.substr(0, presel_separator));
79  jetpresel = jetpresel.substr(presel_separator + 2); // 2 -> strlen("XX")
80  presel_separator = jetpresel.find("XX");
81  }
82  m_jet_presel.push_back(jetpresel);
83  }
84 
85 
86  ATH_MSG_DEBUG( " - L1 threshold: " << L1threshold);
87  ATH_MSG_DEBUG( " - jet multiplicity: " << jet_multiplicity);
88  ATH_MSG_DEBUG( " - jet threshold: " << jet_pt);
89  ATH_MSG_DEBUG( " - eta range: [" << jet_eta_min << "," << jet_eta_max << "]");
90  ATH_MSG_DEBUG( " - JVT cut: " << jvt);
91  ATH_MSG_DEBUG( " - BTagging algorithm: " << tagger);
92  ATH_MSG_DEBUG( " - Jet preselection: " << m_jet_presel);
93  ATH_MSG_DEBUG( " - Dijet Mass: " << dijetmass);
94  ATH_MSG_DEBUG( " - is PFlow: " << (is_PFlow ? "YES":"NO"));
95 
96  m_chainPartName.push_back(chainPartName);
98  m_jet_pt.push_back(jet_pt);
99  m_jet_eta_min.push_back(jet_eta_min);
100  m_jet_eta_max.push_back(jet_eta_max);
101  m_jvt.push_back(jvt);
102  m_tagger.push_back(tagger);
103  m_is_PFlow.push_back(is_PFlow);
104 
105  if(is_shared) {
106  m_shared_idx = chainPart_idx;
107  }
108 
109  if(m_dijetmass.empty() || dijetmass != "None") {
111  }
112  }
113 
114  ATH_MSG_DEBUG( " ^^^ DijetMass: " << m_dijetmass);
115  ATH_MSG_DEBUG( " ^^^ is SHARED: " << (m_shared_idx ? "YES":"NO"));
116 }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level  lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

◆ shared_idx()

int Trig::TrigBtagEmulationChain::shared_idx ( ) const
inline

Definition at line 71 of file TrigBtagEmulationChain.h.

71 { return m_shared_idx; }

◆ tagger()

const std::vector< std::string > & Trig::TrigBtagEmulationChain::tagger ( ) const
inline

Definition at line 68 of file TrigBtagEmulationChain.h.

68 { return m_tagger; }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_chainPartName

std::vector<std::string> Trig::TrigBtagEmulationChain::m_chainPartName {}
private

Definition at line 46 of file TrigBtagEmulationChain.h.

◆ m_dijetmass

std::string Trig::TrigBtagEmulationChain::m_dijetmass = ""
private

Definition at line 55 of file TrigBtagEmulationChain.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_is_PFlow

std::vector<bool> Trig::TrigBtagEmulationChain::m_is_PFlow {}
private

Definition at line 52 of file TrigBtagEmulationChain.h.

◆ m_jet_eta_max

std::vector<double> Trig::TrigBtagEmulationChain::m_jet_eta_max {}
private

Definition at line 50 of file TrigBtagEmulationChain.h.

◆ m_jet_eta_min

std::vector<double> Trig::TrigBtagEmulationChain::m_jet_eta_min {}
private

Definition at line 49 of file TrigBtagEmulationChain.h.

◆ m_jet_multiplicity

std::vector<int> Trig::TrigBtagEmulationChain::m_jet_multiplicity {}
private

Definition at line 47 of file TrigBtagEmulationChain.h.

◆ m_jet_presel

std::vector<std::string> Trig::TrigBtagEmulationChain::m_jet_presel {}
private

Definition at line 54 of file TrigBtagEmulationChain.h.

◆ m_jet_pt

std::vector<double> Trig::TrigBtagEmulationChain::m_jet_pt {}
private

Definition at line 48 of file TrigBtagEmulationChain.h.

◆ m_jvt

std::vector<double> Trig::TrigBtagEmulationChain::m_jvt {}
private

Definition at line 51 of file TrigBtagEmulationChain.h.

◆ m_l1_requirement

std::string Trig::TrigBtagEmulationChain::m_l1_requirement = ""
private

Definition at line 45 of file TrigBtagEmulationChain.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_name

std::string Trig::TrigBtagEmulationChain::m_name
private

Definition at line 44 of file TrigBtagEmulationChain.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_shared_idx

int Trig::TrigBtagEmulationChain::m_shared_idx = 0
private

Definition at line 56 of file TrigBtagEmulationChain.h.

◆ m_tagger

std::vector<std::string> Trig::TrigBtagEmulationChain::m_tagger {}
private

Definition at line 53 of file TrigBtagEmulationChain.h.


The documentation for this class was generated from the following files:
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
Trig::TrigBtagEmulationChain::jet_eta_min
const std::vector< double > & jet_eta_min() const
Definition: TrigBtagEmulationChain.h:64
Trig::TrigBtagEmulationChain::parseChainDefinition
void parseChainDefinition(const std::vector< std::string > &definition)
Definition: TrigBtagEmulationChain.cxx:25
Trig::TrigBtagEmulationChain::m_tagger
std::vector< std::string > m_tagger
Definition: TrigBtagEmulationChain.h:53
Trig::TrigBtagEmulationChain::m_jet_presel
std::vector< std::string > m_jet_presel
Definition: TrigBtagEmulationChain.h:54
Trig::TrigBtagEmulationChain::m_shared_idx
int m_shared_idx
Definition: TrigBtagEmulationChain.h:56
LArCellBinning.etaRange
etaRange
Filling Eta range.
Definition: LArCellBinning.py:128
Trig::TrigBtagEmulationChain::jet_multiplicity
const std::vector< int > & jet_multiplicity() const
Definition: TrigBtagEmulationChain.h:62
Trig::TrigBtagEmulationChain::m_name
std::string m_name
Definition: TrigBtagEmulationChain.h:44
Trig::TrigBtagEmulationChain::is_PFlow
const std::vector< bool > & is_PFlow() const
Definition: TrigBtagEmulationChain.h:67
Trig::TrigBtagEmulationChain::m_jet_pt
std::vector< double > m_jet_pt
Definition: TrigBtagEmulationChain.h:48
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
CHAINPART_VARIABLE
#define CHAINPART_VARIABLE(cp, v)
Definition: TrigBtagEmulationChain.cxx:11
AthMessaging::AthMessaging
AthMessaging()
Default constructor:
Trig::TrigBtagEmulationChain::m_is_PFlow
std::vector< bool > m_is_PFlow
Definition: TrigBtagEmulationChain.h:52
Trig::TrigBtagEmulationChain::name
const std::string & name() const
Name.
Definition: TrigBtagEmulationChain.h:59
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
Trig::TrigBtagEmulationChain::dijetmass
const std::string & dijetmass() const
Definition: TrigBtagEmulationChain.h:70
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
Trig::TrigBtagEmulationChain::jvt
const std::vector< double > & jvt() const
Definition: TrigBtagEmulationChain.h:66
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trig::TrigBtagEmulationChain::jet_pt
const std::vector< double > & jet_pt() const
Definition: TrigBtagEmulationChain.h:63
Trig::TrigBtagEmulationChain::tagger
const std::vector< std::string > & tagger() const
Definition: TrigBtagEmulationChain.h:68
Trig::TrigBtagEmulationChain::chainPartName
const std::vector< std::string > & chainPartName() const
Definition: TrigBtagEmulationChain.h:61
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
Trig::TrigBtagEmulationChain::m_chainPartName
std::vector< std::string > m_chainPartName
Definition: TrigBtagEmulationChain.h:46
Trig::TrigBtagEmulationChain::m_dijetmass
std::string m_dijetmass
Definition: TrigBtagEmulationChain.h:55
Trig::TrigBtagEmulationChain::m_l1_requirement
std::string m_l1_requirement
Definition: TrigBtagEmulationChain.h:45
Trig::TrigBtagEmulationChain::m_jvt
std::vector< double > m_jvt
Definition: TrigBtagEmulationChain.h:51
egammaEnergyPositionAllSamples::e2
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
Trig::TrigBtagEmulationChain::m_jet_multiplicity
std::vector< int > m_jet_multiplicity
Definition: TrigBtagEmulationChain.h:47
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
Trig::TrigBtagEmulationChain::jet_eta_max
const std::vector< double > & jet_eta_max() const
Definition: TrigBtagEmulationChain.h:65
AthMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Definition: AthMessaging.h:132
Trig::TrigBtagEmulationChain::m_jet_eta_max
std::vector< double > m_jet_eta_max
Definition: TrigBtagEmulationChain.h:50
Trig::TrigBtagEmulationChain::m_jet_eta_min
std::vector< double > m_jet_eta_min
Definition: TrigBtagEmulationChain.h:49