1 |
pam-fi |
1.1 |
/* |
2 |
|
|
* CaloDedxVsBetaHistoAction.cpp |
3 |
|
|
* |
4 |
|
|
* Created on: 03/ago/2009 |
5 |
|
|
* Author: Nicola Mori |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
/*! @file CaloDedxVsBetaHistoAction.cpp The CaloDedxVsBetaHistoAction class implementation file. */ |
9 |
|
|
|
10 |
|
|
#include "CaloDedxVsBetaHistoAction.h" |
11 |
|
|
|
12 |
|
|
CaloDedxVsBetaHistoAction::CaloDedxVsBetaHistoAction(const char *actionName, TString outFileName, unsigned int plane, |
13 |
|
|
unsigned int view, TString mode, float minDedx, float maxDedx, unsigned int nBinsDedx, float minBeta, |
14 |
|
|
float maxBeta, unsigned int nBinsBeta) : |
15 |
|
|
CollectionAction(actionName), _outFileName(outFileName), _plane(plane), _view(view), _histo(), _mode(mode) { |
16 |
|
|
|
17 |
|
|
_histo.SetName(GetName()); |
18 |
|
|
TString title = "CALO dE/dx (plane "; |
19 |
|
|
title += _plane; |
20 |
|
|
title += ", "; |
21 |
|
|
if (_view == 0) |
22 |
|
|
title += "X"; |
23 |
|
|
if (_view == 1) |
24 |
|
|
title += "Y"; |
25 |
|
|
title += " view) Vs Beta"; |
26 |
|
|
_histo.SetTitle(title); |
27 |
|
|
_histo.GetXaxis()->SetTitle("Beta"); |
28 |
|
|
_histo.GetYaxis()->SetTitle("dE/dx (MIP)"); |
29 |
|
|
|
30 |
|
|
_histo.SetBins(nBinsBeta, minBeta, maxBeta, nBinsDedx, minDedx, maxDedx); |
31 |
|
|
} |
32 |
|
|
|
33 |
|
|
void CaloDedxVsBetaHistoAction::OnGood(PamLevel2 *event) { |
34 |
|
|
|
35 |
|
|
_histo.Fill(event->GetTrack(0)->GetToFTrack()->beta[12], event->GetCaloLevel1()->qtotpl(_view, _plane)); |
36 |
|
|
//cout << event->GetTrack(0)->GetToFTrack()->beta[12] << " "<< event->GetCaloLevel1()->qtotpl(_view, _plane) << endl; |
37 |
|
|
} |
38 |
|
|
|
39 |
|
|
void CaloDedxVsBetaHistoAction::Finalize() { |
40 |
|
|
|
41 |
|
|
TFile outFile(_outFileName, _mode); |
42 |
|
|
outFile.cd(); |
43 |
|
|
_histo.Write(); |
44 |
|
|
outFile.Close(); |
45 |
|
|
} |