ATLAS Offline Software
SimBarCode.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 ////////////////////////////////////////////////////////////////
7 // //
8 // Inline file for class SimBarCode //
9 // //
10 // Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
11 // Initial version: April 2008 //
12 // //
13 ////////////////////////////////////////////////////////////////
14 
15 //____________________________________________________________________
16 inline SimBarCode::SimBarCode(int barCode, HepMcParticleLink::index_type evtIndex, int pdgCode)
17  : m_barCode(barCode), m_evtIndex(evtIndex), m_pdgCode(pdgCode)
18 {
19 }
20 
21 //____________________________________________________________________
22 inline SimBarCode::SimBarCode(const HepMcParticleLink& l, int pdgCode)
23  : m_barCode(l.barcode()), m_evtIndex(l.eventIndex()), m_pdgCode(pdgCode)
24 {
25 }
26 
27 //____________________________________________________________________
28 inline int SimBarCode::barCode() const
29 {
30  return m_barCode;
31 }
32 
33 //____________________________________________________________________
34 inline int SimBarCode::actualBarCode() const {
35  return m_barCode < 0 ? 0 : m_barCode;
36 }
37 
38 //____________________________________________________________________
39 inline HepMcParticleLink::index_type SimBarCode::evtIndex() const
40 {
41  return m_evtIndex;
42 }
43 
44 //____________________________________________________________________
45 inline int SimBarCode::pdgCode() const
46 {
47  return m_pdgCode;
48 }
49 
50 //____________________________________________________________________
51 inline bool SimBarCode::isNonUniqueSecondary() const {
52  return m_barCode<=0;
53 }
54 
55 //____________________________________________________________________
56 inline bool SimBarCode::operator<(const SimBarCode& o) const
57 {
58  if (m_evtIndex == o.m_evtIndex)
59  return m_barCode == o.m_barCode ? m_pdgCode < o.m_pdgCode : m_barCode < o.m_barCode;
60  return m_evtIndex < o.m_evtIndex;
61 }