|
ATLAS Offline Software
|
Go to the documentation of this file.
20 #include "boost/program_options.hpp"
48 namespace po = boost::program_options;
53 #define CHECK( ARG ) \
55 const bool result = ARG; \
57 ::Error(APP_NAME, "Failed to execute: \"%s\"", \
80 template<
class ContainerType>
83 for(
auto obj : *container){
84 if(
obj->pt() > 10000. && fabs(
obj->eta()) < 2.5)
90 template<>
void selectObjects<xAOD::JetContainer>
94 bool pass = (
jet->pt() > 20000. && fabs(
jet->eta()) < 2.5);
106 template<>
void selectObjects<xAOD::TauJetContainer>
109 for(
auto tau : *taus){
112 tau->pt() > 20000. && fabs(tau->eta()) < 2.5);
132 Info(
APP_NAME,
" %s pt %6.2f eta %5.2f phi %5.2f selected %i %s %i",
138 std::stringstream
ss;
ss << overlapObj->
type();
139 Info(
APP_NAME,
" Overlap: type %s pt %6.2f",
140 ss.str().c_str(), overlapObj->
pt()*0.001);
154 po::options_description optDesc(
"Allowed options");
155 optDesc.add_options()
156 (
"help,h",
"produce help message")
157 (
"input-file,i", po::value<std::string>()->required(),
158 "input xAOD file name")
159 (
"num-events,n", po::value<Long64_t>()->default_value(-1
ll),
160 "number of events to process")
161 (
"working-point,w", po::value<std::string>()->default_value(
"standard"),
164 po::variables_map vm;
166 if(vm.count(
"help")) {
167 std::cout << optDesc << std::endl;
174 std::cout <<
e.what() << std::endl;
180 StatusCode::enableFailure();
183 const auto fileName = vm[
"input-file"].as<std::string>();
193 Long64_t
entries =
event.getEntries();
194 Long64_t optEntries = vm[
"num-events"].as<Long64_t>();
203 const auto wp = vm[
"working-point"].as<std::string>();
204 if(
wp ==
"standard") {
206 }
else if(
wp ==
"HF") {
208 }
else if(
wp ==
"boosted") {
210 }
else if(
wp ==
"boostedHF") {
213 }
else if(
wp ==
"photonFavored") {
226 if(
wp ==
"photonFavored") {
242 unsigned int nTotalElectrons = 0;
243 unsigned int nTotalMuons = 0;
244 unsigned int nTotalJets = 0;
245 unsigned int nTotalTaus = 0;
246 unsigned int nTotalPhotons = 0;
247 unsigned int nSelectedElectrons = 0;
248 unsigned int nSelectedMuons = 0;
249 unsigned int nSelectedJets = 0;
250 unsigned int nSelectedTaus = 0;
251 unsigned int nSelectedPhotons = 0;
252 unsigned int nOverlapElectrons = 0;
253 unsigned int nOverlapMuons = 0;
254 unsigned int nOverlapJets = 0;
255 unsigned int nOverlapTaus = 0;
256 unsigned int nOverlapPhotons = 0;
259 std::cout <<
"Starting loop" << std::endl;
262 event.getEntry(
entry);
267 Info(
APP_NAME,
"===>>> Processing entry %lli, run %u, event %lu <<<===",
293 Info(
APP_NAME,
"nEle %lu, nMuo %lu, nJet %lu, nTau %lu, nPho %lu",
307 Info(
APP_NAME,
"Now dumping the electrons");
312 nSelectedElectrons++;
318 Info(
APP_NAME,
"Now dumping the muons");
319 for(
auto muon : *muons){
329 Info(
APP_NAME,
"Now dumping the jets");
340 Info(
APP_NAME,
"Now dumping the taus");
341 for(
auto tau : *taus){
351 Info(
APP_NAME,
"Now dumping the photons");
352 for(
auto photon : *photons){
362 Info(
APP_NAME,
"=====================================");
363 Info(
APP_NAME,
"End of event processing");
364 Info(
APP_NAME,
"Object count summaries: nOverlap / nSelected / nTotal");
365 Info(
APP_NAME,
"Number overlap elecs: %5i / %5i / %5i",
366 nOverlapElectrons, nSelectedElectrons, nTotalElectrons);
367 Info(
APP_NAME,
"Number overlap muons: %5i / %5i / %5i",
368 nOverlapMuons, nSelectedMuons, nTotalMuons);
369 Info(
APP_NAME,
"Number overlap jets: %5i / %5i / %5i",
370 nOverlapJets, nSelectedJets, nTotalJets);
371 Info(
APP_NAME,
"Number overlap taus: %5i / %5i / %5i",
372 nOverlapTaus, nSelectedTaus, nTotalTaus);
373 Info(
APP_NAME,
"Number overlap photons: %5i / %5i / %5i",
374 nOverlapPhotons, nSelectedPhotons, nTotalPhotons);
376 Info(
APP_NAME,
"Application finished successfully");
const std::string bJetLabel
bool outputPassValue
Output value to assign passing objects.
int main(int argc, char *argv[])
bool boostedLeptons
Activate boosted-lepton recommendations (sliding dR cones)
uint64_t eventNumber() const
The current event's event number.
const ort::inputDecorator_t selectDec(inputLabel)
const std::string inputLabel
@ kAthenaAccess
Access containers/objects like Athena does.
const std::string outputLabel
StatusCode recommendedTools(const ORFlags &flags, ToolBox &toolBox)
Pre-configured standard recommended OR tools.
virtual Type::ObjectType type() const =0
The type of the object as a simple enumeration.
Helper class to provide constant type-safe access to aux data.
const ort::objLinkAccessor_t objLinkAcc("overlapObject")
Class providing the definition of the 4-vector interface.
uint32_t runNumber() const
The current event's run number.
const ort::inputAccessor_t selectAcc(inputLabel)
StatusCode readFrom(TFile *file)
POOL::TEvent event(POOL::TEvent::kClassAccess)
Helper class to provide type-safe access to aux data.
const ort::inputDecorator_t bJetDec(bJetLabel)
std::string bJetLabel
B-jet decoration.
virtual double pt() const =0
The transverse momentum ( ) of the particle.
void selectObjects(const ContainerType *container)
Defines helper functions for initializing the OR tools in C++.
Class describing the basic event information.
A relatively simple transient store for objects created in analysis.
A struct of global config options used to simplify the config helper interface.
StatusCode retrieve(const T *&obj)
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
const bool outputPassValue
Error
The different types of error that can be flagged in the L1TopoRDO.
void printObj(const char *APP_NAME, const char *type, const xAOD::IParticle *obj)
size_type size() const noexcept
Returns the number of elements in the collection.
Tool for accessing xAOD files outside of Athena.
const ort::outputAccessor_t overlapAcc(outputLabel)
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.