ATLAS Offline Software
EventShapes.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef EVENTSHAPES_EVENTSHAPES_H
6 #define EVENTSHAPES_EVENTSHAPES_H
7 
8 #include <string>
9 #include <vector>
10 
12 {
13  public:
14 
15  template<class T>
17 
19  THRUST = 0x0001, /* Thrust */
20  THRUST_MINOR = 0x0002, /* Thrust Minor */
21  HEAVY_JETMASS = 0x0007, /* heavy jet mass */
22  LIGHT_JETMASS = 0x0008, /* light jet mass */
23  TOTAL_BROADENING = 0x0009, /* total jet broadening */
24  WIDE_BROADENING = 0x000A, /* wide-jet broadening */
25  THRUST_PHI = 0x000B, /* phi value of Thrust axis */
26  THRUST_ETA = 0x000C, /* eta value of Thrust axis, if calculated in 3 dimensions */
27 
28  TRANSVERSESPHERICITY = 0x000D, /* transverse sphericity defined in JHEP08(2000) 017 */
29 
30  CPARAMETER = 0x0010, /* C parameter */
31 
32  FOXWOLFRAM = 0x0080, /* Fox Wolfram H0 */
33  FLIPVALUES = 0x0081, /* flipvalue y23 */
34  EEC_PHI = 0x0082, /* EEC along phi */
35  EEC_ETA = 0x0083, /* EEC along eta */
36  EEC_RAD = 0x0084, /* EEC along rad */
37 
38  FORWARD_TERM = 0x00F0, /* exponentially suppressed forward term */
39  CENTRAL_CUT = 0x00F1, /* cut for central region and forward region */
40  JET_ETA_CUT = 0x00F2, /* cut for eta of first two jets */
41  JET1_ET = 0x00F3, /* E_T of jet 1 */
42  JET2_ET = 0x00F4, /* E_T of jet 2 */
43 
44  UNKNOWN = 0xFFFF /* unknown */
45  };
46 
48 
50  : m_type(type)
51  { m_values.push_back(value); };
52 
53  EventShapes(EventShapeType type, std::vector<double>& values, bool canSwap = false)
54  : m_type(type)
55  {
56  if ( canSwap )
57  m_values.swap(values);
58  else
59  m_values = values;
60  };
61 
63 
64  EventShapeType getType() const { return m_type; };
65 
66  unsigned int getSize() const { return m_values.size(); };
67 
68  double getValue( unsigned int index = 0 ) const
69  {
70  return index < m_values.size() ? m_values[index] : 0;
71  };
72 
73  void getValues( std::vector<double>& vec ) const
74  {
75  vec.resize( m_values.size() );
76  for ( unsigned int i=0; i<m_values.size(); ++i )
77  vec[i] = m_values[i];
78  return;
79  };
80 
81  void swapValues( EventShapes& es )
82  {
83  m_values.swap(es.m_values);
84  };
85 
86  void setValue( double value, unsigned int index = 0 )
87  {
88  if ( index > m_values.size() )
89  m_values.resize(index, 0);
91  return;
92  };
93 
94  void setValues( std::vector<double>& values, bool canSwap = false )
95  {
96  if ( canSwap )
97  {
98  m_values.swap(values);
99  }
100  else
101  {
102  m_values.resize( values.size() );
103  for ( unsigned int i=0; i<values.size(); ++i )
104  m_values[i] = values[i];
105  }
106  return;
107  };
108 
109  std::string getName();
110 
111  private:
112 
114 
115  std::vector<double> m_values;
116 };
117 
118 #include "AthenaKernel/CLASS_DEF.h"
119 CLASS_DEF(EventShapes, 255442581, 1)
120 
121 #endif
EventShapes::JET2_ET
@ JET2_ET
Definition: EventShapes.h:42
EventShapes::TRANSVERSESPHERICITY
@ TRANSVERSESPHERICITY
Definition: EventShapes.h:28
EventShapes::UNKNOWN
@ UNKNOWN
Definition: EventShapes.h:44
EventShapes::EEC_RAD
@ EEC_RAD
Definition: EventShapes.h:36
index
Definition: index.py:1
EventShapes::getValues
void getValues(std::vector< double > &vec) const
Definition: EventShapes.h:73
EventShapes::setValue
void setValue(double value, unsigned int index=0)
Definition: EventShapes.h:86
EventShapes::HEAVY_JETMASS
@ HEAVY_JETMASS
Definition: EventShapes.h:21
EventShapes::CENTRAL_CUT
@ CENTRAL_CUT
Definition: EventShapes.h:39
EventShapes::getValue
double getValue(unsigned int index=0) const
Definition: EventShapes.h:68
EventShapes::CPARAMETER
@ CPARAMETER
Definition: EventShapes.h:30
athena.value
value
Definition: athena.py:122
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
EventShapes::FORWARD_TERM
@ FORWARD_TERM
Definition: EventShapes.h:38
EventShapes::JET1_ET
@ JET1_ET
Definition: EventShapes.h:41
EventShapes::EEC_ETA
@ EEC_ETA
Definition: EventShapes.h:35
python.Bindings.values
values
Definition: Control/AthenaPython/python/Bindings.py:797
EventShapes
Definition: EventShapes.h:12
EventShapes::getSize
unsigned int getSize() const
Definition: EventShapes.h:66
EventShapes::swapValues
void swapValues(EventShapes &es)
Definition: EventShapes.h:81
EventShapes::EEC_PHI
@ EEC_PHI
Definition: EventShapes.h:34
lumiFormat.i
int i
Definition: lumiFormat.py:92
EventShapes::setValues
void setValues(std::vector< double > &values, bool canSwap=false)
Definition: EventShapes.h:94
EventShapes::THRUST_ETA
@ THRUST_ETA
Definition: EventShapes.h:26
EventShapes::FLIPVALUES
@ FLIPVALUES
Definition: EventShapes.h:33
EventShapes::EventShapeType
EventShapeType
Definition: EventShapes.h:18
EventShapes::EventShapes
EventShapes(EventShapeType type, double value)
Definition: EventShapes.h:49
EventShapes::JET_ETA_CUT
@ JET_ETA_CUT
Definition: EventShapes.h:40
EventShapes::getName
std::string getName()
Definition: EventShapes.cxx:8
EventShapes::LIGHT_JETMASS
@ LIGHT_JETMASS
Definition: EventShapes.h:22
EventShapes::EventShapes
EventShapes()
Definition: EventShapes.h:47
EventShapes::m_values
std::vector< double > m_values
Definition: EventShapes.h:115
EventShapes::m_type
EventShapeType m_type
Definition: EventShapes.h:113
EventShapes::getType
EventShapeType getType() const
Definition: EventShapes.h:64
EventShapes::~EventShapes
~EventShapes()
Definition: EventShapes.h:62
EventShapes::THRUST_MINOR
@ THRUST_MINOR
Definition: EventShapes.h:20
EventShapes::EventShapes
EventShapes(EventShapeType type, std::vector< double > &values, bool canSwap=false)
Definition: EventShapes.h:53
DeMoScan.index
string index
Definition: DeMoScan.py:362
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
EventShapes::TOTAL_BROADENING
@ TOTAL_BROADENING
Definition: EventShapes.h:23
EventShapes::WIDE_BROADENING
@ WIDE_BROADENING
Definition: EventShapes.h:24
EventShapes::FOXWOLFRAM
@ FOXWOLFRAM
Definition: EventShapes.h:32
CLASS_DEF.h
macros to associate a CLID to a type
EventShapes::THRUST_PHI
@ THRUST_PHI
Definition: EventShapes.h:25
EventShapeStoreConverterBase
Definition: EventShapeStoreConverterBase.h:10
EventShapes::THRUST
@ THRUST
Definition: EventShapes.h:19