23 #ifndef Gw_CorrelatedSpaceTH2
59 #ifndef ROOT_TVirtualPad
60 #include "TVirtualPad.h"
81 if (sType.Contains(
"float"))
83 else if (sType.Contains(
"short"))
85 else if (sType.Contains(
"int"))
87 else if (sType.Contains(
"double"))
90 fLog.SetProcessMethod(
"CorrelatedSpaceTH2(Option_t* )");
107 return Form(
"%s_H2", GetName());
113 return Form(
"%s_H2", GetTitle());
126 return (Double_t)
fHisto->GetBinContent(
fHisto->GetBin(i,j));
138 Int_t dimY =
fHisto->GetNbinsY();
140 Int_t j = iCell / dimY;
141 Int_t i = iCell % dimY;
157 return fHisto->GetNbinsX();
159 return fHisto->GetNbinsY();
169 Int_t dimY =
GetHisto(
"y")->GetNbinsX();
171 Int_t j = iCell / (dimY);
172 Int_t i = iCell % (dimY);
174 fHisto->Fill(i, j, weight);
200 Int_t dimX =
GetHisto(
"x")->GetNbinsX();
201 Int_t dimY =
GetHisto(
"y")->GetNbinsX();
202 Float_t minX =
GetHisto(
"x")->GetXaxis()->GetXmin();
203 Float_t maxX =
GetHisto(
"x")->GetXaxis()->GetXmax();
204 Float_t minY =
GetHisto(
"y")->GetXaxis()->GetXmin();
205 Float_t maxY =
GetHisto(
"y")->GetXaxis()->GetXmax();
206 fHisto->SetBins(dimX, minX, maxX, dimY, minY, maxY);
216 Int_t dimX =
GetHisto(
"x")->GetNbinsX();
217 Int_t dimY =
GetHisto(
"y")->GetNbinsX();
220 fHisto->SetBins(dimX, 0, dimX, dimY, 0, dimY);
223 for (Int_t i = 0; i < dimX; ++i) {
224 for (Int_t j = 0; j < dimY; ++j) {
225 fHisto->Fill(i,j, Xn[i*dimX + j]*weight);
229 TH1D* h1x =
fHisto->ProjectionX();
230 TH1D* h1y =
fHisto->ProjectionY();
232 for (Int_t i= 0; i < dimX; ++i)
235 for (Int_t j = 0; j < dimY; ++j)
250 Int_t dimX = h2->GetNbinsX();
251 Int_t dimY = h2->GetNbinsY();
252 Float_t minX = h2->GetXaxis()->GetXmin();
253 Float_t maxX = h2->GetXaxis()->GetXmax();
254 Float_t minY = h2->GetXaxis()->GetXmin();
255 Float_t maxY = h2->GetXaxis()->GetXmax();
262 fHisto = (TH2*)h2->Clone();
263 TH1D* h1x = h2->ProjectionX();
264 TH1D* h1y = h2->ProjectionY();
266 for (Int_t i= 0; i < dimX; ++i)
267 GetHistoTot(
"x")->SetBinContent(i, h1x->GetBinContent(i));
269 for (Int_t j = 0; j < dimY; ++j)
270 GetHistoTot(
"y")->SetBinContent(j, h1y->GetBinContent(j));
289 fHisto->SetBins(dimX, 0, dimX, dimY, 0, dimY);
299 for (Int_t i = 0; i < dimX; ++i) {
301 for (Int_t j = 0; j < dimY; ++j) {
302 counts = gRandom->Uniform(0, 10);
303 fHisto->Fill(i,j, counts);
307 TH1D* h1x =
fHisto->ProjectionX();
308 TH1D* h1y =
fHisto->ProjectionY();
310 for (Int_t i= 0; i < dimX; ++i)
313 for (Int_t j = 0; j < dimY; ++j)
325 Int_t dimX = h2->GetNbinsX();
326 Float_t minX = h2->GetXaxis()->GetXmin();
327 Float_t maxX = h2->GetXaxis()->GetXmax();
330 Int_t dimY = h2->GetNbinsY();
331 Float_t minY = h2->GetYaxis()->GetXmin();
332 Float_t maxY = h2->GetYaxis()->GetXmax();
337 TH1D* h1x =
fHisto->ProjectionX();
338 TH1D* h1y =
fHisto->ProjectionY();
342 for (Int_t i= 0; i < dimX; ++i)
343 GetHistoTot(
"x")->SetBinContent(i, h1x->GetBinContent(i));
345 for (Int_t j = 0; j < dimY; ++j)
346 GetHistoTot(
"y")->SetBinContent(j, h1y->GetBinContent(j));
383 h1 =
static_cast<TH1D*
> (
fHistoList->At(idx) );
389 Double_t counts = 0.;
405 Short_t inGate[dimProj];
406 Double_t energies[dimProj];
408 for (Int_t i= 0; i < dim1; ++i) {
410 energies[0] = hProj1->GetBinCenter(i);
412 nofGates = filter->
IsInside(energies, dimProj, inGate);
415 fLog <<
error << Form(
"Too much good energies : %d", nofGates) <<
dolog;
419 if (inGate[0] == 1) {
420 for (Int_t j = 0; j < dim2; ++j) {
422 counts = (Double_t)
fHisto->GetBinContent(
fHisto->GetBin(i,j));
424 counts = (Double_t)
fHisto->GetBinContent(
fHisto->GetBin(j,i));
425 h1->Fill(hProj2->GetBinCenter(j), counts);
printf("******************************************************************** \n")
Bool_t IsForBkg()
Is for bkg gates.
LogMessage & error(LogMessage &)
LogMessage & warning(LogMessage &)
virtual Int_t IsInside(Double_t *, Int_t, Short_t *, Int_t=0)
Get the pattern of energies inside the gates.
LogMessage & dolog(LogMessage &)
CSFilter base class for filter.
void SetCondition(Short_t cond)
Set dimension for gating.
virtual void SetProcessMethod(const char *)
To set the current method.
void SetDimension(Short_t dim)
Set dimension for projected space.