Skip to content
Snippets Groups Projects
Commit e35769a6 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'fixes06.08.2021' into 'master'

Fixes for the nightlies 06.08.2021

See merge request !45666
parents 8914c4fa 71be4f30
No related branches found
No related tags found
5 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!51674Fixing hotSpotInHIST for Run3 HIST,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45666Fixes for the nightlies 06.08.2021
......@@ -51,38 +51,42 @@ StatusCode DirectPhotonFilter::filterInitialize() {
return StatusCode::SUCCESS;
}
bool DirectPhotonFilterCmpByPt(HepMC::GenParticle* p1, HepMC::GenParticle* p2) {
bool DirectPhotonFilterCmpByPt(HepMC::ConstGenParticlePtr p1, HepMC::ConstGenParticlePtr p2) {
return (p1->momentum().perp()>p2->momentum().perp());
}
StatusCode DirectPhotonFilter::filterEvent() {
std::vector<HepMC::GenParticle*> promptPhotonsInEta;
std::vector<HepMC::ConstGenParticlePtr> promptPhotonsInEta;
int phot = 0;
for (McEventCollection::const_iterator itr = events_const()->begin(); itr!=events_const()->end(); ++itr) {
const HepMC::GenEvent* genEvt = (*itr);
ATH_MSG_DEBUG("----->>> Process : " << genEvt->signal_process_id());
ATH_MSG_DEBUG("----->>> Process : " << HepMC::signal_process_id(genEvt));
// Find all prompt photons with within given eta range
for (HepMC::GenEvent::particle_const_iterator pitr=genEvt->particles_begin(); pitr!=genEvt->particles_end(); ++pitr) {
if ((*pitr)->pdg_id() == 22 &&
(*pitr)->status() == 1 &&
fabs((*pitr)->momentum().pseudoRapidity()) <= m_EtaRange) {
for (auto pitr: *genEvt) {
if (pitr->pdg_id() == 22 &&
pitr->status() == 1 &&
std::abs(pitr->momentum().pseudoRapidity()) <= m_EtaRange) {
// iterate over parent particles to exclude photons from hadron decays
HepMC::GenVertex* prodVtx = (*pitr)->production_vertex();
auto prodVtx = pitr->production_vertex();
bool fromHadron(false);
for (auto parent = prodVtx->particles_begin(HepMC::parents);
parent != prodVtx->particles_end(HepMC::parents); ++parent) {
int pdgindex = abs((*parent)->pdg_id());
ATH_MSG_DEBUG("Looping on Production (parents) vertex : " << (*parent)->pdg_id() << " " << (*parent)->barcode());
#ifdef HEPMC3
for (auto parent: prodVtx->particles_in()) {
#else
for (auto parent_it = prodVtx->particles_begin(HepMC::parents); parent_it != prodVtx->particles_end(HepMC::parents); ++parent_it) {
auto parent=*parent_it;
#endif
int pdgindex = std::abs(parent->pdg_id());
ATH_MSG_DEBUG("Looping on Production (parents) vertex : " << parent->pdg_id() << " " << HepMC::barcode(parent));
if (pdgindex > 100) {
fromHadron = true;
if (m_AllowSUSYDecay && ( (pdgindex > 1000000 && pdgindex < 1000040) || (pdgindex > 2000000 && pdgindex < 2000016) ) ) fromHadron = false;
}
}
phot++;
if (!fromHadron) promptPhotonsInEta.push_back((*pitr));
if (!fromHadron) promptPhotonsInEta.push_back(pitr);
else ATH_MSG_INFO("non-prompt photon ignored");
}
}
......
......@@ -10,21 +10,21 @@
//
// Written by Dominik Derendarz (dominik.derendarz@cern.ch) based on MultiBjetFilter
#include <math.h>
#include <fstream>
// Header for this module:-
#include "GeneratorFilters/MultiCjetFilter.h"
// Other classes used by this class:-
#include <math.h>
#include "GaudiKernel/SystemOfUnits.h"
#include "xAODJet/JetContainer.h"
#include "McParticleEvent/TruthParticle.h"
#include "CxxUtils/BasicTypes.h"
#include "TLorentzVector.h"
#include <fstream>
using HepMC::GenVertex;
using HepMC::GenParticle;
MultiCjetFilter::MultiCjetFilter(const std::string& name, ISvcLocator* pSvcLocator)
: GenFilter(name,pSvcLocator){
......@@ -112,7 +112,6 @@ StatusCode MultiCjetFilter::filterEvent() {
for(itr = events_const()->begin(); itr!=events_const()->end(); ++itr) {
const HepMC::GenEvent* genEvt = (*itr);
weight = genEvt->weights().front();
HepMC::GenEvent::particle_const_iterator pitr;
// Make a vector containing all the event's b-hadrons
std::vector< HepMC::ConstGenParticlePtr > bHadrons;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment