cms-gem-daq-project / gem-plotting-tools

Repository for GEM commissioning plotting tools
GNU General Public License v3.0
1 stars 26 forks source link

Feature Request: fitScanData.py Takes Number of Injections as Input #15

Closed bdorney closed 7 years ago

bdorney commented 7 years ago

Brief summary of issue

Right now the form of the modified erf function that is used to fit s-curves has parameters that are hardcoded. These parameters should be changed from 500 to 0.5 * nInjections. See L#34 of fitScanData.py

However now the --nevt option can be passed from command line to the scan tool of interest. Right now the --nevt defaults to 1000 so there is no conflict. However if the user supplies a different value the fit may not work as planned.

This was also mentioned in: https://github.com/cms-gem-daq-project/vfatqc-python-scripts/issues/113

Types of issue

Expected Behavior

In L#1 fitScanData() should take an additional parameter as input: nInjections=1000. The default will ensure the same behavior as present.

Then the equation of Fit at L#34 should be modified from:

    fitTF1 = r.TF1('myERF','500*TMath::Erf((TMath::Max([2],x)-[0])/(TMath::Sqrt(2)*[1]))+500',1,253)

to be instead:

    fitTF1 = r.TF1('myERF','%i*TMath::Erf((TMath::Max([2],x)-[0])/(TMath::Sqrt(2)*[1]))+%i'%(0.5*nInjections),1,253)

Current Behavior

Currently if the default value of --nevt=1000 but if the user specifies a value outside of this the modified erf applied to the scurve data may not work as intended

Context (for feature requests)

Ensuring this ensures correct fitting when number of events in scurve/trimming differs from default