7 #include "TDirectory.h"
23 int nbinsx,
double xlow,
double xup,
24 int nbinsy,
double ylow,
double yup,
25 int nbinsz,
double zlow,
double zup)
30 fitFunction_( new TF1(
"gaus",
"gaus") ),
36 cout<<
"creating residual fitter with name "<<name<<endl;
38 string meanname =
name; meanname +=
"_mean";
39 mean_ =
new TH2D(meanname.c_str(), meanname.c_str(),
44 string sigmaname =
name; sigmaname +=
"_sigma";
45 sigma_ =
new TH2D(sigmaname.c_str(), sigmaname.c_str(),
51 string chi2name =
name; chi2name +=
"_chi2";
52 chi2_ =
new TH2D(chi2name.c_str(), chi2name.c_str(),
80 string cname =
"ResidualFitterCanvas_"; cname += GetName();
83 canvas_ ->Connect(
"ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
85 this,
"ExecuteEvent(Int_t,Int_t,Int_t,TObject*)");
95 for(
unsigned it = 0; it<
true_.size(); it++) {
96 for(
unsigned im = 0; im<
meas_.size(); im++) {
111 cout<<
"ResidualFitter::FitSlicesZ"<<endl;
114 for(
int ix=1; ix<=GetNbinsX(); ix++) {
115 for(
int iy=1; iy<=GetNbinsY(); iy++) {
126 if( event != kButton1Down )
return;
128 TH2* histo2d =
dynamic_cast<TH2*
>(
sel);
143 string cname =
"ResidualFitterCanvasFit_"; cname += GetName();
144 canvasFit_ =
new TCanvas(cname.c_str(), cname.c_str(),300,300);
148 int binx = histo2d->GetXaxis()->FindBin(x);
149 int biny = histo2d->GetYaxis()->FindBin(y);
167 TH1::AddDirectory(0);
170 curBin_ = TH3::ProjectionZ(
"", binx, binx, biny, biny);
173 TH1::AddDirectory(1);
180 double maxpos =
curBin_->GetBinCenter(
curBin_->GetMaximumBin() );
186 cout<<
"range : "<<minrange<<
" "<<maxrange<<endl;
192 double chi2overndf=0;
200 chi2_->SetBinContent(binx,biny,chi2overndf);
207 TH1::AddDirectory(1);
void Fit(int x, int y, const char *opt="")
ResidualFitter(const char *name, const char *title, int nbinsx, double xlow, double xup, int nbinsy, double ylow, double yup, int nbinsz, double zlow, double zup)
void ExecuteEvent(Int_t event, Int_t px, Int_t py, TObject *sel)
void FitSlicesZ(TF1 *f1=0)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::vector< ResidualFitter::Point > true_
std::vector< ResidualFitter::Point > meas_
void SetFitFunction(TF1 *func)
void Reset(std::vector< TH2F > &depth)
void ShowFit(TH2 *h2d, double x, double y)