This is the important function of the tool.
38 {
39
40
43
44 std::vector< std::string > momentKeys ;
45
46 if( it != itE ) {
47 momentKeys= (*it)->getMomentKeys();
48
50 (*it)->begin() != (*it)->end() )
51 {
52
53
54
55
56
57
58
59 SG::DataProxy*
proxy =
evtStore()->proxy( (*it)->getContainer( (*it)->begin() ) );
60 if(proxy) {
62 if( !xaodConstitCont )
ATH_MSG_DEBUG(
"Could not retrieve xaod constiuents with key "<<
proxy->name() );
63 }
64 }
65 }
66
67
69 const Jet * jet = *
it;
72
75
77
78
79
80
81 if(xaodConstitCont) {
82 for( ; cit!= citE; ++cit){
83 if (constitSearch) {
84 double min_dr2 = 0.1 * 0.1;
85 int iconstit = -1;
87 for (const xAOD::IParticle* p : *xaodConstitCont) {
88 double deta =
p->eta() - (*cit)->eta();
89 double dphi = TVector2::Phi_mpi_pi (
p->phi() - (*cit)->phi());
90 double dr2 = deta*deta + dphi*dphi;
91 if (dr2 < min_dr2) {
92 min_dr2 = dr2;
94 }
96 }
97 if (iconstit >= 0)
99 (ElementLink<xAOD::IParticleContainer> (xaodConstitCont.key(), iconstit));
100 }
101 else {
105 (ElementLink<xAOD::IParticleContainer> (xaodConstitCont.key(), index));
106 }
107 }
108 }
109
110 for(
size_t i=0;
i<momentKeys.size();
i++){
112 }
114
121
124
125
126
127
128
129
130
131
132
133
134
135
136 }
137
138 return StatusCode::SUCCESS;
139 }
ServiceHandle< StoreGateSvc > & evtStore()
bool isDefault() const
Test to see if we're in the default state.
void toIdentifiedObject(const ID_type &dataID, IProxyDict *sg=0)
Set the link to an object given by a string key.
DataModel_detail::const_iterator< DataVector > const_iterator
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
signalstate_t constituentSignalState() const
Get the current Signal state of the jet constituents.
bool getIndex(const constituent_t *pConst, index_t &ind) const
Retrieve index of object in container.
shape_t getMoment(const mkey_t &shapeName, bool addIfMissing=false) const
Alias for getShape.
navigable_t::object_iter const_iterator
const_iterator begin() const
Begin iterator for constituent store.
const_iterator end() const
End iterator for constituent store.
virtual double eta() const
pseudo rapidity
virtual double phi() const
phi in [-pi,pi[
virtual double m() const
mass
virtual double pt() const
transverse momentum
void setAttribute(const std::string &name, const T &v)
void addConstituent(const ElementLink< IParticleContainer > &link, float weight=1.0)
Add a constituent directly in the ElementLink format.
size_t numConstituents() const
Number of constituents in this jets (this is valid even when reading a file where the constituents ha...
void setJetP4(const JetFourMom_t &p4)
void setConstituentsSignalState(JetConstitScale t)
Set the state at which constituents were when this jet was found. This function is called by jet buil...
virtual double pt() const
The transverse momentum ( ) of the particle.
Jet_v1 Jet
Definition of the current "jet version".
@ JetConstitScaleMomentum
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.