ATLAS Offline Software
Public Member Functions | Public Attributes | Private Attributes | List of all members
HI::AddEventShape Struct Reference

#include <HIEventShapeSummaryUtils.h>

Collaboration diagram for HI::AddEventShape:

Public Member Functions

 AddEventShape (float ww)
 
constexpr AddEventShape ()
 
void operator() (xAOD::HIEventShape *slice, const xAOD::HIEventShape *in_slice) const
 

Public Attributes

bool match_num_harmonics
 

Private Attributes

float m_weight
 

Detailed Description

Definition at line 29 of file HIEventShapeSummaryUtils.h.

Constructor & Destructor Documentation

◆ AddEventShape() [1/2]

HI::AddEventShape::AddEventShape ( float  ww)
inline

Definition at line 34 of file HIEventShapeSummaryUtils.h.

34 : match_num_harmonics(true), m_weight(ww){};

◆ AddEventShape() [2/2]

constexpr HI::AddEventShape::AddEventShape ( )
inlineconstexpr

Definition at line 35 of file HIEventShapeSummaryUtils.h.

35 : match_num_harmonics(true), m_weight(1){};

Member Function Documentation

◆ operator()()

void HI::AddEventShape::operator() ( xAOD::HIEventShape slice,
const xAOD::HIEventShape in_slice 
) const

Definition at line 10 of file HIEventShapeSummaryUtils.cxx.

11  {
12  //update members
13  slice->setNCells(slice->nCells()+m_weight*in_slice->nCells());
14  slice->setEt(slice->et()+m_weight*in_slice->et());
15  slice->setArea(slice->area() + m_weight*in_slice->area());
16  slice->setRho(slice->rho() + m_weight*in_slice->rho());
17 
18  unsigned int nord=slice->etCos().size();
19  if(nord!=slice->etSin().size()) throw std::domain_error("Input HIEventShape has unequal n-harmonics for Q_x and Q_y");
20 
21  //if output shape is empty, copy directly from input
22  if(nord==0)
23  {
24  slice->etCos().assign(in_slice->etCos().begin(),in_slice->etCos().end());
25  slice->etSin().assign(in_slice->etSin().begin(),in_slice->etSin().end());
26  return;
27  }
28 
29  unsigned int in_nord=in_slice->etCos().size();
30  //can only do addition for harmonics in input slice, print warning?
31  if(in_nord < nord) nord=in_nord;
32  else if(in_nord > nord && match_num_harmonics)
33  {
34  //print a warning?
35  auto itr=in_slice->etCos().begin();
36  std::advance(itr,nord);
37  slice->etCos().insert(slice->etCos().end(),itr,in_slice->etCos().end());
38  itr=in_slice->etSin().begin();
39  std::advance(itr,nord);
40  slice->etSin().insert(slice->etSin().end(),itr,in_slice->etSin().end());
41  }
42  //only need to sum to nord, if prev condition was met i>nord set explicitly by insert
43  for(unsigned int i=0; i<nord; i++)
44  {
45  float tmp_cos = slice->etCos().at(i);
46  slice->etCos()[i] = tmp_cos + m_weight*in_slice->etCos().at(i);
47  float tmp_sin = slice->etSin().at(i);
48  slice->etSin()[i] = tmp_sin + m_weight*in_slice->etSin().at(i);
49  }
50  }

Member Data Documentation

◆ m_weight

float HI::AddEventShape::m_weight
private

Definition at line 39 of file HIEventShapeSummaryUtils.h.

◆ match_num_harmonics

bool HI::AddEventShape::match_num_harmonics

Definition at line 32 of file HIEventShapeSummaryUtils.h.


The documentation for this struct was generated from the following files:
xAOD::HIEventShape_v2::et
float et() const
Transverse energy reconstructed.
xAOD::HIEventShape_v2::area
float area() const
xAOD::HIEventShape_v2::etSin
const std::vector< float > & etSin() const
xAOD::HIEventShape_v2::etCos
const std::vector< float > & etCos() const
perfmonmt-refit.slice
slice
Definition: perfmonmt-refit.py:52
lumiFormat.i
int i
Definition: lumiFormat.py:92
xAOD::HIEventShape_v2::nCells
int nCells() const
HI::AddEventShape::m_weight
float m_weight
Definition: HIEventShapeSummaryUtils.h:39
HI::AddEventShape::match_num_harmonics
bool match_num_harmonics
Definition: HIEventShapeSummaryUtils.h:32
xAOD::HIEventShape_v2::rho
float rho() const