10 |
#include "RigFillAction.h" |
#include "RigFillAction.h" |
11 |
|
|
12 |
RigFillAction::RigFillAction(const char *actionName, TString outFileBase, vector<float> &bins, float thresholdCoeff, |
RigFillAction::RigFillAction(const char *actionName, TString outFileBase, vector<float> &bins, float thresholdCoeff, |
13 |
float chargeSign, bool spilloverFlag, float spilloverLimit) : |
float chargeSign, bool spilloverFlag, float spilloverLimit, float mdrMin) : |
14 |
Histo2DAction<Int_t> (actionName, "", outFileBase, "RECREATE", false, true), _thresholdCoeff(thresholdCoeff), |
Histo2DAction<Float_t> (actionName, "", outFileBase, "RECREATE", false, true), _thresholdCoeff(thresholdCoeff), |
15 |
_chargeSign(chargeSign), _spilloverFlag(spilloverFlag), _spilloverLimit(spilloverLimit) { |
_chargeSign(chargeSign), _spilloverFlag(spilloverFlag), _spilloverLimit(spilloverLimit), _mdrMin(mdrMin) { |
16 |
|
|
17 |
SetXAxis("Rc [GV]", bins); |
SetXAxis("Rc [GV]", bins); |
18 |
SetYAxis("R [GV]", bins); |
SetYAxis("R [GV]", bins); |
|
|
|
19 |
} |
} |
20 |
|
|
21 |
RigFillAction::RigFillAction(const char *actionName, TString outFileBase, TString rigBinsFile, float thresholdCoeff, |
RigFillAction::RigFillAction(const char *actionName, TString outFileBase, TString rigBinsFile, float thresholdCoeff, |
22 |
float chargeSign, bool spilloverFlag, float spilloverLimit) : |
float chargeSign, bool spilloverFlag, float spilloverLimit, float mdrMin) : |
23 |
Histo2DAction<Int_t> (actionName, "", outFileBase, "RECREATE", false, true), _thresholdCoeff(thresholdCoeff), |
Histo2DAction<Float_t> (actionName, "", outFileBase, "RECREATE", false, true), _thresholdCoeff(thresholdCoeff), |
24 |
_chargeSign(chargeSign), _spilloverFlag(spilloverFlag), _spilloverLimit(spilloverLimit) { |
_chargeSign(chargeSign), _spilloverFlag(spilloverFlag), _spilloverLimit(spilloverLimit), _mdrMin(mdrMin) { |
25 |
|
|
26 |
SetXAxis("Rc [GV]", rigBinsFile); |
SetXAxis("Rc [GV]", rigBinsFile); |
27 |
SetYAxis("R [GV]", rigBinsFile); |
SetYAxis("R [GV]", rigBinsFile); |
|
|
|
28 |
} |
} |
29 |
|
|
30 |
void RigFillAction::OnGood(PamLevel2 *event) { |
void RigFillAction::OnGood(PamLevel2 *event) { |
32 |
float rigThreshold = _thresholdCoeff * event->GetOrbitalInfo()->GetCutoffSVL(); |
float rigThreshold = _thresholdCoeff * event->GetOrbitalInfo()->GetCutoffSVL(); |
33 |
float rig = 1. / event->GetTrack(0)->GetTrkTrack()->GetDeflection(); |
float rig = 1. / event->GetTrack(0)->GetTrkTrack()->GetDeflection(); |
34 |
|
|
35 |
|
// Compute deflection correction due to MDR cut |
36 |
|
if (_mdrMin > 0.) { |
37 |
|
Double_t F = 0.; |
38 |
|
if (_mdrMin > 300.) { |
39 |
|
F = 2.215e-4 * (log(_mdrMin) - log(300.)); |
40 |
|
} |
41 |
|
rig = 1. / (1. / rig + F); |
42 |
|
} |
43 |
|
|
44 |
if (rig / _chargeSign > 0) { // Check if the particle has the right sign |
if (rig / _chargeSign > 0) { // Check if the particle has the right sign |
45 |
Fill(rigThreshold, rig); |
Fill(rigThreshold, rig); |
46 |
} |
} |
53 |
void RigFillAction::Finalize() { |
void RigFillAction::Finalize() { |
54 |
|
|
55 |
// Save the histogram |
// Save the histogram |
56 |
Histo2DAction<Int_t>::Finalize(); |
Histo2DAction<Float_t>::Finalize(); |
57 |
|
|
58 |
// Save the zero bins |
// Save the zero bins |
59 |
if (_outFileBase != "") { |
if (_outFileBase != "") { |