ATLAS Offline Software
Functions
xAOD::JetTests Namespace Reference

Functions

template<typename T >
void record ATLAS_NOT_THREAD_SAFE (T *cont, const std::string &name)
 
JetContainer *createEmptyJetContainer ATLAS_NOT_THREAD_SAFE (const std::string &name)
 Create and return an empty JetContainer. JetContainer has an AuxContainer associated and is recorded in an event store so its elements can be used as ElementLink. More...
 
void fillJets (JetContainer &jetCont, const std::vector< xAOD::JetFourMom_t > &jet4moms)
 Fill input JetContainer with new jets which 4-momentum are given by jet4moms. More...
 
void fillJets (JetContainer &jetCont, const std::vector< xAOD::JetFourMom_t > &jet4moms, const std::map< std::string, std::vector< float >> jetAttMap)
 Fill input JetContainer with new jets which 4-momentum are given by jet4moms and with attributes as given by the map "jetAttMap". It is expected that vectors in this map have same lenght as jet4moms. More...
 
void fillStandardTestJets (JetContainer &jetCont)
 Fill input JetContainer with a list of test jets. More...
 
void fillStandardTestClusters ATLAS_NOT_THREAD_SAFE (CaloClusterContainer &clustCont)
 Fill input CaloClusterAuxContainer with a list of test clusters (with only their default and Raw 4-momentum set) More...
 

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE() [1/3]

void fillStandardTestClusters xAOD::JetTests::ATLAS_NOT_THREAD_SAFE ( CaloClusterContainer clustCont)

Fill input CaloClusterAuxContainer with a list of test clusters (with only their default and Raw 4-momentum set)

Definition at line 154 of file JetFactory.h.

154  {
155 
156  for(int i=0; i<10; i++){
158  clustCont.push_back(cl);
159 
160 #define SETCLUSTERMOM( E, eta, phi ) cl->setE(E);cl->setEta(eta);cl->setPhi(phi);cl->setM(0)
161 #define SETCLUSTERRAWMOM( E, eta, phi ) cl->setRawE(E);cl->setRawEta(eta);cl->setRawPhi(phi);cl->setRawM(0)
162  SETCLUSTERMOM( 1000+i*1.1, -5+i*0.1, 0);
163  SETCLUSTERRAWMOM( 500+i*2.2, -5+i*0.1, 0);
164 
165  }
166  }

◆ ATLAS_NOT_THREAD_SAFE() [2/3]

CaloClusterContainer *createEmptyCaloClusterContainer xAOD::JetTests::ATLAS_NOT_THREAD_SAFE ( const std::string &  name)

Create and return an empty JetContainer. JetContainer has an AuxContainer associated and is recorded in an event store so its elements can be used as ElementLink.

Create and return an empty CaloClusterAuxContainer. CaloClusterAuxContainer has an AuxContainer associated and is recorded in an event store so its elements can be used as ElementLink.

Definition at line 67 of file JetFactory.h.

67  {
68  JetContainer * jetCont = new JetContainer();
70  jetCont->setStore(aux);
71  record(jetCont, name);
72  return jetCont;
73  }

◆ ATLAS_NOT_THREAD_SAFE() [3/3]

template<typename T >
void record xAOD::JetTests::ATLAS_NOT_THREAD_SAFE ( T *  cont,
const std::string &  name 
)

Definition at line 35 of file JetFactory.h.

35  {
36 #ifndef XAOD_STANDALONE
37  // *********************** init in Athena
38 # ifdef SGTOOLS_CURRENTEVENTSTORE_H
39  initTestStore();
40 # else
41  SG::getDataSourcePointerFunc = getTestDataSourcePointer;
42 # endif
43  store.record(cont, name);
44  store.record((xAOD::IParticleContainer*)cont, name); // also store the container as an IParticleContainer
45 #else
46  // *********************** init in standalone
47 
48  gErrorIgnoreLevel = kWarning;
49  assert( xAOD::Init() );
50  // Create a TEvent object:
52 
53  xAOD::TStore tds;
54  xAOD::TStore* transDataStore = xAOD::TActiveStore::store();
55 
56  assert( transDataStore != 0 );
57 
58  tds.record(cont, name).ignore();
59 
60 #endif
61 
62  }

◆ fillJets() [1/2]

void xAOD::JetTests::fillJets ( JetContainer jetCont,
const std::vector< xAOD::JetFourMom_t > &  jet4moms 
)

Fill input JetContainer with new jets which 4-momentum are given by jet4moms.

Definition at line 78 of file JetFactory.h.

78  {
79  for( const xAOD::JetFourMom_t &v : jet4moms ){
80  jetCont.push_back(new xAOD::Jet());
81  xAOD::Jet *jet = jetCont.back();
82  jet->setJetP4( v ); // set the P4 of the last inserted jet
83  }
84 
85  }

◆ fillJets() [2/2]

void xAOD::JetTests::fillJets ( JetContainer jetCont,
const std::vector< xAOD::JetFourMom_t > &  jet4moms,
const std::map< std::string, std::vector< float >>  jetAttMap 
)

Fill input JetContainer with new jets which 4-momentum are given by jet4moms and with attributes as given by the map "jetAttMap". It is expected that vectors in this map have same lenght as jet4moms.

Definition at line 88 of file JetFactory.h.

90  {
91  int i=0;
92  for( const xAOD::JetFourMom_t &v : jet4moms ){
93  jetCont.push_back(new xAOD::Jet());
94  xAOD::Jet *jet = jetCont.back();
95  jet->setJetP4( v ); // set the P4 of the last inserted jet
96  for( const auto& attpair : jetAttMap) { jet->setAttribute<float>(attpair.first, attpair.second[i]);}
97  i++;
98  }
99 
100  }

◆ fillStandardTestJets()

void xAOD::JetTests::fillStandardTestJets ( JetContainer jetCont)

Fill input JetContainer with a list of test jets.

Definition at line 104 of file JetFactory.h.

104  {
105  static const std::vector<xAOD::JetFourMom_t> jet4moms =
106  {
107  xAOD::JetFourMom_t(40000, 0, 1, 10000 ),
108  xAOD::JetFourMom_t(40000, 0.01, 2, 10000 ),
109  xAOD::JetFourMom_t(40000, 0.01, 2, 0.),
110  xAOD::JetFourMom_t(40000, 0.2, 2, 10000.),
111  xAOD::JetFourMom_t(40000, 1.0, 2, 10000.),
112  xAOD::JetFourMom_t(40000, 1.001, 2, 10000.),
113  xAOD::JetFourMom_t(40000, 2., 2, 10000.),
114  xAOD::JetFourMom_t(40000, 3., 2, 10000.),
115  xAOD::JetFourMom_t(40000, 3.22, 2, 10000.),
116  xAOD::JetFourMom_t(40000, 4., 2, 10000.),
117  xAOD::JetFourMom_t(40000, 5., 2, 10000.),
118  xAOD::JetFourMom_t(40000, 5.5, 2, 10000.),
119 
120  xAOD::JetFourMom_t(0.1, 1.0, 2, 10000.),
121  xAOD::JetFourMom_t(100000, 1.0, 2, 10000.),
122  xAOD::JetFourMom_t(500000, 1.0, 2, 10000.),
123  xAOD::JetFourMom_t(1000000, 1.0, 2, 10000.),
124  xAOD::JetFourMom_t(10000000, 1.0, 2, 10000.),
125 
126  xAOD::JetFourMom_t(100000, 1.0, 2, 100000.),
127  xAOD::JetFourMom_t(100000, 1.0, 2, 1000000.)
128  };
129 
130  std::map< std::string, std::vector<float> > jetAttMap =
131  { { "Width", std::vector<float>(jet4moms.size(), 0.123 )} };
132  fillJets(jetCont, jet4moms, jetAttMap);
133 
134  // also set scales :
135  for(Jet* jet: jetCont){
136  jet->setJetP4(xAOD::JetScale::JetConstitScaleMomentum, 0.9*jet->jetP4());
137  jet->setJetP4(xAOD::JetScale::JetEMScaleMomentum, 0.7*jet->jetP4());
138  }
139  }
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:71
SETCLUSTERRAWMOM
#define SETCLUSTERRAWMOM(E, eta, phi)
xAOD::JetAuxContainer
JetAuxContainer_v1 JetAuxContainer
Definition of the current jet auxiliary container.
Definition: JetAuxContainer.h:22
Jet
Basic data class defines behavior for all Jet objects The Jet class is the principal data class for...
Definition: Reconstruction/Jet/JetEvent/JetEvent/Jet.h:47
xAOD::TActiveStore::store
static TStore * store()
Access the currently active TStore object.
Definition: TActiveStore.cxx:16
xAOD::TEvent::kClassAccess
@ kClassAccess
Access auxiliary data using the aux containers.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:100
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition: Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
xAOD::JetConstitScaleMomentum
@ JetConstitScaleMomentum
Definition: JetTypes.h:29
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
lumiFormat.i
int i
Definition: lumiFormat.py:85
SG::getDataSourcePointerFunc
getDataSourcePointerFunc_t * getDataSourcePointerFunc
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
xAOD::JetEMScaleMomentum
@ JetEMScaleMomentum
Definition: JetTypes.h:28
xAOD::JetFourMom_t
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition: JetTypes.h:17
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
gErrorIgnoreLevel
int gErrorIgnoreLevel
python.PyAthena.v
v
Definition: PyAthena.py:154
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
xAOD::TStore
A relatively simple transient store for objects created in analysis.
Definition: TStore.h:44
xAOD::TStore::record
StatusCode record(T *obj, const std::string &key)
Add an object to the store.
SETCLUSTERMOM
#define SETCLUSTERMOM(E, eta, phi)
xAOD::JetTests::fillJets
void fillJets(JetContainer &jetCont, const std::vector< xAOD::JetFourMom_t > &jet4moms, const std::map< std::string, std::vector< float >> jetAttMap)
Fill input JetContainer with new jets which 4-momentum are given by jet4moms and with attributes as g...
Definition: JetFactory.h:88
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition: JetContainer.h:17
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
xAOD::TEvent
Tool for accessing xAOD files outside of Athena.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:84
xAOD::Init
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
Definition: Init.cxx:31