|
DAS
3.0
Das Analysis System
|
|
template<class Jet > |
bool | keepEvent (const vector< Jet > &jets, float pt1, float pt2) |
|
void | applyDijetSkim (const vector< fs::path > &inputs, const fs::path &output, const pt::ptree &config, const int steering, const DT::Slice slice={1, 0}) |
|
template<class Jet , class Dimuon > |
bool | keepEvent (const vector< Jet > &jets, const Dimuon &dimuon, float zpt, float jpt) |
|
void | applyZJetSkim (const vector< fs::path > &inputs, const fs::path &output, const pt::ptree &config, const int steering, const DT::Slice slice={1, 0}) |
|
◆ applyDijetSkim()
void DAS::Jets::applyDijetSkim |
( |
const vector< fs::path > & |
inputs, |
|
|
const fs::path & |
output, |
|
|
const pt::ptree & |
config, |
|
|
const int |
steering, |
|
|
const DT::Slice |
slice = {1,0} |
|
) |
| |
Skims the input tree to keep only events with at least two jets, with configurable pT thresholds.
- Parameters
-
inputs | input ROOT files (n-tuples) |
output | output ROOT file (n-tuple) |
config | config handled with `Darwin::Tools::options` |
steering | parameters obtained from explicit options |
slice | number and index of slice |
51 cout << __func__ <<
' ' << slice <<
" start" << endl;
54 auto tIn = flow.GetInputTree(
inputs, slice);
55 auto tOut = flow.GetOutputTree(output);
60 const auto pt1 =
config.get<
float>(
"skims.dijet.pt1");
61 metainfo.Set<
float>(
"skims",
"dijet",
"pt1", pt1);
63 const auto pt2 =
config.get<
float>(
"skims.dijet.pt2");
64 metainfo.Set<
float>(
"skims",
"dijet",
"pt2", pt2);
66 cout <<
"Skimming events: pt(jet1) > " << pt1 <<
"\t pt(jet2) > " << pt2 << endl;
68 auto recJets = flow.GetBranchReadOnly<vector<RecJet>>(
"recJets",
DT::facultative);
70 if (recJets !=
nullptr)
71 recDijet = flow.GetBranchWriteOnly<
RecDijet>(
"recDijet");
73 auto genJets = flow.GetBranchReadOnly<vector<GenJet>>(
"genJets",
DT::facultative);
75 if (genJets !=
nullptr)
76 genDijet = flow.GetBranchWriteOnly<
GenDijet>(
"genDijet");
78 if (!recJets && !genJets)
79 BOOST_THROW_EXCEPTION(
DE::BadInput(
"No jets in input tree", tIn) );
81 for (
DT::Looper looper(tIn); looper(); ++looper) {
85 bool passesRec =
true, passesGen =
true;
88 passesRec =
keepEvent(*recJets, pt1, pt2);
89 if (passesRec) *recDijet = recJets->at(0) + recJets->at(1);
90 else recDijet->clear();
93 passesGen =
keepEvent(*genJets, pt1, pt2);
94 if (passesGen) *genDijet = genJets->at(0) + genJets->at(1);
95 else genDijet->clear();
98 if ((steering &
DT::fill) && (passesRec || passesGen)) tOut->Fill();
101 metainfo.Set<
bool>(
"git",
"complete",
true);
103 cout << __func__ <<
' ' << slice <<
" stop" << endl;
◆ applyZJetSkim()
void DAS::Jets::applyZJetSkim |
( |
const vector< fs::path > & |
inputs, |
|
|
const fs::path & |
output, |
|
|
const pt::ptree & |
config, |
|
|
const int |
steering, |
|
|
const DT::Slice |
slice = {1,0} |
|
) |
| |
Skims the input tree to keep only events with at least two jets, with configurable pT thresholds.
- Parameters
-
inputs | input ROOT files (n-tuples) |
output | output ROOT file (n-tuple) |
config | config handled with `Darwin::Tools::options` |
steering | parameters obtained from explicit options |
slice | number and index of slice |
53 cout << __func__ <<
' ' << slice <<
" start" << endl;
56 auto tIn = flow.GetInputTree(
inputs, slice);
57 auto tOut = flow.GetOutputTree(output);
62 const auto zpt =
config.get<
float>(
"skims.ZJet.zpt");
63 metainfo.Set<
float>(
"skims",
"ZJet",
"zpt", zpt);
65 const auto jpt =
config.get<
float>(
"skims.ZJet.jpt");
66 metainfo.Set<
float>(
"skims",
"ZJet",
"jpt", jpt);
68 cout <<
"Skimming events: pt(Z) > " << zpt <<
"\t pt(jet) > " << jpt << endl;
70 auto recJets = flow.GetBranchReadOnly<vector<RecJet>>(
"recJets",
DT::facultative);
71 auto genJets = flow.GetBranchReadOnly<vector<GenJet>>(
"genJets",
DT::facultative);
72 if (!recJets && !genJets)
73 BOOST_THROW_EXCEPTION(
DE::BadInput(
"No jets in input tree", tIn) );
77 if (!recDimuon && !genDimuon)
78 BOOST_THROW_EXCEPTION(
DE::BadInput(
"No dimuon in input tree", tIn) );
81 if (recJets && recDimuon)
82 recZJet = flow.GetBranchWriteOnly<
RecZJet>(
"recZJet");
84 if (genJets && genDimuon)
85 genZJet = flow.GetBranchWriteOnly<
GenZJet>(
"genZJet");
87 for (
DT::Looper looper(tIn); looper(); ++looper) {
91 bool passesRec =
true, passesGen =
true;
94 passesRec =
keepEvent(*recJets, *recDimuon, zpt, jpt);
95 if (passesRec) *recZJet = *recDimuon + recJets->at(0);
96 else recZJet->clear();
99 passesGen =
keepEvent(*genJets, *genDimuon, zpt, jpt);
100 if (passesGen) *genZJet = *genDimuon + genJets->at(0);
101 else genZJet->clear();
104 if ((steering &
DT::fill) && (passesRec || passesGen)) tOut->Fill();
107 metainfo.Set<
bool>(
"git",
"complete",
true);
109 cout << __func__ <<
' ' << slice <<
" stop" << endl;
◆ keepEvent() [1/2]
bool DAS::Jets::keepEvent |
( |
const vector< Jet > & |
jets, |
|
|
const Dimuon & |
dimuon, |
|
|
float |
zpt, |
|
|
float |
jpt |
|
) |
| |
Checks whether an event should be kept.
38 return jets.size() >= 2 &&
jets[0].p4.Pt() > jpt &&
39 dimuon && dimuon.CorrP4().Pt() > zpt;
◆ keepEvent() [2/2]
bool DAS::Jets::keepEvent |
( |
const vector< Jet > & |
jets, |
|
|
float |
pt1, |
|
|
float |
pt2 |
|
) |
| |
Checks whether an event should be kept.
37 return jets.size() >= 2 &&
jets[0].p4.Pt() > pt1 &&
jets[1].p4.Pt() > pt2;
static bool verbose
Definition: Step.h:40
Di< GenJet, GenJet > GenDijet
Definition: Di.h:77
Di< GenDimuon, GenJet > GenZJet
Definition: Di.h:79
string jets
Definition: Ntupliser_cfg.py:41
config
Definition: Ntupliser_cfg.py:264
Di< RecDimuon, RecJet > RecZJet
Definition: Di.h:82
bool keepEvent(const vector< Jet > &jets, const Dimuon &dimuon, float zpt, float jpt)
Checks whether an event should be kept.
Definition: applyZJetSkim.cc:36
Di< RecJet, RecJet > RecDijet
Definition: Di.h:80
def inputs
Definition: jercExample.py:118
bool keepEvent(const vector< Jet > &jets, float pt1, float pt2)
Checks whether an event should be kept.
Definition: applyDijetSkim.cc:35
Di< RecMuon, RecMuon > RecDimuon
Definition: Di.h:81
Di< GenMuon, GenMuon > GenDimuon
Definition: Di.h:78