19 {
20
21 if(argc < 2){
22 ::Error("main()","Please provide a DSID to be checked!");
23 return 0;
24 }
25
26 bool valfile = false;
27 bool genmode = false;
28 if(argc > 2){
29 if(
atoi(argv[2]) == 1){
30 std::cout << "--- File Validation Mode ----" << std::endl;
31 valfile = true;
32 }
33 else if(
atoi(argv[2]) == 2){
34 std::cout << "--- Generator info Mode ----" << std::endl;
35 genmode = true;
36 }
37 }
38 if(!valfile)
39 std::cout << "--- Wrapper Validation Mode ----" << std::endl;
40
41
42
43 SUSY::CrossSectionDB my_XsecDB(gSystem->ExpandPathName(
"$ROOTCOREBIN/data/SUSYTools/mc15_13TeV/"));
44
45
47 pmgxs.
setTypeAndName(
"PMGTools::PMGCrossSectionTool/PMGCrossSectionTool");
49 pmgxs->readInfosFromDir(gSystem->ExpandPathName("$ROOTCOREBIN/data/PMGTools/"));
50
51
53
54
55
56
57 if(!valfile){
58
60
61
62 std::cout << "ST_CrossSection name : " << my_XsecDB.name(dsid) << std::endl;
63 std::cout << "ST_CrossSection xs : " << my_XsecDB.xsectTimesEff(dsid) << std::endl;
64 std::cout << "ST_CrossSection raw : " << my_XsecDB.rawxsect(dsid) << std::endl;
65 std::cout << "ST_CrossSection k : " << my_XsecDB.kfactor(dsid) << std::endl;
66 std::cout << "ST_CrossSection eff : " << my_XsecDB.efficiency(dsid) << std::endl;
67
68
69 std::cout << "PMG_CrossSection name : " << pmgxs->getSampleName(dsid) << std::endl;
70 std::cout << "PMG_CrossSection xs : " << pmgxs->getSampleXsection(dsid) << std::endl;
71 std::cout << "PMG_CrossSection (AMI) : " << pmgxs->getAMIXsection(dsid) << std::endl;
72 std::cout << "PMG_CrossSection (k) : " << pmgxs->getKfactor(dsid) << std::endl;
73 std::cout << "PMG_CrossSection (eff) : " << pmgxs->getFilterEff(dsid) << std::endl;
74
75
76 std::cout << "STPMG_CrossSection name : " << my_XsecDBPMG.name(dsid) << std::endl;
77 std::cout << "STPMG_CrossSection xs : " << my_XsecDBPMG.xsectTimesEff(dsid) << std::endl;
78 std::cout << "STPMG_CrossSection raw : " << my_XsecDBPMG.rawxsect(dsid) << std::endl;
79 std::cout << "STPMG_CrossSection k : " << my_XsecDBPMG.kfactor(dsid) << std::endl;
80 std::cout << "STPMG_CrossSection eff : " << my_XsecDBPMG.efficiency(dsid) << std::endl;
81
82 }
83
84 else if (genmode){
85 std::vector<int>
ids = pmgxs->getLoadedDSIDs();
86 for(auto id : ids){
87 std::string genname="SHOWER";
88 std::cout << id << "\t"
89 << genname << std::endl;
90 }
91 }
92
93 else if (valfile){
94
95
96
97 std::vector<int>
ids = pmgxs->getLoadedDSIDs();
98
99 for(auto id : ids){
100
101
102 if(my_XsecDB.xsectTimesEff(id) < 0) continue;
103
104 TString
cmd = Form(
"grep \"%d\" PMGTools/data/*.txt | cut -d: -f1 >> PMG_id_file.txt",
id);
105 gSystem->Exec(cmd);
106
107 std::string shortname = pmgxs->getSampleName(id).erase(0,18);
108 std::string delim="\t";
109
110 std::cout << id << delim
111 << shortname << delim
112 << my_XsecDB.xsectTimesEff(id) << delim
113 << pmgxs->getSampleXsection(id) << delim
114 << my_XsecDB.rawxsect(id) << delim
115 << pmgxs->getAMIXsection(id) << delim
116 << my_XsecDB.kfactor(id) << delim
117 << pmgxs->getKfactor(id) << delim
118 << my_XsecDB.efficiency(id) << delim
119 << pmgxs->getFilterEff(id)
120 << std::endl;
121 }
122 }
123
124
125 return 0;
126}
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...