ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
SimpleHypoJetVectorGenerator Class Reference

#include <SimpleHypoJetVectorGenerator.h>

Inheritance diagram for SimpleHypoJetVectorGenerator:
Collaboration diagram for SimpleHypoJetVectorGenerator:

Public Member Functions

 SimpleHypoJetVectorGenerator (const std::string &type, const std::string &name, const IInterface *parent)
 
 ~SimpleHypoJetVectorGenerator ()
 
virtual StatusCode initialize () override
 
virtual HypoJetVector get () override
 
virtual std::string toString () const override
 

Private Attributes

Gaudi::Property< std::vector< double > > m_es {this, "ets", {}, "jet E values"}
 
Gaudi::Property< std::vector< double > > m_etas {this, "etas", {}, "jet eta values"}
 
Gaudi::Property< int > m_nbkgd {this, "n_bkgd", 0, "No of background jets to generate "}
 
Gaudi::Property< double > m_bkgd_etmax {this, "bkgd_etmax", 0., "Max Et background jets"}
 
Gaudi::Property< double > m_bkgd_etamax {this, "bkgd_etamax", 5., "Lower limit Eta range background "}
 
Gaudi::Property< bool > m_useEtaEtNotEtaE {this, "useEtaEtNotEtaE", true, "e values or et values "}
 
std::default_random_engine m_shuffle_re
 

Detailed Description

Definition at line 13 of file SimpleHypoJetVectorGenerator.h.

Constructor & Destructor Documentation

◆ SimpleHypoJetVectorGenerator()

SimpleHypoJetVectorGenerator::SimpleHypoJetVectorGenerator ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 17 of file SimpleHypoJetVectorGenerator.cxx.

19  :
20  base_class(type, name, parent){
21 
22 }

◆ ~SimpleHypoJetVectorGenerator()

SimpleHypoJetVectorGenerator::~SimpleHypoJetVectorGenerator ( )
inline

Definition at line 22 of file SimpleHypoJetVectorGenerator.h.

22 {}

Member Function Documentation

◆ get()

HypoJetVector SimpleHypoJetVectorGenerator::get ( )
overridevirtual

Definition at line 51 of file SimpleHypoJetVectorGenerator.cxx.

51  {
52 
53  auto factory = std::unique_ptr<ITLorentzVectorFactory>(nullptr);
54  if (m_useEtaEtNotEtaE){
55  factory.reset(new TLorentzVectorFactory());
56  } else {
57  factory.reset(new TLorentzVectorFactoryEtaE());
58  }
59 
61 
62  for(std::size_t i = 0; i < m_es.size(); ++i){
63  const auto& eta = m_etas[i];
64  const auto& et = m_es[i];
65  auto tlv = factory->make(eta, et);
66  result.push_back(std::shared_ptr<const HypoJet::IJet>(new TLorentzVectorAsIJet(tlv)));
67  }
68 
69  if(m_nbkgd){
70  std::default_random_engine generator;
71  std::uniform_real_distribution<double> eta_distribution(-m_bkgd_etamax,
73 
74  std::uniform_real_distribution<double> en_distribution(5.,
75  m_bkgd_etmax);
76 
77 
78 
79  for(int i = 0; i < m_nbkgd; ++i){
80  const auto& eta = eta_distribution(generator);
81  const auto& en = en_distribution(generator);
82  // depending on the factory, en is e or et
83  auto tlv = factory->make(eta, en);
84  result.push_back(std::shared_ptr<const HypoJet::IJet>(new TLorentzVectorAsIJet(tlv)));
85  }
86  }
87 
88  std::shuffle(result.begin(), result.end(), m_shuffle_re);
89  return result;
90 }

◆ initialize()

StatusCode SimpleHypoJetVectorGenerator::initialize ( )
overridevirtual

Definition at line 26 of file SimpleHypoJetVectorGenerator.cxx.

26  {
27  if(m_es.size() != m_etas.size()){
28  ATH_MSG_ERROR("Config error: no of Et values != no of Eta values"
29  << m_es.size() << " " << m_etas.size());
30  return StatusCode::FAILURE;
31  }
32 
33  return StatusCode::SUCCESS;
34 
35 }

◆ toString()

std::string SimpleHypoJetVectorGenerator::toString ( ) const
overridevirtual

Definition at line 37 of file SimpleHypoJetVectorGenerator.cxx.

37  {
38  std::stringstream ss;
39  ss << name() <<":: e: ";
40  for(const auto& e : m_es){ss << e << ", ";}
41  ss << " eta: ";
42  for(const auto& e : m_etas){ss << e << ", ";}
43  ss<<" bkgd: "<< m_nbkgd << " max E" << m_bkgd_etmax << " max abs eta: "
44  << m_bkgd_etamax << '\n';
45 
46  return ss.str();
47 }

Member Data Documentation

◆ m_bkgd_etamax

Gaudi::Property<double> SimpleHypoJetVectorGenerator::m_bkgd_etamax {this, "bkgd_etamax", 5., "Lower limit Eta range background "}
private

Definition at line 45 of file SimpleHypoJetVectorGenerator.h.

◆ m_bkgd_etmax

Gaudi::Property<double> SimpleHypoJetVectorGenerator::m_bkgd_etmax {this, "bkgd_etmax", 0., "Max Et background jets"}
private

Definition at line 42 of file SimpleHypoJetVectorGenerator.h.

◆ m_es

Gaudi::Property<std::vector<double> > SimpleHypoJetVectorGenerator::m_es {this, "ets", {}, "jet E values"}
private

Definition at line 31 of file SimpleHypoJetVectorGenerator.h.

◆ m_etas

Gaudi::Property<std::vector<double> > SimpleHypoJetVectorGenerator::m_etas {this, "etas", {}, "jet eta values"}
private

Definition at line 34 of file SimpleHypoJetVectorGenerator.h.

◆ m_nbkgd

Gaudi::Property<int> SimpleHypoJetVectorGenerator::m_nbkgd {this, "n_bkgd", 0, "No of background jets to generate "}
private

Definition at line 39 of file SimpleHypoJetVectorGenerator.h.

◆ m_shuffle_re

std::default_random_engine SimpleHypoJetVectorGenerator::m_shuffle_re
private

Definition at line 51 of file SimpleHypoJetVectorGenerator.h.

◆ m_useEtaEtNotEtaE

Gaudi::Property<bool> SimpleHypoJetVectorGenerator::m_useEtaEtNotEtaE {this, "useEtaEtNotEtaE", true, "e values or et values "}
private

Definition at line 48 of file SimpleHypoJetVectorGenerator.h.


The documentation for this class was generated from the following files:
TLorentzVectorFactory
Definition: TLorentzVectorFactory.h:13
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
SimpleHypoJetVectorGenerator::m_es
Gaudi::Property< std::vector< double > > m_es
Definition: SimpleHypoJetVectorGenerator.h:31
std::shuffle
void shuffle(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, UniformRandom &g)
Specialization of shuffle for DataVector/List.
Definition: DVL_algorithms.h:863
et
Extra patterns decribing particle interation process.
get_generator_info.result
result
Definition: get_generator_info.py:21
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
SimpleHypoJetVectorGenerator::m_bkgd_etamax
Gaudi::Property< double > m_bkgd_etamax
Definition: SimpleHypoJetVectorGenerator.h:45
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SimpleHypoJetVectorGenerator::m_useEtaEtNotEtaE
Gaudi::Property< bool > m_useEtaEtNotEtaE
Definition: SimpleHypoJetVectorGenerator.h:48
lumiFormat.i
int i
Definition: lumiFormat.py:85
SimpleHypoJetVectorGenerator::m_bkgd_etmax
Gaudi::Property< double > m_bkgd_etmax
Definition: SimpleHypoJetVectorGenerator.h:42
SimpleHypoJetVectorGenerator::m_shuffle_re
std::default_random_engine m_shuffle_re
Definition: SimpleHypoJetVectorGenerator.h:51
test_pyathena.parent
parent
Definition: test_pyathena.py:15
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition: HypoJetDefs.h:27
SimpleHypoJetVectorGenerator::m_nbkgd
Gaudi::Property< int > m_nbkgd
Definition: SimpleHypoJetVectorGenerator.h:39
SimpleHypoJetVectorGenerator::m_etas
Gaudi::Property< std::vector< double > > m_etas
Definition: SimpleHypoJetVectorGenerator.h:34
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
PlotCalibFromCool.en
en
Definition: PlotCalibFromCool.py:399
TLorentzVectorAsIJet
Definition: TLorentzVectorAsIJet.h:12
mc.generator
generator
Configure Herwig7 These are the commands corresponding to what would go into the regular Herwig infil...
Definition: mc.MGH7_FxFx_H71-DEFAULT_test.py:18
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TLorentzVectorFactoryEtaE
Definition: TLorentzVectorFactoryEtaE.h:13