11 Running the FCNC fitter
Renata Kopecná edited this page 2022-02-10 14:50:58 +01:00

Table of Contents

Running the FCNC fitter

The easiest way to run the FCNC fitter is to use the python wraper run.py. As the easiest way how to pass arguments to a C++ program is to use single letters, the python wrapper allows a nice quick conversion from running the cryptic C++ code

./bu2kstarmumu  -r 12 -d 0 -k 

to rather self explanatory

python run.py -Data -Run 12 -convert 

The possible arguments to add to the runnig script can be listed anytime by running

python run.py -h

For the full help printout showing you the arguments when running the code directly from the compiled executable, with nice colors and everything, run

python run.py -hilfe

The mandatory parameters are -Run or -year, it will probably not crash immediately if you do not specify the data type, but it is highly recommended. The full list parameters is in this beautiful table

Parameter Parameter Parameter description
-h, --help Show this help message and exit
-v <intVerbosity> --verbosity <intVerbosity> Set verbosity level. Default is INFO.
Available levels are:
0: Trace
1: Debug
2: Info
3: Warn
4: Error
5: Critical
-log <strLog> --log <strLog> Set log file name. Default is no log, streaming right into console.
-hilfe --hilfe Print full help directly from the C++ code
-compile --compile Compile the code. The code is compiled before any running as default, use this option when you want to only compile and nothing else.
-dontCompile --dontCompile Don't compile the code before runing. The code is compiled before any running as default
-Run <Run> --Run <Run> Set the Run number. Default is Run 1
-allRun --allRun Run on Runs 1, 2 and 12
-year <year> --year <year> Run only on one year.
-PHSP --PHSP Run on PHSP MC
-Data --Data Run on Data
-Ref --Ref Run on reference channel (Jpsi Q2). Makes a cut on Q2, so it can be run also with the -Data or PHSP or other data samples. Automatically sets the number of Q2 bins to one.
-MC --MC Run on signal MC
-all --all Run on data, signal MC, reference MC and PHSP
-allMC --allMC Run on signal MC, reference MC and PHSP
-genMC --genMC Run on generator level MC
-boost --boost Run on boosted sample, turn on also generator level MC option!
-convert --convert Convert selection tuples to FCNC tuples. This is needed for the FCNC event reader to be able to read the branches.
-angCorr --angCorr Obtain angular acceptance correction coefficients from PHSP Monte Carlo events.
-scan --scan Scan whatever you are doing :) Currently effectively only used as an additional option when scanning the order of the polynomial used to describe the angular distributions.
-fit --fit Run the fit. Depending on the other option the corresponding fit will be executed (eg -fit -MC has different fit model than -fit -Data -Ref)
-angRes --angRes Get angular resolution from signal MC.
-toys --toys Generate toys. Add -evts to generate custom number of events.
-script --script Run whatever script you decided. For more details see how to run helper scripts
-job <job> --job <job> Set the job number (used with toys)
-evts <evts> --evts <evts> Set number of used/generated events
-onlyBkg --onlyBkg Fit only angular background.
-upper --upper Fit only upper-mass side-band.
-lower --lower Fit only lower-mass side-band.
-bin <bin>, --bin <bin> Which angular bin would you like to fit? For detials see the Q2 binning section.
-nBins <nBins> --nBins <nBins> Set total number q2 bins. For detials see the Q2 binning section. The available numbers of bins are 1, 2, 4 or 5 (or 8, however that is not properly implemented). When using the -Ref option, the number of bins is automatically set to be 1. The default is set to be 4.
-MagDown --MagDown Run only on MagDown (possibly broken, as it was not used)
-MagUp --MagUp Run only on MagUp (possibly broken, as it was not used)
-trueMC --trueMC Use MC true information, obsolete option, don't use
-likelyhood --likelyhood Likelihood profile scans. It is not working as we never got to it, but it is kept for legacy reasons
-massDim --massDim Fit mass dimension only.
-MoM --MoM Use Method of Moments instead of the fit. It is not working as we never got to it, but it is kept for legacy reasons
-observeP --observeP use P(') angular observables in the fit instead of the S(') It is not working as we never got to it, but it is kept for legacy reasons
-folding <folding> --folding <folding> Set the folding of angles.Five possibilities, use range [0-4]. For details see the angular folding section.
Default is -1, meaning no folding.
-loopFolds --loopFolds Evaluate all five foldings
-index <index> --index <index> Set index, used for various checks.
-test <test> --test <test> Test parameter, used when testing some new functionality in development. When !=-1, verbosity automatically on debug.

Running standalone scripts

The standalone scripts are saved in sources/Scritps. They can be ran using the file RunningScripts.cc. It is done by including the given header for your favorite script and then just call the function inside runWhatever(). This way, the mainfile does not need to know what script you use and does not have to be changed and recompiled all the time: only RunningScripts is then recompiled.

Running jobs on condor

Condor is installed at lhcba1. The submission file is called runToysHD.sub. In this file, the number of calls is specified. If I want to generate 500 toys, I set

queue 500

It calls condor.sh. In this file, the working directory is set (you need to set this by hand to fit your needs) and also the path to job.sh. In job.sh, the paht to the FCNCfitter executable needs to be set by hand. In this file, the executable is called with given options.

No, I also do not know why there is 20 files calling each other, but it works and I had no time to fix it, so there you go. Yes, it woudl be easier to have some automatic input with the options, but again, no time.

Since I haven't figured out a nice way how to force condor to save it's output organized in folders, there is a script called cleanup.sh. It moves the log, error report and outputfiles into neat folders. The name corresponds to the jobID (the number condor gives to the job). It cleans up after jobs specified in the loop inside cleanup.sh.

For readers convenience, python script that checks the condor output, checkConvergence.py, is included. It loops through the outputfiles and checks for failed Hesse and failed Squared Hesse. The script is not perfect and very quickly written, however it should work more or less.