Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
JetStructs.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file JetStructs.h
1
#ifndef JETBASE_JETSTRUCTS_H
2
#define JETBASE_JETSTRUCTS_H
3
4
// A few convenience structures for either iterating over data, or referencing between classes
5
6
#include "
Jet.h
"
7
#include <TClonesArray.h>
8
9
class
Jetv2
;
10
11
12
struct
JetV2SortingCriteria
{
13
Jet::SORT
criteria
{
Jet::SORT::PT
};
14
Jet::PROPERTY
property
{ Jet::PROPERTY::no_property };
// when sorted by property
15
Jet::SORT_ORDER
order
{ Jet::SORT_ORDER::DESCENDING };
//
16
unsigned
int
prop_index
{ 0 };
// for use when sorting by criteria
17
};
18
19
// ---------------------------------------------------------------------------------------
20
// Convenience class for iterating over jets in TClonesArray in a JetContainer
21
// ---------------------------------------------------------------------------------------
22
struct
IterJetv2TCA
{
23
TClonesArray*
tca
{
nullptr
};
24
Jetv2
*&
current_jet
;
25
int
index
{ 0 };
26
int
size
;
27
28
// build Iterator -- capture reference to current_jet pointer from JetContainer
29
IterJetv2TCA
(TClonesArray* _tca,
Jetv2
*& _in_jet)
30
:
tca
{_tca},
current_jet
{_in_jet},
size
{
tca
->GetEntriesFast() }
31
{
32
current_jet
= (
Jetv2
*)
tca
->UncheckedAt(0);
33
}
34
35
void
operator++() {
36
current_jet
= (
Jetv2
*)
tca
->UncheckedAt(++
index
);
37
};
38
39
Jetv2
*
operator*
() {
return
current_jet
; };
40
41
bool
operator!=
(
const
IterJetv2TCA
&
rhs
) {
42
if
(
index
== rhs.
size
) {
43
current_jet
= (
Jetv2
*)
tca
->UncheckedAt(0);
44
return
false
;
45
}
else
{
46
return
true
;
47
}
48
};
49
};
50
51
#endif
coresoftware
blob
master
offline
packages
jetbase
JetStructs.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:06
using
1.8.2 with
sPHENIX GitHub integration