Final method2 implementation

Hcal 25ns reconstruction method2 implementation with fast fitter
Was TMinuit2 considered?
or better a less HEP-py solution such as:
http://people.sc.fsu.edu/~jburkardt/cpp_src/asa047/asa047.cpp

On Oct 23, 2014, at 4:14 PM, Chris Jones <notifications@github.com>
 wrote:

> In RecoLocalCalo/HcalRecAlgos/src/PulseShapeFitOOTPileupCorrection.cc:
> 
> > +   }
> > +
> > +   double TIMES[10]={-100,-75,-50,-25,0,25,50,75,100,125};
> > +
> > +   if(n_max==0){
> > +      max_index[0]=i_tsmax;
> > +   }
> > +
> > +   double error = 1.;
> > +   for(int i=0;i<10;i++){
> > +      FitterFuncs::psFit_x[i]=i;
> > +      FitterFuncs::psFit_y[i]=energyVec[i];
> > +      FitterFuncs::psFit_erry[i]=error;
> > +   }
> > +
> > +   TFitterMinuit * gMinuit = new TFitterMinuit();
> 
> Unfortunately, the constructor and destructor of TFitterMinuit are not thread safe. The constructor changes gMinuit2 to point to this instance (an annoyance) and the constructor adds this object to a global list of 'special' objects. It is the latter which is unsafe. The destructor does the same but 'in reverse'. Therefore constructing and destructing instances of TFitterMinuit can lead to a crash.
> 
> —
> Reply to this email directly or view it on GitHub.
>