Commit ebc49336 authored by Andrii Verbytskyi's avatar Andrii Verbytskyi Committed by Vakhtang Tsulaia
Browse files

Copy some neutral changes fom the HepMC3part2 MR

parent 07d2aec7
......@@ -185,7 +185,7 @@ namespace xAODMaker {
if (isSignalProcess) {
xTruthEventContainer->push_back( xTruthEvent );
// Cross-section
const HepMC::GenCrossSection* const crossSection = genEvt->cross_section();
auto crossSection = genEvt->cross_section();
xTruthEvent->setCrossSection(crossSection ? (float)crossSection->cross_section() : -1);
xTruthEvent->setCrossSectionError(crossSection ? (float)crossSection->cross_section_error() : -1);
......@@ -209,7 +209,7 @@ namespace xAODMaker {
xTruthEvent->setWeights(weights);
// Heavy ion info
const HepMC::HeavyIon* const hiInfo = genEvt->heavy_ion();
auto const hiInfo = genEvt->heavy_ion();
if (hiInfo) {
xTruthEvent->setHeavyIonParameter(hiInfo->Ncoll_hard(), xAOD::TruthEvent::NCOLLHARD);
xTruthEvent->setHeavyIonParameter(hiInfo->Npart_proj(), xAOD::TruthEvent::NPARTPROJ);
......@@ -230,7 +230,7 @@ namespace xAODMaker {
// Parton density info
// This will exist 99% of the time, except for e.g. cosmic or particle gun simulation
const HepMC::PdfInfo* const pdfInfo = genEvt->pdf_info();
auto const pdfInfo = genEvt->pdf_info();
if (pdfInfo) {
xTruthEvent->setPdfInfoParameter(pdfInfo->id1(), xAOD::TruthEvent::PDGID1);
xTruthEvent->setPdfInfoParameter(pdfInfo->id2(), xAOD::TruthEvent::PDGID2);
......@@ -425,8 +425,7 @@ namespace xAODMaker {
// FIXME: class member protection violation here.
// This appears to be because WeightContainer has no public methods
// to get information about the weight names.
const std::map<std::string,HepMC::WeightContainer::size_type>& weightNameMap =
genEvt.weights().m_names;
const auto& weightNameMap = genEvt.weights().m_names;
std::vector<std::string> orderedWeightNameVec;
orderedWeightNameVec.reserve( weightNameMap.size() );
for (const auto& entry: weightNameMap) {
......
......@@ -193,9 +193,9 @@ StatusCode BeamHaloGeneratorAlg::callGenerator() {
// Fill monitoring plots if requested
if(m_doMonitoringPlots) {
HepMC::WeightContainer weightContainer = m_evt.weights();
auto weightContainer = m_evt.weights();
if(weightContainer.size() != 5) {
ATH_MSG_WARNING("HepMC::WeightContainer does not contain five elements.");
ATH_MSG_WARNING("The number of weights for this event is not equal to 5.");
return StatusCode::SUCCESS;
}
double weight = weightContainer[0];
......
......@@ -21,6 +21,8 @@
#include "AtlasHepMC/HEPEVT_Wrapper.h"
#include "AtlasHepMC/IO_HEPEVT.h"
#include "AtlasHepMC/GenEvent.h"
#include "AtlasHepMC/HeavyIon.h"
#include "Epos_i/Epos.h"
......
......@@ -520,7 +520,7 @@ StatusCode TestHepMC::execute() {
int tau_child = 0;
if (abs(ppdgid) == m_pdg && (pstatus == 1 || pstatus == 2)) {
++m_TotalTaus;
HepMC::GenVertex* vtx = (*pitr)->end_vertex();
auto vtx = (*pitr)->end_vertex();
if (vtx) {
double p_energy = 0;
HepMC::GenVertex::particle_iterator desc = vtx->particles_begin(HepMC::descendants);
......@@ -550,7 +550,7 @@ StatusCode TestHepMC::execute() {
// Check for undisplaced decay daughters from long-lived hadrons
if ((*pitr)->end_vertex()) {
HepMC::GenVertex* decayvtx = (*pitr)->end_vertex();
auto decayvtx = (*pitr)->end_vertex();
const HepMC::FourVector decaypos = decayvtx->position();
const double displacement = decaypos.x()*decaypos.x() + decaypos.y()*decaypos.y() + decaypos.z()*decaypos.z();
if (displacement > 1e-6) {
......
......@@ -172,10 +172,10 @@ StatusCode EventBoost::AnalyseGenEvent(const HepMC::GenEvent* genEvt) {
msg(MSG::VERBOSE) << "EventBoost begin AnalyseGenEvent()" << endmsg;
std::vector<HepMC::GenParticlePtr> particles_needing_modification;
HepMC::GenEvent::particle_const_iterator p = genEvt->particles_begin();
HepMC::GenEvent::particle_const_iterator pEnd = genEvt->particles_end();
std::vector<HepMC::GenParticlePtr> particles_needing_modification;
for(; p != pEnd; ++p ) {
particles_needing_modification.push_back(*p);
......
......@@ -111,8 +111,7 @@ int PdfAnalysis::Process(HepMC::GenEvent *event)
double weight;
weight = MC::get_weight(event, 0 );
HepMC::PdfInfo* pdf = nullptr;
pdf = event->pdf_info();
auto pdf = event->pdf_info();
if(pdf != 0){
m_Qscale -> Fill(pdf -> scalePDF(), weight);
......
......@@ -35,7 +35,7 @@ atlas_add_component( Herwig7_i
-DHWVER_IS_72=\"${HW3_VER_IS_72}\"
LINK_LIBRARIES ${HERWIG3_LIBRARIES} ${Boost_LIBRARIES}
${THEPEG_LIBRARIES} ${GSL_LIBRARIES} ${VBFNLO_LIBRARIES}
GeneratorModulesLib EventInfo GaudiKernel PathResolver )
GeneratorModulesLib EventInfo GaudiKernel PathResolver AtlasHepMCLib )
# ${OPENLOOPS_INCLUDE_DIRS} ${OPENLOOPS_LIBRARIES}
# Install files from the package:
......
......@@ -29,6 +29,7 @@
#include "AtlasHepMC/GenEvent.h"
#include "AtlasHepMC/GenVertex.h"
#include "AtlasHepMC/GenParticle.h"
#include "AtlasHepMC/HeavyIon.h"
#include <stdlib.h>
......@@ -475,9 +476,10 @@ Hijing::fillEvt(HepMC::GenEvent* evt)
<< ", " << vertexPtrVec[parentDecayIndex]->position().z()
<< ", associated daughter IDs = ";
HepMC::GenVertex::particles_out_const_iterator iter;
for (iter = vertexPtrVec[parentDecayIndex]->particles_out_const_begin();
iter != vertexPtrVec[parentDecayIndex]->particles_out_const_end();
auto vertexPtrVec_particles_out_const_begin=vertexPtrVec[parentDecayIndex]->particles_out_const_begin();
auto vertexPtrVec_particles_out_const_end=vertexPtrVec[parentDecayIndex]->particles_out_const_end();
for (auto iter = vertexPtrVec_particles_out_const_begin;
iter != vertexPtrVec_particles_out_const_end;
iter++)
{
log << HepMC::barcode((*iter)) << ", ";
......
......@@ -8,6 +8,8 @@
#include "GeneratorModules/GenModule.h"
#include "CLHEP/Vector/LorentzVector.h"
#include "AtlasHepMC/IO_BaseClass.h"
#include "AtlasHepMC/Polarization.h"
#include "AtlasHepMC/Flow.h"
#include "HepPDT/ParticleDataTable.hh"
......
......@@ -184,7 +184,7 @@ StatusCode CompactHardTruth::execute() {
// Signal event is first (only?) event; front() is from DataVector
const HepMC::GenEvent* mcEvt = mcEvts->front();
HepMC::WeightContainer wtCont = mcEvt->weights();
auto wtCont = mcEvt->weights();
//double wt = 1;
if( wtCont.size() != 0 ){
//wt = wtCont[0];
......
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