BmnRoot
Loading...
Searching...
No Matches
BmnTriggerEfficiencyRun7.h
Go to the documentation of this file.
1#include <TGraph.h>
2
3#include <BmnLambdaAnalRun7.h>
5#include <BmnTwoParticleDecay.h>
6
7using namespace std;
8
9#ifndef BMNTRIGEFFRUN7_H
10#define BMNTRIGEFFRUN7_H 1
11
13public:
14
16
18 : BmnLambdaAnalRun7(dir),
19 fEoSNode("root://ncm.jinr.ru/"),
20 isAddTriggerCondition(kFALSE),
21 fSpectraFile(""),
22 nFdCounts(1000),
23 nBdCounts(1000),
24 nMultBins(18)
25 {
26 // Preparing default multiplicity ranges (nTracks in prim. vertex) ...
27 const Int_t minMult = 2;
28 const Int_t maxMult = 20;
29 Int_t multStep = (maxMult - minMult) / nMultBins;
30
31 for (Int_t iBin = 0; iBin < nMultBins; iBin++) {
32 Int_t step = iBin * multStep + minMult;
33
34 fMultMap[iBin] = make_pair(step, step + multStep);
35 }
36 }
37
39 ;
40 }
41
42 // Setters ...
43
44 void SetTrigger(TString trigg) {
45 fTrigger = trigg;
46 }
47
48 void SetMultiplicityMap(vector <pair <Int_t, Int_t>> bins) {
49 fMultMap.clear();
50
51 nMultBins = bins.size();
52
53 for (size_t iBin = 0; iBin < bins.size(); iBin++)
54 fMultMap[iBin] = bins.at(iBin);
55 }
56
57 void SetSpectraFile(TString f) {
58 fSpectraFile = f;
59 }
60
61 void SetEffFiles(TString f) {
62 fEffFiles.push_back(f);
63 }
64
65 // Getters ...
66
67
68 // Anals ...
69 void triggerEfficiency();
70
71private:
72 TString fEoSNode;
73
74 TString fTrigger;
75 Bool_t isAddTriggerCondition;
76
77 TString fSpectraFile;
78 vector <TString> fEffFiles; // to be set if needed !!!
79
80 enum TriggConditions {
81 base = 0, severe
82 };
83
84 Int_t nFdCounts;
85 Int_t nBdCounts;
86 Int_t nMultBins;
87
88 map <Int_t, pair <Int_t, Int_t>> fMultMap;
89
90 // Spectrum histos ...
91 TH1F*** hSpectra; // [triggCond][multCondition]
92
93 // Multiplicity histos ...
94 TH1F** hMult; // [triggCond]
95
96 // Redefinition aimed at getting trigger condition when doing file list ...
97 vector <TString> createFilelist(vector <TString>);
98
99 // Redefinition aimed at getting trigger condition in anal ...
100 void ReadFile(TString, BmnParticlePairCut* cut0);
101
102 Int_t FinMultBin(Int_t multValue) {
103 for (auto it : fMultMap) {
104 Int_t bin = it.first;
105 Int_t min = it.second.first;
106 Int_t max = it.second.second;
107
108 if (multValue >= min && multValue < max)
109 return bin;
110 }
111 // If multBin not found ...
112 return -1;
113 }
114
115private:
116
117 void DoNormalization(TH1F* h) {
118 if (h->GetEntries() == 0)
119 return;
120
121 // Collecting all bin contents ...
122 Double_t contentAll = 0.;
123
124 for (Int_t iBin = 1; iBin < h->GetNbinsX() + 1; iBin++)
125 contentAll += h->GetBinContent(iBin);
126
127 // Normalizing histo ...
128 for (Int_t iBin = 1; iBin < h->GetNbinsX() + 1; iBin++) {
129 h->SetBinContent(iBin, h->GetBinContent(iBin) / contentAll);
130 h->SetBinError(iBin, 0.);
131 }
132
133 h->GetYaxis()->SetRangeUser(0., 1.1 * h->GetMaximum());
134 }
135
136 ClassDef(BmnTriggerEfficiencyRun7, 0)
137};
138
139#endif
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition P4_F32vec4.h:30
float f
Definition P4_F32vec4.h:21
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition P4_F32vec4.h:31
vector< TString > createFilelist()
void SetMultiplicityMap(vector< pair< Int_t, Int_t > > bins)
STL namespace.