28 #ifndef Gw_CubicFilter
49 fGateList(new TList()),
53 fLog.GetProcessName() =
"CubicFilter";
54 fGateList->SetOwner(
true);
55 for (Int_t i = 0; i < 4; ++i) {
56 fGateList->Add(
new Gate());
78 Gate* gate =
static_cast<Gate*
> (fGateList->At(idx));
90 Gate* gate =
static_cast<Gate*
> (fGateList->At(0));
93 std::ifstream filein(name);
97 while ( filein.good() ) {
98 filein >> gateInf >> gateSup;
99 gate->
AddGate(gateInf, gateSup, opt);
109 if (axis < fGateList->GetEntries()) {
110 Gate* gate =
static_cast<Gate*
> (fGateList->At(axis));
111 gate->
AddGate(gateInf, gateSup, opt);
126 if (tmp.Contains(
"peak"))
138 for (Int_t iGate = 0; iGate < fGateList->GetEntries(); ++iGate) {
140 Gate* gate =
static_cast<Gate*
> ( fGateList->At(iGate) );
151 Gate* gate =
static_cast<Gate*
> ( fGateList->At(iGate) );
159 for(Int_t i = 0; i < mult; ++i) {
161 Bool_t IsInGate =
false;
176 for(Int_t i = 0; i < mult; ++i)
181 for(Int_t i = 0; i < mult; ++i)
191 void CubicFilter::ResetGates()
194 for (Int_t i = 0; i < fGateList->GetEntries(); ++i) {
195 Gate* gate =
static_cast<Gate*
> ( fGateList->At(i) );
201 void CubicFilter::FillGates()
208 while ( (peak = (
Peak1D*)next()) ) {
210 if (idx == -1)
continue;
211 gate =
static_cast<Gate*
> ( fGateList->At(idx) );
218 void CubicFilter::FillBkgGates()
224 while ( (peak = (
Peak1D*)next()) ) {
227 if (idx == -1)
continue;
229 gate =
static_cast<Gate*
> ( fGateList->At(idx) );
234 gate->
AddGate(vecL.X(), vecL.Y());
235 gate->
AddGate(vecR.X(), vecR.Y());
275 if (option.Contains(
"reset")) {
279 fGateInf.Set(fGateInf.GetSize()+1);
280 fGateInf.AddAt(gateInf, fGateInf.GetSize()-1);
282 fGateSup.Set(fGateSup.GetSize()+1);
283 fGateSup.AddAt(gateSup, fGateSup.GetSize()-1);
LogMessage & error(LogMessage &)
Short_t fDimension
number of conditions for gating
TList * fPeakList
dimension for projection
Double_t GetGateInf(Int_t idx)
Get gate inf.
Bool_t IsBkg
list of peaks
CubicFilter class for cubic gates.
LogMessage fLog
flag to know whether gate are made with bkg
static Int_t GetGateAxis(Color_t co)
void AddGate(Double_t gateInf, Double_t gateSup, Int_t axis=0, Option_t *opt="update")
Add gate.
Bool_t IsCombined()
Flag to combined.
Double_t GetGateSup(Int_t idx)
Get Gate sup.
virtual Color_t GetLineColorPeak()
Get line peak color.
virtual Double_t GetFWHM(Option_t *axis="X") const
Get FWHM of peak.
const TVector2 GetBkgRight() const
Bool_t IsListFilled(Int_t idx)
Check if gate filled.
LogMessage & dolog(LogMessage &)
virtual Double_t GetPosition(Option_t *axis="X") const
Get position of peak.
void MakeGates(Option_t *opt="peak")
Make gates.
CSFilter base class for filter.
void AddGate(Double_t gateInf, Double_t gateSup, Option_t *opt="update")
Add gate.
header file for a general 1D peak
void ImportGates(const Char_t *name, Option_t *opt="update")
Import gates from file.
Int_t IsInside(Double_t *energies, Int_t mult, Short_t *inGate, Int_t iGate=0)
Get energies inside gates.
A graphical interface for placing schematic peak onto a 1D histogram with a given position...
const TVector2 GetBkgLeft() const
Get background limits.
virtual void SetProcessMethod(const char *)
To set the current method.
Int_t GetNofGates() const
Get number of gates.
ClassImp(CubicFilter) CubicFilter