41 #include "TRestResponse.h"
104 RESTError <<
"TRestResponse::LoadResponse. The response filename was not defined" <<
RESTendl;
109 if (fullFilename.empty()) {
110 RESTError <<
"TRestResponse::LoadResponse. The response filename was not found!" <<
RESTendl;
112 RESTError <<
"You may want to define <seachPath inside <globals> definition" <<
RESTendl;
117 if (!extension.empty() && extension[0] ==
'N' && extension.back() ==
'f') {
129 RESTError <<
"Extension format - " << extension <<
" - not recognized!" <<
RESTendl;
141 std::vector<std::pair<Double_t, Double_t>> response;
144 RESTError <<
"TRestResponse::GetResponse. Response matrix has not been loaded yet!" <<
RESTendl;
148 if (input < GetInputRange().X() || input > GetInputRange().Y()) {
149 RESTError <<
"TRestResponse::GetResponse. The input value " << input <<
" is outside range!"
161 std::pair<Double_t, Double_t> outp{output, value};
163 response.push_back(outp);
170 Int_t binRight = binLeft + 1;
174 if (input <= GetInputRange().X() +
fBinSize / 2. || input >= GetInputRange().Y() -
fBinSize / 2.)
192 std::pair<Double_t, Double_t> outp{output, value};
194 response.push_back(outp);
224 RESTMetadata <<
"Response matrix has been loaded" <<
RESTendl;
227 RESTMetadata <<
" - Input range : " << GetInputRange().X() <<
" - " << GetInputRange().Y()
229 RESTMetadata <<
" - Output range : " << GetOutputRange().X() <<
" - " << GetOutputRange().Y()
234 RESTMetadata <<
"Original matrix was transposed" <<
RESTendl;
237 RESTMetadata <<
"Response matrix has NOT been loaded" <<
RESTendl;
238 RESTMetadata <<
"Try calling TRestResponse::LoadResponse()" <<
RESTendl;
242 RESTMetadata <<
"Interpolation is enabled" <<
RESTendl;
245 RESTMetadata <<
"Interpolation is disabled" <<
RESTendl;
A response matrix that might be applied to a given component inside a TRestComponent.
Double_t fBinSize
The resolution of the response matrix (binning)
std::vector< std::vector< Float_t > > fResponseMatrix
The response matrix.
Bool_t fTransposed
Determines if the response matrix has been transposed.
void Initialize() override
It will initialize the data frame with the filelist and column names (or observables) that have been ...
void LoadResponse(Bool_t transpose=true)
It loads into the fResponseMatrix data member the response from a file.
~TRestResponse()
Default destructor.
Bool_t fInterpolation
It allows to decide if the returned response should be interpolated (default:false)
std::string fVariable
It defines the variable name for which the response should be applied to.
std::vector< std::pair< Double_t, Double_t > > GetResponse(Double_t input)
This method will return a vector of std::pair, each pair will contain the output energy together with...
TVector2 fOrigin
First element of the response matrix (input/incident, output/detected)
TRestResponse()
Default constructor.
void PrintMetadata() override
Prints on screen the information about the metadata members of TRestAxionSolarFlux.
std::string fFilename
The filename used to import the response matrix.
void PrintResponseMatrix(Int_t fromRow, Int_t toRow)
Prints on screen the information about the metadata members of TRestAxionSolarFlux.
@ REST_Info
+show most of the information for each steps