1
/* This file is part of MAUS: http:// micewww.pp.rl.ac.uk:8080/projects/maus
3
* MAUS is free software: you can redistribute it and/or modify
4
* it under the terms of the GNU General Public License as published by
5
* the Free Software Foundation, either version 3 of the License, or
6
* (at your option) any later version.
8
* MAUS is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with MAUS. If not, see <http:// www.gnu.org/licenses/>.
19
#include "Recon/Global/ComPIDVarD.hh"
20
#include "Utils/Exception.hh"
26
const std::string ComPIDVarD::VARIABLE = "CommissioningEMRrange";
28
ComPIDVarD::ComPIDVarD(std::string hypothesis, std::string unique_identifier)
29
: PIDBase1D(VARIABLE, hypothesis, unique_identifier, minBinComD, maxBinComD,
31
_nonZeroHistEntries = true;
34
ComPIDVarD::ComPIDVarD(TFile* file, std::string hypothesis, int minComD,
36
: PIDBase1D(file, VARIABLE, hypothesis, minComD, maxComD, minBinComD,
40
ComPIDVarD::~ComPIDVarD() {}
42
std::pair<double, double> ComPIDVarD::Calc_Var(MAUS::DataStructure::Global::Track* track) {
43
EMR_range = track->get_emr_range_primary();
44
if (EMR_range == 0.0) {
45
Squeak::mout(Squeak::debug) << "Global track records no range " <<
46
" of particle in EMR, Recon::Global::ComPIDVarD::Calc_Var()" << std::endl;
47
return std::make_pair(-1, 0);
48
} else if ( minBinComD > EMR_range || EMR_range > maxBinComD ) {
49
Squeak::mout(Squeak::debug) << "Range of particle in EMR " <<
50
"outside of PDF range, Recon::Global::ComPIDVarD::Calc_Var()" <<
52
return std::make_pair(-1, 0);
54
return std::make_pair(EMR_range, 0);