From f89a1c533f15a80e94d96e4f6ed81af3165cf9d2 Mon Sep 17 00:00:00 2001 From: Andrii Verbytskyi <andrii.verbytskyi@mpp.mpg.de> Date: Fri, 26 Apr 2024 09:43:47 +0200 Subject: [PATCH 1/8] IMplement PID replacement in FixHEPMC --- Generators/EvgenProdTools/EvgenProdTools/FixHepMC.h | 3 +++ Generators/EvgenProdTools/src/FixHepMC.cxx | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/Generators/EvgenProdTools/EvgenProdTools/FixHepMC.h b/Generators/EvgenProdTools/EvgenProdTools/FixHepMC.h index 06d3e7e6e5a9..7455360c1ef2 100644 --- a/Generators/EvgenProdTools/EvgenProdTools/FixHepMC.h +++ b/Generators/EvgenProdTools/EvgenProdTools/FixHepMC.h @@ -59,7 +59,10 @@ private: long m_pdg0Killed; long m_decayCleaned; long m_totalSeen; + long m_replacedPIDs; //@} + + std::map<int,int> m_pidmap; //!< map of pids to change. }; diff --git a/Generators/EvgenProdTools/src/FixHepMC.cxx b/Generators/EvgenProdTools/src/FixHepMC.cxx index 892ee3487c4f..539ea111c3d1 100644 --- a/Generators/EvgenProdTools/src/FixHepMC.cxx +++ b/Generators/EvgenProdTools/src/FixHepMC.cxx @@ -17,11 +17,13 @@ FixHepMC::FixHepMC(const std::string& name, ISvcLocator* pSvcLocator) , m_pdg0Killed(0) , m_decayCleaned(0) , m_totalSeen(0) + , m_replacedPIDs(0) { declareProperty("KillLoops", m_killLoops = true, "Remove particles in loops?"); declareProperty("KillPDG0", m_killPDG0 = true, "Remove particles with PDG ID 0?"); declareProperty("CleanDecays", m_cleanDecays = true, "Clean decay chains from non-propagating particles?"); declareProperty("LoopsByBarcode", m_loopByBC = false, "Detect loops based on barcodes as well as vertices?"); + declareProperty("PIDmap", m_pidmap = std::map<int,int>(), "Map of PDG IDs to replace"); } #ifndef HEPMC3 //---->//This is copied from MCUtils @@ -91,6 +93,15 @@ StatusCode FixHepMC::execute() { for (McEventCollection::const_iterator ievt = events()->begin(); ievt != events()->end(); ++ievt) { // FIXME: const_cast HepMC::GenEvent* evt = const_cast<HepMC::GenEvent*>(*ievt); + if (!m_pidmap.empty()) { + for (auto ip: *evt) { + // Skip this particle if (somehow) its pointer is null + if (!ip) continue; + auto newpid = m_pidmap.find(ip->pdg_id()); + if (newpid == m_pidmap.end()) continue; + ip->set_pdg_id(newpid->second); + } + } #ifdef HEPMC3 // Add a unit entry to the event weight vector if it's currently empty if (evt->weights().empty()) { @@ -467,6 +478,7 @@ StatusCode FixHepMC::finalize() { if (m_killLoops ) ATH_MSG_INFO( "Removed " << m_loopKilled << " of " << m_totalSeen << " particles because of loops." ); if (m_killPDG0 ) ATH_MSG_INFO( "Removed " << m_pdg0Killed << " of " << m_totalSeen << " particles because of PDG ID 0." ); if (m_cleanDecays) ATH_MSG_INFO( "Removed " << m_decayCleaned << " of " << m_totalSeen << " particles while cleaning decay chains." ); + if (!m_pidmap.empty()) ATH_MSG_INFO( "Replaced " << m_replacedPIDs << "PIDs of particles." ); return StatusCode::SUCCESS; } -- GitLab From b91458b5ea373dd0b60fc1f86a2d23149728cd20 Mon Sep 17 00:00:00 2001 From: Andrii Verbytskyi <andrii.verbytskyi@cern.ch> Date: Sun, 19 May 2024 21:31:01 +0200 Subject: [PATCH 2/8] Delete outdated TODO --- Generators/Herwig7_i/TODO | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 Generators/Herwig7_i/TODO diff --git a/Generators/Herwig7_i/TODO b/Generators/Herwig7_i/TODO deleted file mode 100644 index a720cf9e79f2..000000000000 --- a/Generators/Herwig7_i/TODO +++ /dev/null @@ -1,19 +0,0 @@ -* update settings for Herwig 7 - - * cuts? - -* add hints for citation to terminal output, analogous to - Thanks for using LHAPDF 6.1.6. Please make sure to cite the paper: - INFO Eur.Phys.J. C75 (2015) 3, 132 (http://arxiv.org/abs/1412.7420) - -* Matchbox interface - - * new generator name Herwig7Matchbox necessary or can both run - modes be unified under the Herwig7 generator? - * copy over Matchbox python bits and pieces and try to figure - out correct requirements files with Grigory - (open ticket at https://its.cern.ch/jira/browse/ATLINFR) - * ATLAS parameter settings - -* force Herwig output to be prepended by "Herwig7:" in the log.generate? - -- GitLab From 2683d12e1ebbd43aa1b04634e6a7ac977f45a571 Mon Sep 17 00:00:00 2001 From: Andrii Verbytskyi <andrii.verbytskyi@cern.ch> Date: Mon, 20 May 2024 08:30:59 +0200 Subject: [PATCH 3/8] Delete packagedoc.h --- Generators/GeneratorObjects/doc/packagedoc.h | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 Generators/GeneratorObjects/doc/packagedoc.h diff --git a/Generators/GeneratorObjects/doc/packagedoc.h b/Generators/GeneratorObjects/doc/packagedoc.h deleted file mode 100644 index a82ac6d462a2..000000000000 --- a/Generators/GeneratorObjects/doc/packagedoc.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - - <i> Package containing the list of generator objects and their links -To make them persisten also the package GeneratorObjectsTPCn is needed. -</i> - -@page GeneratorObjects_page - - - -*/ -- GitLab From 1cdbe755b100212ab30394dc79a94fbe351cf7e0 Mon Sep 17 00:00:00 2001 From: Andrii Verbytskyi <andriish@pcatlas18.mpp.mpg.de> Date: Wed, 19 Jun 2024 16:38:43 +0200 Subject: [PATCH 4/8] Replacement of logical conditions that use status() of truth particles with MC:: functions, part 1 --- .../src/SoftLeptonInJetFilter.cxx | 2 +- .../src/xAODMuDstarFilter.cxx | 42 +++++++++---------- .../src/xAODMultiElecMuTauFilter.cxx | 2 +- .../src/MenuTruthThinning.cxx | 5 +-- 4 files changed, 25 insertions(+), 26 deletions(-) diff --git a/Generators/GeneratorFilters/src/SoftLeptonInJetFilter.cxx b/Generators/GeneratorFilters/src/SoftLeptonInJetFilter.cxx index 1cd064644e71..281505d36852 100644 --- a/Generators/GeneratorFilters/src/SoftLeptonInJetFilter.cxx +++ b/Generators/GeneratorFilters/src/SoftLeptonInJetFilter.cxx @@ -124,7 +124,7 @@ bool SoftLeptonInJetFilter::isElectron(const HepMC::ConstGenParticlePtr& p) cons } bool SoftLeptonInJetFilter::isParton(const HepMC::ConstGenParticlePtr& p) const { - return (std::abs(p->pdg_id()) == m_part_ID && p->status()==3 && + return (std::abs(p->pdg_id()) == m_part_ID && !MC::isPhysical(p) && p->momentum().perp() >= m_part_Ptmin && std::abs(p->momentum().pseudoRapidity()) <= m_part_EtaRange); } diff --git a/Generators/GeneratorFilters/src/xAODMuDstarFilter.cxx b/Generators/GeneratorFilters/src/xAODMuDstarFilter.cxx index 29d9ee627c30..562a8ba745f7 100644 --- a/Generators/GeneratorFilters/src/xAODMuDstarFilter.cxx +++ b/Generators/GeneratorFilters/src/xAODMuDstarFilter.cxx @@ -40,7 +40,7 @@ #include "TLorentzVector.h" -#include "TruthUtils/AtlasPID.h" +#include "TruthUtils/HepMCHelpers.h" #include "xAODTruth/TruthParticle.h" #include "xAODTruth/TruthVertex.h" @@ -123,7 +123,7 @@ StatusCode xAODMuDstarFilter::filterEvent() // Loop over all particles in the event for (const xAOD::TruthParticle* pitr : *xTruthParticleContainer) { - if (pitr->status() == 4){ + if (MC::isBeam(pitr)){ const xAOD::TruthVertex *vprim = (pitr)->decayVtx(); primx = vprim->x(); primy = vprim->y(); @@ -131,7 +131,7 @@ StatusCode xAODMuDstarFilter::filterEvent() ATH_MSG_DEBUG("xAODMuDstarFilter: PV x, y = " << primx << " , " << primy); } - if (pitr->status() == 3) + if (!MC::isPhysical(pitr)) continue; // photos history line // muons @@ -155,11 +155,11 @@ StatusCode xAODMuDstarFilter::filterEvent() ATH_MSG_DEBUG("xAODMuDstarFilter: NumMuons = " << NumMuons ); for (const xAOD::TruthParticle* pitr : *xTruthParticleContainer) { - if (pitr->status() == 3) + if (!MC::isPhysical(pitr)) continue; // photos history line // Dstars - if (std::abs(pitr->pdgId()) == DSTAR) + if (std::abs(pitr->pdgId()) == MC::DSTAR) { if ((pitr->pt() >= m_PtMinDstar) && (pitr->pt() < m_PtMaxDstar) && @@ -192,10 +192,10 @@ StatusCode xAODMuDstarFilter::filterEvent() { auto thisChild = pitr->decayVtx()->outgoingParticle(thisChild_id); - if (thisChild->status() == 3) + if (!MC::isPhysical(thisChild)) continue; // photos history line - if (std::abs(thisChild->pdgId()) == PIPLUS) + if (std::abs(thisChild->pdgId()) == MC::PIPLUS) { if ((thisChild->pt() >= m_PtMinPis) && (thisChild->pt() < m_PtMaxPis) && @@ -229,21 +229,21 @@ StatusCode xAODMuDstarFilter::filterEvent() for (size_t thisChild_id = 0; thisChild_id < pitr->decayVtx()->nOutgoingParticles(); thisChild_id++) { auto thisChild = pitr->decayVtx()->outgoingParticle(thisChild_id); - if (thisChild->status() == 3) + if (!MC::isPhysical(thisChild)) continue; // photos history line - if (std::abs(thisChild->pdgId()) == D0) + if (std::abs(thisChild->pdgId()) == MC::D0) { if (! thisChild->decayVtx()) continue; for (size_t thisChild1_id = 0; thisChild1_id < thisChild->decayVtx()->nOutgoingParticles(); thisChild1_id++) { auto thisChild1 = thisChild->decayVtx()->outgoingParticle(thisChild1_id); - if (thisChild1->status() == 3) + if (!MC::isPhysical(thisChild1)) continue; // photos history line if (thisChild1->isElectron() || thisChild1->isMuon() || - std::abs(thisChild1->pdgId()) == PIPLUS || std::abs(thisChild1->pdgId()) == KPLUS) + std::abs(thisChild1->pdgId()) == MC::PIPLUS || std::abs(thisChild1->pdgId()) == MC::KPLUS) { NumChildD0++; @@ -268,16 +268,16 @@ StatusCode xAODMuDstarFilter::filterEvent() NumChildD0mu++; D0ChildMu = thisChild1; } - if (std::abs(thisChild1->pdgId()) == PIPLUS) + if (std::abs(thisChild1->pdgId()) == MC::PIPLUS) NumChildD0pi++; - if (std::abs(thisChild1->pdgId()) == KPLUS) + if (std::abs(thisChild1->pdgId()) == MC::KPLUS) { NumChildD0K++; K_pdg = thisChild1->pdgId(); } } } - else if (std::abs(thisChild1->pdgId()) == PI0) + else if (std::abs(thisChild1->pdgId()) == MC::PI0) { NumChildD0++; } @@ -289,8 +289,8 @@ StatusCode xAODMuDstarFilter::filterEvent() { NumChildD0gammas++; } - else if (std::abs(thisChild1->pdgId()) == K0 || std::abs(thisChild1->pdgId()) == K0L || - std::abs(thisChild1->pdgId()) == K0S) + else if (std::abs(thisChild1->pdgId()) == MC::K0 || std::abs(thisChild1->pdgId()) == MC::K0L || + std::abs(thisChild1->pdgId()) == MC::K0S) { NumChildD0++; NumChildD0++; @@ -301,11 +301,11 @@ StatusCode xAODMuDstarFilter::filterEvent() { auto thisChild2 = thisChild1->decayVtx()->outgoingParticle(thisChild2_id); - if (thisChild2->status() == 3) + if (!MC::isPhysical(thisChild2)) continue; // photos history line if (thisChild2->isElectron() || thisChild2->isMuon() || - std::abs(thisChild2->pdgId()) == PIPLUS || std::abs(thisChild2->pdgId()) == KPLUS) + std::abs(thisChild2->pdgId()) == MC::PIPLUS || std::abs(thisChild2->pdgId()) == MC::KPLUS) { NumChildD0++; @@ -332,7 +332,7 @@ StatusCode xAODMuDstarFilter::filterEvent() } } } - else if (std::abs(thisChild2->pdgId()) == PI0) + else if (std::abs(thisChild2->pdgId()) == MC::PI0) { NumChildD0++; } @@ -344,8 +344,8 @@ StatusCode xAODMuDstarFilter::filterEvent() { NumChildD0gammas++; } - else if (std::abs(thisChild2->pdgId()) == K0 || std::abs(thisChild2->pdgId()) == K0L || - std::abs(thisChild2->pdgId()) == K0S) + else if (std::abs(thisChild2->pdgId()) == MC::K0 || std::abs(thisChild2->pdgId()) == MC::K0L || + std::abs(thisChild2->pdgId()) == MC::K0S) { NumChildD0++; NumChildD0++; diff --git a/Generators/GeneratorFilters/src/xAODMultiElecMuTauFilter.cxx b/Generators/GeneratorFilters/src/xAODMultiElecMuTauFilter.cxx index bdc83e290e46..371ff3ba28b4 100644 --- a/Generators/GeneratorFilters/src/xAODMultiElecMuTauFilter.cxx +++ b/Generators/GeneratorFilters/src/xAODMultiElecMuTauFilter.cxx @@ -57,7 +57,7 @@ StatusCode xAODMultiElecMuTauFilter::filterEvent() { if (!m_incHadTau) continue; const xAOD::TruthParticle *tau= nullptr; const xAOD::TruthParticle *taunu= nullptr; - if (std::abs(pitr->pdgId()) != 15 || pitr->status() == 3) continue; + if (!MC::isTau(pitr) || !MC::isPhysical(pitr)) continue; tau = pitr; if(!tau->decayVtx()) continue; // Loop over children and: diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/src/MenuTruthThinning.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/src/MenuTruthThinning.cxx index 001f0723f335..385636bd39cc 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/src/MenuTruthThinning.cxx +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/src/MenuTruthThinning.cxx @@ -319,8 +319,7 @@ bool DerivationFramework::MenuTruthThinning::isAccepted(const xAOD::TruthParticl // hadron range int motherPDGID = 999999999; // AV: dropped the HepMC::PHOTOSMIN condition - if(!HepMC::is_simulation_particle(p) && - p->hasProdVtx() ) + if ( !HepMC::is_simulation_particle(p) && p->hasProdVtx() ) { const xAOD::TruthVertex* vprod = p->prodVtx(); if (vprod->nIncomingParticles() > 0) { @@ -532,7 +531,7 @@ bool DerivationFramework::MenuTruthThinning::isLeptonFromTau(const xAOD::TruthPa unsigned int nIncoming = prod->nIncomingParticles(); for(unsigned int itr = 0; itr<nIncoming; ++itr){ int parentId = prod->incomingParticle(itr)->pdgId(); - if(abs(parentId) == 15) { + if( MC::isTau(parentId) ) { ATH_MSG_DEBUG("Particle with pdgId = " << pdg << ", matched to tau"); return true; // Has tau parent } -- GitLab From cc8894200a2ca9c92c9471dfa3efd8ca0399e20f Mon Sep 17 00:00:00 2001 From: Andrii Verbytskyi <andrii.verbytskyi@cern.ch> Date: Sun, 30 Jun 2024 22:13:52 +0200 Subject: [PATCH 5/8] Delete outdated Superchic.tex, which is superseded by README.md --- Generators/Superchic_i/doc/Superchic.tex | 163 ----------------------- 1 file changed, 163 deletions(-) delete mode 100644 Generators/Superchic_i/doc/Superchic.tex diff --git a/Generators/Superchic_i/doc/Superchic.tex b/Generators/Superchic_i/doc/Superchic.tex deleted file mode 100644 index 1f5b69fd059c..000000000000 --- a/Generators/Superchic_i/doc/Superchic.tex +++ /dev/null @@ -1,163 +0,0 @@ -\documentclass[11pt]{article} -\newdimen\SaveHeight \SaveHeight=\textheight -\textwidth=6.5in -\textheight=8.9in -\textwidth=6.5in -\textheight=9.0in -\hoffset=-.5in -\voffset=-1in -\def\topfraction{1.} -\def\textfraction{0.} -\def\topfraction{1.} -\def\textfraction{0.} -\begin{document} -\title{Superchic\_i: An interface between SuperChic MC event generator for CEP and Athena -version in release 21.6} -\author{ Prabhakar Palni (Prabhakar.Palni@cern.ch)} -%\today - -\maketitle - - -\section{Introduction} - - - SuperChic 3 Monte Carlo event generator for central exclusive production - -This interface package runs SuperChic MC Generator (v3.05) within Athena framework, and stores the events output into the transient store in HepMC format. - -SuperChic MC event generator is dedicated for Central exclusive production (CEP) processes in high-energy hadron-hadron collisions (pp, pA, and AA beams) for both photon and QCD-initiated production. This documentation gives you some details about setting up the Superchic interface (which is prepared using the latest available Superchic version 3.05) and activating the module using the JobOptions. - -In order to initialize and calculate input parameters like such as opacity,screening amplitude,sudakov factor, and skewed PDF the subroutine calcparam.F is used. To generate events superchicrun.F subroutine is used which inheritates from the superchic.f subroutine. - - -\section{Usage of Job Options} - - -The example job option file can be found under the following path. - - {\bf Superchic\_i/share/jobOptions.Superchic.py } - -Before running this script, first setup the athena - - {\bf asetup 21.6,latest,AthGeneration,slc6 } - - Above command sets up the latest AthGeneration cache. - -The Superchic input parameters can be set from the job options service. The - default parameters initializes the Superchic for PbPb beams at center-of-mass energy per nucleon of 5.02 TeV for the light by light scattering process [$\gamma \gamma \rightarrow \gamma \gamma$ (process no. 59)]. - - - -{\bf All the parameters passed to Superchic are in the units specified -in the Superchic manual https://superchic.hepforge.org/superchic3.pdf } - -The default jobOptions.Superchic.py file can be copied to your test run directory. The initialization parameters can be changed via the following line in the jobOptions.py - -\begin{verbatim}Superchic.Initialize = ["parameter_1 value_1", "parameter_2 value_2"] -\end{verbatim} - -Each quoted string sets one parameter value in the fortran variable format. You can set all the input parameters -separated by commas, however, the important ones are listed below. - - - -{\bf parameter\_1:} must be one of the following variable names, an error message is returned if the specified variable is not in the input parameter list. - -{\bf value\_1:} is the input parameter's value.\\ - -JO Example:\\ -The following command generates 10 events for Pb+Pb collisions at 5.02 TeV center-of-mass energy along with important input parameters for process 59 i.e $\gamma \gamma \rightarrow \gamma \gamma$. \\ - -Running the Job Option to produce events -\begin{verbatim} -Generate_tf.py --ecmEnergy=5020.0 --maxEvents=10 --firstEvent=1 --randomSeed=14 - --outputEVNTFile=test.pool.root --jobConfig jobOptions.Superchic.py - -\end{verbatim} - - -Example of the initialization of the input parameters in the JO is shown below. - - -\begin{verbatim} - - -genSeq.Superchic.Initialize = \ -["rts 5.02d3", # set the COM collision energy (in fortran syntax) -"isurv 4", # Model of soft survival -"intag 'in5'", # for input files -"PDFname 'MMHT2014lo68cl'", # PDF set name -"PDFmember 0", # PDF member -"proc 59", # Process number (59:gg->gg, 56:gg->ee, 57:gg->mumu) -"beam 'ion'", # Beam type ('prot', 'ion','ionp') -"outtg 'out'", # for output file name -"sfaci .false." # Include soft survival effects -] - -\end{verbatim} - -One can also add the kinematical cuts to the outgoing particles or the system, details can be found in the manual. - -% -%{\large \bf Random Numbers}\\ -% -% Superchic\_i is using the AtRndmGenSvc Athena Service to provide to Superchic (via the ran function, -% found in Superchic\_i/src/ran.F) the necessary random numbers. This service is using the RanecuEngine of CLHEP, -% and is based on the ``stream'' logic, each stream being able to provide an idependent sequence of random -% numbers. Superchic\_i is using two streams: Superchic\_INIT and Superchic. The first stream is used to provide -% random numbers for the initialization phase of Superchic and the second one for the event generation. The user -% can set the initial seeds of each stream via the following option in the jobOption file. -% -% \begin{verbatim} -% AtRndmGenSvc.Seeds = [``Superchic_INIT 2345533 9922199'', ``Superchic 5498921 659091''] -% \end{verbatim} -% -% The above sets the seeds of the Superchic\_INIT stream to 2345533 and 9922199 and of the Superchic one to -% 5498921 and 659091. If the user will not set the seeds of a stream then the AtRndmGenSvc will use default -% values. -% -% The seeds of the Random number service are saved for each event in the HepMC Event record and they are printed -% on screen by DumpMC. In this way an event can be reproduced easily. The user has to rerun the job by simply seting -% the seeds of the Superchic stream (the seeds of the Superchic\_INIT stream should stay the same) to the seeds of that -% event. -% -% Additionaly the AtRndmGenSvc is dumping into a file (AtRndmGenSvc.out) the seeds of all the streams at the end -% of the job. This file can be read back by the service if the user set the option -% \begin{verbatim} AtRndmGenSvc.ReadFromFile = true \end{verbatim} (default = false). In this case the file -% AtRndmGenSvc.out is read and the streams saved in this file are created with seeds as in this file. The name of -% the file to be read can be set by the user via the option -% \begin{verbatim} AtRndmGenSvc.FileToRead = MyFileName \end{verbatim} -% -% The above file is also written out when a job crashes. {\bf This last option (when job crashing) is currently not -% working, waiting for a modification in Athena}. -% -% The {\bf Superchic\_i/share/jobOptions.Superchic.py } contains the above options.\\ - - - - - - -\section{Running SuperChic in Standalone way} - -One can directly carry out following commands in the fresh terminal to produce superchic events in standalone way. - -\begin{tiny} -\begin{verbatim} - -source /cvmfs/sft.cern.ch/lcg/releases/LCG_88/MCGenerators/superchic/3.05/x86_64-slc6-gcc49-opt/superchicenv-genser.sh -cp -rf /cvmfs/sft.cern.ch/lcg/releases/LCG_88/MCGenerators/superchic/3.05/x86_64-slc6-gcc49-opt/bin /tmp/cern_username/ -cd /tmp/cern_username/bin/ -export LHAPATH=/cvmfs/sft.cern.ch/lcg/external/lhapdfsets/current/ -./init < input.DAT -./superchic < input.DAT - -\end{verbatim} -\end{tiny} - - -You can change the input.DAT file to change the C.O.M collision energy for the particular process, process no., numberof events etc. Above commands will produce output stored under the directory {\bf 'evrecs' }. - - -\end{document} -- GitLab From b13f7bb9dfd1244e1d50642a5c97a9d042f31a6e Mon Sep 17 00:00:00 2001 From: Andrii Verbytskyi <andrii.verbytskyi@cern.ch> Date: Mon, 1 Jul 2024 10:12:34 +0200 Subject: [PATCH 6/8] Delete TrigTrackSelector_old.h --- .../TrigTrackSelector_old.h | 680 ------------------ 1 file changed, 680 deletions(-) delete mode 100644 Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TrigTrackSelector_old.h diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TrigTrackSelector_old.h b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TrigTrackSelector_old.h deleted file mode 100644 index 7f491015d738..000000000000 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TrigTrackSelector_old.h +++ /dev/null @@ -1,680 +0,0 @@ -/* emacs: this is -*- c++ -*- */ -/** - ** @file TrigTrackSelector_old.h - ** - ** @author mark sutton - ** @date Thu 10 Jan 2019 20:41:57 CET - ** - ** Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration - **/ - -#ifndef TRIGTRACKSELECTOR_H -#define TRIGTRACKSELECTOR_H - -/// L2 tracks -#include "TrigInDetEvent/TrigInDetTrackCollection.h" -///TruthMap -#include "TrigInDetTruthEvent/TrigInDetTrackTruthMap.h" - -/// offline and EF -#include "Particle/TrackParticle.h" -#include "Particle/TrackParticleContainer.h" - -/// MC truth -#include "McParticleEvent/TruthParticleContainer.h" -#include "AtlasHepMC/GenEvent.h" -#include "AtlasHepMC/GenVertex.h" -#include "AtlasHepMC/GenParticle.h" - - -///// FrameWork includes -/// #include "GaudiKernel/ServiceHandle.h" -/// #include "GaudiKernel/IPartPropSvc.h" -/// absolutely pathetic!! write my own class - -#include "TrigInDetAnalysisUtils/particleType.h" - -/// TrigInDetAnalysis classes -#include "TrigInDetAnalysis/TrackSelector.h" -#include "TrigInDetAnalysis/Track.h" -#include "TrigInDetAnalysis/TrackFilter.h" - -#include "TrkParameters/TrackParameters.h" -#include "TrkParameters/Perigee.h" -#include "TrkTrack/TrackCollection.h" -#include "TrkTrack/Track.h" -#include "TrkTrackSummary/TrackSummary.h" -#include "TrkToolInterfaces/ITrackSummaryTool.h" -#include "GaudiKernel/ToolHandle.h" -#include "TMath.h" - - - - -// namspace TrigInDetAnalysis { - -// class TrigTrackSelector : public TIDA::TrackSelector<TIDA::Track> { - -class TrigTrackSelector : public TrackSelector { - -public: - - // TrigTrackSelector( bool (*selector)(const TIDA::Track*)=NULL ) : TrackSelector(selector) { } - TrigTrackSelector( TrackFilter* selector ) : TrackSelector(selector), m_id(0) { } - - virtual void clear() { for ( unsigned i=m_tracks.size() ; i-- ; ) delete m_tracks[i]; m_tracks.clear(); } - - - void selectTrack( const TrigInDetTrack* track, const TrigInDetTrackTruthMap* truthMap=0 ) { - // do the track extraction stuff here.... - if ( track ) { - - double eta = track->param()->eta(); - double phi = track->param()->phi0(); - double z0 = track->param()->z0(); - double pT = track->param()->pT(); - double d0 = track->param()->a0(); - - double deta = track->param()->eeta(); - double dphi = track->param()->ephi0(); - double dz0 = track->param()->ez0(); - double dpT = track->param()->epT(); - double dd0 = track->param()->ea0(); - - int algoid = track->algorithmId(); - - int nBlayerHits = (track->HitPattern() & 0x1); - int nPixelHits = 2 * track->NPixelSpacePoints(); // NB: for comparison with offline - int nSctHits = 2 * track->NSCT_SpacePoints(); // a spacepoint is 2 "hits" - int nStrawHits = track->NStrawHits(); - int nTrHits = track->NTRHits(); - - int nSiHits = nPixelHits + nSctHits; - - bool expectBL = false; //not filled in - - unsigned long id = (unsigned long)track; - - unsigned hitPattern = track->HitPattern(); - unsigned multiPattern = 0; - - double chi2 = track->chi2(); - - bool truth = false; - int match_barcode = -1; - - if ( truthMap ) { - const TrigInDetTrackTruth* trackTruth = truthMap->truth(track); - if (trackTruth!=0 && trackTruth->nrMatches() > 0) { - match_barcode = trackTruth->bestSiMatch()->barcode(); - truth = true; - } - } - - - TIDA::Track* t = new TIDA::Track( eta, phi, z0, d0, pT, chi2, - deta, dphi, dz0, dd0, dpT, - nBlayerHits, nPixelHits, nSctHits, nSiHits, - nStrawHits, nTrHits, - hitPattern, multiPattern, - algoid, truth, -1, match_barcode, - expectBL, id) ; - - // std::cout << "SUTT ID track " << *t << "\t0x" << std::hex << track->HitPattern() << std::dec << std::endl; - - if ( !addTrack( t ) ) delete t; - } - } - - - // extract all the tracks from a TrigInDetTrack collection and associated TruthMap and convert them - void selectTracks( const TrigInDetTrackCollection* trigtracks, const TrigInDetTrackTruthMap* truthMap=0 ) { - // do the track extraction stuff here.... - TrigInDetTrackCollection::const_iterator trackitr = trigtracks->begin(); - TrigInDetTrackCollection::const_iterator trackend = trigtracks->end(); - while ( trackitr!=trackend ) { - selectTrack( *trackitr, truthMap ); - trackitr++; - } - } - - - // add a TrackParticle - void selectTrack( const Rec::TrackParticle* track ) { - - // do the track extraction stuff here.... - - static int hpmap[20] = { 0, 1, 2, 7, 8, 9, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }; - - if ( track ) { - - const Trk::MeasuredPerigee* measPer = track->measuredPerigee(); - - CLHEP::HepVector perigeeParams = measPer->parameters(); - - double pT = measPer->pT(); - double eta = measPer->eta(); - double phi = perigeeParams[Trk::phi0]; - double z0 = perigeeParams[Trk::z0]; - double d0 = perigeeParams[Trk::d0]; - - double theta = perigeeParams[Trk::theta]; - double p = 1/perigeeParams[Trk::qOverP]; - - // AAARCH!!!!! the TrackParticle pT is NOT SIGNED!!!! ( I ask you! ) - if ( perigeeParams[Trk::qOverP]<0 && pT>0 ) pT *= -1; - - const Trk::ErrorMatrix err = measPer->localErrorMatrix(); - - double dtheta = err.error(Trk::theta); - double dqovp = err.error(Trk::qOverP); - double covthetaOvP = err.covValue(Trk::qOverP,Trk::theta); - - - double deta = 0.5*dtheta/(std::cos(0.5*theta)*std::cos(0.5*theta)*std::tan(0.5*theta)); - double dphi = err.error(Trk::phi0); - double dz0 = err.error(Trk::z0); - double dd0 = err.error(Trk::d0); - double dpT = 0; - - - double sintheta = std::sin(theta); - double costheta = std::cos(theta); - double dpt2 = (p*p*sintheta)*(p*p*sintheta)*dqovp*dqovp + (p*costheta)*(p*costheta)*dtheta*dtheta - 2*(p*p*sintheta)*(p*costheta)*covthetaOvP; - - if ( dpt2>0 ) dpT = std::sqrt( dpt2 ); - - - - - // Check number of hits - // NB: a spacepoint is two offline "hits", so a pixel spacepoint is really - // 2 "hits" and an offline SCT "hit" is really a 1D cluster, so two intersetcting - // stereo clusters making a spacepoint are two "hits" - const Trk::TrackSummary *summary = track->trackSummary(); - int nBlayerHits = 2*summary->get(Trk::numberOfBLayerHits); - int nPixelHits = 2*summary->get(Trk::numberOfPixelHits); - int nSctHits = summary->get(Trk::numberOfSCTHits); - int nStrawHits = summary->get(Trk::numberOfTRTHits); - int nTrHits = summary->get(Trk::numberOfTRTHighThresholdHits); - - int nSiHits = nPixelHits + nSctHits; - bool expectBL = false; // Not stored for Rec::TrackParticle - - const Trk::FitQuality *quality = track->fitQuality(); - double chi2 = quality->chiSquared(); - - unsigned bitmap = 0; - - unsigned long id = (unsigned long)track; - - for ( int ih=0 ; ih<20 ; ih++ ) { - if ( summary->isHit(Trk::DetectorType(ih)) ) bitmap |= ( 1<<hpmap[ih] ); - } - - /// now some *ridiculous* code to get the author of the - /// TrackParticle (offline) tracks - - // std::cout << "fetching author info :" << track->info().trackFitter() << ":" - // << track->info().dumpInfo() << ": bm 0x" << std::hex << bitmap << std::dec << std::endl; - - int fitter = track->info().trackFitter(); - std::string dumpinfo = track->info().dumpInfo(); - - int trackAuthor = -1; - if ( fitter>0 && fitter<Trk::TrackInfo::NumberOfTrackFitters ) { - if ( dumpinfo.find("TRTStandalone")!=std::string::npos) trackAuthor = 2; - else if ( dumpinfo.find("TRTSeededTrackFinder")!=std::string::npos) trackAuthor = 1; - else trackAuthor = 0; - } - -#if 0 - std::cout << "\t\t\tSUTT TP track" - << "\teta=" << eta // << " +- " << (*trackitr)->params()->deta() - << "\tphi=" << phi // << " +- " << (*trackitr)->params()->dphi() - << "\tz0=" << z0 - << "\tpT=" << pT // << "\t( " << 1/qoverp << ")" - << "\td0=" << d0 - << "\tNsi=" << nSiHits - << "\tNtrt=" << nTrHits - << "\tNstr=" << nStrawHits - << "\tauthor=" << trackAuthor - << std::endl; -#endif - - // Create and save Track - - TIDA::Track* t = new TIDA::Track(eta, phi, z0, d0, pT, chi2, - deta, dphi, dz0, dd0, dpT, - nBlayerHits, nPixelHits, nSctHits, nSiHits, - nStrawHits, nTrHits, bitmap, 0, - trackAuthor, - expectBL, id) ; - - // std::cout << "SUTT TP track " << *t << "\t0x" << std::hex << bitmap << std::dec << std::endl; - - if ( !addTrack( t ) ) delete t; - - } - } - - - // extract all the tracks from a TrackParticle collection and add them - void selectTracks( const Rec::TrackParticleContainer* trigtracks ) { - - // std::cout << "\t\t\tSUTT \tTrackParticleContainer->size() = " << trigtracks->size() << std::endl; - - Rec::TrackParticleContainer::const_iterator trackitr = trigtracks->begin(); - Rec::TrackParticleContainer::const_iterator trackend = trigtracks->end(); - - while ( trackitr!=trackend ) { - - selectTrack( *trackitr ); - - trackitr++; - - } // loop over tracks - - } - - - - // extract all the tracks from a TrackParticle collection and add them - void selectTracks( const TruthParticleContainer* truthtracks ) { - - // std::cout << "\t\t\tSUTT \tTrackParticleContainer->size() = " << trigtracks->size() << std::endl; - - TruthParticleContainer::const_iterator trackitr = truthtracks->begin(); - TruthParticleContainer::const_iterator trackend = truthtracks->end(); - - while ( trackitr!=trackend ) { - - selectTrack( *trackitr ); - - trackitr++; - - } // loop over tracks - - } - - - - // add a TruthParticle from a GenParticle - easy, bet it doesn't work - void selectTrack( const HepMC::GenParticle* track ) { - - /// not a "final state" particle - if ( track->status() != 1 ) return; - - /// set this so can use it as the identifier - don't forget to reset!! - m_id = (unsigned long)track; - selectTrack( TruthParticle(track) ); - m_id = 0; - } - - - // add a TruthParticle - void selectTrack( const TruthParticle& track ) { selectTrack( &track ); } - - - // add a TruthParticle - void selectTrack( const TruthParticle* track ) { - TIDA::Track* t = makeTrack( track, m_id ); - if ( t && !addTrack(t) ) delete t; - } - - - // make a TIDA::Track from a GenParticle - static TIDA::Track* makeTrack( const HepMC::GenParticle* track ) { - unsigned long id = (unsigned long)track; - TruthParticle t = TruthParticle(track); - return makeTrack( &t, id ); - } - - // make a TIDA::Track from a TruthParticle - static TIDA::Track* makeTrack( const TruthParticle* track, unsigned long tid=0 ) { - - if ( track==0 ) return 0; - - - //bool proto = true; /// proto final state - Removed 24/06/13 - - /// NB: Could replace this with a simple tests on production - /// and decay vertices - ie define some cylindrical plane, - /// and produced within this plane, and either doesn't - /// decay, or decays outside this plane then take as stable - /// gets round duplicated, or secondary tracks, brem electrons - /// etc. (actually done this now - see code later) - /// only want final state, charged particles - this is a quick hack - //if ( track->nDecay()>0 ) proto = false; /// what if decay is inside the calorimeter? - Removed 24/06/13 - /// charge information ios not filled in TruthParticle unless build - /// with the TruthParticleCnvTool ! I ask you!!! - /// if ( !track->hasCharge() || track->charge()==0 ) return; - //smh Hack to get rid of internal MC ids - //smh This one can probably stay: 83 to 100 are reserved for MC - //smh Only stable entries from generator - //if ( abs(track->pdgId()) > 1000000000) proto = false; /// does this work? - Removed 24/06/13 - //if ( track->pdgId() >= 83 && track->pdgId() <= 100 ) proto = false; /// shouldn't be needed - Removed 24/06/13 - //if ( track->status() != 1 ) proto = false; - Removed 24/06/13 - - double phi = track->phi(); - double eta = track->eta(); - - //// ABSOLUTELY STUPID!!! to get the production vertex, you need to navigate to - //// the genparticle, the production vertex, etc, at each stage they could be a - //// null pointer, so you would have to check all of them to be robust - double xp[3] = { 0, 0, 0 }; - - if ( track->genParticle()->production_vertex() ) { - xp[0] = track->genParticle()->production_vertex()->position().x(); - xp[1] = track->genParticle()->production_vertex()->position().y(); - xp[2] = track->genParticle()->production_vertex()->position().z(); - } - - - // CHANGED BY JK - z0 with respect to (0,0) - // double z0 = xp[2]; - double theta = 2*std::atan( exp( (-1)*eta ) ); - double z0 = xp[2] - (xp[0]*std::cos(phi) + xp[1]*std::sin(phi))/std::tan(theta); - - double xd[3] = { 0, 0, 0 }; - - if ( track->genParticle()->end_vertex() ) { - xd[0] = track->genParticle()->end_vertex()->position().x(); - xd[1] = track->genParticle()->end_vertex()->position().y(); - xd[2] = track->genParticle()->end_vertex()->position().z(); - } - - double rp = std::sqrt( xp[0]*xp[0] + xp[1]*xp[1] ); - double rd = std::sqrt( xd[0]*xd[0] + xd[1]*xd[1] ); - - - bool final_state = false; - - /// the is our new "final state" requirement - /// the inner and outer radii are in some sense - /// arbitrary - these correspond to an envelope - /// around the pixel detector, so the track must - /// pass through the entire pixel detector - /// NB: In order to ensure you don't miss any - /// tracks they really need to be the same - /// ie if a track brems in your "volume" - /// then you will miss that track, and - /// also the resulting track, even if it is - /// a high et track - const double inner_radius = 47; - // const double outer_radius = 47; - const double outer_radius = 47; - if ( ( track->genParticle()->production_vertex() && rp<=inner_radius ) && - ( track->genParticle()->end_vertex()==0 || rd>outer_radius ) ) final_state = true; - - if ( !final_state ) return 0; /// keep anything over 10 GeV with the old requirement - - //// AAAARGHHH!!!! For some *stupid* reason, when converting from a - //// GenParticle to a TruthParticle, the charge is not filled (or in - //// fact it *is* filled, but with a default value of -999) and so - //// we would need to access the PDT in order to find it out - //// *surely* this lookup should be done in the TruthParticle - //// constructor, by a helper class, and not be dependent on the - //// subsequent invocation of some external helper class at some - //// later stage? I mean, who leaves it up to some external class - //// to provide values inside a class based on information already - //// in the class? It's perverse! - - double q = track->charge(); - - static particleType ptype; - - /// avoid default (unset) TruthParticle charge - if ( q==-999 ) q = ptype.charge( track->pdgId() ); - - /// only use charged tracks - if ( q==0 ) return 0; - - double pT = q*track->pt(); - - - double d0 = 0; - - /// what a faff - refuse to mess about with the classes to swim tracks etc - why can't - /// they just encode this sort of information in the class!! It's not as if it doesn't - /// actually have members for anything else useless!! Classes should be designed for - /// ease of use !!!! - - /// is there a sign issue here ? - - - // CHANGED BY JK - d0 with respect to (0,0) - //d0 = q*rp*std::sin(phi); - d0 = xp[1]*std::cos(phi) - xp[0]*std::sin(phi); - - - //// AAAARGHHH!!!! For some *stupid* reason, when converting from a - - /// static HepPDT::ParticleDataTable* m_pdt = new ParticleDataTable(); - /// - /// // Get the Particle Properties Service - /// if ( m_pdt==0 ) { - /// ServiceHandle<IPartPropSvc> partPropSvc("PartPropSvc", "TrigTestMonToolAC"); // , name()); - /// if ( !partPropSvc.retrieve().isSuccess() ) { - /// m_pdt = partPropSvc->PDT(); - /// } - /// else { - /// std::cerr << " Could not initialize Particle Properties Service" << std::endl; - /// return; // StatusCode::FAILURE; - /// } - /// } - - /// how about storing barcode/status/pidg info? - int author = track->pdgId(); /// this isn't good!! but it will do for testing - int barcode = track->barcode(); /// probably won't work either - - - unsigned long id = (unsigned long)track; - if ( tid!=0 ) id = tid; - - /// get the production vertex for the z0 and d0 but should we store the z0 of - /// the production vertex? or swim the track to the perigee point with respect - /// to 0,0 and use the parameters there? - - - /// what to do with these??? - - // std::cout << "\t\t\tSUTT Truth track" - // << "\teta=" << eta // << " +- " << (*trackitr)->params()->deta() - // << "\tphi=" << phi // << " +- " << (*trackitr)->params()->dphi() - // << "\tz0=" << z0 - // << "\tpT=" << pT // << "\t( " << 1/qoverp << ")" - // << "\td0=" << d0 - // << "\tauthor=" << author - // << std::endl; - - - - TIDA::Track* t = new TIDA::Track(eta, phi, z0, d0, pT, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - author, false, barcode, -1, - false, - id ) ; - - return t; - - } - - - - // add a Trk::Track - void selectTrack( const Trk::Track* track ) { - - // do the track extraction stuff here.... - - static int hpmap[20] = { 0, 1, 2, 7, 8, 9, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }; - // std::cout << __FILE__<< " " <<__LINE__<<std::endl; - - if ( track ) { - - // const Trk::Perigee* startPerigee = track->perigeeParameters(); - // const Trk::MeasuredPerigee* measPer = dynamic_cast<const Trk::MeasuredPerigee*>(track->perigeeParameters()); - const Trk::MeasuredPerigee* startPerigee = dynamic_cast<const Trk::MeasuredPerigee*>(track->perigeeParameters()); - // CLHEP::HepVector perigeeParams = measPer->parameters(); - // double pT = measPer->pT(); - // double eta = measPer->eta(); - // double phi = perigeeParams[Trk::phi0]; - // double z0 = perigeeParams[Trk::z0]; - // double d0 = perigeeParams[Trk::d0]; - // // AAARCH!!!!! the TrackParticle pT is NOT SIGNED!!!! ( I ask you! ) - // if ( perigeeParams[Trk::qOverP]<0 ) pT *= -1; - // std::cout <<pT1<<" pt1vspT "<<pT<<std::endl; - - if (startPerigee){ - - - double theta = startPerigee->parameters()[Trk::theta]; - double p = 1/startPerigee->parameters()[Trk::qOverP]; - double qOverPt = startPerigee->parameters()[Trk::qOverP]/std::sin(theta); - double charge = startPerigee->charge(); - double eta = startPerigee->eta(); - double phi = startPerigee->parameters()[Trk::phi0]; - double z0 = startPerigee->parameters()[Trk::z0]; - double d0 = startPerigee->parameters()[Trk::d0]; - // double pT = (1./qOverPt)*(charge); - double pT = (1./qOverPt); // always use signed PT - - if ( charge<0 && pT>0 ) pT *= -1; - if ( charge<0 && p>0 ) p *= -1; - - const Trk::ErrorMatrix err = startPerigee->localErrorMatrix(); - - double dtheta = err.error(Trk::theta); - double dqovp = err.error(Trk::qOverP); - double covthetaOvP = err.covValue(Trk::qOverP,Trk::theta); - - - double deta = 0.5*dtheta/(std::cos(0.5*theta)*std::cos(0.5*theta)*std::tan(0.5*theta)); - double dphi = err.error(Trk::phi0); - double dz0 = err.error(Trk::z0); - double dd0 = err.error(Trk::d0); - double dpT = 0; - - - double sintheta = std::sin(theta); - double costheta = std::cos(theta); - double dpT2 = (p*p*sintheta)*(p*p*sintheta)*dqovp*dqovp + (p*costheta)*(p*costheta)*dtheta*dtheta - 2*(p*p*sintheta)*(p*costheta)*covthetaOvP; - - if ( dpT2>0 ) dpT = std::sqrt( dpT2 ); - - // Check number of hits - // NB: a spacepoint is two offline "hits", so a pixel spacepoint is really - // 2 "hits" and an offline SCT "hit" is really a 1D cluster, so two intersetcting - // stereo clusters making a spacepoint are two "hits" - // const Trk::TrackSummary *summary = dynamic_cast<const Trk::TrackSummary*>(track->trackSummary()); - //ToolHandle< Trk::ITrackSummaryTool > m_trackSumTool; - //m_trackSumTool = ToolHandle<Trk::ITrackSummaryTool>("Trk::TrackSummaryTool/InDetTrackSummaryTool"); - //const Trk::TrackSummary* summary = NULL; - //summary = m_trackSumTool->createSummary(*track); - - const Trk::TrackSummary * summary = track->trackSummary(); - int nBlayerHits = 0; - int nPixelHits = 0; - int nSctHits = 0; - int nStrawHits = 0; - int nTrHits = 0; - int nSiHits = 0; - bool expectBL = false; // Not stored for Trk::Track - unsigned bitmap = 0; - - if(summary==0){ - std::cout << "Could not create TrackSummary - Track will likely fail hits requirements" << std::endl; - } - else{ - nBlayerHits = 2*summary->get(Trk::numberOfBLayerHits); - nPixelHits = 2*summary->get(Trk::numberOfPixelHits); - nSctHits = summary->get(Trk::numberOfSCTHits); - nStrawHits = summary->get(Trk::numberOfTRTHits); - nTrHits = summary->get(Trk::numberOfTRTHighThresholdHits); - nSiHits = nPixelHits + nSctHits; - for ( int ih=0 ; ih<20 ; ih++ ) { - if ( summary->isHit(Trk::DetectorType(ih)) ) bitmap |= ( 1<<hpmap[ih] ); - } - } - - unsigned long id = (unsigned long)track; - double chi2 = 0.; - //const Trk::FitQuality *quality = dynamic_cast<const Trk::FitQuality*>(track->fitQuality()); - const Trk::FitQuality *quality = (track->fitQuality()); - if(quality==0) std::cout << "Could not create FitQuality - Track will likely fail hits requirements" << std::endl; - else{ - chi2 = quality->chiSquared(); - } - - int trackAuthor = -1; - - /// now some *ridiculous* code to get the author of the - /// TrackParticle (offline) tracks - - // std::cout << "fetching author info :" << track->info().trackFitter() << ":" - // << track->info().dumpInfo() << ": bm 0x" << std::hex << bitmap << std::dec << std::endl; - - int fitter = track->info().trackFitter(); - // std::string dumpinfo = track->info().dumpInfo(); - - if ( fitter>0 && fitter<Trk::TrackInfo::NumberOfTrackFitters ) { - if ((track->info().dumpInfo()).find("TRTStandalone") != std::string::npos) trackAuthor = 2; - else if ((track->info().dumpInfo()).find("TRTSeededTrackFinder") != std::string::npos) trackAuthor = 1; - else trackAuthor = 0; - } - - #if 0 - std::cout << "\t\t\tSUTT TP track" - << "\teta=" << eta // << " +- " << (*trackitr)->params()->deta() - << "\tphi=" << phi // << " +- " << (*trackitr)->params()->dphi() - << "\tz0=" << z0 - << "\tpT=" << pT // << "\t( " << 1/qoverp << ")" - << "\td0=" << d0 - << "\tNsi=" << nSiHits - << "\tNtrt=" << nTrHits - << "\tNstr=" << nStrawHits - << "\tauthor=" << trackAuthor - << std::endl; - #endif - // Create and save Track - TIDA::Track* t = new TIDA::Track(eta, phi, z0, d0, pT, chi2, - deta, dphi, dz0, dd0, dpT, - nBlayerHits, nPixelHits, nSctHits, nSiHits, - nStrawHits, nTrHits, bitmap, 0, - trackAuthor, - expectBL, id) ; - - if ( !addTrack( t ) ) delete t; - - //std::cout << "SUTT TP track " << *t << "\t0x" << std::hex << bitmap << std::dec << std::endl; - } - } - } - - // extract all the tracks from a TrackCollection and add them - void selectTracks( const TrackCollection* trigtracks ) { - - // std::cout << "\t\t\tSUTT \tTrackContainer->size() = " << trigtracks->size() << std::endl; - - TrackCollection::const_iterator trackitr = trigtracks->begin(); - TrackCollection::const_iterator trackend = trigtracks->end(); - - while ( trackitr!=trackend ) { - selectTrack( *trackitr ); - trackitr++; - } // loop over tracks - - } - - -private: - - unsigned long m_id; - -}; - - - -#endif // TRIGTRACKSELECTOR_H -- GitLab From 21755aa35507100134893be1083682c66c13ddad Mon Sep 17 00:00:00 2001 From: Andrii Verbytskyi <andriish@pcatlas18.mpp.mpg.de> Date: Mon, 1 Jul 2024 14:59:53 +0200 Subject: [PATCH 7/8] Removed references to deleted file --- .../TrigInDetAnalysisUtils/TrigTrackSelector.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TrigTrackSelector.h b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TrigTrackSelector.h index c32dca13045f..b24b55a5910f 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TrigTrackSelector.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TrigTrackSelector.h @@ -14,10 +14,6 @@ #include "TrigInDetAnalysisUtils/TIDA_newtracking.h" -#ifndef TIDA_NEWTRACKING_H -#include "TrigInDetAnalysisUtils/TrigTrackSelector_old.h" -#else - /// L2 tracks #include "TrigInDetEvent/TrigInDetTrackCollection.h" ///TruthMap @@ -210,6 +206,4 @@ private: }; - -#endif // TIDA_NEWTRACKING_H #endif // TIDAUTILS_TRIGTRACKSELECTOR_H -- GitLab From 4e7eb7b324ad410fc523e7aca8a5cf5024d7a8a9 Mon Sep 17 00:00:00 2001 From: Andrii Verbytskyi <andriish@pcatlas18.mpp.mpg.de> Date: Tue, 13 Aug 2024 16:02:52 +0200 Subject: [PATCH 8/8] Renaming in TruthUtils --- .../TruthUtils/TruthUtils/MagicNumbers.h | 26 +++++++++---------- .../src/HGTD_DigitizationTool.cxx | 4 +-- .../src/HGTD_SmearedDigitizationTool.cxx | 2 +- .../src/PixelFastDigitizationTool.cxx | 2 +- .../src/SCT_FastDigitizationTool.cxx | 2 +- .../src/SiSmearedDigitizationTool.cxx | 2 +- .../src/TRTFastDigitizationTool.cxx | 2 +- .../src/PixelDigitizationTool.cxx | 2 +- .../src/SCT_DigitizationTool.cxx | 4 +-- .../src/StripDigitizationTool.cxx | 4 +-- .../src/TRTDigitizationTool.cxx | 2 +- .../src/CscDigitizationTool.cxx | 2 +- .../src/MdtDigitizationTool.cxx | 2 +- .../src/RpcDigitizationTool.cxx | 2 +- .../src/TgcDigitizationTool.cxx | 2 +- .../src/MuonDigitizationTool.cxx | 2 +- 16 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Generators/TruthUtils/TruthUtils/MagicNumbers.h b/Generators/TruthUtils/TruthUtils/MagicNumbers.h index a07ada8640dd..796346aa34ad 100644 --- a/Generators/TruthUtils/TruthUtils/MagicNumbers.h +++ b/Generators/TruthUtils/TruthUtils/MagicNumbers.h @@ -193,10 +193,10 @@ namespace HepMC { template <class T> inline bool is_truth_suppressed_pileup(const T& p){ return (barcode(p) == SUPPRESSED_PILEUP_BARCODE);} /// @brief Method to establish if a if the object is linked to something which was never saved to the HepMC Truth - for example particle was too low energy to be recorded - template <class T> inline bool no_truth_link(const T& p){ return (barcode(p) == UNDEFINED_ID);} + template <class T> inline bool has_truth_link(const T& p){ return (barcode(p) != UNDEFINED_ID);} /// @brief Helper function for SDO creation in PileUpTools - template <class T> inline bool ignoreTruthLink(const T& p, bool vetoPileUp){ const int b = barcode(p); return no_truth_link(b) || (vetoPileUp && is_truth_suppressed_pileup(b)); } + template <class T> inline bool ignore_truth_link(const T& p, bool vetoPileUp){ const int b = barcode(p); return !has_truth_link(b) || (vetoPileUp && is_truth_suppressed_pileup(b)); } /// @brief Method to establish if a particle (or barcode) was created during the simulation (only to be used in legacy TP converters) template <class T> inline bool is_simulation_particle(const T& p){ return (barcode(p)>SIM_BARCODE_THRESHOLD);} @@ -234,25 +234,25 @@ namespace HepMC { } /// @brief Method to establish if a if the object is linked to something which was never saved to the HepMC Truth - for example particle was too low energy to be recorded - template <class T> inline bool no_truth_link(const T& p){ + template <class T> inline bool has_truth_link(const T& p){ if constexpr (std::is_same_v<std::remove_const_t<T>, HepMcParticleLink>) { - return p.linkIsNull(); + return !p.linkIsNull(); } else if constexpr (std::is_same_v<std::remove_const_t<remove_smart_pointer_t<std::remove_pointer_t<T>>>, HepMcParticleLink>) { - return p->linkIsNull(); + return !p->linkIsNull(); } else { - return (uniqueID(p) == UNDEFINED_ID); + return (uniqueID(p) != UNDEFINED_ID); } } /// @brief Helper function for SDO creation in PileUpTools - template <class T> inline bool ignoreTruthLink(const T& p, bool vetoPileUp){ + template <class T> inline bool ignore_truth_link(const T& p, bool vetoPileUp){ if constexpr (std::is_same_v<std::remove_const_t<remove_smart_pointer_t<std::remove_pointer_t<T>>>, HepMcParticleLink>) { - return no_truth_link(p) || (vetoPileUp && is_truth_suppressed_pileup(p)); + return !has_truth_link(p) || (vetoPileUp && is_truth_suppressed_pileup(p)); } else { - const int u = uniqueID(p); return no_truth_link(u) || (vetoPileUp && is_truth_suppressed_pileup(u)); + const int u = uniqueID(p); return !has_truth_link(u) || (vetoPileUp && is_truth_suppressed_pileup(u)); } } @@ -328,15 +328,15 @@ namespace HepMC { } /// @brief Method to establish if a if the object is linked to something which was never saved to the HepMC Truth - for example particle was too low energy to be recorded - template <class T> inline bool no_truth_link(const T& p){ return StatusBased::no_truth_link(p);} + template <class T> inline bool has_truth_link(const T& p){ return StatusBased::has_truth_link(p);} /// @brief Helper function for SDO creation in PileUpTools - template <class T> inline bool ignoreTruthLink(const T& p, bool vetoPileUp){ + template <class T> inline bool ignore_truth_link(const T& p, bool vetoPileUp){ if constexpr (std::is_same_v<std::remove_const_t<remove_smart_pointer_t<std::remove_pointer_t<T>>>, HepMcParticleLink>) { - return StatusBased::ignoreTruthLink(p, vetoPileUp); + return StatusBased::ignore_truth_link(p, vetoPileUp); } else { - return BarcodeBased::ignoreTruthLink(p, vetoPileUp); + return BarcodeBased::ignore_truth_link(p, vetoPileUp); } } diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_DigitizationTool.cxx b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_DigitizationTool.cxx index 494b30f52e41..2598df7a43d3 100644 --- a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_DigitizationTool.cxx +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_DigitizationTool.cxx @@ -421,7 +421,7 @@ void HGTD_DigitizationTool::createAndStoreSDO( for (; charge_list_itr != charge_list_itr_end; ++charge_list_itr) { const HepMcParticleLink &trkLink = charge_list_itr->particleLink(); - if (HepMC::ignoreTruthLink(trkLink, m_vetoPileUpTruthLinks)) { + if (HepMC::ignore_truth_link(trkLink, m_vetoPileUpTruthLinks)) { continue; } if (!real_particle_hit) { @@ -434,7 +434,7 @@ void HGTD_DigitizationTool::createAndStoreSDO( // processType()==SiCharge::cut_track // Tracks With Truth: barcode!=0 && // processType()==SiCharge::track - if (!HepMC::no_truth_link(trkLink) && charge_list_itr->processType() == SiCharge::track) { + if (HepMC::has_truth_link(trkLink) && charge_list_itr->processType() == SiCharge::track) { real_particle_hit = true; } // real_particle_hit = trkLink.isValid(); diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/HGTD_SmearedDigitizationTool.cxx b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/HGTD_SmearedDigitizationTool.cxx index f99dc6b6715f..7e162cf68cf1 100644 --- a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/HGTD_SmearedDigitizationTool.cxx +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/HGTD_SmearedDigitizationTool.cxx @@ -364,7 +364,7 @@ StatusCode HGTD_SmearedDigitizationTool::fillMultiTruthCollection(PRD_MultiTruth << *cluster << " and link = " << trk_link); if (trk_link.isValid()) { - if (!HepMC::ignoreTruthLink(trk_link, m_vetoPileUpTruthLinks)) { + if (!HepMC::ignore_truth_link(trk_link, m_vetoPileUpTruthLinks)) { map->insert(std::make_pair(cluster->identify(), trk_link)); } } diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/src/PixelFastDigitizationTool.cxx b/InnerDetector/InDetDigitization/FastSiDigitization/src/PixelFastDigitizationTool.cxx index 104215a68c54..67f9bb78ff38 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/src/PixelFastDigitizationTool.cxx +++ b/InnerDetector/InDetDigitization/FastSiDigitization/src/PixelFastDigitizationTool.cxx @@ -786,7 +786,7 @@ StatusCode PixelFastDigitizationTool::digitize(const EventContext& ctx, const PixelCluster* insertedCluster = it->second; if (currentLink.isValid()) { - if (!HepMC::ignoreTruthLink(currentLink, m_vetoPileUpTruthLinks)) { + if (!HepMC::ignore_truth_link(currentLink, m_vetoPileUpTruthLinks)) { m_pixPrdTruth->insert( std::make_pair(insertedCluster->identify(), currentLink)); ATH_MSG_DEBUG("Truth map filled with cluster" diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/src/SCT_FastDigitizationTool.cxx b/InnerDetector/InDetDigitization/FastSiDigitization/src/SCT_FastDigitizationTool.cxx index e02b6480333f..d4e4aa41d59f 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/src/SCT_FastDigitizationTool.cxx +++ b/InnerDetector/InDetDigitization/FastSiDigitization/src/SCT_FastDigitizationTool.cxx @@ -862,7 +862,7 @@ StatusCode SCT_FastDigitizationTool::digitize(const EventContext& ctx, // Build Truth info for current cluster if (currentLink.isValid()) { - if (!HepMC::ignoreTruthLink(currentLink, m_vetoPileUpTruthLinks)) { + if (!HepMC::ignore_truth_link(currentLink, m_vetoPileUpTruthLinks)) { sctPrdTruth->insert(std::make_pair(potentialCluster->identify(), currentLink)); ATH_MSG_DEBUG("Truth map filled with cluster" << potentialCluster << " and link = " << currentLink); } diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/src/SiSmearedDigitizationTool.cxx b/InnerDetector/InDetDigitization/FastSiDigitization/src/SiSmearedDigitizationTool.cxx index e2d44b16f95f..528c187cb6d8 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/src/SiSmearedDigitizationTool.cxx +++ b/InnerDetector/InDetDigitization/FastSiDigitization/src/SiSmearedDigitizationTool.cxx @@ -484,7 +484,7 @@ StatusCode SiSmearedDigitizationTool::FillTruthMap(PRD_MultiTruthCollection * ma ATH_MSG_DEBUG("Truth map filling with cluster " << *cluster << " and link = " << hit->particleLink()); if (hit->particleLink().isValid()){ - if (!HepMC::ignoreTruthLink(hit->particleLink(), m_vetoPileUpTruthLinks)) { + if (!HepMC::ignore_truth_link(hit->particleLink(), m_vetoPileUpTruthLinks)) { map->insert(std::make_pair(cluster->identify(), hit->particleLink())); ATH_MSG_DEBUG("Truth map filled with cluster " << *cluster << " and link = " << hit->particleLink()); } diff --git a/InnerDetector/InDetDigitization/FastTRT_Digitization/src/TRTFastDigitizationTool.cxx b/InnerDetector/InDetDigitization/FastTRT_Digitization/src/TRTFastDigitizationTool.cxx index ec46a3ceaa95..0d39c8c5f8f3 100644 --- a/InnerDetector/InDetDigitization/FastTRT_Digitization/src/TRTFastDigitizationTool.cxx +++ b/InnerDetector/InDetDigitization/FastTRT_Digitization/src/TRTFastDigitizationTool.cxx @@ -405,7 +405,7 @@ StatusCode TRTFastDigitizationTool::produceDriftCircles(const EventContext& ctx, m_driftCircleMap.insert( std::multimap< Identifier, InDet::TRT_DriftCircle * >::value_type( straw_id, trtDriftCircle ) ); const HepMcParticleLink particleLink = HepMcParticleLink::getRedirectedLink(hit->particleLink(), hit.eventId(), ctx); // This link should now correctly resolve to the TruthEvent McEventCollection in the main StoreGateSvc. if ( particleLink.isValid() ) { - if (!HepMC::ignoreTruthLink(particleLink, m_vetoPileUpTruthLinks)) { + if (!HepMC::ignore_truth_link(particleLink, m_vetoPileUpTruthLinks)) { trtPrdTruth->insert( std::make_pair( trtDriftCircle->identify(), particleLink ) ); ATH_MSG_DEBUG( "Truth map filled with cluster " << trtDriftCircle << " and link = " << particleLink ); } diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitizationTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitizationTool.cxx index 58ad1bd27fef..a67ff08e2a0b 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitizationTool.cxx +++ b/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitizationTool.cxx @@ -295,7 +295,7 @@ void PixelDigitizationTool::addSDO(SiChargedDiodeCollection* collection) { for (list_t::const_iterator i_ListOfCharges = charges.begin(); i_ListOfCharges != EndOfChargeList; ++i_ListOfCharges) { const HepMcParticleLink& trkLink = i_ListOfCharges->particleLink(); - if (HepMC::ignoreTruthLink(trkLink, m_vetoPileUpTruthLinks)) { + if (HepMC::ignore_truth_link(trkLink, m_vetoPileUpTruthLinks)) { continue; } if (!real_particle_hit) { diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DigitizationTool.cxx b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DigitizationTool.cxx index f26c08b9910f..6f4ae075a37a 100644 --- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DigitizationTool.cxx +++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DigitizationTool.cxx @@ -774,7 +774,7 @@ void SCT_DigitizationTool::addSDO(SiChargedDiodeCollection* collection, SG::Writ const list_t::const_iterator EndOfChargeList{charges.end()}; for (list_t::const_iterator i_ListOfCharges{charges.begin()}; i_ListOfCharges != EndOfChargeList; ++i_ListOfCharges) { const HepMcParticleLink& trkLink{i_ListOfCharges->particleLink()}; - if (HepMC::ignoreTruthLink(trkLink, m_vetoPileUpTruthLinks)) { + if (HepMC::ignore_truth_link(trkLink, m_vetoPileUpTruthLinks)) { continue; } if (!real_particle_hit) { @@ -787,7 +787,7 @@ void SCT_DigitizationTool::addSDO(SiChargedDiodeCollection* collection, SG::Writ // processType()==SiCharge::cut_track // Tracks With Truth: barcode!=0 and // processType()==SiCharge::track - if (!HepMC::no_truth_link(trkLink) && i_ListOfCharges->processType() == SiCharge::track) { + if (HepMC::has_truth_link(trkLink) && i_ListOfCharges->processType() == SiCharge::track) { real_particle_hit = true; } } diff --git a/InnerDetector/InDetDigitization/StripDigitization/src/StripDigitizationTool.cxx b/InnerDetector/InDetDigitization/StripDigitization/src/StripDigitizationTool.cxx index e303f95af277..d15b7945a737 100644 --- a/InnerDetector/InDetDigitization/StripDigitization/src/StripDigitizationTool.cxx +++ b/InnerDetector/InDetDigitization/StripDigitization/src/StripDigitizationTool.cxx @@ -885,7 +885,7 @@ void StripDigitizationTool::addSDO(SiChargedDiodeCollection* collection, SG::Wri list_t::const_iterator EndOfChargeList{charges.end()}; for (list_t::const_iterator i_ListOfCharges{charges.begin()}; i_ListOfCharges != EndOfChargeList; ++i_ListOfCharges) { const HepMcParticleLink& trkLink{i_ListOfCharges->particleLink()}; - if (HepMC::ignoreTruthLink(trkLink, m_vetoPileUpTruthLinks)) { + if (HepMC::ignore_truth_link(trkLink, m_vetoPileUpTruthLinks)) { continue; } if (not real_particle_hit) { @@ -898,7 +898,7 @@ void StripDigitizationTool::addSDO(SiChargedDiodeCollection* collection, SG::Wri // processType()==SiCharge::cut_track // Tracks With Truth: barcode!=0 and // processType()==SiCharge::track - if (!HepMC::no_truth_link(trkLink) && i_ListOfCharges->processType() == SiCharge::track) { + if (HepMC::has_truth_link(trkLink) && i_ListOfCharges->processType() == SiCharge::track) { real_particle_hit = true; } } diff --git a/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTDigitizationTool.cxx b/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTDigitizationTool.cxx index 2760aef149b6..50af15af3638 100644 --- a/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTDigitizationTool.cxx +++ b/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTDigitizationTool.cxx @@ -428,7 +428,7 @@ StatusCode TRTDigitizationTool::processStraws(const EventContext& ctx, // create a new deposit InDetSimData::Deposit deposit( HepMcParticleLink::getRedirectedLink((*hit_iter)->particleLink(), hit_iter->eventId(), ctx), // This link should now correctly resolve to the TruthEvent McEventCollection in the main StoreGateSvc. (*hit_iter)->GetEnergyDeposit() ); - if (HepMC::ignoreTruthLink(deposit.first, m_vetoPileUpTruthLinks)) { + if (HepMC::ignore_truth_link(deposit.first, m_vetoPileUpTruthLinks)) { continue; } ATH_MSG_VERBOSE ( "Deposit: trackID " << deposit.first << " energyDeposit " << deposit.second ); diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx index f059df7b238f..94165ddde783 100644 --- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx @@ -204,7 +204,7 @@ StatusCode CscDigitizationTool::CoreDigitization(Collections_t& collections,CscS zpos = zi + f*dz; } - if (!m_includePileUpTruth && HepMC::ignoreTruthLink(phit->particleLink(), m_vetoPileUpTruthLinks)) { + if (!m_includePileUpTruth && HepMC::ignore_truth_link(phit->particleLink(), m_vetoPileUpTruthLinks)) { hashVec.clear(); continue; } diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx index df5019fbc5f9..d296023377d7 100644 --- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx @@ -762,7 +762,7 @@ bool MdtDigitizationTool::createDigits(const EventContext& ctx, Collections_t& c ATH_MSG_VERBOSE(" createDigits() phit-" << &phit << " hit-" << hit.print() << " localZPos = " << hit.localPosition().z()); // Do not store pile-up truth information - if (!m_includePileUpTruth && HepMC::ignoreTruthLink(phit->particleLink(), m_vetoPileUpTruthLinks)) { continue; } + if (!m_includePileUpTruth && HepMC::ignore_truth_link(phit->particleLink(), m_vetoPileUpTruthLinks)) { continue; } // Create the Deposit for MuonSimData MuonSimData::Deposit deposit(HepMcParticleLink::getRedirectedLink(phit->particleLink(), phit.eventId(), ctx), // This link should now correctly resolve to the TruthEvent McEventCollection in the main StoreGateSvc. diff --git a/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx index 683ce0cfc721..206fbd84ad99 100644 --- a/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx @@ -659,7 +659,7 @@ StatusCode RpcDigitizationTool::doDigitization(const EventContext& ctx, // MuonMCData((*b),G4Time+bunchTime+proptime )); // store tof+strip_propagation // Do not store pile-up truth information - if (m_includePileUpTruth || !HepMC::ignoreTruthLink(phit->particleLink(), m_vetoPileUpTruthLinks)) { + if (m_includePileUpTruth || !HepMC::ignore_truth_link(phit->particleLink(), m_vetoPileUpTruthLinks)) { if (std::abs(hit.particleEncoding()) == 13 || hit.particleEncoding() == 0) { if (channelSimDataMap.find(atlasId) == channelSimDataMap.end()) { SimDataContent& content = channelSimDataMap[atlasId]; diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx index b6f2e8bf682a..e36f3c1aca29 100644 --- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx @@ -442,7 +442,7 @@ StatusCode TgcDigitizationTool::digitizeCore(const EventContext& ctx) { // fill the SDO collection in StoreGate if not pile-up if (!m_includePileUpTruth && - HepMC::ignoreTruthLink(phit->particleLink(), + HepMC::ignore_truth_link(phit->particleLink(), m_vetoPileUpTruthLinks)) { continue; } diff --git a/MuonSpectrometer/MuonPhaseII/MuonDigitization/MuonDigitizationR4/src/MuonDigitizationTool.cxx b/MuonSpectrometer/MuonPhaseII/MuonDigitization/MuonDigitizationR4/src/MuonDigitizationTool.cxx index 2fe1610ca66b..eb2d7c96f9fd 100644 --- a/MuonSpectrometer/MuonPhaseII/MuonDigitization/MuonDigitizationR4/src/MuonDigitizationTool.cxx +++ b/MuonSpectrometer/MuonPhaseII/MuonDigitization/MuonDigitizationR4/src/MuonDigitizationTool.cxx @@ -151,7 +151,7 @@ namespace MuonR4{ ATH_MSG_VERBOSE("No SDO container setup of writing"); return nullptr; } - if (!m_includePileUpTruth && HepMC::ignoreTruthLink(hit->genParticleLink(), m_vetoPileUpTruthLinks)) { + if (!m_includePileUpTruth && HepMC::ignore_truth_link(hit->genParticleLink(), m_vetoPileUpTruthLinks)) { ATH_MSG_VERBOSE("Hit "<<m_idHelperSvc->toString(hit->identify())<<" is a pile-up truth link"); return nullptr; } -- GitLab