39#include <TArtemisUtil.h>
60 RegisterInputCollection(
"InputCollection",
"input branch name",
fInputColName, TString(
"data"));
61 RegisterInputCollection(
"InputReacCollection",
"input reaction branch name",
fInputReacColName, TString(
"reaction"));
63 DoubleVec_t init_d_vec;
64 RegisterProcessorParameter(
"Nbin_angle",
"Nbin of the angle histogram",
fNbin_angle, 0);
65 RegisterProcessorParameter(
"range_angle",
"range of the angle histogram",
fRange_angle, init_d_vec);
66 RegisterProcessorParameter(
"Nbin_energy",
"Nbin of the energy histogram",
fNbin_energy, 0);
67 RegisterProcessorParameter(
"range_energy",
"range of the energy histogram",
fRange_energy, init_d_vec);
69 RegisterProcessorParameter(
"HistFile",
"name of output histogram rootfile",
fFileName, TString(
""));
92 Info(
"Init",
"make solid angle histogram Ecm and Thetacm");
94 SetStateError(
"input steering yaml format is wrong, range size should be 2");
99 Info(
"Init",
"\t2D(%d, %.1lf, %.1lf, %d, %.1lf, %.1lf)",
102 Info(
"Init",
"saved %s",
fFileName.Data());
106 SetStateError(Form(
"input not found: %s",
fInputColName.Data()));
109 const TClass *
const cl = (*fInData)->GetClass();
110 if (!cl->InheritsFrom(art::crib::TTelescopeData::Class())) {
111 SetStateError(
"contents of input array must inherit from art::crib::TTelescopeData");
119 const TClass *
const cl_reac = (*fInReacData)->GetClass();
120 if (!cl_reac->InheritsFrom(art::crib::TReactionInfo::Class())) {
121 SetStateError(
"contents of input array must inherit from art::crib::TReactionInfo");
140 if ((*fInReacData)->GetEntriesFast() != 1) {
141 SetStateError(
"input reaction data branch entry is not 1");
145 if ((*fInData)->GetEntriesFast() != 1) {
146 SetStateError(
"input telescope data branch entry is not 1");
172 TFile *file = TFile::Open(
fFileName,
"recreate");
173 if (!file || file->IsZombie()) {
174 std::cerr <<
"ERROR : cannot open " <<
fFileName << std::endl;
180 h1_a->Scale(4.0 * TMath::Pi());
181 h1_a->SetTitle(
"Solid Angle;Angle CM (deg);");
185 h1_e->Scale(4.0 * TMath::Pi());
186 h1_e->SetTitle(
"Solid Angle;Energy CM (MeV);");
190 h2->Scale(4.0 * TMath::Pi());
191 h2->SetTitle(
"Solid Angle;Energy CM (MeV);Angle CM (deg)");
ClassImp(TSolidAngleProcessor)
Double_t GetEnergy() const
Double_t GetTheta() const
TH2D * h2_all
for normalie (x: Ecm, y: angle_cm)
void EndOfRun() override
EndOfRun process (override)
DoubleVec_t fRange_energy
Histogram range (min, max)
TSolidAngleProcessor()
default constructor
TH1D * h1_e_all
for normalize (x: Ecm)
TString fInputReacColName
Input reaction object name.
TString fInputColName
Input detected particle object name.
DoubleVec_t fRange_angle
Histogram range (min, max)
~TSolidAngleProcessor() override
default destructor
TH2D * h2
solid angle (x: Ecm, y: angle_cm)
TClonesArray ** fInData
Input detected particle object.
TH1D * h1_a_all
for normalize (x: angle_cm)
void Init(TEventCollection *col) override
Init (override)
TH1D * h1_e
solid angle (x: Ecm)
TString fFileName
Output histogram ROOT file name.
TH1D * h1_a
solid angle (x: angle_cm)
Int_t fNbin_angle
Histogram bin number.
TClonesArray ** fInReacData
Input reaction object.
void Process() override
Process (override)
Int_t fNbin_energy
Histogram bin number.