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

#include <Volatility.h>

Inheritance diagram for JetSubStructureUtils::Volatility:
Collaboration diagram for JetSubStructureUtils::Volatility:

Public Member Functions

 Volatility (unsigned int num_iterations, double zcut, double dcut_fctr, double exp_min, double exp_max, double rigidity, double truncation_fctr=0.0)
 
virtual double result (const fastjet::PseudoJet &jet) const
 
void setSeed (unsigned int seed)
 
virtual TOut result (const xAOD::Jet &jet) const
 
virtual double result (const xAOD::Jet &jet) const
 

Private Attributes

unsigned int m_num_iterations
 
double m_zcut
 
double m_dcut_fctr
 
double m_exp_min
 
double m_exp_max
 
double m_rigidity
 
double m_truncation_fctr
 
int m_seed
 

Detailed Description

Definition at line 12 of file Volatility.h.

Constructor & Destructor Documentation

◆ Volatility()

JetSubStructureUtils::Volatility::Volatility ( unsigned int  num_iterations,
double  zcut,
double  dcut_fctr,
double  exp_min,
double  exp_max,
double  rigidity,
double  truncation_fctr = 0.0 
)
inline

Definition at line 14 of file Volatility.h.

15  :
16  m_num_iterations(num_iterations),
17  m_zcut(zcut), m_dcut_fctr(dcut_fctr), m_exp_min(exp_min), m_exp_max(exp_max),
18  m_rigidity(rigidity), m_truncation_fctr(truncation_fctr),
19  m_seed(-1)
20  {};

Member Function Documentation

◆ result() [1/3]

double Volatility::result ( const fastjet::PseudoJet &  jet) const
virtual

Definition at line 11 of file Volatility.cxx.

12 {
13  vector<fastjet::PseudoJet> constit_pseudojets = jet.constituents();
14  if(constit_pseudojets.empty()) return -999;
15 
17  fastjet::JetDefinition qjets_def(&qjets_plugin);
18 
19  unsigned int n = 0;
20  double sum_mass = 0, sum_mass2 = 0;
21  for(unsigned int i=0; i < m_num_iterations; i++) {
22  if(m_seed != -1) { // Seed needs to be different for each run of Qjets, but this has consistent running
23  qjets_plugin.SetRandSeed(m_seed + i);
24  }
25  fastjet::ClusterSequence clust_seq(constit_pseudojets, qjets_def);
26  vector<fastjet::PseudoJet> qjets = fastjet::sorted_by_pt(clust_seq.inclusive_jets());
27 
28  if(qjets.empty()) {
29  //cout << "0 jets" << endl;
30  continue;
31  }
32 
33  n++;
34  sum_mass += qjets[0].m();
35  sum_mass2 += qjets[0].m2();
36  }
37 
38  if(n == 0) {
39  // Prevent div-0
40  return -999;
41  }
42 
43  double rms_dev2 = sum_mass2/n - pow(sum_mass/n, 2.0);
44  if(rms_dev2 < 0) {
45  // To prevent NaN. Small negative numbers can happen due to floating point inaccuracy
46  // when all qjets are same -> i.e. 0 rms
47  rms_dev2 = 0;
48  }
49 
50  double rms_dev = sqrt(rms_dev2);
51  double volatility = rms_dev / (sum_mass/n);
52 
53  return volatility;
54 }

◆ result() [2/3]

virtual TOut JetSubStructureUtils::SubstructureCalculator< TOut >::result
inline

Definition at line 25 of file SubstructureCalculator.h.

25  {
26  // PS 4/18 master developent
27  // std::vector<fastjet::PseudoJet> constit_pseudojets =
28  // jet::JetConstituentFiller::constituentPseudoJets(jet);
29 
30  std::vector<fastjet::PseudoJet> constit_pseudojets;
31  std::transform(jet.getConstituents().begin(),
32  jet.getConstituents().end(),
33  std::back_inserter(constit_pseudojets),
34  [](const auto& c){
35  const xAOD::IParticle* ip = c->rawConstituent();
36  return
37  // fastjet::PseudoJet((c->rawConstituent())->p4());
38  fastjet::PseudoJet(ip->p4());
39  });
40 
41  fastjet::PseudoJet pjet = fastjet::join(constit_pseudojets);
42 
43  return result(pjet);
44  }

◆ result() [3/3]

virtual double JetSubStructureUtils::SubstructureCalculator< double >::result ( const xAOD::Jet jet) const
inlinevirtualinherited

Definition at line 25 of file SubstructureCalculator.h.

25  {
26  // PS 4/18 master developent
27  // std::vector<fastjet::PseudoJet> constit_pseudojets =
28  // jet::JetConstituentFiller::constituentPseudoJets(jet);
29 
30  std::vector<fastjet::PseudoJet> constit_pseudojets;
31  std::transform(jet.getConstituents().begin(),
32  jet.getConstituents().end(),
33  std::back_inserter(constit_pseudojets),
34  [](const auto& c){
35  const xAOD::IParticle* ip = c->rawConstituent();
36  return
37  // fastjet::PseudoJet((c->rawConstituent())->p4());
38  fastjet::PseudoJet(ip->p4());
39  });
40 
41  fastjet::PseudoJet pjet = fastjet::join(constit_pseudojets);
42 
43  return result(pjet);
44  }

◆ setSeed()

void Volatility::setSeed ( unsigned int  seed)

Definition at line 56 of file Volatility.cxx.

57 {
58  m_seed = seed;
59 }

Member Data Documentation

◆ m_dcut_fctr

double JetSubStructureUtils::Volatility::m_dcut_fctr
private

Definition at line 29 of file Volatility.h.

◆ m_exp_max

double JetSubStructureUtils::Volatility::m_exp_max
private

Definition at line 29 of file Volatility.h.

◆ m_exp_min

double JetSubStructureUtils::Volatility::m_exp_min
private

Definition at line 29 of file Volatility.h.

◆ m_num_iterations

unsigned int JetSubStructureUtils::Volatility::m_num_iterations
private

Definition at line 28 of file Volatility.h.

◆ m_rigidity

double JetSubStructureUtils::Volatility::m_rigidity
private

Definition at line 29 of file Volatility.h.

◆ m_seed

int JetSubStructureUtils::Volatility::m_seed
private

Definition at line 30 of file Volatility.h.

◆ m_truncation_fctr

double JetSubStructureUtils::Volatility::m_truncation_fctr
private

Definition at line 29 of file Volatility.h.

◆ m_zcut

double JetSubStructureUtils::Volatility::m_zcut
private

Definition at line 29 of file Volatility.h.


The documentation for this class was generated from the following files:
JetSubStructureUtils::Volatility::m_seed
int m_seed
Definition: Volatility.h:30
JetSubStructureUtils::Volatility::m_truncation_fctr
double m_truncation_fctr
Definition: Volatility.h:29
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
JetSubStructureUtils::SubstructureCalculator< double >::result
virtual double result(const xAOD::Jet &jet) const
Definition: SubstructureCalculator.h:25
JetSubStructureUtils::Volatility::m_num_iterations
unsigned int m_num_iterations
Definition: Volatility.h:28
JetSubStructureUtils::Volatility::m_exp_min
double m_exp_min
Definition: Volatility.h:29
JetSubStructureUtils::QjetsPlugin
Definition: QjetsPlugin.h:13
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
Generate_dsid_ranseed.seed
seed
Definition: Generate_dsid_ranseed.py:10
jet::ClusterSequence
fastjet::ClusterSequence ClusterSequence
Definition: ClusterSequence.h:21
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
JetSubStructureUtils::Volatility::result
virtual double result(const fastjet::PseudoJet &jet) const
Definition: Volatility.cxx:11
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
JetSubStructureUtils::Volatility::m_zcut
double m_zcut
Definition: Volatility.h:29
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
JetSubStructureUtils::Volatility::m_exp_max
double m_exp_max
Definition: Volatility.h:29
JetSubStructureUtils::Volatility::m_rigidity
double m_rigidity
Definition: Volatility.h:29
JetSubStructureUtils::Volatility::m_dcut_fctr
double m_dcut_fctr
Definition: Volatility.h:29
python.compressB64.c
def c
Definition: compressB64.py:93