Angular analysis of B+->K*+(K+pi0)mumu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

593 lines
23 KiB

  1. //Renata Kopecna
  2. #include <paths.hh>
  3. #include <sstream>
  4. #include <spdlog.h>
  5. #include "Helpers/helpers.hh"
  6. //=====================================//
  7. // Paths for datsets //
  8. //=====================================//
  9. std::string datapath(){ //Returns the path where the data is stored based on the server/user
  10. char cwd[256];
  11. if (getcwd(cwd, sizeof(cwd)) != NULL) {
  12. spdlog::debug("CURRENT DATA DIRECTORY: "+std::string(cwd));
  13. if(strstr(cwd, "kopecna")){
  14. if(strstr(cwd, "cern")) return "TODO/ADD/PATH/TO/FILES/ON/LXPLUS";//for lxplus //TODO @Renata
  15. if(strstr(cwd, "home")) return "/home/lhcb/kopecna/B2KstarMuMu_clean/Data/Tuples/";//for HD servers
  16. }
  17. if(strstr(cwd, "dgerick")){
  18. if(strstr(cwd, "cern")) return "/afs/cern.ch/work/d/dgerick/b2kmm/data/";//for lxplus
  19. if(strstr(cwd, "work")) return "/home/lhcb/kopecna/B2KstarMuMu_clean/Data/Tuples/";//for HD servers
  20. }
  21. if(strstr(cwd, "condor")) return "/afs/cern.ch/work/d/dgerick/b2kmm/data/";//for condor
  22. }
  23. //default value:
  24. spdlog::warn("None of the expected data paths are found! Setting workpath to the default \n /home/lhcb/kopecna/B2KstarMuMu_clean/Data/Tuples/");
  25. return "/home/lhcb/kopecna/B2KstarMuMu_clean/Data/Tuples/";
  26. }
  27. std::string workpath(){ //Returns the path where the program is executed based on the server/user
  28. char cwd[256];
  29. if (getcwd(cwd, sizeof(cwd)) != NULL) {
  30. spdlog::debug("CURRENT WORKING DIRECTORY: "+std::string(cwd));
  31. if(strstr(cwd, "kopecna")){
  32. if(strstr(cwd, "cern")) return "TODO/ADD/PATH/TO/FCNCFITTER/ON/LXPLUS";//for lxplus //TODO @Renata
  33. if(strstr(cwd, "home")) return "/home/lhcb/kopecna/B2KstarMuMu_clean/Code/FCNCFitter/";//for HD servers
  34. }
  35. if(strstr(cwd, "dgerick")){
  36. if(strstr(cwd, "cern")) return "/afs/cern.ch/work/d/dgerick/b2kmm/";//for lxplus
  37. if(strstr(cwd, "work")) return "/home/lhcb/kopecna/B2KstarMuMu_clean/Code/FCNCFitter/";//for HD servers
  38. }
  39. if(strstr(cwd, "condor")) return "/afs/cern.ch/work/d/dgerick/b2kmm/";//for condor
  40. }
  41. //default value
  42. spdlog::warn("None of the expected workpaths are found! Setting workpath to the default \n /home/lhcb/kopecna/B2KstarMuMu_clean/Code/FCNCFitter/");
  43. return "/home/lhcb/kopecna/B2KstarMuMu_clean/Code/FCNCFitter/";
  44. }
  45. std::string get_folderName_from_jobID(int dataset, std::string decayName){
  46. if(dataset == 0) return "Data/"+ decayName+ "_";
  47. else if(dataset == 1) return "MC/"+ decayName + "_MC";
  48. else if(dataset == 2) return "MC/"+ decayName + "_RefMC";
  49. else if(dataset == 3) return "PHSP/"+ decayName + "_PHSP";
  50. else if(dataset == 4 || dataset == 5) return "";
  51. else {
  52. spdlog::error("Invalid index for conversion function given: {0:d}", dataset);
  53. assert(0);
  54. }
  55. }
  56. std::string getSelectedTuplePath(int dataset, int run, int year){
  57. if (dataset==4) return "/home/lhcb/kopecna/B2KstarMuMu_clean/Data/Tuples/PHSP/EvtGen/AtRest/MCTruth_PHSP.root";
  58. else if (dataset ==5) return "/home/lhcb/kopecna/B2KstarMuMu_clean/Data/Tuples/MC/EvtGen/AtRest/MCTruth.root";
  59. else return DATA_PATH + get_folderName_from_jobID(dataset, DECAY_NAME) +"_BDToutputSelection_Run"+std::to_string(run)+"_" +std::to_string(year)+".root";
  60. }
  61. std::string get_theFCNCpath(int dataset, int run){
  62. //standard output for [0]: data, [1]: signal MC, [2]: reference channel MC, [3]: phase-space MC, [4]: genLevelMC
  63. UInt_t loadingRun = (run > 20) ? 2 : run;
  64. std::string theFCNCpath = DATA_PATH
  65. + DECAY_NAME
  66. + "_Run"+std::to_string(loadingRun);
  67. if (dataset == 0) return theFCNCpath + "_FCNC.root";
  68. if (dataset == 1) return theFCNCpath + "_MC_FCNC.root";
  69. if (dataset == 2) return theFCNCpath + "_RefMC_FCNC.root";
  70. if (dataset == 3) return theFCNCpath + "_PHSP_FCNC.root";
  71. if (dataset == 4) return theFCNCpath + "_PHSP_EvtGen_FCNC.root";
  72. if (dataset == 5) return theFCNCpath + "_MC_EvtGen_FCNC.root";
  73. return "";
  74. }
  75. std::string get_finalToySamplePath(int nPDF, int job_id, bool fitReference){
  76. return std::string("FinalToySample_")+(fitReference ? "Jpsi_" : "")+std::to_string(job_id)+"_PDF"+std::to_string(nPDF)+".root";
  77. }
  78. //=====================================//
  79. // Paths for angular parametrization //
  80. //=====================================//
  81. std::string get_angCorrPath(bool test){
  82. if (test) return PLOTS_PATH + "/angular/test/";
  83. else return PLOTS_PATH + "/angular/";
  84. }
  85. std::string coeffs_eff_phsp_4D(fcnc::options *opts){
  86. std::string filename = COEFFS_PATH+"Coeffs_"
  87. + DECAY_NAME + "_"
  88. + "Run" + std::to_string(opts->run)
  89. + ((opts->angacccorrperyear && opts->year != -1) ? "_"+std::to_string(opts->year) : "")
  90. // + (opts->full_angular ? "" : "_folding"+std::to_string(opts->folding))
  91. + (opts->systematic == 1 ? "_bs"+std::to_string(opts->job_id) : "")
  92. + (opts->systematic == 2 ? "_sym_ctl" : "")
  93. + (opts->systematic == 3 ? "_"+std::to_string(opts->orderincrease)+"moreOrders" : "")
  94. + (opts->systematic == 4 ? "_dw"+std::to_string(opts->job_id) : "")
  95. + (opts->systematic == 9 ? "_trg" : "")
  96. + (opts->systematic == 10 ? "_ksPT" : "")
  97. +".txt";
  98. return filename;
  99. }
  100. //=====================================//
  101. // Paths for angular resolution //
  102. //=====================================//
  103. std::string get_angResoFolder_path(){
  104. return PLOTS_PATH+"angReso/";
  105. }
  106. std::string get_angResoPlot_path(std::string angle, int year, std::string format){
  107. return get_angResoFolder_path() + "/Reso_"+angle+"_"+std::to_string(year) + "." + format;
  108. }
  109. //=====================================//
  110. // Paths for fit results //
  111. //=====================================//
  112. std::string subfolder_path(bool Ref){
  113. if (Ref) return "Jpsi/";
  114. else return "Signal/";
  115. }
  116. std::string get_MainFitPlot_path(){
  117. return PLOTS_PATH+"MainFit/";
  118. }
  119. std::string get_MCfitPlot_path(){
  120. return PLOTS_PATH+"MCfit/";
  121. }
  122. std::string get_scan_path(){
  123. return PLOTS_PATH+"Scans/";
  124. }
  125. std::string get_MCfitPlot_path(bool Ref, bool PHSP){
  126. if (PHSP){
  127. return get_MCfitPlot_path()+"/PHSP/" + subfolder_path(Ref);
  128. }
  129. else{
  130. return get_MCfitPlot_path() + subfolder_path(Ref);
  131. }
  132. }
  133. std::string get_genLvlFitPlot_path(bool PHSP){
  134. if (PHSP) return PLOTS_PATH+"GenLvlFit/PHSP/";
  135. else return PLOTS_PATH+"GenLvlFit/";
  136. }
  137. std::string get_MoMPlot_path(){
  138. return PLOTS_PATH+"MoMFit/";
  139. }
  140. std::string get_GenLvlPlot_path(){
  141. return PLOTS_PATH+"GenLvlFit/";
  142. }
  143. std::string get_PullPlot_path(){
  144. return PLOTS_PATH+"Pulls/";
  145. }
  146. std::string get_JpsiSimFit2D_path(int idx, bool pPrimes){ //TODO
  147. return FIT_RESULTS_PATH+"fitresult_JpsiFit_SimultaneousFit_2Dfit_pdf"+std::to_string(idx)+
  148. std::string(pPrimes ? "_Pprimes" : "") + ".txt";
  149. }
  150. std::string get_SigMCSimFit2D_path(int idx, int bin){ //TODO
  151. return FIT_RESULTS_PATH+"/fitresult_SignalFit_MC_SimultaneousFit_2Dfit_bin"+std::to_string(bin)+"_pdf"+std::to_string(idx)+".txt";
  152. }
  153. std::string get_param_scan_path(std::string name, bool error){
  154. return get_scan_path()
  155. + std::string(error ? "error_" : "value_")
  156. + name + ".eps";
  157. }
  158. //=====================================//
  159. // Fit result tags //
  160. //=====================================//
  161. std::string tag_bin(int nBinsToFit){
  162. std::ostringstream label;
  163. if(nBinsToFit==1) label << "_1BIN";
  164. else if(nBinsToFit==NBINS_DEFAULT) label << "_ALLBINS";
  165. else label << "_" << nBinsToFit << "BINS";
  166. return label.str();
  167. }
  168. std::string tag_bin(int nBinsToFit, int bin){
  169. std::ostringstream label;
  170. label << tag_bin(nBinsToFit);
  171. label << std::string(bin == -1 ? "" : ("_bin" + std::to_string(bin)));
  172. //TODO: check what bin == -1 does
  173. return label.str();
  174. }
  175. std::string tag_Run(int Run){
  176. return "_Run" + std::to_string(Run);
  177. }
  178. std::string tag_OnlyOneRun(int Run){
  179. if (Run == 1) return "_OnlyRun1";
  180. if (Run == 2) return "_OnlyRun2";
  181. else return tag_Run(Run);
  182. }
  183. std::string tag_Run(int Run, int effRun){
  184. if (effRun == Run) return tag_OnlyOneRun(Run);
  185. else return tag_Run(effRun);
  186. }
  187. std::string tag_OnlyOnePolarity(int polarity){
  188. if(polarity==-1) return "_OnlyMagDown";
  189. if(polarity==+1) return "_OnlyMagUp";
  190. else return "";
  191. }
  192. std::string tag_massSideband(bool lowMass, bool highMass){
  193. if(lowMass) return ("_LowBmass");
  194. if(highMass) return ("_HighBmass");
  195. else return "";
  196. }
  197. std::string tag_sample_blind(basic_params params){
  198. return tag_OnlyOneRun(params.Run)+
  199. tag_OnlyOnePolarity(params.polarity);
  200. }
  201. std::string tag_sample_blind(int Run, int polarity){
  202. return tag_OnlyOneRun(Run)+
  203. tag_OnlyOnePolarity(polarity);
  204. };
  205. std::string tag_datasample(bool fitReference, bool fitMC, bool fitPHSP){
  206. std::ostringstream label;
  207. if(fitMC) label << "_MC";
  208. if(fitPHSP) label << "_PHSP";
  209. if(fitReference) label << "_JpsiFit";
  210. else label << "_SignalFit";
  211. return label.str();
  212. }
  213. std::string tag_folding(int folding){
  214. if(folding!=-1) return "_folding" + std::to_string(folding);
  215. else return "";
  216. }
  217. std::string tag_observables(bool usePprime){
  218. if(usePprime) return "_Pprimes";
  219. else return "";
  220. }
  221. std::string tag_simFit(bool SimultaneousFit){
  222. if(SimultaneousFit) return "_SimultaneousFit";
  223. else return "_IndividualFit";
  224. }
  225. std::string tag_splitFit(bool splitRuns){
  226. if(splitRuns) return "";
  227. else return "_BothRuns";
  228. }
  229. std::string tag_partialFit(bool onlyAng, bool onlyMass){
  230. if (onlyAng) return "_OnlyAngles";
  231. else if (onlyMass) return "_OnlyMass";
  232. else return "";
  233. }
  234. std::string tag_onlyBkgSig(bool onlySig, bool onlyBkg){
  235. if (onlySig) return "_OnlySignal";
  236. else if (onlyBkg) return "_OnlyBackground";
  237. else return "";
  238. }
  239. std::string tag_jobID(int jobID){
  240. if (jobID == -1) return "";
  241. else return "_" + std::to_string(jobID) + "_"; //Add _ for easy identification of the id in case of some script needed
  242. }
  243. std::string tag_systematics(int systematics, int moreOrders = 0){
  244. switch (systematics){
  245. case -1: return "";
  246. case 1: return "_bs";
  247. case 2: return "_sym_ctl";
  248. case 3: return "_"+std::to_string(moreOrders)+"moreOrders";
  249. case 4: return "_dw";
  250. case 5: return "_rndFS";
  251. case 6: return "_angreso";
  252. case 7: return "_mm";
  253. case 8: return "_angbkg";
  254. case 9: return "_trggr";
  255. case 10: return "_kspt";
  256. case 11: return "_bkg_veto";
  257. }
  258. return "_WrongSystematics"; //If nada, return an emergency name (and not empty string, because that means no systematics
  259. }
  260. std::string tag_statFraction(double frac){
  261. if (frac==1.0) return "";
  262. else return "_statFrac" + std::to_string(frac);
  263. //TODO: add Jpsi with rare stats
  264. }
  265. //----------------------------------------------------------------------------
  266. // Paths for main fit
  267. //----------------------------------------------------------------------------
  268. std::string get_MainFitResult_path(){
  269. return FIT_RESULTS_PATH+"MainFit/";
  270. }
  271. std::string final_result_name(bool fitReference, bool fitSignalMC, basic_params params,
  272. bool simFit, int nBinsToFit, int effRun,
  273. bool FitFinalToySamples, double statFrac,
  274. bool NP, int systematics){
  275. return get_MainFitResult_path() + "fitresult"
  276. + tag_datasample(fitReference, fitSignalMC, false)
  277. + tag_bin(nBinsToFit,-1)
  278. + tag_simFit(simFit)
  279. + tag_folding(params.folding)
  280. + tag_observables(params.usePprime)
  281. + tag_Run(params.Run, effRun)
  282. + tag_OnlyOnePolarity(params.polarity)
  283. + tag_systematics(systematics)
  284. + tag_statFraction(statFrac)
  285. + std::string(FitFinalToySamples ? "_FinalToys" : "")
  286. + tag_jobID(params.jobID)
  287. + std::string(NP ? "_NP" : "")
  288. + ".root";
  289. }
  290. std::string get_eps_label(bool fitReference, bool fitSignalMC, bool fitPHSP,
  291. bool FitFinalToySamples,
  292. int nBinsToFit, int bin,
  293. int polarity,
  294. bool SimultaneousFit, fcnc::options opts){
  295. return tag_datasample( fitReference, fitSignalMC, fitPHSP).erase(0,1)
  296. + std::string(FitFinalToySamples ? "_FinalToys" : "")
  297. + tag_bin(nBinsToFit,bin)
  298. + tag_simFit(SimultaneousFit)
  299. + tag_folding(opts.folding)
  300. + tag_observables(opts.fit_pprimes)
  301. + tag_sample_blind(opts.run, polarity);
  302. }
  303. std::string get_eps_label(bool fitReference, bool fitSignalMC, bool fitPHSP,
  304. bool FitFinalToySamples,
  305. int nBinsToFit, int bin,
  306. bool SimultaneousFit, basic_params params){
  307. return tag_datasample( fitReference, fitSignalMC, fitPHSP).erase(0,1)
  308. + std::string(FitFinalToySamples ? "_FinalToys" : "")
  309. + tag_bin(nBinsToFit,bin)
  310. + tag_simFit(SimultaneousFit)
  311. + tag_folding(params.folding)
  312. + tag_observables(params.usePprime)
  313. + tag_sample_blind(params);
  314. }
  315. //----------------------------------------------------------------------------
  316. // Paths for MC fit
  317. //----------------------------------------------------------------------------
  318. std::string get_MCfit_label(bool fitReference, bool fitPHSP,
  319. int nBinsToFit, int bin,
  320. bool simFit,
  321. basic_params params, int effRun,
  322. bool onlyAng, bool onlyMass){
  323. //eff Run is there in case of plotting the results separately for each run when doing a simultaneous fit in ti
  324. return tag_datasample(fitReference,true,fitPHSP).erase(0,1)
  325. + tag_bin(nBinsToFit,bin)
  326. + tag_simFit(simFit)
  327. + tag_folding(onlyMass ? -1 : params.folding)
  328. + tag_observables(params.usePprime)
  329. + tag_Run(params.Run, effRun)
  330. + tag_OnlyOnePolarity(params.polarity)
  331. + tag_partialFit(onlyAng,onlyMass);
  332. }
  333. std::string finalResult_MCfit_txt(int nPDF, bool fitReference, bool fitPHSP,
  334. int nBinsToFit, int bin,
  335. bool simFit,
  336. basic_params params, int effRun,
  337. bool onlyAng, bool onlyMass){
  338. return FIT_RESULTS_PATH +
  339. "MCfit/fitresult_" +
  340. get_MCfit_label(fitReference, fitPHSP,
  341. nBinsToFit, bin,
  342. simFit, params, effRun,
  343. onlyAng, onlyMass) +
  344. "_pdf" + std::to_string(nPDF) + ".txt";
  345. }
  346. std::string final_result_name_MC(basic_params params, int nBins, bool fitReference, bool fitPHSP, bool simFit, bool onlyAng, bool onlyMass){
  347. return FIT_RESULTS_PATH
  348. +"MCfit/finalresult_"
  349. + get_MCfit_label(fitReference, fitPHSP,
  350. nBins, -1,
  351. simFit, params, params.Run,
  352. onlyAng,onlyMass)
  353. + ".root";
  354. }
  355. //----------------------------------------------------------------------------
  356. // Paths for GenLvl MC fit
  357. //----------------------------------------------------------------------------
  358. std::string get_genLvlFit_label(bool fitPHSP, int nBinsToFit, int bin, basic_params params,
  359. bool onlyAng, bool onlyMass){
  360. return "genLvl" + tag_datasample(false,true,fitPHSP)
  361. + tag_bin(nBinsToFit,bin)
  362. + tag_folding(params.folding)
  363. + tag_observables(params.usePprime)
  364. + tag_partialFit(onlyAng,onlyMass);
  365. }
  366. std::string finalResult_genLvlMCfit_txt(bool fitPHSP,
  367. int nBinsToFit, int bin,
  368. basic_params params,
  369. bool onlyAng, bool onlyMass){
  370. return FIT_RESULTS_PATH +
  371. "GenLvlFit/fitresult_" +
  372. get_genLvlFit_label(fitPHSP,nBinsToFit, bin, params, onlyAng, onlyMass) +
  373. "_pdf.txt";
  374. }
  375. std::string final_result_name_genLvlMC(basic_params params, int nBins, bool fitPHSP,
  376. bool onlyAng, bool onlyMass){
  377. return FIT_RESULTS_PATH
  378. +"GenLvlFit/finalresult_"
  379. + get_genLvlFit_label(fitPHSP, nBins, -1, params, onlyAng,onlyMass)
  380. + ".root";
  381. }
  382. //----------------------------------------------------------------------------
  383. // Paths for bkg fit
  384. //----------------------------------------------------------------------------
  385. std::string get_bkgFitPlot_path(){
  386. return PLOTS_PATH+"bkgFit/";
  387. }
  388. std::string get_bkgFitResult_path(){
  389. return FIT_RESULTS_PATH+"bkgFit/";
  390. }
  391. std::string get_bkg_tag(int bin, int nBins, bool fitReference, bool lowMass, bool highMass, bool fitKpi, basic_params params){
  392. return "Bckgnd"
  393. + tag_datasample(fitReference,false, false)
  394. + tag_bin(nBins,bin)
  395. + tag_Run(params.Run)
  396. + tag_OnlyOnePolarity(params.polarity)
  397. + tag_massSideband(lowMass,highMass)
  398. + tag_folding(params.folding)
  399. + std::string(fitKpi ? "_Kpi" : "");
  400. }
  401. std::string get_bkgCorrPlot_path(std::string ang1, std::string ang2, int bin, int nBins, bool fitReference, bool lowMass, bool highMass, bool fitKpi, basic_params params){
  402. return get_bkgFitPlot_path()
  403. +"Background_Correlation_"+ang1+"_"+ang2+"_"
  404. +get_bkg_tag(bin, nBins,fitReference, lowMass, highMass, fitKpi, params)
  405. +".eps";
  406. }
  407. std::string final_result_name_bkg(int nBins, bool fitReference, bool lowMass, bool highMass, bool fitKpi, basic_params params){
  408. return get_bkgFitResult_path() + "finalresult_"
  409. +get_bkg_tag(-1, nBins,fitReference, lowMass, highMass, fitKpi, params)
  410. + ".root";
  411. }
  412. //----------------------------------------------------------------------------
  413. // Paths for mass fit
  414. //----------------------------------------------------------------------------
  415. std::string get_MassFitPlot_path(){
  416. return PLOTS_PATH+"MassFit/";
  417. }
  418. std::string get_MassFitResult_path(){
  419. return FIT_RESULTS_PATH+"MassFit/";
  420. }
  421. std::string get_MassFit_label(bool fitReference, int bin, int nBins, bool splitRuns, basic_params params, int effRun){
  422. //eff Run is there in case of plotting the results separately for each run when doing a simultaneous fit in ti
  423. return "massfit" + tag_datasample(fitReference,false, false)
  424. + tag_bin(nBins,bin)
  425. + tag_splitFit(splitRuns)
  426. + tag_observables(params.usePprime)
  427. + tag_Run(params.Run, effRun)
  428. + tag_OnlyOnePolarity(params.polarity);
  429. }
  430. std::string final_result_name_mass(bool fitReference, int nBins, bool splitRuns, basic_params params, int effRun){
  431. return get_MassFitResult_path() + "finalresult_"
  432. +get_MassFit_label(fitReference, -1, nBins, splitRuns, params, effRun)
  433. + ".root";
  434. }
  435. //----------------------------------------------------------------------------
  436. // Paths for toys fit
  437. //----------------------------------------------------------------------------
  438. std::string get_ToysFitPlot_path(basic_params params){
  439. if(params.index > -1){
  440. std::string name = PLOTS_PATH + "Toys/" + std::to_string(params.index) + "/";
  441. if(!existsTest(name))makeFolder(name);
  442. return name;
  443. }
  444. return PLOTS_PATH+"Toys/";
  445. }
  446. std::string get_ToysFitResult_path(basic_params params){
  447. //create a subfolder in fitResults/Toys/ whenever the index option is set:
  448. if(params.index > -1){
  449. std::string name = FIT_RESULTS_PATH + "ToysFit/" + std::to_string(params.index) + "/";
  450. if(!existsTest(name))makeFolder(name);
  451. return name;
  452. }
  453. return FIT_RESULTS_PATH+"ToysFit/";
  454. }
  455. std::string get_ToysFit_label(int jobID, bool fitReference, int bin, int nBins, bool simFit, basic_params params, int effRun, bool onlyAng, bool onlyMass, bool onlySig, bool onlyBkg, bool lowMass, bool highMass){
  456. //eff Run is there in case of plotting the results separately for each run when doing a simultaneous fit
  457. return "toyfit_"
  458. + tag_jobID(jobID)
  459. + tag_datasample(fitReference,false, false)
  460. + tag_onlyBkgSig(onlySig,onlyBkg)
  461. + tag_partialFit(onlyAng,onlyMass)
  462. + tag_bin(nBins,bin)
  463. + tag_Run(params.Run, effRun)
  464. + tag_simFit(simFit)
  465. + tag_folding(params.folding)
  466. + tag_observables(params.usePprime)
  467. + tag_massSideband(lowMass,highMass)
  468. + tag_OnlyOnePolarity(params.polarity);
  469. }
  470. std::string final_result_name_toys(int jobID, bool fitReference, int nBins, bool simFit, basic_params params, int effRun, bool onlyAng, bool onlyMass, bool onlySig, bool onlyBkg, bool lowMass, bool highMass){
  471. return get_ToysFitResult_path(params) + "finalresult_"
  472. +get_ToysFit_label(jobID, fitReference, -1, nBins, simFit, params, effRun, onlyAng, onlyMass, onlySig, onlyBkg, lowMass, highMass)
  473. + ".root";
  474. }
  475. std::string init_params_name_toys(int jobID, bool fitReference, int nBins, bool simFit, basic_params params, int effRun, bool onlyAng, bool onlyMass, bool onlySig, bool onlyBkg, bool lowMass, bool highMass){
  476. return get_ToysFitResult_path(params) + "initParams_"
  477. +get_ToysFit_label(jobID, fitReference, -1, nBins, simFit, params, effRun, onlyAng, onlyMass, onlySig, onlyBkg, lowMass, highMass)
  478. + ".root";
  479. }
  480. std::string get_finalToys_file(bool fitReference, int nBins, bool simFit, basic_params params, int effRun){
  481. return TOYS_PATH + "Toy_"
  482. +get_ToysFit_label(-1, fitReference, -1, nBins, simFit, params, effRun, false, false, false, false, false, false)
  483. + ".root";
  484. }
  485. std::string get_ToyPullPlot_folder( basic_params params){
  486. return get_ToysFitPlot_path(params)
  487. +"/"+std::to_string(params.jobID)+"/";
  488. }
  489. std::string get_ToyPullPlot_tag(int bin, std::string varName, basic_params params, bool dist, bool pull){
  490. return get_ToyPullPlot_folder(params)
  491. + varName
  492. + "_bin"+std::to_string(bin) //FUCKING KILL ME
  493. + (dist ? "_dist" : (pull ? "_Pulls" : "_Res"));
  494. }
  495. //=====================================//
  496. // Paths for Latex couts //
  497. //=====================================//
  498. //THIS IS TODO, BIG TIME
  499. std::string get_Latex_noteFile(std::string tag){
  500. return LATEX_PATH + "latex_couts"+tag+".tex";
  501. }
  502. std::string latex_fitterFile(std::string index){
  503. return "_fit_" + index;
  504. }
  505. std::string latex_toyFile(){
  506. return "_toy";
  507. }
  508. std::string latex_params(){
  509. return "_params";
  510. }
  511. std::string latex_paramScan(){
  512. return "_paramsScan";
  513. }
  514. std::string latex_bkgFit(){
  515. return "_bkgFit";
  516. }
  517. std::string latex_massFit(){
  518. return "_massFit";
  519. }