10 std::cout <<
"Examples are only defined in the analysis release." << std::endl;
60using namespace asg::msgUserCode;
62int main(
int argc,
char* argv[]) {std::cout << __PRETTY_FUNCTION__ << std::endl;
69 StatusCode::enableFailure();
76 TString
fileName = gSystem->Getenv(
"ASG_TEST_FILE_MC");
77 std::string
jetType =
"AntiKt4EMTopo";
78 for (
int i=0;
i<
argc; ++
i) {
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]) ==
"-invisEle") {
85 }
else if (std::string(argv[i]) ==
"-debug") {
91 std::unique_ptr< TFile >
ifile( TFile::Open( fileName,
"READ" ) );
92 assert(
ifile.get() );
108 jetCalibrationTool.
setTypeAndName(
"JetCalibrationTool/jetCalibTool");
110 ANA_CHECK( jetCalibrationTool.
setProperty(
"ConfigFile",
"JES_MC15cRecommendation_May2016_rel21.config") );
116 metSystTool.
setTypeAndName(
"met::METSystematicsTool/metSystTool");
126 for(Long64_t ievent = 0; ievent < std::min(
int(
event->getEntries()), 100); ++ievent){
127 if(ievent % 10 == 0) std::cout <<
"event number: " << ievent << std::endl;
134 std::string coreMetKey =
"MET_Core_" +
jetType;
136 if(
debug) std::cout <<
"Using core MET " << coreMet << std::endl;
150 if(jetCalibrationTool->applyCalibration(*calibJets).isFailure())
153 std::cout <<
"Failed to set the original object links" << std::endl;
160 std::string metAssocKey =
"METAssoc_" +
jetType;
170 isys != recSysList.
end();
178 newMetContainer->setStore(newMetAuxContainer);
185 for(
const auto *el : *electrons) {
186 if(
el->pt()>20e3 &&
el->eta()<2.47) {
188 invisElectrons.push_back(el);
190 metElectrons.push_back(el);
194 if(!invisElectrons.empty()){
195 ANA_CHECK( metMaker->markInvisible(invisElectrons.asDataVector(),metHelper,newMetContainer) );
198 ANA_CHECK( metMaker->rebuildMET(
"TrkEle",
201 metElectrons.asDataVector(),
207 for(
const auto *mu : *muons) {
208 if(
mu->pt()>20e3 &&
mu->eta()<2.4) metMuons.push_back(mu);
210 ANA_CHECK( metMaker->rebuildMET(
"TrkMuons",
213 metMuons.asDataVector(),
218 ANA_CHECK( metMaker->rebuildTrackMET(
"TrkJet",
233 ANA_CHECK( metSystTool->applySystematicVariation(iSysSet) );
235 metSystTool->setRandomSeed(
int(1e6*(*newMetContainer)[
"PVSoftTrk"]->
phi()) );
239 ANA_CHECK( metSystTool->applyCorrection(*softTrkMet, metHelper) );
240 if(
debug) std::cout <<
"Soft track met: " << softTrkMet->
met();
245 ANA_CHECK( metSystTool->applyCorrection(*jetTrkMet, metHelper));
246 if(
debug) std::cout <<
"Jet track met: " << jetTrkMet->
met();
257#ifdef XAOD_STANDALONE
260 assert(
event->fill());
265#ifndef XAOD_STANDALONE
Scalar phi() const
phi method
static void enableFailure() noexcept
This module implements the central registry for handling systematic uncertainties with CP tools.
const SystematicSet & recommendedSystematics() const
returns: the recommended set of systematics
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Class to wrap a set of SystematicVariations.
const_iterator end() const
description: const iterator to the end of the set
std::set< SystematicVariation >::const_iterator const_iterator
const_iterator begin() const
description: const iterator to the beginning of the set
DataVector adapter that acts like it holds const pointers.
void record(const T *p, const std::string &key)
ReadStats & stats()
Access the object belonging to the current thread.
static IOStats & instance()
Singleton object accessor.
float met() const
Returns .
void printSmartSlimmingBranchList(bool autoIncludeLinks=false) const
Print the accessed variables, formatted for smart slimming.
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.
uint64_t bitmask_t
Type for status word bit mask.
IAppMgrUI * Init(const char *options="POOLRootAccess/basic.opts")
Bootstraps (creates and configures) the Gaudi Application with the provided options file.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
StatusCode buildMETSum(const std::string &totalName, xAOD::MissingETContainer *metCont)
@ Muon
The object is a muon.
@ Electron
The object is an electron.
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
MissingET_v1 MissingET
Version control by type defintion.
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, const EventContext &ctx)
Function making a shallow copy of a constant container.
MissingETContainer_v1 MissingETContainer
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...
MissingETAuxContainer_v1 MissingETAuxContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
MissingETAssociationMap_v1 MissingETAssociationMap
Version control by type defintion.
@ Track
Indicator for MET contribution from reconstructed charged particle tracks.