ATLAS Offline Software
JetCollection.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef JETEVENT_JETCOLLECTION_H
6 #define JETEVENT_JETCOLLECTION_H
7 //********************************************************************
8 //NAME: JetCollection.h
9 //********************************************************************
10 
11 // INCLUDE HEADER FILES:
12 
14 #include "AthLinks/DataLink.h"
15 #include "AthenaKernel/CLASS_DEF.h"
16 #include "JetEvent/Jet.h"
18 #include "JetEvent/JetMomentMap.h"
19 
21 // Needed for constructing the mirror container hierarchy
22 // This tells StoreGate that DV<Jet> derives from DV<IParticle>
24 
25 namespace fastjet {
26  class ClusterSequence ;
27 }
28 
29 class JetCollection : public DataVector<Jet>
30 {
31  public:
32 
33  // JetCollection types ---------------------
35  enum OrderedVar { ByEtDown = 0,
36  ByEtUp = 1,
37  ByPtDown = 2,
38  ByPtUp = 3,
39  ByEDown = 4,
40  ByEUp = 5,
41  ByEtaUp = 6,
42  ByEtaDown = 7,
45  ByPhiDown = 10,
46  ByPhiUp = 11,
48  InEtaPhiUp = 13,
49  Random = 14 };
50  // --------------------------------------
51 
52  // constructor
54 
55 
56 
57  virtual ~JetCollection() ;
58  // void print();
59 
60 
61  // make ByEtDown the default
63  { return ordering == m_ordered; };
64 
66  { m_ordered = ordered; return; };
67 
69  { return m_ordered; };
70 
71 
72  // we redefine the insertion mechanisms to be sure to capture the jet moments
73  // associated to the inserted jets and assign an id within this collection
74  void push_back(Jet* j);
75 
76  iterator insert(iterator position, Jet* j);
77 
78  template <class InputIterator>
79  void insert(iterator position, InputIterator first, InputIterator last);
80 
81  // cppcheck-suppress duplInheritedMember
82  void clear();
83  // cppcheck-suppress duplInheritedMember
85 
86 
87  private:
88 
90 
91  public:
92 
95 
96  void setAuthor(const std::string& author);
97  std::string author() const;
98 
99  const JetMomentMap * getMomentMap() const;
100  std::string getMomentMapName() const;
101 
103 
104  protected:
105  friend class JetCollectionCnv_p6;
106 
107 #if !defined(__REFLEX__) && !defined(__CLING__)
109 #endif
110 
111 
114  size_t m_jetAuthor;
115 
116 
117 
118  size_t getNextId();
120  size_t m_nextId;
121 
122 
123  void acquireJet(Jet *j);
124 
127 
128 
130  mutable bool m_ownMap; // it is mutable because a map can be created from a const collection
131 
132  void recordedInSG(std::string key);
133 
134  void resetJetId(std::size_t);
135 
136 
137 protected:
141 public:
145 
146 
147 };
148 
149 // auto-symlink:
151 
152 CLASS_DEF( JetCollection , 1162448536 , 1 )
153  //CLASS_DEF(JetCollection<Jet>, 3005, 1 )
154  //CLASS_DEF(JetCollection<CombinedJetSums> , 3007, 1 )
155 
156 
157 template <class InputIterator>
158 void JetCollection::insert(iterator position, InputIterator first, InputIterator last){
159  InputIterator it = first;
160  for(; it != last; ++it) acquireJet(*it);
161  DataVector<Jet>::insert(position,first,last);
162 }
183 #endif
JetMomentMap
Definition: JetMomentMap.h:21
JetCollection::ByAbsEtaUp
@ ByAbsEtaUp
Definition: JetCollection.h:43
JetMomentMap.h
SG_BASE
SG_BASE(JetCollection, DataVector< Jet >)
JetCollection::keyDesc
JetKeyDescriptorInstance * keyDesc() const
Definition: JetCollection.cxx:43
JetKeyDescriptor.h
JetCollection::ByAbsEtaDown
@ ByAbsEtaDown
Definition: JetCollection.h:44
fastjet
Definition: FastJetLinkBase.h:22
Jet
Basic data class defines behavior for all Jet objects The Jet class is the principal data class for...
Definition: Reconstruction/Jet/JetEvent/JetEvent/Jet.h:47
skel.it
it
Definition: skel.GENtoEVGEN.py:396
taskman.template
dictionary template
Definition: taskman.py:317
JetCollection::acquireJet
void acquireJet(Jet *j)
Definition: JetCollection.cxx:105
JetCollection::JetCollection
JetCollection(SG::OwnershipPolicy own=SG::OWN_ELEMENTS)
Definition: JetCollection.cxx:9
JetCollection::OrderedVar
OrderedVar
Definition: JetCollection.h:35
JetCollection::ByPhiUp
@ ByPhiUp
Definition: JetCollection.h:46
JetCollection::m_fastjetClustSeq
const fastjet::ClusterSequence * m_fastjetClustSeq
Pointer to the fastjet object this jet is build from.
Definition: JetCollection.h:140
SG::OwnershipPolicy
OwnershipPolicy
describes the possible element ownership policies (see e.g. DataVector)
Definition: OwnershipPolicy.h:16
JetCollection::m_keyStore
DataLink< JetKeyDescriptor > m_keyStore
link to the JetKeyDescriptor is mandatory for persistency. Access done through the JetKeyDescriptorIn...
Definition: JetCollection.h:94
JetCollection::ByEDown
@ ByEDown
Definition: JetCollection.h:39
JetCollection::m_ordered
OrderedVar m_ordered
Definition: JetCollection.h:89
JetCollection::getMomentMapName
std::string getMomentMapName() const
Definition: JetCollection.cxx:47
JetCollection::resetJetId
void resetJetId(std::size_t)
Definition: JetCollection.cxx:160
Random
Definition: TrigAnalysis/TrigInDetAnalysisUser/Resplot/src/Random.h:26
jet::ClusterSequence
fastjet::ClusterSequence ClusterSequence
Definition: ClusterSequence.h:21
SG::OWN_ELEMENTS
@ OWN_ELEMENTS
this data object owns its elements
Definition: OwnershipPolicy.h:17
JetCollection::m_keyDescInstance
JetKeyDescriptorInstance m_keyDescInstance
This JetKeyDescriptorInstance points by default to the global JetKeyDescriptorInstance's store....
Definition: JetCollection.h:126
JetCollection::m_nextId
size_t m_nextId
the next free identifier for jets inside this collection
Definition: JetCollection.h:120
JetCollection::m_jetAuthor
size_t m_jetAuthor
the author of this jetcollection.
Definition: JetCollection.h:114
JetCollection::ordered
JetCollection::OrderedVar ordered() const
Definition: JetCollection.h:68
JetCollection::ByPtDown
@ ByPtDown
Definition: JetCollection.h:37
JetCollection::ByEtUp
@ ByEtUp
Definition: JetCollection.h:36
JetCollection::clear
void clear()
Definition: JetCollection.cxx:93
DataVector::insert
iterator insert(iterator position, value_type pElem)
Add a new element to the collection.
JetCollection::isOrdered
bool isOrdered(JetCollection::OrderedVar ordering=JetCollection::ByEtDown) const
Definition: JetCollection.h:62
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
JetCollection::m_momentMapLink
DataLink< JetMomentMap > m_momentMapLink
Definition: JetCollection.h:108
DATAVECTOR_BASE
DATAVECTOR_BASE(Jet, IParticle)
JetCollection::setAuthor
void setAuthor(const std::string &author)
Definition: JetCollection.cxx:140
JetCollection::ByEtaUp
@ ByEtaUp
Definition: JetCollection.h:41
JetCollection::setFastjetClustSeq
void setFastjetClustSeq(const fastjet::ClusterSequence *cs)
Definition: JetCollection.h:144
JetCollection::author
std::string author() const
Definition: JetCollection.cxx:136
JetCollectionCnv_p6
Definition: JetCollectionCnv_p6.h:35
JetCollection::ByEtDown
@ ByEtDown
Definition: JetCollection.h:35
JetCollection::m_ownMap
bool m_ownMap
false if the map is recorded in SG
Definition: JetCollection.h:130
JetCollection::ByEtaDown
@ ByEtaDown
Definition: JetCollection.h:42
JetCollection::ByEUp
@ ByEUp
Definition: JetCollection.h:40
JetCollection::getMomentMap
const JetMomentMap * getMomentMap() const
Definition: JetCollection.cxx:53
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
JetCollection::InEtaPhiUp
@ InEtaPhiUp
Definition: JetCollection.h:48
JetCollection::getNextId
size_t getNextId()
Definition: JetCollection.cxx:78
JetCollection::ByPhiDown
@ ByPhiDown
Definition: JetCollection.h:45
JetCollection
Container for Jets
Definition: JetCollection.h:30
JetCollection::insert
iterator insert(iterator position, Jet *j)
Definition: JetCollection.cxx:88
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
DeMoScan.first
bool first
Definition: DeMoScan.py:536
JetCollection::ByPtUp
@ ByPtUp
Definition: JetCollection.h:38
DataVector< Jet >::ownPolicy
SG::OwnershipPolicy ownPolicy() const
Return the ownership policy setting for this container.
IParticleContainer.h
Jet.h
JetCollection::setOrdered
void setOrdered(JetCollection::OrderedVar ordered)
Definition: JetCollection.h:65
JetCollection::iterator
DataVector< Jet >::iterator iterator
Definition: JetCollection.h:34
JetCollection::fastjetClustSeq
const fastjet::ClusterSequence * fastjetClustSeq() const
Access to the internal fastjet object. CAN RETURN NULL, see the description of m_pseudoJet.
Definition: JetCollection.h:143
IParticle
Definition: Event/EventKernel/EventKernel/IParticle.h:43
JetCollection::push_back
void push_back(Jet *j)
Definition: JetCollection.cxx:82
JetKeyDescriptorInstance
Definition: JetKeyDescriptor.h:100
CLASS_DEF.h
macros to associate a CLID to a type
JetCollection::recordedInSG
void recordedInSG(std::string key)
Definition: JetCollection.cxx:144
hist_file_dump.ordering
ordering
Definition: hist_file_dump.py:80
JetCollection::InEtaPhiDown
@ InEtaPhiDown
Definition: JetCollection.h:47
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
JetCollection::~JetCollection
virtual ~JetCollection()
Definition: JetCollection.cxx:24