|
ATLAS Offline Software
|
Go to the documentation of this file.
11 std::cout <<
"Examples are only defined in the analysis release." << std::endl;
16 #ifdef XAOD_STANDALONE
60 using namespace asg::msgUserCode;
62 int main(
int argc,
char*
argv[]) {std::cout << __PRETTY_FUNCTION__ << std::endl;
64 #ifdef XAOD_STANDALONE
68 StatusCode::enableFailure();
73 TString
fileName = gSystem->Getenv(
"ASG_TEST_FILE_MC");
74 std::string
jetType =
"AntiKt4EMTopo";
76 bool calibjets =
true;
79 if (std::string(
argv[
i]) ==
"-filen" &&
i+1<
argc) {
81 }
else if (std::string(
argv[
i]) ==
"-jetcoll" &&
i+1<
argc) {
83 }
else if (std::string(
argv[
i]) ==
"-nocalib") {
85 }
else if (std::string(
argv[
i]) ==
"-evtmax" &&
i+1<
argc) {
87 }
else if (std::string(
argv[
i]) ==
"-debug") {
93 std::unique_ptr< TFile >
ifile( TFile::Open(
fileName,
"READ" ) );
94 assert(
ifile.get() );
97 #ifdef XAOD_STANDALONE
100 #else // Athena "Store" is the same StoreGate used by the TEvent
111 jetCalibrationTool.setName(
"jetCalibTool");
113 ANA_CHECK( jetCalibrationTool.
setProperty(
"ConfigFile",
"JES_MC15cRecommendation_May2016_rel21.config") );
119 metSystTool.
setTypeAndName(
"met::METSystematicsTool/metSystTool");
131 if(ievent % 10 == 0) std::cout <<
"event number: " << ievent << std::endl;
138 std::string coreMetKey =
"MET_Core_" +
jetType;
140 if(
debug) std::cout <<
"Using core MET " << coreMet << std::endl;
166 if(
debug) std::cout <<
"Failed to set the original object links" << std::endl;
173 std::string metAssocKey =
"METAssoc_" +
jetType;
183 isys != recSysList.
end();
187 if(
debug) std::cout <<
"Doing systematic : " << (*isys).name() << std::endl;
192 newMetContainer->setStore(newMetAuxContainer);
201 if(
el->pt()>20
e3 &&
el->eta()<2.47) metElectrons.push_back(
el);
206 metElectrons.asDataVector(),
212 for(
const auto& ph : *photons) {
213 if(ph->pt()>20
e3 && ph->eta()<2.47) metPhotons.push_back(ph);
218 metPhotons.asDataVector(),
224 for(
const auto& tau : *taus) {
225 if(tau->pt()>20
e3 && tau->eta()<2.5) metTaus.push_back(tau);
230 metTaus.asDataVector(),
236 for(
const auto&
mu : *muons) {
237 if(
mu->pt()>20
e3 &&
mu->eta()<2.4) metMuons.push_back(
mu);
242 metMuons.asDataVector(),
269 if(
debug) std::cout <<
"Soft cluster met term met " << softClusMet->
met() << std::endl;
274 if(
debug) std::cout <<
"Soft track met term met " << softTrkMet->
met() << std::endl;
289 const std::vector<float>& jetweights = jetMet->
auxdataConst<std::vector<float> >(
"ConstitObjectWeights");
290 const std::vector<ElementLink<xAOD::IParticleContainer> >& constitjets = jetMet->
auxdataConst<std::vector<ElementLink<xAOD::IParticleContainer> > >(
"ConstitObjectLinks");
291 for(
size_t iconstit=0; iconstit < jetweights.size(); ++iconstit) {
293 const float jetweight = jetweights[iconstit];
294 std::cout <<
"RefJet jet " << constjet->
index() <<
", weight " << jetweight <<
", pt: " << constjet->
pt() << std::endl;
299 #ifdef XAOD_STANDALONE
302 assert(
event->fill());
307 #ifndef XAOD_STANDALONE
Electron_v1 Electron
Definition of the current "egamma version".
MissingETAuxContainer_v1 MissingETAuxContainer
ReadStats & stats()
Access the object belonging to the current thread.
virtual StatusCode rebuildJetMET(const std::string &metJetKey, const std::string &metSoftKey, xAOD::MissingETContainer *metCont, const xAOD::JetContainer *jets, const xAOD::MissingETContainer *metCoreCont, xAOD::MissingETAssociationHelper &helper, bool doJetJVT)=0
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
static void enableFailure() noexcept
std::set< SystematicVariation >::const_iterator const_iterator
Class to wrap a set of SystematicVariations.
MissingETContainer_v1 MissingETContainer
@ kClassAccess
Access auxiliary data using the aux containers.
virtual StatusCode rebuildMET(const std::string &metKey, xAOD::Type::ObjectType metType, xAOD::MissingETContainer *metCont, const xAOD::IParticleContainer *collection, xAOD::MissingETAssociationHelper &helper, MissingETBase::UsageHandler::Policy objScale=MissingETBase::UsageHandler::PhysicsObject)=0
IAppMgrUI * Init(const char *options="POOLRootAccess/basic.opts")
Bootstraps (creates and configures) the Gaudi Application with the provided options file.
StatusCode buildMETSum(const std::string &totalName, xAOD::MissingETContainer *metCont)
void addGhostMuonsToJets(const xAOD::MuonContainer &muons, xAOD::JetContainer &jets)
StatusCode readFrom(TFile *file)
POOL::TEvent event(POOL::TEvent::kClassAccess)
Principal data object for Missing ET.
const_iterator end() const
description: const iterator to the end of the set
Auxiliary data store for xAOD::MissingETContainer.
size_t index() const
Return the index of this element within its container.
static IOStats & instance()
Singleton object accessor.
void printSmartSlimmingBranchList(bool autoIncludeLinks=false) const
Print the accessed variables, formatted for smart slimming.
Container for xAOD::MissingET_v1 objects.
void record(const T *p, const std::string &key)
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, [[maybe_unused]] const EventContext &ctx)
Function making a shallow copy of a constant container.
Photon_v1 Photon
Definition of the current "egamma version".
struct TBPatternUnitContext Muon
A relatively simple transient store for objects created in analysis.
This module implements the central registry for handling systematic uncertainties with CP tools.
DataVector adapter that acts like it holds const pointers.
StatusCode retrieve(const T *&obj)
bool setOriginalObjectLink(const IParticle &original, IParticle ©)
This function should be used by CP tools when they make a deep copy of an object in their correctedCo...
const_iterator begin() const
description: const iterator to the beginning of the set
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::const_reference_type auxdataConst(const std::string &name) const
Fetch an aux data variable, as a const reference.
@ Tau
The object is a tau (jet)
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
virtual double pt() const
The transverse momentum ( ) of the particle.
Tool for accessing xAOD files outside of Athena.
float met() const
Returns .
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.