Commit 61d6a17d authored by Tomas Dado's avatar Tomas Dado Committed by Nils Erik Krumnack
Browse files

AnalysisTop: Adding support for photon triggers

parent 2e95cae8
......@@ -1388,6 +1388,13 @@ namespace top {
if (m_mu_trigMatched.find(trigger_name) != m_mu_trigMatched.end()) continue;
m_mu_trigMatched [trigger_name] = std::vector<char>();
}
for (auto& trigger_name : m_config->photonTriggers_Tight(branchName))
m_ph_trigMatched [trigger_name] = std::vector<char>();
for (auto& trigger_name : m_config->photonTriggers_Loose(branchName)) {
// let's make sure this isn't done twice
if (m_ph_trigMatched.find(trigger_name) != m_ph_trigMatched.end()) continue;
m_ph_trigMatched [trigger_name] = std::vector<char>();
}
++index;
}
......@@ -1397,6 +1404,8 @@ namespace top {
systematicTree->makeOutputVariable(trig_name.second, "el_trigMatch_" + trig_name.first);
for (auto& trig_name : m_mu_trigMatched)
systematicTree->makeOutputVariable(trig_name.second, "mu_trigMatch_" + trig_name.first);
for (auto& trig_name : m_ph_trigMatched)
systematicTree->makeOutputVariable(trig_name.second, "ph_trigMatch_" + trig_name.first);
}
setupUpgradeTreeManager();
......@@ -2500,6 +2509,8 @@ namespace top {
m_ph_phi.resize(event.m_photons.size());
m_ph_e.resize(event.m_photons.size());
m_ph_iso.resize(event.m_photons.size());
for (const auto& trigger : m_ph_trigMatched)
m_ph_trigMatched[trigger.first].resize(event.m_photons.size());
for (const auto* const phPtr : event.m_photons) {
m_ph_pt[i] = phPtr->pt();
m_ph_eta[i] = phPtr->eta();
......@@ -2508,6 +2519,10 @@ namespace top {
m_ph_iso[i] = 0.;
if (phPtr->isAvailable<float>("ptvarcone20")) m_ph_iso[i] = phPtr->auxdata<float>("ptvarcone20");
for (const auto& trigger : m_ph_trigMatched) {
std::string trig = "TRIGMATCH_" + trigger.first;
m_ph_trigMatched[trigger.first][i] = phPtr->auxdataConst<char>(trig);
}
++i;
}
......
......@@ -623,6 +623,7 @@ namespace top {
std::vector<float> m_ph_true_origin;
std::vector<float> m_ph_faketype;
std::vector<float> m_ph_iso;
std::unordered_map<std::string, std::vector<char> > m_ph_trigMatched;
//taus
std::vector<float> m_tau_pt;
......
......@@ -340,10 +340,12 @@ namespace top {
m_electronTriggers_Tight(nullptr),
m_muonTriggers_Tight(nullptr),
m_tauTriggers_Tight(nullptr),
m_photonTriggers_Tight(nullptr),
m_allTriggers_Loose(nullptr),
m_electronTriggers_Loose(nullptr),
m_muonTriggers_Loose(nullptr),
m_tauTriggers_Loose(nullptr),
m_photonTriggers_Loose(nullptr),
// Where the sum of event weights
// before derivation framework is kept
......@@ -3442,6 +3444,15 @@ namespace top {
return m_dummyTrigger;
}
const std::vector<std::string>& TopConfig::photonTriggers_Tight(const std::string& selection) const {
std::unordered_map<std::string,
std::vector<std::string> >::const_iterator key = m_photonTriggers_Tight->find(selection);
if (key != m_photonTriggers_Tight->end()) {
return (*key).second;
}
return m_dummyTrigger;
}
const std::vector<std::string>& TopConfig::allTriggers_Loose(const std::string& selection) const {
std::unordered_map<std::string,
std::vector<std::string> >::const_iterator key = m_allTriggers_Loose->find(selection);
......@@ -3478,6 +3489,15 @@ namespace top {
return m_dummyTrigger;
}
const std::vector<std::string>& TopConfig::photonTriggers_Loose(const std::string& selection) const {
std::unordered_map<std::string,
std::vector<std::string> >::const_iterator key = m_photonTriggers_Loose->find(selection);
if (key != m_photonTriggers_Loose->end()) {
return (*key).second;
}
return m_dummyTrigger;
}
///-- top::TopPersistentSettings allows us to take a snapshot of top::TopConfig --///
///-- and save it to a mini-xAOD. We can then re-create the top::TopConfig from file --///
top::TopPersistentSettings* TopConfig::createPersistentSettings() {
......@@ -3616,8 +3636,14 @@ namespace top {
out->m_electronTriggers_Tight.insert(i);
}
for (auto i : *m_muonTriggers_Tight) {
out->m_muonTriggers_Tight.insert(i);
}
for (auto i : *m_tauTriggers_Tight) {
out->m_tauTriggers_Tight.insert(i);
}
for (auto i : *m_photonTriggers_Tight) {
out->m_photonTriggers_Tight.insert(i);
}
for (auto i : *m_allTriggers_Loose) {
out->m_allTriggers_Loose.insert(i);
......@@ -3631,6 +3657,9 @@ namespace top {
for (auto i : *m_tauTriggers_Loose) {
out->m_tauTriggers_Loose.insert(i);
}
for (auto i : *m_photonTriggers_Loose) {
out->m_photonTriggers_Loose.insert(i);
}
return out;
}
......@@ -3772,11 +3801,13 @@ namespace top {
m_electronTriggers_Tight = std::make_shared<std::unordered_map<std::string, std::vector<std::string> > >();
m_muonTriggers_Tight = std::make_shared<std::unordered_map<std::string, std::vector<std::string> > >();
m_tauTriggers_Tight = std::make_shared<std::unordered_map<std::string, std::vector<std::string> > >();
m_photonTriggers_Tight = std::make_shared<std::unordered_map<std::string, std::vector<std::string> > >();
m_allTriggers_Loose = std::make_shared<std::unordered_map<std::string, std::vector<std::string> > >();
m_electronTriggers_Loose = std::make_shared<std::unordered_map<std::string, std::vector<std::string> > >();
m_muonTriggers_Loose = std::make_shared<std::unordered_map<std::string, std::vector<std::string> > >();
m_tauTriggers_Loose = std::make_shared<std::unordered_map<std::string, std::vector<std::string> > >();
m_photonTriggers_Loose = std::make_shared<std::unordered_map<std::string, std::vector<std::string> > >();
for (auto i : settings->m_allTriggers_Tight) {
m_allTriggers_Tight->insert(i);
......@@ -3790,6 +3821,9 @@ namespace top {
for (auto i : settings->m_tauTriggers_Tight) {
m_tauTriggers_Tight->insert(i);
}
for (auto i : settings->m_photonTriggers_Tight) {
m_photonTriggers_Tight->insert(i);
}
for (auto i : settings->m_allTriggers_Loose) {
m_allTriggers_Loose->insert(i);
......@@ -3803,6 +3837,9 @@ namespace top {
for (auto i : settings->m_tauTriggers_Loose) {
m_tauTriggers_Loose->insert(i);
}
for (auto i : settings->m_photonTriggers_Loose) {
m_photonTriggers_Loose->insert(i);
}
fixConfiguration();
}
......
......@@ -82,10 +82,12 @@ namespace top {
m_electronTriggers_Tight(),
m_muonTriggers_Tight(),
m_tauTriggers_Tight(),
m_photonTriggers_Tight(),
m_allTriggers_Loose(),
m_electronTriggers_Loose(),
m_muonTriggers_Loose(),
m_tauTriggers_Loose()
m_tauTriggers_Loose(),
m_photonTriggers_Loose()
{}
}
......@@ -504,6 +504,13 @@ namespace top {
}
}
inline virtual void photonTriggers_Tight(std::shared_ptr<std::unordered_map<std::string,
std::vector<std::string> > > triggers) {
if (!m_configFixed) {
m_photonTriggers_Tight = triggers;
}
}
inline virtual void allTriggers_Loose(std::shared_ptr<std::unordered_map<std::string,
std::vector<std::string> > > triggers) {
if (!m_configFixed) {
......@@ -532,16 +539,25 @@ namespace top {
}
}
inline virtual void photonTriggers_Loose(std::shared_ptr<std::unordered_map<std::string,
std::vector<std::string> > > triggers) {
if (!m_configFixed) {
m_photonTriggers_Loose = triggers;
}
}
inline std::shared_ptr<std::vector<std::string> > allSelectionNames() const {return m_allSelectionNames;}
virtual const std::vector<std::string>& allTriggers_Tight(const std::string& selection) const;
virtual const std::vector<std::string>& electronTriggers_Tight(const std::string& selection) const;
virtual const std::vector<std::string>& muonTriggers_Tight(const std::string& selection) const;
virtual const std::vector<std::string>& tauTriggers_Tight(const std::string& selection) const;
virtual const std::vector<std::string>& photonTriggers_Tight(const std::string& selection) const;
virtual const std::vector<std::string>& allTriggers_Loose(const std::string& selection) const;
virtual const std::vector<std::string>& electronTriggers_Loose(const std::string& selection) const;
virtual const std::vector<std::string>& muonTriggers_Loose(const std::string& selection) const;
virtual const std::vector<std::string>& tauTriggers_Loose(const std::string& selection) const;
virtual const std::vector<std::string>& photonTriggers_Loose(const std::string& selection) const;
// StoreGate Keys
virtual void sgKeyMCParticle(const std::string& s);
......@@ -2648,10 +2664,12 @@ namespace top {
std::shared_ptr<std::unordered_map<std::string, std::vector<std::string> > > m_electronTriggers_Tight;
std::shared_ptr<std::unordered_map<std::string, std::vector<std::string> > > m_muonTriggers_Tight;
std::shared_ptr<std::unordered_map<std::string, std::vector<std::string> > > m_tauTriggers_Tight;
std::shared_ptr<std::unordered_map<std::string, std::vector<std::string> > > m_photonTriggers_Tight;
std::shared_ptr<std::unordered_map<std::string, std::vector<std::string> > > m_allTriggers_Loose;
std::shared_ptr<std::unordered_map<std::string, std::vector<std::string> > > m_electronTriggers_Loose;
std::shared_ptr<std::unordered_map<std::string, std::vector<std::string> > > m_muonTriggers_Loose;
std::shared_ptr<std::unordered_map<std::string, std::vector<std::string> > > m_tauTriggers_Loose;
std::shared_ptr<std::unordered_map<std::string, std::vector<std::string> > > m_photonTriggers_Loose;
std::vector<std::string> m_dummyTrigger;
// Where the sum of event weights
......
......@@ -111,11 +111,13 @@ namespace top {
std::unordered_map<std::string, std::vector<std::string> > m_electronTriggers_Tight;
std::unordered_map<std::string, std::vector<std::string> > m_muonTriggers_Tight;
std::unordered_map<std::string, std::vector<std::string> > m_tauTriggers_Tight;
std::unordered_map<std::string, std::vector<std::string> > m_photonTriggers_Tight;
std::unordered_map<std::string, std::vector<std::string> > m_allTriggers_Loose;
std::unordered_map<std::string, std::vector<std::string> > m_electronTriggers_Loose;
std::unordered_map<std::string, std::vector<std::string> > m_muonTriggers_Loose;
std::unordered_map<std::string, std::vector<std::string> > m_tauTriggers_Loose;
std::unordered_map<std::string, std::vector<std::string> > m_photonTriggers_Loose;
};
}
// Dictonaries
......
......@@ -14,9 +14,11 @@ namespace top {
m_electronTriggers_Tight = config->electronTriggers_Tight(selectorName);
m_muonTriggers_Tight = config->muonTriggers_Tight(selectorName);
m_tauTriggers_Tight = config->tauTriggers_Tight(selectorName);
m_photonTriggers_Tight = config->photonTriggers_Tight(selectorName);
m_electronTriggers_Loose = config->electronTriggers_Loose(selectorName);
m_muonTriggers_Loose = config->muonTriggers_Loose(selectorName);
m_tauTriggers_Loose = config->tauTriggers_Loose(selectorName);
m_photonTriggers_Loose = config->photonTriggers_Loose(selectorName);
}
bool TrigMatchSelector::apply(const top::Event& event) const {
......@@ -26,9 +28,9 @@ namespace top {
// if no trigger menu us associated to this selection, return true
// no effect of TRIGMATCH if TRIGDEC wasn't used
if (!loose) {
if (m_electronTriggers_Tight.size() + m_muonTriggers_Tight.size() + m_tauTriggers_Tight.size() == 0) return true;
if (m_electronTriggers_Tight.size() + m_muonTriggers_Tight.size() + m_tauTriggers_Tight.size() + m_photonTriggers_Tight.size() == 0) return true;
} else {
if (m_electronTriggers_Loose.size() + m_muonTriggers_Loose.size() + m_tauTriggers_Loose.size() == 0) return true;
if (m_electronTriggers_Loose.size() + m_muonTriggers_Loose.size() + m_tauTriggers_Loose.size() + m_photonTriggers_Loose.size() == 0) return true;
}
bool trigMatch(false);
......@@ -76,6 +78,20 @@ namespace top {
} // Loop over triggers
} // Loop over taus
// Loop over photons
for (const auto* const photonPtr : event.m_photons) {
// Loop over triggers; loose ones for loose events, tight ones for tight events
for (const auto& trigger : loose ? m_photonTriggers_Loose : m_photonTriggers_Tight) {
std::string trig = "TRIGMATCH_" + trigger;
if (photonPtr->isAvailable<char>(trig)) {
if (photonPtr->auxdataConst<char>(trig) == 1) {
trigMatch = true;
return trigMatch;
}
} // decoration isAvailable
} // Loop over triggers
} // Loop over photons
return trigMatch;
}
......
......@@ -29,9 +29,11 @@ namespace top {
std::vector<std::string> m_electronTriggers_Tight;
std::vector<std::string> m_muonTriggers_Tight;
std::vector<std::string> m_tauTriggers_Tight;
std::vector<std::string> m_photonTriggers_Tight;
std::vector<std::string> m_electronTriggers_Loose;
std::vector<std::string> m_muonTriggers_Loose;
std::vector<std::string> m_tauTriggers_Loose;
std::vector<std::string> m_photonTriggers_Loose;
};
}
......
......@@ -112,10 +112,12 @@ namespace top {
m_electronTriggers_Tight.clear();
m_muonTriggers_Tight.clear();
m_tauTriggers_Tight.clear();
m_photonTriggers_Tight.clear();
m_allTriggers_Loose.clear();
m_electronTriggers_Loose.clear();
m_muonTriggers_Loose.clear();
m_tauTriggers_Loose.clear();
m_photonTriggers_Loose.clear();
// Trigger maps for TopConfig - to be used by individual selectors
std::shared_ptr<std::unordered_map<std::string, std::vector<std::string> > > allTriggers_perSelector_Tight
......@@ -126,6 +128,8 @@ namespace top {
(new std::unordered_map<std::string, std::vector<std::string> > );
std::shared_ptr<std::unordered_map<std::string, std::vector<std::string> > > tauTriggers_perSelector_Tight
(new std::unordered_map<std::string, std::vector<std::string> > );
std::shared_ptr<std::unordered_map<std::string, std::vector<std::string> > > photonTriggers_perSelector_Tight
(new std::unordered_map<std::string, std::vector<std::string> > );
std::shared_ptr<std::unordered_map<std::string, std::vector<std::string> > > allTriggers_perSelector_Loose
(new std::unordered_map<std::string, std::vector<std::string> > );
std::shared_ptr<std::unordered_map<std::string, std::vector<std::string> > > electronTriggers_perSelector_Loose
......@@ -134,6 +138,8 @@ namespace top {
(new std::unordered_map<std::string, std::vector<std::string> > );
std::shared_ptr<std::unordered_map<std::string, std::vector<std::string> > > tauTriggers_perSelector_Loose
(new std::unordered_map<std::string, std::vector<std::string> > );
std::shared_ptr<std::unordered_map<std::string, std::vector<std::string> > > photonTriggers_perSelector_Loose
(new std::unordered_map<std::string, std::vector<std::string> > );
// Loop over all selections
......@@ -147,11 +153,13 @@ namespace top {
std::vector<std::string> electronTriggers_thisSelector_Tight;
std::vector<std::string> muonTriggers_thisSelector_Tight;
std::vector<std::string> tauTriggers_thisSelector_Tight;
std::vector<std::string> photonTriggers_thisSelector_Tight;
std::list<std::string> listAllTriggers_thisSelector_Loose;
std::vector<std::string> allTriggers_thisSelector_Loose;
std::vector<std::string> electronTriggers_thisSelector_Loose;
std::vector<std::string> muonTriggers_thisSelector_Loose;
std::vector<std::string> tauTriggers_thisSelector_Loose;
std::vector<std::string> photonTriggers_thisSelector_Loose;
// Loop over cut names and look for TRIGDEC, GRL, GOODCALO, PRIVTX
bool selectionHasTriggerCut(false);
......@@ -243,12 +251,16 @@ namespace top {
if ((trigger.find("_tau") != std::string::npos)) {
tauTriggers_thisSelector_Tight.push_back(trigger);
}
if (isPhotonTrigger(trigger)) {
photonTriggers_thisSelector_Tight.push_back(trigger);
}
}
allTriggers_perSelector_Tight->insert(std::make_pair(sel.m_name, allTriggers_thisSelector_Tight));
electronTriggers_perSelector_Tight->insert(std::make_pair(sel.m_name, electronTriggers_thisSelector_Tight));
muonTriggers_perSelector_Tight->insert(std::make_pair(sel.m_name, muonTriggers_thisSelector_Tight));
tauTriggers_perSelector_Tight->insert(std::make_pair(sel.m_name, tauTriggers_thisSelector_Tight));
photonTriggers_perSelector_Tight->insert(std::make_pair(sel.m_name, photonTriggers_thisSelector_Tight));
} // Cut requested is TRIGDEC_TIGHT
else if (starts_with(cut, "TRIGDEC_LOOSE ")) {
if (selectionHasTriggerCut_Loose) {
......@@ -291,12 +303,16 @@ namespace top {
if ((trigger.find("_tau") != std::string::npos)) {
tauTriggers_thisSelector_Loose.push_back(trigger);
}
if (isPhotonTrigger(trigger)) {
photonTriggers_thisSelector_Loose.push_back(trigger);
}
}
allTriggers_perSelector_Loose->insert(std::make_pair(sel.m_name, allTriggers_thisSelector_Loose));
electronTriggers_perSelector_Loose->insert(std::make_pair(sel.m_name, electronTriggers_thisSelector_Loose));
muonTriggers_perSelector_Loose->insert(std::make_pair(sel.m_name, muonTriggers_thisSelector_Loose));
tauTriggers_perSelector_Loose->insert(std::make_pair(sel.m_name, tauTriggers_thisSelector_Loose));
photonTriggers_perSelector_Loose->insert(std::make_pair(sel.m_name, photonTriggers_thisSelector_Loose));
} // Cut requested is TRIGDEC_LOOSE
else if (starts_with(cut, "TRIGDEC ")) {
if (selectionHasTriggerCut) {
......@@ -349,6 +365,9 @@ namespace top {
if ((trigger.find("_tau") != std::string::npos)) {
tauTriggers_thisSelector_Tight.push_back(trigger);
}
if (isPhotonTrigger(trigger)) {
photonTriggers_thisSelector_Tight.push_back(trigger);
}
}
for (const auto& trigger : allTriggers_thisSelector_Loose) {
......@@ -361,17 +380,22 @@ namespace top {
if ((trigger.find("_tau") != std::string::npos)) {
tauTriggers_thisSelector_Loose.push_back(trigger);
}
if (isPhotonTrigger(trigger)) {
photonTriggers_thisSelector_Loose.push_back(trigger);
}
}
allTriggers_perSelector_Tight->insert(std::make_pair(sel.m_name, allTriggers_thisSelector_Tight));
electronTriggers_perSelector_Tight->insert(std::make_pair(sel.m_name, electronTriggers_thisSelector_Tight));
muonTriggers_perSelector_Tight->insert(std::make_pair(sel.m_name, muonTriggers_thisSelector_Tight));
tauTriggers_perSelector_Tight->insert(std::make_pair(sel.m_name, tauTriggers_thisSelector_Tight));
photonTriggers_perSelector_Tight->insert(std::make_pair(sel.m_name, photonTriggers_thisSelector_Tight));
allTriggers_perSelector_Loose->insert(std::make_pair(sel.m_name, allTriggers_thisSelector_Loose));
electronTriggers_perSelector_Loose->insert(std::make_pair(sel.m_name, electronTriggers_thisSelector_Loose));
muonTriggers_perSelector_Loose->insert(std::make_pair(sel.m_name, muonTriggers_thisSelector_Loose));
tauTriggers_perSelector_Loose->insert(std::make_pair(sel.m_name, tauTriggers_thisSelector_Loose));
photonTriggers_perSelector_Loose->insert(std::make_pair(sel.m_name, photonTriggers_thisSelector_Loose));
} // Cut requested is TRIGDEC
} // Loop over all cuts
......@@ -431,6 +455,9 @@ namespace top {
if ((trigger.find("_tau") != std::string::npos)) {
m_tauTriggers_Tight.push_back(trigger);
}
if (isPhotonTrigger(trigger)) {
m_photonTriggers_Tight.push_back(trigger);
}
}
// Split triggers into electron, muon and tau
for (const auto& trigger : m_allTriggers_Loose) {
......@@ -443,6 +470,9 @@ namespace top {
if ((trigger.find("_tau") != std::string::npos)) {
m_tauTriggers_Loose.push_back(trigger);
}
if (isPhotonTrigger(trigger)) {
m_photonTriggers_Loose.push_back(trigger);
}
}
// Tell TopConfig about the triggers
......@@ -450,10 +480,12 @@ namespace top {
m_config->electronTriggers_Tight(electronTriggers_perSelector_Tight);
m_config->muonTriggers_Tight(muonTriggers_perSelector_Tight);
m_config->tauTriggers_Tight(tauTriggers_perSelector_Tight);
m_config->photonTriggers_Tight(photonTriggers_perSelector_Tight);
m_config->allTriggers_Loose(allTriggers_perSelector_Loose);
m_config->electronTriggers_Loose(electronTriggers_perSelector_Loose);
m_config->muonTriggers_Loose(muonTriggers_perSelector_Loose);
m_config->tauTriggers_Loose(tauTriggers_perSelector_Loose);
m_config->photonTriggers_Loose(photonTriggers_perSelector_Loose);
// If the user has requested that all events are saved, then we'd better turn off the vetos
if (!m_config->saveOnlySelectedEvents()) {
......@@ -606,6 +638,7 @@ namespace top {
if (m_config->useElectrons()) matchElectrons();
if (m_config->useMuons()) matchMuons();
if (m_config->useTaus()) matchTaus();
if (m_config->usePhotons()) matchPhotons();
// Do we veto events? Only if ALL selectors request TRIGDEC and no trigger passes
if (m_vetoEventsTrigger) {
......@@ -719,6 +752,38 @@ namespace top {
}
}
void EventCleaningSelection::matchPhotons() {
const xAOD::EventInfo* eventInfo(nullptr);
top::check(evtStore()->retrieve(eventInfo, m_config->sgKeyEventInfo()),
"Failed to retrieve EventInfo");
// Take photons from input file.
// Decorate these before doing any calibration/shallow copies
const xAOD::PhotonContainer* photons(nullptr);
top::check(evtStore()->retrieve(photons, m_config->sgKeyPhotons()),
"Failed to retrieve photons");
// Loop over photons
std::unordered_set<std::string> triggers;
triggers.insert(m_photonTriggers_Tight.begin(), m_photonTriggers_Tight.end());
triggers.insert(m_photonTriggers_Loose.begin(), m_photonTriggers_Loose.end());
for (const auto* photon : *photons) {
// Loop over photon triggers
for (const auto& trigger : triggers) {
bool match(false);
// Match even if event fails trigger decision - it's important in case of pre-scaled menus
if (photon->isAvailable<char>(m_config->getDerivationStream() + "_" + trigger)) {
match = photon->auxdataConst<char>(m_config->getDerivationStream() + "_" + trigger);
} else {
match = m_trigMatchTool->match(*photon, trigger);
}
char decoration = match ? 1 : 0;
photon->auxdecor<char>("TRIGMATCH_" + trigger) = decoration;
}
}
}
void EventCleaningSelection::addExtraBranches(std::vector<std::string>& extraBranchList) {
for (const auto& trigger : m_allTriggers_Tight)
extraBranchList.push_back("TRIGDEC_" + trigger);
......@@ -764,4 +829,12 @@ namespace top {
bool success;
return(TrigGlobEffCorr::ImportData::associatedLeptonFlavour(trigger.substr(4), success) == xAOD::Type::Muon);
}
bool EventCleaningSelection::isPhotonTrigger(std::string const& trigger) const {
// this is really not the best way to do it, but TrigGlobEffCorr doesnt seem to be able to identify photon triggers
if (trigger.find("_1g") != std::string::npos) return true;
if (trigger.find("_2g") != std::string::npos) return true;
return false;
}
}
......@@ -55,6 +55,7 @@ namespace top {
bool isElectronTrigger(std::string const& trigger) const;
bool isMuonTrigger(std::string const& trigger) const;
bool isPhotonTrigger(std::string const& trigger) const;
static std::vector<std::string> getIndividualFromGlobalTriggers(std::vector<std::string> const& triggers);
private:
///Match offline electrons to the trigger
......@@ -66,6 +67,9 @@ namespace top {
///Match offline taus to the trigger
void matchTaus();
///Match offline photon to the trigger
void matchPhotons();
/// Top config
std::shared_ptr<top::TopConfig> m_config;
......@@ -93,10 +97,12 @@ namespace top {
std::vector<std::string> m_electronTriggers_Tight;
std::vector<std::string> m_muonTriggers_Tight;
std::vector<std::string> m_tauTriggers_Tight;
std::vector<std::string> m_photonTriggers_Tight;
std::vector<std::string> m_allTriggers_Loose;
std::vector<std::string> m_electronTriggers_Loose;
std::vector<std::string> m_muonTriggers_Loose;
std::vector<std::string> m_tauTriggers_Loose;
std::vector<std::string> m_photonTriggers_Loose;
/// Apply a logical OR cut to all supplied triggers
/// If ANY selection does not request the trigger, this will not be set
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment