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

#include <RandomSignalHypoJetVectorGenerator.h>

Inheritance diagram for RandomSignalHypoJetVectorGenerator:
Collaboration diagram for RandomSignalHypoJetVectorGenerator:

Public Member Functions

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

Private Attributes

Gaudi::Property< int > m_n_sig_lo {this, "n_sig_lo", 2, "Lower bound nsig jets to generate "}
 
Gaudi::Property< int > m_n_sig_hi {this, "n_sig_hi", 6, "Upper bound nsig jets to generate "}
 
Gaudi::Property< double > m_e_sig_lo {this, "e_sig_lo", 50., "Lower bound e sig to generate "}
 
Gaudi::Property< double > m_e_sig_hi {this, "e_sig_hi", 100., "Upper bound e sig to generate "}
 
Gaudi::Property< double > m_eta_sig_hi {this, "eta_sig_hi", 3.2, "Upper bound eta sig to generate "}
 
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
 
RandUint m_randNSig
 
RandDouble m_randEtaSig
 
RandDouble m_randEnSig
 
RandDouble m_randEtaBkd
 
RandDouble m_randEnBkd
 
RandUint m_flip
 

Detailed Description

Definition at line 15 of file RandomSignalHypoJetVectorGenerator.h.

Constructor & Destructor Documentation

◆ RandomSignalHypoJetVectorGenerator()

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

Definition at line 16 of file RandomSignalEventGenerator.cxx.

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

◆ ~RandomSignalHypoJetVectorGenerator()

RandomSignalHypoJetVectorGenerator::~RandomSignalHypoJetVectorGenerator ( )
inline

Definition at line 24 of file RandomSignalHypoJetVectorGenerator.h.

24 {}

Member Function Documentation

◆ get()

HypoJetVector RandomSignalHypoJetVectorGenerator::get ( )
overridevirtual

Definition at line 63 of file RandomSignalEventGenerator.cxx.

63  {
64 
65  auto factory = std::unique_ptr<ITLorentzVectorFactory>(nullptr);
66  if (m_useEtaEtNotEtaE){
67  factory.reset(new TLorentzVectorFactory());
68  } else {
69  factory.reset(new TLorentzVectorFactoryEtaE());
70  }
71 
73 
74  auto nj = m_randNSig();
75  for(std::size_t ij = 0; ij < nj; ++ij){
76  const auto& eta = m_randEtaSig();
77  const auto& en = m_randEnSig();
78  // depending on the factory, en is e or et
79  auto tlv = factory->make(eta, en);
80  if(m_flip()){
81  tlv.SetZ(-tlv.Z()); // randomly flip the sign of the +vly generated tlv.
82  }
83  result.push_back(std::shared_ptr<const HypoJet::IJet>(new TLorentzVectorAsIJet(tlv)));
84  }
85 
86  if(m_nbkgd){
87  for(int i = 0; i < m_nbkgd; ++i){
88  const auto& eta = m_randEtaBkd();
89  const auto& en = m_randEnBkd();
90  // depending on the factory, en is e or et
91  auto tlv = factory->make(eta, en);
92  if(m_flip()){
93  tlv.SetZ(-tlv.Z()); // randomly flip the sign of the +vly generated tlv.
94  }
95  result.push_back(std::shared_ptr<const HypoJet::IJet>(new TLorentzVectorAsIJet(tlv)));
96  }
97  }
98 
99  std::shuffle(result.begin(), result.end(), m_shuffle_re);
100  return result;
101 }

◆ initialize()

StatusCode RandomSignalHypoJetVectorGenerator::initialize ( )
overridevirtual

Definition at line 25 of file RandomSignalEventGenerator.cxx.

25  {
26  if(m_n_sig_lo >= m_n_sig_hi ||
28  ){
29  ATH_MSG_ERROR("Config error: lower signal limit exceeds uper limit");
30  return StatusCode::FAILURE;
31  }
32 
34  m_flip = RandUint(0, 1);
35 
38 
41 
42  return StatusCode::SUCCESS;
43 }

◆ toString()

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

Definition at line 45 of file RandomSignalEventGenerator.cxx.

45  {
46  std::stringstream ss;
47  ss << name() <<":: "
48  << m_n_sig_lo << " "
49  << m_n_sig_hi << " "
50  << m_e_sig_lo << " "
51  << m_e_sig_hi << " "
52  << m_eta_sig_hi << " ";
53 
54  ss << m_nbkgd << " "
55  << m_bkgd_etmax << " "
56  << m_bkgd_etamax << '\n';
57 
58  return ss.str();
59 }

Member Data Documentation

◆ m_bkgd_etamax

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

Definition at line 59 of file RandomSignalHypoJetVectorGenerator.h.

◆ m_bkgd_etmax

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

Definition at line 56 of file RandomSignalHypoJetVectorGenerator.h.

◆ m_e_sig_hi

Gaudi::Property<double> RandomSignalHypoJetVectorGenerator::m_e_sig_hi {this, "e_sig_hi", 100., "Upper bound e sig to generate "}
private

Definition at line 45 of file RandomSignalHypoJetVectorGenerator.h.

◆ m_e_sig_lo

Gaudi::Property<double> RandomSignalHypoJetVectorGenerator::m_e_sig_lo {this, "e_sig_lo", 50., "Lower bound e sig to generate "}
private

Definition at line 41 of file RandomSignalHypoJetVectorGenerator.h.

◆ m_eta_sig_hi

Gaudi::Property<double> RandomSignalHypoJetVectorGenerator::m_eta_sig_hi {this, "eta_sig_hi", 3.2, "Upper bound eta sig to generate "}
private

Definition at line 49 of file RandomSignalHypoJetVectorGenerator.h.

◆ m_flip

RandUint RandomSignalHypoJetVectorGenerator::m_flip
private

Definition at line 72 of file RandomSignalHypoJetVectorGenerator.h.

◆ m_n_sig_hi

Gaudi::Property<int> RandomSignalHypoJetVectorGenerator::m_n_sig_hi {this, "n_sig_hi", 6, "Upper bound nsig jets to generate "}
private

Definition at line 37 of file RandomSignalHypoJetVectorGenerator.h.

◆ m_n_sig_lo

Gaudi::Property<int> RandomSignalHypoJetVectorGenerator::m_n_sig_lo {this, "n_sig_lo", 2, "Lower bound nsig jets to generate "}
private

Definition at line 33 of file RandomSignalHypoJetVectorGenerator.h.

◆ m_nbkgd

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

Definition at line 53 of file RandomSignalHypoJetVectorGenerator.h.

◆ m_randEnBkd

RandDouble RandomSignalHypoJetVectorGenerator::m_randEnBkd
private

Definition at line 70 of file RandomSignalHypoJetVectorGenerator.h.

◆ m_randEnSig

RandDouble RandomSignalHypoJetVectorGenerator::m_randEnSig
private

Definition at line 68 of file RandomSignalHypoJetVectorGenerator.h.

◆ m_randEtaBkd

RandDouble RandomSignalHypoJetVectorGenerator::m_randEtaBkd
private

Definition at line 69 of file RandomSignalHypoJetVectorGenerator.h.

◆ m_randEtaSig

RandDouble RandomSignalHypoJetVectorGenerator::m_randEtaSig
private

Definition at line 67 of file RandomSignalHypoJetVectorGenerator.h.

◆ m_randNSig

RandUint RandomSignalHypoJetVectorGenerator::m_randNSig
private

Definition at line 66 of file RandomSignalHypoJetVectorGenerator.h.

◆ m_shuffle_re

std::default_random_engine RandomSignalHypoJetVectorGenerator::m_shuffle_re
private

Definition at line 65 of file RandomSignalHypoJetVectorGenerator.h.

◆ m_useEtaEtNotEtaE

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

Definition at line 62 of file RandomSignalHypoJetVectorGenerator.h.


The documentation for this class was generated from the following files:
TLorentzVectorFactory
Definition: TLorentzVectorFactory.h:13
RandomSignalHypoJetVectorGenerator::m_nbkgd
Gaudi::Property< int > m_nbkgd
Definition: RandomSignalHypoJetVectorGenerator.h:53
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
RandomSignalHypoJetVectorGenerator::m_useEtaEtNotEtaE
Gaudi::Property< bool > m_useEtaEtNotEtaE
Definition: RandomSignalHypoJetVectorGenerator.h:62
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
RandomSignalHypoJetVectorGenerator::m_eta_sig_hi
Gaudi::Property< double > m_eta_sig_hi
Definition: RandomSignalHypoJetVectorGenerator.h:49
RandomSignalHypoJetVectorGenerator::m_shuffle_re
std::default_random_engine m_shuffle_re
Definition: RandomSignalHypoJetVectorGenerator.h:65
RandDouble
Definition: RandDouble.h:8
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
RandUint
Definition: RandUint.h:8
RandomSignalHypoJetVectorGenerator::m_n_sig_lo
Gaudi::Property< int > m_n_sig_lo
Definition: RandomSignalHypoJetVectorGenerator.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
RandomSignalHypoJetVectorGenerator::m_e_sig_lo
Gaudi::Property< double > m_e_sig_lo
Definition: RandomSignalHypoJetVectorGenerator.h:41
RandomSignalHypoJetVectorGenerator::m_randEnSig
RandDouble m_randEnSig
Definition: RandomSignalHypoJetVectorGenerator.h:68
test_pyathena.parent
parent
Definition: test_pyathena.py:15
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition: HypoJetDefs.h:27
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
RandomSignalHypoJetVectorGenerator::m_n_sig_hi
Gaudi::Property< int > m_n_sig_hi
Definition: RandomSignalHypoJetVectorGenerator.h:37
PlotCalibFromCool.en
en
Definition: PlotCalibFromCool.py:399
TLorentzVectorAsIJet
Definition: TLorentzVectorAsIJet.h:12
RandomSignalHypoJetVectorGenerator::m_flip
RandUint m_flip
Definition: RandomSignalHypoJetVectorGenerator.h:72
RandomSignalHypoJetVectorGenerator::m_bkgd_etmax
Gaudi::Property< double > m_bkgd_etmax
Definition: RandomSignalHypoJetVectorGenerator.h:56
RandomSignalHypoJetVectorGenerator::m_randEtaBkd
RandDouble m_randEtaBkd
Definition: RandomSignalHypoJetVectorGenerator.h:69
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TLorentzVectorFactoryEtaE
Definition: TLorentzVectorFactoryEtaE.h:13
RandomSignalHypoJetVectorGenerator::m_randEtaSig
RandDouble m_randEtaSig
Definition: RandomSignalHypoJetVectorGenerator.h:67
RandomSignalHypoJetVectorGenerator::m_bkgd_etamax
Gaudi::Property< double > m_bkgd_etamax
Definition: RandomSignalHypoJetVectorGenerator.h:59
RandomSignalHypoJetVectorGenerator::m_randEnBkd
RandDouble m_randEnBkd
Definition: RandomSignalHypoJetVectorGenerator.h:70
RandomSignalHypoJetVectorGenerator::m_randNSig
RandUint m_randNSig
Definition: RandomSignalHypoJetVectorGenerator.h:66
RandomSignalHypoJetVectorGenerator::m_e_sig_hi
Gaudi::Property< double > m_e_sig_hi
Definition: RandomSignalHypoJetVectorGenerator.h:45