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
PHAna.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHAna.h
1
#ifndef __PHANA_H__
2
#define __PHANA_H__
3
4
#include <
fun4all/SubsysReco.h
>
5
#include <string>
6
7
//Forward declerations
8
class
PHCompositeNode
;
9
class
PHG4HitContainer
;
10
class
PHG4TruthInfoContainer
;
11
class
TFile;
12
class
TNtuple;
13
14
15
//Brief: basic ntuple and histogram creation for sim evaluation
16
class
PHAna
:
public
SubsysReco
17
{
18
public
:
19
//Default constructor
20
PHAna
(
const
std::string
&
name
=
"PHAna"
);
21
22
//Initialization, called for initialization
23
int
Init
(
PHCompositeNode
*);
24
25
//Process Event, called for each event
26
int
process_event
(
PHCompositeNode
*);
27
28
//End, write and close files
29
int
End
(
PHCompositeNode
*);
30
31
//Change output filename
32
void
set_filename
(
const
char
*
file
)
33
{
if
(file)
_outfile
=
file
; }
34
35
float
Square
(
float
x
){
return
x*
x
; }
36
37
//Flags of different kinds of outputs
38
enum
Flag
39
{
40
//all disabled
41
NONE
= 0,
42
43
//truth
44
TRUTH
= (1<<0),
45
46
//histograms
47
HIST
= (1<<1),
48
49
//Sampling fractions
50
SF
= (1<<2),
51
52
//Inner HCal Towers
53
HCALIN_TOWER
= (1<<3),
54
55
//All flags ON
56
ALL
= (1<<4)-1
57
};
58
59
//Set the flag
60
//Flags should be set like set_flag(PHAna::TRUTH, true) from macro
61
void
set_flag
(
const
Flag
& flag,
const
bool
&
value
)
62
{
63
if
(value)
_flags
|= flag;
64
else
_flags
&= (~flag);
65
}
66
67
//User modules
68
void
fill_truth_ntuple
(
PHCompositeNode
*);
69
void
fill_sf_ntuple
(
PHCompositeNode
*);
70
void
create_histos
();
71
void
fill_histos
(
PHCompositeNode
*);
72
73
private
:
74
//output filename
75
std::string
_outfile
;
76
77
//Event counter
78
int
_event
;
79
80
//Get all the nodes
81
void
GetNodes
(
PHCompositeNode
*);
82
83
//flags
84
unsigned
int
_flags
;
85
86
//TNtuples
87
TNtuple*
_truth
;
88
TNtuple*
_sf
;
89
TNtuple*
_hcalin_towers
;
90
91
//Node pointers
92
PHG4TruthInfoContainer
*
_truth_container
;
93
PHG4HitContainer
*
_hcalout_hit_container
;
94
PHG4HitContainer
*
_hcalin_hit_container
;
95
PHG4HitContainer
*
_cemc_hit_container
;
96
PHG4HitContainer
*
_hcalout_abs_hit_container
;
97
PHG4HitContainer
*
_hcalin_abs_hit_container
;
98
PHG4HitContainer
*
_cemc_abs_hit_container
;
99
PHG4HitContainer
*
_cemc_electronics_hit_container
;
100
PHG4HitContainer
*
_hcalin_spt_hit_container
;
101
102
103
};
104
105
#endif //* __PHANA_H__ *//
analysis
blob
master
Ana
PHAna.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:46
using
1.8.2 with
sPHENIX GitHub integration