![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
24 #include "GaudiKernel/MsgStream.h"
29 #include <TLorentzVector.h>
47 return StatusCode::SUCCESS;
53 return StatusCode::SUCCESS;
62 std::vector<int> vLeptonPDGIDs;
63 std::vector<double> vLeptonPt;
64 std::vector<double> vLeptonEta;
65 std::vector< std::vector < size_t > > vLeptonParentPDGIDs;
71 ATH_MSG_ERROR(
"No TruthParticle collection with name " <<
"TruthGen" <<
" found in StoreGate!");
72 return StatusCode::FAILURE;
76 unsigned int nPart = xTruthParticleContainer->
size();
77 for (
unsigned int iPart = 0; iPart < nPart; ++iPart) {
85 if( std::abs(pitr->
pdgId()) != 11 && std::abs(pitr->
pdgId()) != 13)
continue;
91 bool massiveParent =
false;
94 auto vxp =
p->prodVtx();
96 if(vxp->nIncomingParticles()!=1)
break;
97 p = vxp->incomingParticle(0);
98 const int pdg = std::abs(
p->pdgId());
99 if(!((pdg>=11 && pdg<=16) || pdg==22))
101 massiveParent = (
p->m()>20000);
105 if(!massiveParent)
continue;
108 vLeptonPDGIDs.push_back(pitr->
pdgId());
109 vLeptonPt.push_back(pitr->
pt());
110 vLeptonEta.push_back(pitr->
eta());
112 std::vector<size_t> parentPDG_tmp;
115 vLeptonParentPDGIDs.push_back(parentPDG_tmp);
119 int nLeptons = vLeptonPDGIDs.size();
125 return StatusCode::SUCCESS;
137 for (
unsigned int i = 0 ;
i < vLeptonPDGIDs.size() ;
i++){
139 for (
unsigned int j =
i ; j < vLeptonPDGIDs.size() ; j++){
142 id1 = vLeptonPDGIDs[
i];
143 id2 = vLeptonPDGIDs[j];
145 if(std::abs(id1)==std::abs(
id2) && id1*
id2 < 0) nSFOS+=1;
146 else if(std::abs(id1)==std::abs(
id2) && id1*
id2 > 0) nSFSS+=1;
147 else if(std::abs(id1)!=std::abs(
id2) && id1*
id2 < 0) nOFOS+=1;
148 else if(std::abs(id1)!=std::abs(
id2) && id1*
id2 > 0) nOFSS+=1;
164 bool passSFOS =
false;
165 bool passSFSS =
false;
166 bool passOFOS =
false;
167 bool passOFSS =
false;
168 bool passPairSum =
false;
172 ATH_MSG_INFO(
"# Lep " << vLeptonPDGIDs.size() <<
", "<< nSFOS <<
" SFOS, "<<nSFSS<<
" SFSS, " << nOFOS <<
" OFOS, " << nOFSS <<
" OFSS pairs ," << nPairSum <<
"summed pairs" );
180 if(passSFOS && passSFSS && passOFOS && passOFSS && passPairSum){
182 for (
unsigned int i = 0;
i<vLeptonPDGIDs.size();
i++){
183 int pdg = vLeptonPDGIDs[
i];
184 double pt = vLeptonPt[
i];
185 double eta = vLeptonEta[
i];
187 for (
unsigned int j=0;j<vLeptonParentPDGIDs[
i].size();j++)
msg(
MSG::DEBUG) << vLeptonParentPDGIDs[
i][j];
190 return StatusCode::SUCCESS;
194 setFilterPassed(
false);
196 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
Gaudi::Property< int > m_nOFSS_Min
virtual StatusCode filterEvent()
Gaudi::Property< double > m_EtaRange
Gaudi::Property< bool > m_bUseSFOSInSum
Scalar eta() const
pseudorapidity method
Gaudi::Property< bool > m_onlyMassiveParents
virtual StatusCode filterFinalize()
Gaudi::Property< bool > m_bUseSFSSInSum
Gaudi::Property< int > m_nSFOS_Max
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Base class for event generator filtering modules.
Gaudi::Property< int > m_nSFOS_Min
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
Gaudi::Property< int > m_nOFOS_Max
const TruthParticle_v1 * incomingParticle(size_t index) const
Get one of the incoming particles.
Gaudi::Property< int > m_nLeptons_Min
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
virtual StatusCode filterInitialize()
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Gaudi::Property< int > m_nPairSum_Min
Gaudi::Property< int > m_nOFOS_Min
Gaudi::Property< int > m_nSFSS_Max
bool isStable(const T &p)
Gaudi::Property< bool > m_bUseOFOSInSum
size_t nIncomingParticles() const
Get the number of incoming particles.
xAODLeptonPairFilter(const std::string &name, ISvcLocator *pSvcLocator)
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Gaudi::Property< double > m_Ptmin
Gaudi::Property< bool > m_bUseOFSSInSum
int pdgId() const
PDG ID code.
Gaudi::Property< int > m_nLeptons_Max
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Property< int > m_nSFSS_Min
Gaudi::Property< int > m_nOFSS_Max
virtual ~xAODLeptonPairFilter()
Gaudi::Property< int > m_nPairSum_Max