11 |
|
|
12 |
TofDedxVsBetaHistoAction::TofDedxVsBetaHistoAction(const char *actionName, unsigned int layers, bool standAlone, |
TofDedxVsBetaHistoAction::TofDedxVsBetaHistoAction(const char *actionName, unsigned int layers, bool standAlone, |
13 |
TString outFileBase, TString mode, bool outRoot, bool outText, TString title) : |
TString outFileBase, TString mode, bool outRoot, bool outText, TString title) : |
14 |
Histo2DAction<Int_t>(actionName, title, outFileBase, mode, outRoot, outText), _layers(layers), _nLayers(0), _badEvents( |
Histo2DAction<Int_t> (actionName, title, outFileBase, mode, outRoot, outText), _layers(layers), _nLayers(0), |
15 |
0), _standAlone(standAlone) { |
_badEvents(0), _standAlone(standAlone) { |
16 |
|
|
17 |
bool buildTitle = false; |
bool buildTitle = false; |
18 |
if (title == "") { |
if (title == "") { |
78 |
static unsigned int badLayers; |
static unsigned int badLayers; |
79 |
|
|
80 |
static int trkSeqNo; |
static int trkSeqNo; |
|
static int idx; |
|
81 |
if (_standAlone) |
if (_standAlone) |
82 |
trkSeqNo = -1; |
trkSeqNo = 0; |
83 |
else |
else |
84 |
trkSeqNo = event->GetTrack(0)->GetTrkTrack()->GetSeqNo(); |
for (int i = 0; i < event->GetToFLevel2()->ntrk(); i++) { |
85 |
|
if (event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == event->GetTrack(0)->GetTrkTrack()->GetSeqNo()) |
86 |
for (int i = 0; i < event->GetToFLevel2()->ntrk(); i++) { |
trkSeqNo = i; |
87 |
if (event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == trkSeqNo) |
} |
|
idx = i; |
|
|
} |
|
88 |
|
|
89 |
dEdx = 0.; |
dEdx = 0.; |
90 |
badLayers = 0; |
badLayers = 0; |
91 |
if ((_layers & S11) == S11) { |
if ((_layers & S11) == S11) { |
92 |
dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 0, 100); |
dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 0, 100); |
93 |
if (dEdxLayer > 0. && dEdxLayer < 4090) |
if (dEdxLayer > 0. && dEdxLayer < 4090) |
94 |
dEdx += dEdxLayer; |
dEdx += dEdxLayer; |
95 |
else |
else |
96 |
badLayers++; |
badLayers++; |
97 |
} |
} |
98 |
if ((_layers & S12) == S12) { |
if ((_layers & S12) == S12) { |
99 |
dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 1, 100); |
dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 1, 100); |
100 |
if (dEdxLayer > 0. && dEdxLayer < 4090) |
if (dEdxLayer > 0. && dEdxLayer < 4090) |
101 |
dEdx += dEdxLayer; |
dEdx += dEdxLayer; |
102 |
else |
else |
103 |
badLayers++; |
badLayers++; |
104 |
} |
} |
105 |
if ((_layers & S21) == S21) { |
if ((_layers & S21) == S21) { |
106 |
dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 2, 100); |
dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 2, 100); |
107 |
if (dEdxLayer > 0. && dEdxLayer < 4090) |
if (dEdxLayer > 0. && dEdxLayer < 4090) |
108 |
dEdx += dEdxLayer; |
dEdx += dEdxLayer; |
109 |
else |
else |
110 |
badLayers++; |
badLayers++; |
111 |
} |
} |
112 |
if ((_layers & S22) == S22) { |
if ((_layers & S22) == S22) { |
113 |
dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 3, 100); |
dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 3, 100); |
114 |
if (dEdxLayer > 0. && dEdxLayer < 4090) |
if (dEdxLayer > 0. && dEdxLayer < 4090) |
115 |
dEdx += dEdxLayer; |
dEdx += dEdxLayer; |
116 |
else |
else |
117 |
badLayers++; |
badLayers++; |
118 |
} |
} |
119 |
if ((_layers & S31) == S31) { |
if ((_layers & S31) == S31) { |
120 |
dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 4, 100); |
dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 4, 100); |
121 |
if (dEdxLayer > 0. && dEdxLayer < 4090) |
if (dEdxLayer > 0. && dEdxLayer < 4090) |
122 |
dEdx += dEdxLayer; |
dEdx += dEdxLayer; |
123 |
else |
else |
124 |
badLayers++; |
badLayers++; |
125 |
} |
} |
126 |
if ((_layers & S32) == S32) { |
if ((_layers & S32) == S32) { |
127 |
dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 5, 100); |
dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 5, 100); |
128 |
if (dEdxLayer > 0. && dEdxLayer < 4090) |
if (dEdxLayer > 0. && dEdxLayer < 4090) |
129 |
dEdx += dEdxLayer; |
dEdx += dEdxLayer; |
130 |
else |
else |
131 |
badLayers++; |
badLayers++; |
132 |
} |
} |
133 |
if (badLayers == 0) { |
if (badLayers == 0) { |
134 |
dEdx /= _nLayers - badLayers; |
dEdx /= _nLayers; |
135 |
Fill(event->GetToFLevel2()->GetToFTrkVar(idx)->beta[12], dEdx); |
Fill(event->GetToFLevel2()->GetToFTrkVar(trkSeqNo)->beta[12], dEdx); |
136 |
} |
} |
137 |
else |
else |
138 |
_badEvents++; |
_badEvents++; |