Skip to content

Crash when doing Weighted Likelihood fit #14458

@lmoneta

Description

@lmoneta

Check duplicate issues.

  • Checked for duplicates

Description

ROOT crashes when performing the uncertainty correction in (Fitter::DoWeightMinimization) when doing a weighted likelihood fit.
See https://root-forum.cern.ch/t/root-crashes-when-doing-a-weighted-likelihood-fit/57976

Reproducer

void test(){                                                                                                                                                                                                
  TH1F* h = new TH1F("h","h",3,0,3);                                                                                                                                                                        
  for(int i = 0; i < 3; i++)h->Fill(0.5);                                                                                                                                                                   
  for(int i = 0; i < 4; i++)h->Fill(1.5);                                                                                                                                                                   
  for(int i = 0; i < 3; i++)h->Fill(2.5);                                                                                                                                                                   
                                                                                                                                                                                                            
  //This works                                                                                                                                                                                              
  std::cout << "Likelihood Fit:" << std::endl;                                                                                                                                                              
  h->Fit("pol0","L");                                                                                                                                                                                       
                                                                                                                                                                                                            
  //This dosn't                                                                                                                                                                                             
  h->Sumw2();                                                                                                                                                                                               
  h->Scale(10);                                                                                                                                                                                             
  std::cout << "Weighted Likelihood Fit:" << std::endl;                                                                                                                                                     
  h->Fit("pol0","WL");                                                                                                                                                                                      
}    

ROOT version

6.28, 6.30 and master

Installation method

all

Operating system

all

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions