![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 31 of file top-el.cxx.
37 ATH_MSG_INFO(
"Code to perform object and event selection and write-out\n"
38 <<
"a few histograms and / or a tree in xAOD format.\n"
40 <<
" " <<
argv[0] <<
" cuts.txt input.txt\n"
41 <<
" cuts.txt - file containing cuts\n"
42 <<
" input.txt - file containing list of input files\n"
43 <<
" submitdir - path for EventLoop submit directory\n"
47 <<
" $ROOTCOREBIN/data/TopAnalysis/nocuts.txt "
48 "$ROOTCOREBIN/data/TopAnalysis/input-13TeV-fondueworld.txt output\n");
59 StatusCode::enableFailure();
65 std::string settingsFilename =
68 ATH_MSG_INFO(
"LOCATED (using PathResolverFindFile ): Configuration file = " << settingsFilename
70 ANA_CHECK(algConfig.setProperty(
"ConfigPath", settingsFilename));
72 ATH_MSG_INFO(
"Configuration Files:\n" << settingsFilename <<
"\n" <<
argv[2] <<
"\n");
83 const std::string libraryNames = settings->
value(
"LibraryNames");
85 ANA_CHECK(algConfig.setProperty(
"LibraryNames", libraryNames));
106 std::unique_ptr<TFile> checkingYieldFile(TFile::Open(
filename.c_str()));
109 const TTree *
const collectionTree =
110 dynamic_cast<TTree *
>(checkingYieldFile->Get(
"CollectionTree"));
111 if (collectionTree) {
118 std::unique_ptr<TFile>
testFile(TFile::Open(usethisfile.c_str()));
120 ATH_MSG_ERROR(
"Unable to access FileMetaData in this file : "
121 << usethisfile <<
"\nPlease report this message.");
126 topConfig->setConfigSettings(settings);
128 if (topConfig->isMC() && !topConfig->isTruthDxAOD()) {
133 const std::string tdp_filename = settings->
value(
"TDPPath");
138 ATH_MSG_ERROR(
"TopDataPreparation - could not read file\n" << tdp_filename);
147 <<
"ShowerIndex: " << ShowerIndex
149 topConfig->setMapIndex(ShowerIndex);
150 topConfig->setShoweringAlgorithm(tdp.
getShowering(topConfig->getDSID()));
151 ANA_CHECK(algConfig.setProperty(
"FTAGMapIndex", ShowerIndex));
152 ANA_CHECK(algConfig.setProperty(
"ShoweringAlgorithm", topConfig->getShoweringAlgorithm()));
159 const unsigned int entries = xaodEvent.getEntries();
161 xaodEvent.getEntry(0);
163 top::check(xaodEvent.retrieve(eventInfo, topConfig->sgKeyEventInfo()),
164 "Failed to retrieve EventInfo");
165 const unsigned int runnumber = eventInfo->runNumber();
166 const std::string thisYear = topConfig->getYear(
runnumber, topConfig->isMC());
167 topConfig->SetYear(thisYear);
169 topConfig->SetYear(
"UNKNOWN");
171 topConfig->SetTriggersToYear(topConfig->isMC());
173 ANA_CHECK(algConfig.setProperty(
"DataTakingYear", topConfig->getYear()));
181 auto sample = std::make_unique<SH::SampleLocal>(
"sample");
185 job.sampleHandler(
sh);
192 ANA_CHECK(algConfig.setProperty(
"StreamName",
"output"));
194 job.algsAdd(algConfig);
static const std::string optMaxEvents
description: the name of the option used for setting the maximum number of events to process per samp...
const std::string & value(const std::string &key) const
The user wants to know the value for the specified key.
void loadLibraries(const std::string &libraryNames)
So that we can load external libraries with (1) extra event selection tools in, (2) user defined obje...
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
static void enableDataSubmission(::Bool_t value)
Function for turning data submission on/off.
void checkSettings()
Validate that configured options make sense.
void loadFromFile(const std::string &filename)
Read the settings from a text file given by.
bool readMetaData(TFile *inputFile, const std::shared_ptr< top::TopConfig > &config)
This function will be used to load the metadata object and pull information from it.
an object that can create a AnaAlgorithm
@ kClassAccess
Access auxiliary data using the aux containers.
std::vector< std::string > fileList(const std::string &filename)
Given a filename for a text file, parse it and extract a list of root files.
void setTranslator(const std::unordered_map< std::string, std::string > &map)
bool readFromFile(const char *fName)
std::string getShoweringString(const int dsid) const
static ConfigurationSettings * get(bool reset=false)
Design patterns 101.
void xAODInit(bool failOnUnchecked)
A little wrapper for the xAOD tools.
void check(bool thingToCheck, const std::string &usefulFailureMessage)
Print an error message and terminate if thingToCheck is false.
showering getShowering(const int dsid) const
a Driver that runs directly inside the submission job itself
Class describing the basic event information.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
A class that manages a list of Sample objects.
static const std::string optSubmitDirMode
the submit-dir mode (allowed values: "no-clobber", "overwrite", "unique", "unique-link")
static const std::string optSkipEvents
description: the name of the option used for skipping a certain number of events in the beginning rat...
int getShoweringIndex(const int dsid) const
Hold the configuration information for the whole run.
Tool for accessing xAOD files outside of Athena.