ATLAS Offline Software
Loading...
Searching...
No Matches
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"
16#include "JetEvent/Jet.h"
19
21// Needed for constructing the mirror container hierarchy
22// This tells StoreGate that DV<Jet> derives from DV<IParticle>
24
25namespace fastjet {
26 class ClusterSequence ;
27}
28
29class JetCollection : public DataVector<Jet>
30{
31 public:
32
33 // JetCollection types ---------------------
35 enum OrderedVar { ByEtDown = 0,
36 ByEtUp = 1,
38 ByPtUp = 3,
40 ByEUp = 5,
46 ByPhiUp = 11,
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
67
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:
106
107#if !defined(__REFLEX__) && !defined(__CLING__)
109#endif
110
111
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
137protected:
140 const fastjet::ClusterSequence* m_fastjetClustSeq;
141public:
143 const fastjet::ClusterSequence * fastjetClustSeq() const {return m_fastjetClustSeq;}
144 void setFastjetClustSeq(const fastjet::ClusterSequence * cs){ m_fastjetClustSeq = cs;}
145
146
147};
148
149// auto-symlink:
151
152CLASS_DEF( JetCollection , 1162448536 , 1 )
153 //CLASS_DEF(JetCollection<Jet>, 3005, 1 )
154 //CLASS_DEF(JetCollection<CombinedJetSums> , 3007, 1 )
155
156
157template <class InputIterator>
158void 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}
163
183#endif
#define SG_BASE(D, B)
Declare that class D derives from class B.
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
An STL vector of pointers that by default owns its pointed-to elements.
#define DATAVECTOR_BASE(T, BASE)
Declare base class info to DataVector.
Definition DataVector.h:649
JetCollection
Derived DataVector<T>.
Definition DataVector.h:795
DataModel_detail::iterator< DataVector > iterator
Standard iterator.
Definition DataVector.h:842
iterator insert(iterator position, value_type pElem)
Add a new element to the collection.
DataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
SG::OwnershipPolicy ownPolicy() const
size_t m_nextId
the next free identifier for jets inside this collection
std::string getMomentMapName() const
void acquireJet(Jet *j)
OrderedVar m_ordered
const fastjet::ClusterSequence * m_fastjetClustSeq
Pointer to the fastjet object this jet is build from.
bool m_ownMap
false if the map is recorded in SG
iterator insert(iterator position, Jet *j)
void setAuthor(const std::string &author)
JetCollection::OrderedVar ordered() const
std::string author() const
void setFastjetClustSeq(const fastjet::ClusterSequence *cs)
JetKeyDescriptorInstance m_keyDescInstance
This JetKeyDescriptorInstance points by default to the global JetKeyDescriptorInstance's store....
friend class JetCollectionCnv_p6
void resetJetId(std::size_t)
DataLink< JetMomentMap > m_momentMapLink
DataLink< JetKeyDescriptor > m_keyStore
link to the JetKeyDescriptor is mandatory for persistency. Access done through the JetKeyDescriptorIn...
void recordedInSG(std::string key)
void setOrdered(JetCollection::OrderedVar ordered)
const fastjet::ClusterSequence * fastjetClustSeq() const
Access to the internal fastjet object. CAN RETURN NULL, see the description of m_pseudoJet.
JetCollection(SG::OwnershipPolicy own=SG::OWN_ELEMENTS)
virtual ~JetCollection()
const JetMomentMap * getMomentMap() const
bool isOrdered(JetCollection::OrderedVar ordering=JetCollection::ByEtDown) const
size_t m_jetAuthor
the author of this jetcollection.
DataVector< Jet >::iterator iterator
void push_back(Jet *j)
JetKeyDescriptorInstance * keyDesc() const
Theses classes implement a mapping between string and index used by jets.
OwnershipPolicy
@ OWN_ELEMENTS
this data object owns its elements