Package : Rich/RichMirrCombinFit Package Coordinators : Paras Naik, Anatoly Solomin Purpose : RICH mirror combination histos fitting program
2018-07-03 - Anatoly Solomin - Incremented version to v17r2. - Replaced some names for more self-explanatory ones.
2017-10-12 - Paras Naik - "Tagged" as v17r1 (internally, since only Panoptes gets a tag now). - Added m_minFracPhiBinsPopulated, which sets the minimum fraction of phi bins that need to be well-populated in order to report any underpopulated bins. This can be configured via the .conf file (typically provided by Rich/RichMirrorAlignmentOnline). - Changed the underpopulation warning message so that the level of underpopulation is clear in the same line (and thus visible in the FitNGE file).
2017-06-09 - Paras Naik - Added workDir to options - Added trailing slash to workDir in files/*.conf since this is now, always provided by RichMirrorAlignmentOnline and thus expected. - Removed StopOrContinue() which is obsolete. - The _combinfitdecision.txt file should now be properly written to the workDir - Fixed typos.
2016-05-22 - Anatoly Solomin - Incremented version to v17r0. - Very important: [re-]implemented "STOP"/"CONTINUE" decision generating in MirrCombFit::CombinFitDecision(), that now permits to stop running immediately after the main (untilted) bunch of histograms are fitted. If all histograms, i.e. all mirror combinations, have both Y and Z tilts within tolerance, no need to do anything else, even compute the new compensations and update the CONDDB. Let alone running with calibrational tilts to re-evaluate the magnification factors "on-fly". This new feature supersedes the stopping decision in RichMirrAlign, even the new one, with the diversified stop tolerances. Therefore, switch to this mode of stopping decision taking requires respective upgrade of the driver script. - Eliminated default values for RICH-dependent options. - Introduced option nominalResolutionSigma: RICH-dependent nominal Cherenkov angle distribution sigma; no default here. - Introduced option stopSigmaFraction (default 0.5): tolerance for total tilt of mirror pair in terms of fraction of the nominal sigma. - Introduced option stopToleranceMode: 0(default)->calculate it from nominal sigma and stopSigmaFraction, e.g. stopTolerance = nominalResolutionSigma*stopSigmaFraction 1->use the one set up by hand in the conf file. - Respective changes in the conf files. Examples in <...>/files. - Changed order of lines in the conf file to make it more readable. - Respectively, changed order of lines in the options reading part. - In the options reading part equipped all options that have no defaults (RICH-dependent and iteration count) with the diagnostics if they are not defined in the configuration file. - Improved printout of the options. - m_minAverageBinPop is now integer. Purely internal change. - Implemented choice of stopTolerance according to stopToleranceMode in the MirrCombFit::CombinFitDecision() - Corrected and improved WARNING/NOTE/OK printouts in CombinFitDecision() NOTE is when relative shift of a mirror combination over an axis is > 1, but < warningFactor. - m_sigmaTDR is replaced by m_nominSigmRad = m_nominalResolutionSigma/1000.0 just for non-ambiguity and convenience. - Removed from RichXMirrCombFit.cpp constructors hard-coded m_begRange, m_endRange, m_nominSigmRad, because they are derived from the respective options: m_begRange = -deltaThetaWindow/1000.0; m_endRange = deltaThetaWindow/1000.0; m_nominSigmRad = m_nominalResolutionSigma/1000.0;
2016-03-29 - Paras Naik - Incremented version to v16r0p1. - Fixed typos in release notes.
2016-03-21 - Paras Naik - Incremented version to v16r0p0. - Updated CMakeLists.txt
2016-03-09 - Anatoly Solomin - Incremented version to v16r0. - Naming of the files and classes made more consistent: in <...>/Rich/RichMirrCombinFit/Python/ MirrorFitWrapper.py -> RichMirrCombinFitWrapper.py in <...>/Rich/RichMirrCombinFit/RichMirrCombinFit/ IRichMirrFit.h -> IMirrCombFit.h Rich1MirrFit.h -> Rich1MirrCombFit.h Rich2MirrFit.h -> Rich2MirrCombFit.h RichMirrFit.h -> MirrCombFit.h RichMirrorPair.h -> MirrComb.h ... -> HPDFitter.h in <...>/Rich/RichMirrCombinFit/src/ MirrorFit.cpp -> RichMirrCombinFit.cpp (main) Rich1MirrFit.cpp -> Rich1MirrCombFit.cpp Rich2MirrFit.cpp -> Rich2MirrCombFit.cpp RichMirrFit.cpp -> MirrCombFit.cpp RichMirrorPair.cpp -> MirrComb.cpp ... -> HPDFitter.cpp ... -> RichHPDFit.cpp - Restored code formatting standard and improved readability. - Removed Matt from the code coordinators (see above). - Migrated the main parameters to the beginning of the array: Y is now [0], while Z is [1] - Restored the meaning of the "shift" parameter ([2]) as individual for each mirror combination. - Gauss sigma is now either [3] parameter when widths are unified, or the sigmas are the next phiBins parameters after [2]. And so the constant before Gauss now always follows the sigma(s). This makes the parameter order more comprehensible. - Instead of m_findShift, added a new variable m_fixSinusoidShift default =1 : fix at sinusoidShift; if =0, it is not fixed. - In the RichMirrCombinFitWrapper.py restored conventional naming: <...>/Rich"+rich+"MirrCombinFit.conf > "+workDir+"/Rich"+rich+"MirrFitCombinFitOut.txt"<...> - Replaced all instances of the misleading "mirror shift" words in printouts with the appropriate "mirror combination tilt" words. - Enabled usage of m_zeroGlobalFitMean option in GlobalFit - Added setConstantMean function to DThetaFitter - Enabled usage of m_useGlobalFitMean in RichMirrCombFit::FitHistos - Migrated out of the loop over phiBin (in Rich1/2MirrCombFit.cpp) setting of sigma when it is "unified" - In parameter names in config file replaced subsets file name with combAndMirrSubsets - combAndMirrSubsets file got new, more convenient format. - In parameter names in config file replaced combinFitVariant with combinFitMethod - Accordingly, in the file naming string "formula" Fv replaced with Fm (fitting method i.e. "combinFitMethod") - Similarly, in the file naming string "formula" Cm (coefficients mode) replaced with Mm (magnification mode) - New design of Rich1/2CombAndMirrSubsets.txt - More simple way of reading the list of combinations from m_combAndMirrSubsetsFile - Renamed: HPDCombinfit.h/cpp -> HPDFitter.h/cpp because it was misleading. - According to the common coding recommendations, in all header files left only necessary in the headers includes, while added all (and only) necessary includes into the implementation files. - Both in Rich1/2MirrCombFit.cpp and HPDFitter.cpp fixed mistake in Fit2D function: [0]*sin(x) + [1]*cos(x) -> [0]*cos(x) + [1]*sin(x) so now, as anywhere else throughout the code, parameter [0] corresponds to rotation around Y axis (vertical), while parameter [1] corresponds to rotation around Z asis (horizontal). - Updated <...>/Rich/RichMirrCombinFit/cmt/requirements in accord with new file names. - Prepended Rich1/2 to all plot files. - All tilts and shifts are now printed and written to results file in formatted way which makes them observable at a glance. - In the RichMirrCombinFitWrapper.py changed redirection of stdout from ... > <...>.txt to ... > <...>.out. Similar should be observed in the corresponding online codes. - In Rich1/2MirrCombFit.cpp corrected: TH1D* slice = m_histo->ProjectionY("", phiBin, phiBin), instead of phiBin, phiBin+1, which doubled estimation of avHeight. - Made phi bin numbering consistently from 1 in Rich1/2MirrCombFit.cpp and in FitSurf.h - corrUniWid = - phiBins + 1 and the parameter ordinal numbers are corrected by adding such a correction when the Gaussian sigmas are unified in Rich1/2MirrCombFit.cpp - Added m_iterationCount to be used to identify e.g. <...>_i0.png files in MirrCombFit. - Added m_thisVariant for the same purpose. Consequently, thisVariant is added to .conf files exact same way as in the RichMirrAlign .conf - mirrCombinFitResults replaces outputResults in .conf files and in the MirrCombFit.cpp - inputHistos replaces inputHistoFile in .conf files and in the MirrCombFit.cpp - In MirrCombinFit.cpp Replaced: gStyle->SetPalette(kBlueYellow), was kRainBow, which is strongly deprecated at CERN, - Added "files" folder with *Subsets.txt, *.conf files and RichMirrCombinFitREADME.txt with example how to run (cmt fashion). Updated cmt/requirements accordingly. - Code stile now complies to CERN's rules: indentations, TypeA* typea; ++i in loops, etc. Please, please, do not use your personal code styles: this is core LHCb software, not our private at all. - HPD part still needs to be investigated.
2015-07-10 - Paras Naik - StopOrContinue() now replaced with CombinFitDecision(). Gives a decision to PAUSE if the mirror shifts by more than warningFactor*stopTolerance, both introduced to RichMirrCombinFit. warningFactor default is 20, stopTolerance default is 0.1 (mrad). Decision is written into file ending with _combinfitdecision.txt Default decision is CONTINUE - Color scheme for 2D histograms cahanged to Palette #55 (code from Claire Prouve) - LHCbStyle() changed LHCbStyle(true) to better support COLZ plots (code from Claire Prouve)
2015-07-09 - Paras Naik - Added code to unify Gaussian widths in all phi bins (setting: combinFitVariant = 5). - Now we use Minuit Strategy 0 for Fitting the 2D Histos. - Added, as standard, code to re-fit with MINIMIZE if fit is not valid with MIGRAD. - Added code to reduce the number of phi bins for the 2D fits by a factor of phiBinFactor. (setting: phiBinFactor, default is 1 which does not rebin) - Fixed typo that did not zero out all deltaTheta bins in an underpopulated phi bin. - Increase maximum number of calls and minuit iterations to avoid CALL LIMIT failures.
2015-07-01 - Paras Naik (code provided by Claire Prouve) - Remove extraneous information (only added in Online) from histogram names, when m_histo->GetName() is called.
2015-06-13 - Paras Naik - Added a limit expander that slowly increases the limits on the mirror tilts in the FitSurface fit. Useful when fitting initial alignments to misaligned detectors. (Code from Sam Harnew). - Also changed the printouts of RichMirrCombinFit which print bins are too low for alignment. Before it was (300*20/nbins_phi) photons per bin was too low, now it's (minAverageBinPop*nbins_theta) photons per bin. 2015-06-09 - Paras Naik - Added plots for FitSurface. (Code from Sam Harnew)
2015-05-11 - Paras Naik - Changed the code so that the functionality of justGlobalFit = 1 has now been absorbed into justGlobalFit = 0, i.e. there is always a globalFit plot made to the deltaThetaUnAmb distribution. Note that this is only meaningful for the untilted distribution. The purposely misaligned tilts will of course not be representative of an aligned detector. 2015-04-29 - Paras Naik - minAverageBinPop is no longer hardcoded. We now take this value in from the settings file.
2015-04-23 - Paras Naik - minAverageBinPop used to be hardcoded at 9. We now take this value in from the settings file. However, temporarily, minAverageBinPop for RICH2 has been hardcoded to 4.8 to avoid breaking currently running processes. This hardcoding will be removed shortly. - Added function BinCounter to RichMirrFit.cpp. This prints out bin content in the phi projection of the 2D dThetavphiRec histograms for each mirror combination. It also outputs "not_good_enough" if 80% of the bins do not have (20*300/xBins) photons.
2015-03-26 - Paras Naik - mirrorPair, a variable defined to designate a mirror pair now is always a string with four characters. This is important for compatibility with the new RichMirrAlign. All 2240 combinations of primary and secondary mirrors are accounted for. - Code has been added to ensure that if a mirrorPair is not on the list of ~94 mirror pairs used for the mirror alignment, that no line for that mirrorPair is placed into the output. - Code has been added to ensure that if a mirrorPair is not on the list of ~94 mirror pairs used for the mirror alignment, that no STOP or CONTINUE decision is based off of this mirrorPair. - Commented out code that has been added to show how one could use of Minuit2 with fit strategy 2 for the "MirrCombin" fits. However, we have not proceeded with Minuit2, for now. 2015-03-24 - Paras Naik - From whatever the HEAD version was the day before today: Updated the code to include Sam Harnew's justGlobalFit, which if activated (activated when argc > 3, argv[3] = 1), just performs a global fit to the results from all mirror pairs combined, just to find the overall cherenkov angle resolution (or shift if we're looking to make our own refractive index calibration).
2014-01-10 - Paras Naik (on behalf of Marco Clemencic) - Added CMake configuration. 2012-12-11 - Matt Coombes - Added check to remove Iso histograms from fit. 2012-12-10 - Matt Coombes - Removed some compile time warnings. 2012-11-30 - Paras Naik (on behalf of Sam Harnew) - Added a new class for fitting DeltaTheta, and implemetented this into the code. 2012-07-26 - Matt Coombes - Add fit for HPD alignment in RICH1 detector. - Minimum number of entries ~10,000 to align HPDs. - Incremented version. 2011-09-11 - Matthew Coombes - Fixed Compile time warnings with unused parameters xbins and param1. 2011-08-15 - Matthew Coombes - Fixed Compile time warnings. 2011-07-04 - Matthew Coombes - Changed limits of sigma for surfaceB fit. Introduced non-zero lower limit for RICH1 preventing fit failure. 2011-06-28 - Matthew Coombes - Updated fit parameters for surfaceB method RICH1. 2011-06-21 - Matthew Coombes - Added surfaceB method for RICH1.
2011-06-08 - Anatoly Solomin - Increment version v12r1. - Rewritten the fitting function, using functor. Key reason for this is to be able to pass additional parameters (apart from those being fitted) for tuning and control into the functor. - Because the numerical part of the Rich/RichMirrorAlignmentGanga migrated from Job application GaudiPython to Executable (thus re-enabling the framework to run with the checked out local versions of the numeric packages RichMirrCombinFit and RichMirrAlign), the wrappers: Rich1MirrCombinFitWrapper.py and Rich2MirrCombinFitWrapper.py are totally rewritten. 2011-05-31 - Anatoly Solomin - Increment version v11r1. - Streamlined job, file, etc. naming conventions for better usability. Modified programmatic name formation accordingly - Improved code readability. 2011-05-20 - Anatoly Solomin - Increment version v10r6. - Corrected these release notes, fixed the header of the previous release, to address the fact that in PANOPTES v3r0, v3r1 and v3r2 these packages were temporarily excluded, because xqilla was not yet available in the officially released LHCb environment.
2011-03-30 - Matt Coombes - Increment version v10r5. - Updated fitting for RICH1. Updated background function. 2010-11-09 - Anatoly Solomin - Increment version v10r4. - Completely new approach: sinusoid with its parameters is now an additional bond when fitting the histograms. Instead of fitting slices and then separately - sinusoid drawn through positions of Gaussian peaks, sinusoid is now part of the fitting of 2D histograms.
2010-07-01 - Matt Coombes, Anatoly Solomin - Increment version v9r0. - Renamed program RichMirrCombinFit. - Transition to generalized case for fitting alignment histograms in both RICH1 and RICH2. 2010-06-03 - Anatoly Solomin - Increment version v8r2. - Straightened out naming of program options.
2010-05-26 - Anatoly Solomin - Increment version v8r1. - Made magnification coefficients calibration tilts variate-able instead of being always 1 mrad. 2010-05-24 - Anatoly Solomin - Added delta theta window width parameter. 2010-05-14 - Anatoly Solomin - Increment version v7r1. - Improved printout. 2010-04-15 - Anatoly Solomin - Increment version v7r0. - Added switchable on/off option of using offsets obtained from relevant MC for correction of the total tilts evaluation. - Made printout of the results in at-a-glance format, so that the numbers are at the same places as their combinations in the "ASCII-pictorial" list of chosen mirror combinations. - Widened the window for fitting (and finding the mode position) of the delta theta distribution. That became feasible after using "Loose" cuts in photon creation. As a result, the whole procedure acquired correctness and precision. - Straightened out order of file naming convention. 2010-03-28 - Anatoly Solomin - Increment version v6r3. - Fitting procedure changed: no FitSlicesY anymore. Fit slices individually with automatic initial values from each slice. - Subset of mirrors defined by an "ASCII-pictorial" list of chosen mirror combinations. - Conversion coefficients are re-evaluated on-fly for each iteration. Eight families of conversion coefficients: primary/secondary times Y/Z times +/-. Each mirror segment tilt around one axis results in final tilts around both axes: major around the corresponding, minor around the alternative one. That is 2D. - Control parameters are now keyed, and typed as a key=value column in Rich2MirrCombinFit.conf. Modified the Rich2MirrCombinFitWrapper.py. Use boost::program_options library.
2009-10-23 - Anatoly Solomin - Increment version v3r7. - Fitting procedure improved with automatic initial values from the histograms. - Added parameter to initiate the coefficients calculation instead of normal fit.
2009-07-21 - Anatoly Solomin - Increment version v3r5. - Reduced hardcodedness. 2009-07-03 - Anatoly Solomin - Increment version v3r4. - Replace X with Z. - Ignore Y-Z correlation in magnification coefficients. - Use ROOT's FitSlicesY and fit sinusoid through means. 2009-04-24 - Ulrich Kerzel - fix requirements file and add ROOT configuration 2009-04-20 - Anatoly Solomin - Implement new slice-by-slice fitting method. - Update file-name notations to use 2008 geometry. - Add attic folder for older version. 2009-03-04 - Anatoly Solomin - Increment version: v2r6. - Remove "using" statements in Rich2MirrCombinFit.cpp.
2009-02-14 - Anatoly Solomin - Bring notations in agreement with Conditions/Rich2/Alignment/Mirrors.xml 2008. 2009-02-06 - Ulrich Kerzel - add Gaudi Policy to requirements file, - add apply_pattern to requirements file
2008-11-14 - Anatoly Solomin - Wrap Rich2MirrCombinFit.exe executable into the python/Rich2MirrCombinFitWrapper.py. This enables Ganga to run it within a Ganga script the following way: app = GaudiPython( project ='Panoptes', ...) j = Job( application = app ) j.application.script = expandvars('.../Rich2MirrCombinFitWrapper.py') j.inputsandbox += [expandvars('.../Rich2MirrCombinFit.exe')] 2008-11-01 - Anatoly Solomin - Made loop over the variants, including the calibration histograms.