-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAliGMFMixingManager.h
140 lines (115 loc) · 5.55 KB
/
AliGMFMixingManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#ifndef VERBOSE
#define VERBOSE 0
#endif
#ifndef AliGMFMixingManager_H
#define AliGMFMixingManager_H
#include <vector>
#include <TObject.h>
#include "AliGMFEventContainer.h"
class TTree;
class TH1;
class AliGMFTTreeHeader;
class AliGMFTTreeTrack;
class TClonesArray;
class TFile;
class TArrayI;
class TObjArray;
class AliGMFEventReader;
class AliGMFEventContainer;
class AliGMFHistogramManager;
class AliGMFMixingManager : public TObject {
public:
AliGMFMixingManager();
virtual ~AliGMFMixingManager();
// core functions
Bool_t Initialize();
Int_t DoPerChunkMixing();
// setters - ranges
void SetMultiplicityRange(Int_t min, Int_t max) {
fMultiplicityMin = min;
fMultiplicityMax = max;
}
void SetVertexRange(Float_t min, Float_t max) {
fVertexMin = min;
fVertexMax = max;
}
void SetEventPlaneRange(Float_t min, Float_t max) {
fEventPlaneMin = min;
fEventPlaneMax = max;
}
void SetEventPlane3Range(Float_t min, Float_t max) {
fEventPlane3Min = min;
fEventPlane3Max = max;
}
void SetCentralityRange(Float_t min, Float_t max) {
fCentralityMin = min;
fCentralityMax = max;
}
// setters - behavior
void SetSplittingForTracksWithPtHigherThan(Float_t pt) {
fSplittingThreshold = pt;
}
void SetRandomMultiplicity(Bool_t r) {
fRandomMultiplicity = r;
}
void SetSplitTrackPt(Float_t pt) {
fSplitTrackPt = pt;
}
void SetMultInvariantSplitting(Bool_t b) {fMultInvariantSplitting = b;}
// setters - IO
void SetMaxEvents(Int_t e) {fMaxEvents = e;}
void SetMaxEventsPerFile(Int_t e) {fMaxEventsPerFile = e;}
void SetAllowBufferPadding(Int_t o) {fBufferPadding = o;}
void SetEventReader(AliGMFEventReader* r) {fEventReader = r;}
void SetAutoOverflow(Bool_t r) {fAutoOverflow = r;}
void DoQA();
private:
Bool_t IsSelected(AliGMFEventContainer* event);
void InitializeMixingCache();
Bool_t FillMixingCache(Int_t iCache = 0);
void StageCachedEvent(Int_t i);
void FillHeaderWithCachedEventInfo();
AliGMFTTreeTrack* GetNextTrackFromEventI(Int_t i);
// AliGMFTTreeTrack* GetRandomTrackFromEventI(Int_t i) {return static_cast<AliGMFTTreeTrack*>(0x0);} // to be implemented
void CreateNewEventChunk();
void WriteCurrentTreeToFile(Bool_t createNewOutputStructures);
void PushToTTree();
void FlushCurrentTTree();
void Finish();
Int_t fMultiplicityMin; // minimum multiplicity
Int_t fMultiplicityMax; // maximum multiplicity
Float_t fVertexMin; // minimum vertexz
Float_t fVertexMax; // maximum vertexz
Float_t fEventPlaneMin; // minimum event plane angle
Float_t fEventPlaneMax; // maximum event plane angle
Float_t fEventPlane3Min; // minimum event plane 3 angle
Float_t fEventPlane3Max; // maximum event plane 3 angle
Float_t fCentralityMin; // minimum event centrality
Float_t fCentralityMax; // maximum event centrality
Int_t fMaxEvents; // maximum number of mixed events that will be generated
Int_t fBufferPadding; // percentage of padding that is attached to the event buffer (for high multiplicity classes)
Int_t fMaxEventsPerFile; // maximum number of mixed events written per file
Float_t fSplittingThreshold;// tracks with pt > this will be split collinearly
Float_t fSplitTrackPt; // pt of tracks that are split off
Bool_t fMultInvariantSplitting; // set to false if a split track should change the multiplicity
// data structures for mixed event output
TTree* fTree; //! output data
AliGMFTTreeHeader* fEvent; //! event header
AliGMFEventContainer* fBufferedEvent; //! buffered real event
TClonesArray* fTrackArray; //! track container
TFile* fOutputFile; //! output file
// misc
AliGMFEventReader* fEventReader; // event reader
Bool_t fAutoOverflow; // automatic overflow of read buffer when cache cannot be filled
Int_t fOverflowPosition; // cache position at which overflow started
Int_t fEventBufferPosition; //! global buffer position
Int_t fTrackBufferPosition; //! 'walks' trough the track cache
AliGMFHistogramManager* fQAManager; // run QA
TObjArray* fEventCache; // event cache
Int_t fTotalEventBuffer; //! total number of events
TH1* fOnTheFlyMultDist; //! on the fly multiplicity distribution
std::vector<int> fMultiplicityDist; // multiplicity distribution of current buffer
Bool_t fRandomMultiplicity; // choose mult randomly from input dist
ClassDef(AliGMFMixingManager, 1);
};
#endif