10 |
#include "TofDedxVsBetaHistoAction.h" |
#include "TofDedxVsBetaHistoAction.h" |
11 |
|
|
12 |
TofDedxVsBetaHistoAction::TofDedxVsBetaHistoAction(const char *actionName, TString outFileName, unsigned int layers, |
TofDedxVsBetaHistoAction::TofDedxVsBetaHistoAction(const char *actionName, TString outFileName, unsigned int layers, |
13 |
TString mode, float minDedx, float maxDedx, unsigned int nBinsDedx, float minBeta, float maxBeta, |
TString mode, bool standAlone, float minDedx, float maxDedx, unsigned int nBinsDedx, float minBeta, float maxBeta, |
14 |
unsigned int nBinsBeta) : |
unsigned int nBinsBeta) : |
15 |
CollectionAction(actionName), _outFileName(outFileName), _layers(layers), _nLayers(0), _badEvents(0), _histo(), _mode(mode) { |
CollectionAction(actionName), _outFileName(outFileName), _layers(layers), _nLayers(0), _badEvents(0), _histo(), |
16 |
|
_mode(mode), _standAlone(standAlone) { |
17 |
|
|
18 |
_histo.SetName(GetName()); |
_histo.SetName(GetName()); |
19 |
TString title = "TOF dE/dx ("; |
TString title = "TOF dE/dx ("; |
64 |
float dEdx = 0.; |
float dEdx = 0.; |
65 |
float dEdxLayer = 0.; |
float dEdxLayer = 0.; |
66 |
unsigned int badLayers = 0; |
unsigned int badLayers = 0; |
67 |
int trkSeqNo = event->GetTrack(0)->GetToFTrack()->trkseqno; |
|
68 |
|
int trkSeqNo; |
69 |
|
if (_standAlone) |
70 |
|
trkSeqNo = 0; |
71 |
|
else |
72 |
|
trkSeqNo = event->GetTrack(0)->GetToFTrack()->trkseqno; |
73 |
|
|
74 |
if ((_layers & S11) == S11) { |
if ((_layers & S11) == S11) { |
75 |
dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 0, 100); |
dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 0, 100); |
114 |
badLayers++; |
badLayers++; |
115 |
} |
} |
116 |
if (badLayers == 0) { |
if (badLayers == 0) { |
117 |
dEdx /= _nLayers-badLayers; |
dEdx /= _nLayers - badLayers; |
118 |
_histo.Fill(event->GetTrack(0)->GetToFTrack()->beta[12], dEdx); |
_histo.Fill(event->GetTrack(0)->GetToFTrack()->beta[12], dEdx); |
119 |
} |
} |
120 |
else |
else |