1 |
/* |
2 |
* TrkSigmaDeflHistoAction.cpp |
3 |
* |
4 |
* Created on: 2009-06-17 |
5 |
* Author: S. Ricciarini |
6 |
*/ |
7 |
|
8 |
/*! @file TrkSigmaDeflHistoAction.cpp The TrkSigmaDeflHistoAction class implementation file. */ |
9 |
|
10 |
#include "TrkSigmaDeflHistoAction.h" |
11 |
|
12 |
TrkSigmaDeflHistoAction::TrkSigmaDeflHistoAction(const char *actionName, std::vector<float> binning) : |
13 |
CollectionAction(actionName), _binning(binning), _histogram(binning.size() - 1, 0) { |
14 |
} |
15 |
|
16 |
void TrkSigmaDeflHistoAction::OnGood(PamLevel2 *event){ |
17 |
|
18 |
float sigmaDefl = pow(event->GetTrack(0)->GetTrkTrack()->coval[4][4],0.5); |
19 |
|
20 |
// Bin filling: sigmaDefl must be less than (<) 1/(bin maximum) |
21 |
|
22 |
UInt_t i = 0; |
23 |
while ((sigmaDefl < 1./_binning[i+1]) && (i<=_binning.size()-1)) { // rigidity bin i maximum = _binning[i+1]. Exit while loop when i exceeds the bin number = _binning.size()-1 |
24 |
_histogram[i]++; |
25 |
i++; |
26 |
} |
27 |
|
28 |
} |