ATLAS Offline Software
Loading...
Searching...
No Matches
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.
void fillJets (JetContainer &jetCont, const std::vector< xAOD::JetFourMom_t > &jet4moms)
 Fill input JetContainer with new jets which 4-momentum are given by jet4moms.
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.
void fillStandardTestJets (JetContainer &jetCont)
 Fill input JetContainer with a list of test jets.
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)

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 }
#define SETCLUSTERRAWMOM(E, eta, phi)
#define SETCLUSTERMOM(E, eta, phi)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ 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 }
JetAuxContainer_v1 JetAuxContainer
Definition of the current jet auxiliary container.
JetContainer_v1 JetContainer
Definition of the current "jet container version".

◆ 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 }
static TStore * store()
Access the currently active TStore object.
Tool for accessing xAOD files outside of Athena.
@ kClassAccess
Access auxiliary data using the aux containers.
A relatively simple transient store for objects created in analysis.
Definition TStore.h:45
StatusCode record(T *obj, const std::string &key)
Add an object to the store.
TestStore store
Definition TestStore.cxx:23
getDataSourcePointerFunc_t * getDataSourcePointerFunc
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
Definition Init.cxx:31
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.

◆ 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 }
const T * back() const
Access the last element in the collection as an rvalue.
Jet_v1 Jet
Definition of the current "jet version".
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition JetTypes.h:17

◆ 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 }
void fillJets(JetContainer &jetCont, const std::vector< xAOD::JetFourMom_t > &jet4moms)
Fill input JetContainer with new jets which 4-momentum are given by jet4moms.
Definition JetFactory.h:78
@ JetEMScaleMomentum
Definition JetTypes.h:28
@ JetConstitScaleMomentum
Definition JetTypes.h:29