leave this commented here - now instead of bombing out if we don't specify the reference file, just carry on as if it was not specified at all, so as this changes the external behaviour of the code we want this retained
don't fail anymore if can't open the reference file, now continue without plotting the refereces, instead printing a warning on the plots
we divide the resolutions by these values if we have an "entries" histogram to tell us how many events there are overall
set up the correct reference chain names ...
read config in from a file if requested ...
pointless root data types ...
words can not express the sheer unpleasantness in trying to do anything serious with subpanels
leave this code commented here for the time being ... if ( histo.name()=="pT" || histo.name()=="pT_rec" ) ypos = 0.19;
legends ....
leave these comments here for testing ...
get the actual chain name and track collection from the Chain histogram if present
do we need these ? - keep for the time being ...
Actually DO refit the references - if we are adding together many resplots, then the means etc may not even have been calculated
leave this code commented here since we want to know where to change this in the future it was added for a reason, so is useful to keep for now
useful test for debugging ...
do we still need to prevent the x transaltion ? need to check ...
leave this code commented here since we want to know where to change this in the future it was added for a reason, so useful to keep for now
debugging ...
rebin if requested ...
leave for documentation purposes ...
again, this changes the external behaviour so we want to leave this "continue" in place, but commented
replace the "/" in the filename so we don't try to make plots in subdirectories by accident
sort out the range settings for the xaxis ...
this stuff is tricky to get right - leave this here until we know it will no loner be needed
keep the original equation by way of documentation ...
leave this code commented here since we want to know where to change this in the future it was added for a reason, so it is useful to keep for now
std::exit(-1);
calculate the required range such that the histogram labels won't crowd the points
actually draw the plot here ...
NB: now, we no longer print the individual plots - only the "panels" individual plots can still be printed by creating a "panel" which contains only that plots - in fast the "histos" item that before provided details of the separate plots is now interpreted as a list of single plot panels so this is done for you
debugging ...
973 {
974
976
978 std::cout << "\n---------------------------------\n";
979 std::cout << "\n comparitor is off ...\n";
980
981 if ( argc<4 )
return usage(argv[0], -1,
"too few arguments");
982
984
985 std::string
tag =
"";
986 std::string
key =
"";
987
988 std::string
dir =
"";
989
990 std::string ftestname = "";
991 std::string frefname = "";
992
993 TFile* ftest_ = 0;
994 TFile* fref_ = 0;
995
996 bool effset = false;
997 double effmin = 90;
998 double effmax = 102;
999
1000 std::string defreflabel = "";
1001
1003
1004 std::vector<std::string> usrlabels;
1005 bool uselabels = false;
1006 bool addinglabels = false;
1007
1008 std::vector<std::string> taglabels;
1009 std::vector<std::string> taglabels2;
1010 bool addingtags = false;
1011 bool addingtags2 = false;
1012
1013 bool lumiref_trans = false;
1014 bool lumitest_trans = false;
1015
1016 bool make_efficiencies = true;
1017
1018 bool make_ref_efficiencies = false;
1019 bool refit_resplots = false;
1020 bool refitref_resplots = false;
1021 bool bayes = true;
1022 bool nostats = false;
1023 bool nomeans = false;
1024 bool means = false;
1025 bool noref = false;
1026 bool atlasstyle = false;
1027 bool deleteref = false;
1028 bool nowatermark = false;
1029 bool noplots = false;
1030 bool nopng = false;
1031 bool nopdf = false;
1032 bool Cfile = false;
1033 bool notitle = true;
1034 bool dochi2 = false;
1035 bool normref = false;
1036 bool scalepix = false;
1037 bool oldrms = false;
1038 bool addchains = false;
1039 bool usechainref = false;
1041
1042 bool RANGEMAP = false;
1043 bool ALLRANGEMAP = false;
1044
1045 double xerror = 0;
1046
1047 std::string atlaslabel_tmp = "Internal";
1048
1049
1050 double scale_eff = -1;
1051 double scale_eff_ref = -1;
1052
1053 std::string configfile = "";
1054
1055 double xoffset = 0;
1056
1057
1058 double ypos_in = 0;
1059
1061 std::string
regex =
"";
1062
1063 std::string patternr = "";
1064 std::string regexr = "";
1065
1066 std::string patternt = "";
1067 std::string regext = "";
1068
1069 std::string basedir = "";
1070
1071 std::string xpattern = "";
1072 std::string xregex = "";
1073
1074 std::vector<std::string>
chains;
1075 std::vector<std::string> refchains;
1076
1077 bool addingrefchains = false;
1078
1079 std::string mapfile = "";
1080
1081 std::vector<std::string> chainfiles;
1082
1083 int ncols = 2;
1084
1086
1087 bool refbands = false;
1088
1089 for(
int i=1;
i<
argc;
i++){
1091
1092 ifdbg(
"\ncnt: " + arg );
1093
1094
1095 if (
arg.find(
'-')!=0 && addinglabels ) {
1099 usrlabels.push_back(
label );
1100 continue;
1101 }
1102 else addinglabels = false;
1103
1104 if (
arg.find(
'-')!=0 && addingrefchains ) {
1105 refchains.push_back( arg );
1106 continue;
1107 }
1108 else addingrefchains = false;
1109
1110 if (
arg.find(
'-')!=0 && addingtags ) {
1111 taglabels.push_back(
fullreplace( arg,
"__",
" " ) );
1112 std::cout << "\tadding tag label: " << taglabels.back() << std::endl;
1113 continue;
1114 }
1115 else addingtags = false;
1116
1117 if (
arg.find(
'-')!=0 && addingtags2 ) {
1118 taglabels2.push_back(
fullreplace( arg,
"__",
" " ) );
1119 std::cout << "\tadding tag label: " << taglabels2.back() << std::endl;
1120 continue;
1121 }
1122 else addingtags2 = false;
1123
1124 ifdbg(
"starting if cascade: "+arg );
1125
1126 if ( arg=="-h" || arg=="--help" ) {
1127 return usage(argv[0], 0);
1128 }
1129 else if ( arg=="-c" || arg=="--config" ) {
1130 if ( ++i<argc ) configfile=
argv[
i];
1131 else return usage(argv[0], -1,
"no config file provided");
1133 }
1134 else if ( arg=="--jl" ) {
1137 }
1138 else if ( arg=="--eps" ) {
1141 }
1142 else if ( arg=="-t" || arg=="--tag" ) {
1143 if ( ++i<argc )
tag=std::string(
"-")+
argv[
i];
1144 else return usage(argv[0], -1,
"no tag provided");
1146 }
1147 else if ( arg=="-l" || arg=="--labels" ) {
1148 addinglabels = true;
1150 }
1151 else if ( arg=="-el" ) {
1154 }
1155 else if ( arg=="-k" || arg=="--key" ) {
1157 else return usage(argv[0], -1,
"no key provided");
1159 }
1160 else if ( arg=="--run" ) {
1162 else return usage(argv[0], -1,
"no run number provided");
1164 }
1165 else if ( arg=="-m" || arg=="--mapfile" ) {
1166 if ( ++i<argc ) mapfile=
argv[
i];
1167 else return usage(argv[0], -1,
"no mapfile provided");
1169 }
1170 else if ( arg=="-d" || arg=="--dir" ) {
1172 else return usage(argv[0], -1,
"no directory provided");
1174 }
1175 else if ( arg=="--lumi" ) {
1176 lumitest_trans = true;
1177 lumiref_trans = true;
1179 }
1180 else if ( arg=="--lumitest" ) {
1181 lumitest_trans = true;
1182 ifdbg(
"--lumitest");
1183 }
1184 else if ( arg=="--lumiref" ) {
1185 lumiref_trans = true;
1187 }
1188 else if ( arg=="-rb" || arg=="--refbands" ) {
1189 refbands = true;
1190 ifdbg(
"--refbands");
1191 }
1192 else if ( arg=="-b" || arg=="--bdir" ) {
1193 if ( ++i<argc ) basedir=
argv[
i];
1194 else return usage(argv[0], -1,
"no directory provided");
1196 }
1197 else if ( arg=="--taglabels" ) {
1198 addingtags = true;
1199 ifdbg(
"--taglabels");
1200 }
1201 else if ( arg=="--taglabels2" ) {
1202 addingtags2 = true;
1203 ifdbg(
"--taglabels2");
1204 }
1205 else if ( arg=="--unscalepix" ) {
1206 scalepix = false;
1207 ifdbg(
"--unscalepix");
1208 }
1209 else if ( arg=="--scalepix" ) {
1210 scalepix = true;
1211 ifdbg(
"--scalepix");
1212 }
1213 else if ( arg=="-ac" || arg=="--addchains" ) {
1214 addchains = true;
1215 ifdbg(
"--sddchains");
1216 }
1217 else if ( arg=="-yrange" ) {
1218 effset = true;
1219 if ( ++i<argc ) effmin=std::atof(argv[i]);
1220 else return usage(argv[0], -1,
"no range specified");
1221 if ( ++i<argc ) effmax=std::atof(argv[i]);
1222 else return usage(argv[0], -1,
"no upper y limit specified");
1224 }
1225 else if ( arg=="-e" || arg=="--efficiencies" ) {
1226 make_ref_efficiencies = true;
1227 ifdbg(
"--efficiencies");
1228 }
1229 else if ( arg=="-r" || arg=="--refit" ) {
1230 refit_resplots = true;
1232 }
1233 else if ( arg=="-rr" || arg=="--refitref" ) {
1234 refitref_resplots = true;
1235 ifdbg(
"--refitref");
1236 }
1237 else if ( arg=="--oldrms" ) {
1238 oldrms = true;
1240 }
1241 else if ( arg=="-nw" || arg=="--nowatermark" ) {
1242 nowatermark = true;
1244 ifdbg(
"--nowatermark");
1245 }
1246 else if ( arg=="--chi2" ) {
1247 dochi2 = true;
1249 }
1250 else if ( arg=="-ns" || arg=="--nostats" ) {
1251 nostats = true;
1253 }
1254 else if ( arg=="-nm" || arg=="--nomeans" ) {
1255 nomeans = true;
1257 }
1258 else if ( arg=="--means" ) {
1259 means = true;
1261 }
1262 else if ( arg=="-nt" || arg=="--notitle" ) {
1263 notitle = true;
1265 }
1266 else if ( arg=="-nr" || arg=="--noref" ) {
1268 noref = true;
1270 }
1271 else if ( arg=="--normref" ) {
1272 normref = true;
1274 }
1275 else if ( arg=="-rc" || arg=="--refchains" ) {
1276 addingrefchains = true;
1277 ifdbg(
"--refchains");
1278 }
1279 else if ( arg=="-uc" || arg=="--usechainref" ) {
1280 usechainref = true;
1281 ifdbg(
"--usechainref");
1282 }
1283 else if ( arg=="-nb" || arg=="--nobayes" ) {
1284 bayes = false;
1286 }
1287 else if ( arg=="-es" || arg=="--effscale" ) {
1288 if ( ++i<argc ) scale_eff=std::atof(argv[i]);
1289 else return usage(argv[0], -1,
"no efficiency scale provided");
1290 ifdbg(
"--effscale");
1291 }
1292 else if ( arg=="-er" || arg=="--effscaleref" ) {
1293 if ( ++i<argc ) scale_eff_ref=std::atof(argv[i]);
1294 else return usage(argv[0], -1,
"no efficiency scale for the reference histograms provided");
1295 ifdbg(
"--effscaleref");
1296 }
1297 else if ( arg=="--ncols" ) {
1298 if ( ++i<argc ) ncols=std::atoi(argv[i]);
1299 else return usage(argv[0], -1,
"no number of columns provided");
1301 }
1302 else if ( arg=="-np" || arg=="--noplots" ) {
1303 noplots = true;
1305 }
1306 else if ( arg=="-C" || arg=="--Cfiles" ) {
1307 Cfile = true;
1309 }
1310 else if ( arg=="--deleteref" ) {
1311 deleteref = true;
1312 ifdbg(
"--deleteref");
1313 }
1314 else if ( arg=="--nopng" ) {
1315 nopng = true;
1317 }
1318 else if ( arg=="--nopdf" ) {
1319 nopdf = true;
1321 }
1322 else if ( arg=="-as" || arg=="--atlasstyle" ) {
1323 atlasstyle = true;
1324
1325 ifdbg(
"--atlasstyle");
1326 }
1327 else if ( arg=="--tp" ) {
1328 make_efficiencies = false;
1330 }
1331 else if ( arg=="-q" || arg=="--quiet" ) {
1334 }
1335 else if ( arg=="-al" || arg=="--atlaslabel" ) {
1336 if ( ++i<argc ) atlaslabel_tmp=
argv[
i];
1337 else return usage(argv[0], -1,
"no label provided");
1338 ifdbg(
"--atlaslabel");
1339 }
1340 else if ( arg=="-xo" || arg=="--xoffset" ) {
1341 if ( ++i<argc ) xoffset=std::atof(argv[i]);
1342 else return usage(argv[0], -1,
"no xoffset provided");
1344 }
1345 else if ( arg=="-yp" || arg=="--ypos" ) {
1346 if ( ++i<argc ) ypos_in=std::atof(argv[i]);
1347 else return usage(argv[0], -1,
"no y position provided");
1349 }
1350 else if ( arg=="-xe" || arg=="--xerror" ) {
1351 if ( ++i<argc ) xerror=std::atof(argv[i]);
1352 else return usage(argv[0], -1,
"no x error provided");
1354 }
1355 else if ( arg=="-s" || arg=="--swap" ) {
1357 else return usage(argv[0], -1,
"no patterns provided");
1359 else return usage(argv[0], -1,
"no target pattern provided");
1361 }
1362 else if ( arg=="--swapt" ) {
1363 if ( ++i<argc ) patternt=
argv[
i];
1364 else return usage(argv[0], -1,
"no patterns provided");
1365 if ( ++i<argc ) regext=
argv[
i];
1366 else return usage(argv[0], -1,
"no target pattern provided");
1368 }
1369 else if ( arg=="--swapr" ) {
1370 if ( ++i<argc ) patternr=
argv[
i];
1371 else return usage(argv[0], -1,
"no patterns provided");
1372 if ( ++i<argc ) regexr=
argv[
i];
1373 else return usage(argv[0], -1,
"no target pattern provided");
1375 }
1376 else if ( arg=="-sx" || arg=="--swapaxtitles" ) {
1377 if ( ++i<argc ) xregex=
argv[
i];
1378 else return usage(argv[0], -1,
"no target pattern provided");
1379 if ( ++i<argc ) xpattern=
argv[
i];
1380 else return usage(argv[0], -1,
"no patterns provided");
1381 ifdbg(
"--swapxtitles");
1382 }
1383 else if (
arg.find(
'-')==0 ) {
1384 std::cerr <<
"unknown option: " <<
arg <<
"\n" << std::endl;
1385 return usage(argv[0], -4);
1386 }
1387 else {
1388 ifdbg(
"arg: + "+arg);
1389 if ( ftestname==
"" ) ftestname =
arg;
1390 else if ( frefname==
"" ) frefname =
arg;
1391 else {
1392 std::string
file =
"";
1393
1394 if (
arg.find(
":file:")!=std::string::npos ) {
1396 chainfiles.push_back(
file );
1398 }
1399
1401
1405
1406 std::cout <<
"file: " <<
file <<
"\tchain: " <<
chain << std::endl;
1407
1408 }
1409 }
1410 }
1411
1412 if ( ftestname.empty() ) {
1413 std::cerr << "main(): test file not specified " << std::endl;
1414 return -1;
1415 }
1416
1417 if ( !
exists(ftestname) ) {
1418 std::cerr << "main(): test file " << ftestname << " does not exist" << std::endl;
1419 return -1;
1420 }
1421
1422 std::vector<TFile*> chainTFiles;
1423
1424 if ( chainfiles.size()==0 ) ftest_ = TFile::Open( ftestname.c_str() );
1425 else {
1426 noref=true;
1427 chainTFiles.resize(chainfiles.size());
1428 for (
size_t i=0 ;
i<chainfiles.size() ;
i++ ) {
1429 chainTFiles[
i] = TFile::Open( chainfiles[i].c_str() );
1430 if ( chainTFiles[i] == 0 ) {
1431 std::cerr <<
"\tfile: " << chainfiles[
i] <<
" could not be opened" << std::endl;
1432 return -1;
1433 }
1434 else std::cout <<
"\tchainfiles: " << chainfiles[
i] <<
" " << chainTFiles[
i] << std::endl;
1435 }
1436 }
1437
1438
1439 if ( noref==false ) {
1440 if ( frefname.empty() ) {
1441 std::cerr << "main(): ref file not specified " << std::endl;
1443 noref = true;
1448
1449 }
1450
1451 if ( frefname==ftestname ) fref_ = ftest_;
1452 else if (
exists(frefname) ) fref_ = TFile::Open( frefname.c_str() );
1453 else {
1454 std::cerr << "main(): ref file " << frefname << " does not exist" << std::endl;
1455
1457 noref=true;
1458 }
1459 }
1460 else fref_ = ftest_;
1461
1462 if ( chainfiles.size()==0 ) {
1463 if ( ftest_==0 ) {
1464 std::cerr << "could not open test file " << ftestname << std::endl;
1465 return -1;
1466 }
1467
1468 if ( noref==false && fref_==0 ) {
1469 std::cerr << "could not open files " << std::endl;
1473 noref=true;
1474 fref_=ftest_;
1475 defreflabel = "failed to open reference file";
1476 }
1477
1478 }
1479
1480 if ( scale_eff == -1 ) scale_eff = 100;
1481 if ( scale_eff_ref == -1 ) scale_eff_ref = scale_eff;
1482
1483
1484 bool noreftmp = noref;
1485
1486 if (
chains.size()==0 )
return usage(argv[0], -1,
"no chains specified");
1487
1488
1489 if ( basedir.size()>0 ) {
1490 if ( basedir[basedir.size()-1]!='/' ) basedir += "/";
1492 }
1493
1494 if ( refchains.size()>0 && refchains.size()!=
chains.size() )
return usage(argv[0], -1,
"not enough chains specified");
1495
1496 if ( refchains.size()==0 ) refchains =
chains;
1497
1498 std::vector<std::string> chainref(
chains.size(),
"");
1499 std::vector<std::string> chain_name(
chains.size(),
"");
1500
1501 std::vector<std::string> refchain(chainref.size(),"");
1502
1503
1504
1505 std::cout <<
argv[0] <<
" options:" << std::endl;
1506 std::cout << "\tATLAS style: " << ( atlasstyle ? "true" : "false" ) << std::endl;
1507 std::cout << "\tBayesian uncertainties: " << ( bayes ? "true" : "false" ) << std::endl;
1508 std::cout << "\trefit resplot uncertainties: " << ( refit_resplots ? "true" : "false" ) << std::endl;
1509 std::cout << "\tsuppress mean and rms stats: " << ( nostats ? "true" : "false" ) << std::endl;
1510 if ( !nostats ) std::cout << "\tsuppress meanstats: " << ( nomeans ? "true" : "false" ) << std::endl;
1511 std::cout << "\tsuppress png output: " << ( nopng ? "true" : "false" ) << std::endl;
1512 std::cout << "\tsuppress pdf output: " << ( nopdf ? "true" : "false" ) << std::endl;
1513 std::cout << "\tsuppress reference output: " << ( noref ? "true" : "false" ) << std::endl;
1514 std::cout << "\tuse chain references: " << ( usechainref ? "true" : "false" ) << std::endl;
1515 std::cout << "\tpanel ncols: " << ncols << std::endl;
1516
1517 if ( usrlabels.size()>0 ) std::cout << "\tlabels: " << usrlabels.size() << std::endl;
1518 if ( taglabels.size()>0 ) std::cout << "\textra text: " << taglabels << std::endl;
1519 if ( taglabels2.size()>0 ) std::cout << "\textra text: " << taglabels2 << std::endl;
1520
1521
1522 for (
size_t il=0 ;
il<usrlabels.size() ;
il++ ) {
1523 std::cout <<
"usr label[" <<
il <<
"] : " << usrlabels[
il] << std::endl;
1524 }
1525
1526 std::cout << "atlas style : " << atlasstyle << std::endl;
1527
1528 if ( atlasstyle ) {
1531 gStyle->cd();
1532 }
1533 else {
1534 gROOT->SetStyle("Plain");
1535 gStyle->cd();
1536 gStyle->SetLineScalePS(1);
1537 xoffset += 0.02;
1538 }
1539
1540 gStyle->SetErrorX(xerror);
1541
1542 gStyle->SetPadLeftMargin(0.15);
1543 gStyle->SetPadBottomMargin(0.15);
1544
1545 gStyle->SetPadRightMargin(0.02);
1546 gStyle->SetPadTopMargin(0.05);
1547
1548 std::cout << "Chains: " << std::endl;
1549 for (
unsigned ic=0 ;
ic<
chains.size() ;
ic++ ) std::cout <<
"\t" << chains[ic] << std::endl;
1550
1551 if ( usrlabels.size()>0 ) std::cout << "labels: " << usrlabels << std::endl;
1552
1553 if ( usrlabels.size()>0 && usrlabels.size()==
chains.size() ) uselabels =
true;
1554
1556
1557 TTree* dataTree = 0;
1558 TString* releaseData = new TString("");
1559 std::vector<std::string> release_data;
1560
1561
1562 if ( !nowatermark && ftest_ ) {
1563
1564 dataTree = (TTree*)ftest_->Get("dataTree");
1565
1566 if ( dataTree ) {
1567 dataTree->SetBranchAddress( "ReleaseMetaData", &releaseData);
1568
1569 for (
unsigned int i=0;
i<dataTree->GetEntries() ;
i++ ) {
1570 dataTree->GetEntry(i);
1571 release_data.push_back( releaseData->Data() );
1572 std::cout << "main() release data: " << release_data.back() << " : " << *releaseData << std::endl;
1573 }
1574 }
1575
1576 std::cout << "release data size " << release_data.size() << std::endl;
1577
1578 if ( release_data.size()>0 ) {
1579 if ( release_data.size()>1 ) std::cerr << "main() more than one release - using only the first" << std::endl;
1580
1581
1582
1583 std::string rd = release_data[0];
1584
1585 while ( rd.size()>0 ) {
1586
1588
1589 if (
contains(nightly,
"private" ) ) {
1590 for (
int ic=0 ;
ic<4 ;
ic++ )
chop(release_data[0],
" " );
1591 release +=
" (" + release_data[0]+
")";
1592 break;
1593 }
1594 else {
1595
1596 if (
contains(nightly,
"nightly") ) {
1597 chop( nightly,
"/" );
1600 break;
1601 }
1602
1603 }
1604 }
1605 }
1606 }
1607
1608 std::cout <<
"release: " <<
release << std::endl;
1609
1610
1611
1613
1615
1616 std::cout << "trying to make directory" << std::endl;
1619 if (
mkdir(
dir.c_str(), 0777 ) ) std::cerr <<
"main() couldn't create directory " <<
dir << std::endl;
1620 else std::cout <<
"main() output will be sent to directory " <<
dir << std::endl;
1621 }
1622 }
1623
1624 if ( ftest_==0 && chainTFiles.size()>0 ) fref_ = ftest_ = chainTFiles[0];
1625
1626 TFile* ftest = ftest_;
1627 TFile* fref = fref_;
1628
1630
1631 std::string rawrefrun = "";
1632 std::string refrun = "";
1633
1634 if ( fref_ ) refrun = rawrefrun =
findrun( fref );
1635
1636 std::cout <<
"testrun: " <<
testrun <<
"\nrefrun: " << refrun << std::endl;
1637
1638 if ( !
testrun.empty() && refrun != testrun ) {
1642 }
1643
1644 }
1645
1646 if ( !refrun.empty() ) {
1647
1648 std::string newtag = "Reference: ";
1649
1650 std::cout << "refrun: " << refrun << std::endl;
1651
1653 while ( (pos=refrun.find('_'))!=std::string::npos ) refrun.replace( pos, 1, " " );
1654 newtag += refrun;
1655
1656 std::string rawrun = refrun.erase( refrun.find("run"), 4 );
1657
1658 if (
contains(frefname, rawrun) ) {
1659
1660 std::string
release = frefname;
1661
1663
1669
1670 newtag += " ";
1672
1673 }
1674
1675 taglabels.push_back( newtag );
1676
1677 std::cout << "tag labels: " << taglabels << std::endl;
1678
1679 }
1680
1685 int NeventTest = 1;
1686 int NeventRef = 1;
1687
1688
1690
1691
1692 if ( !nowatermark ) {
1693
1694
1695 TH1D* htestev = (TH1D*)ftest->Get("event") ;
1696 TH1D* hrefev = (TH1D*)fref->Get("event") ;
1697
1698
1699
1700 std::cout << "htestev " << htestev << " " << hrefev << std::endl;
1701
1702 if ( htestev ) NeventTest = htestev->GetEntries();
1703 if ( hrefev ) NeventRef = hrefev->GetEntries();
1704
1706 }
1707 else {
1708 NeventTest = 1;
1709 NeventRef = 1;
1710 }
1711
1712
1713 if ( NeventTest>1 ) std::cout << "Nevents Test: " << NeventTest << std::endl;
1714 if ( NeventRef>1 ) std::cout << "Nevents Ref: " << NeventRef << std::endl;
1715
1717
1718 if ( mapfile.empty() ) mapfile = configfile;
1719
1720
1721 std::cout << "mapfile: " << mapfile << std::endl;
1722
1723 if ( !mapfile.empty() ) {
1724
1726
1727 if (
m.isTagDefined(
"ChainMap" ) ) {
1728
1729 std::vector<std::string>
chains =
m.GetStringVector(
"ChainMap" );
1730
1731 for (
size_t i=0 ;
i<
chains.size() ;
i+=2 ) std::cout <<
"map: " << chains[i] <<
" -> " << chains[i+1] << std::endl;
1732
1734
1735 for (
size_t i=0 ;
i<
chains.size() ;
i+=2 ) {
1736 chainmap->insert( chainmap_t::value_type( chains[i], chains[i+1] ) );
1737 }
1738
1739 std::cout << "\nusing chain map:" << std::endl;
1740
1741 for ( chainmap_t::iterator itr=chainmap->begin() ; itr!=chainmap->end() ; itr++ ) {
1742 std::cout << "\t" << itr->first << "\t" << itr->second << std::endl;
1743 }
1744 }
1745 }
1746
1748
1749 std::cout << "\ncreating chain and reference information ..." << std::endl;
1750
1751 for (
size_t j=0;
j<
chains.size();
j++) {
1752
1755
1757
1759 std::cout <<
"chain: " <<
chains[
j] <<
"\taddchains: " << addchains << std::endl;
1760
1761 if ( addchains && (
contains(chains[j],
"Shifter") || ( !
contains(chains[j],
"HLT_") && !
contains(chains[j],
"Fullscan" ) ) ) ) {
1762
1763 TFile* fftest = ftest;
1764
1765 if ( chainfiles.size()>0 && chainfiles.size()>j ) fftest = chainTFiles[
j];
1766
1767 TH1F* hchain =
Get( *fftest, chains[j]+
"/Chain", testrun );
1768
1769 if ( hchain ) {
1770
1771 std::string
name = hchain->GetTitle();
1772
1773 if ( usechainref && !
contains(chains[j],
"Purity") ) {
1774
1776
1777 std::cout <<
"new chainref: " << chainref[
j] << std::endl;
1778
1779 std::string::size_type
pos = chainref[
j].find(
":for");
1780 if ( pos!=std::string::npos ) chainref[
j].replace( pos, 4,
"_for" );
1781 std::replace( chainref[j].
begin(), chainref[j].
end(),
':',
'/');
1782 std::string newchain =
dirname(
dirname( chains[j]) ) +
"/Expert/" + chainref[
j];
1783 chainref[
j] = newchain;
1784
1785 std::cout <<
"final chainref: " << chainref[
j] << std::endl;
1786
1787 }
1788
1789 std::cout <<
"chainref: " << chainref[
j] << std::endl;
1790
1792
1793 std::cout <<
"name: " <<
name << std::endl;
1794
1795 if (
contains( name,
":" ) ) chain_name[
j] =
name.substr( 0,
name.find(
':') ) +
" : ";
1796 else chain_name[
j] =
name;
1797
1798 if ( chain_name[j] ==
" : " ) chain_name[
j] =
"";
1799
1800 std::cout <<
"chain_name: " << chain_name[
j] << std::endl;
1801 }
1802 }
1803 }
1804
1805 std::cout << "chainref size: " << chainref.size() << " " << refchains.size() << std::endl;
1806
1807 for (
size_t j=0 ;
j<chainref.size() ;
j++ ) {
1808 std::cout <<
"chainref: " << chainref[
j] <<
" :: " << refchains[
j] << std::endl;
1809
1811 if ( chainref[j]!=
"" ) refchain[
j] =
fullreplace( chainref[j], pattern, regex );
1812 else refchain[
j] =
fullreplace( refchains[j], pattern, regex );
1813
1814 if ( !patternr.empty() ) {
1815 if ( chainref[j]!=
"" ) refchain[
j] =
fullreplace( chainref[j], patternr, regexr );
1816 else refchain[
j] =
fullreplace( refchains[j], patternr, regexr );
1817 }
1818
1819 std::cout <<
"refchain: " << refchain[
j] << std::endl;
1820 }
1821
1822 std::cout << "done chains" << std::endl;
1823
1825
1826 std::vector<Panel> panels;
1827
1829
1831
1832
1833 std::vector<int> ccolours;
1834 std::vector<int> cstyles;
1835
1836 std::vector<std::string> ctags;
1837 std::vector<std::string> ctaglabels;
1838
1839
1840 std::cout <<
"\n" <<
argv[0] <<
"\tconfigfile: " << configfile << std::endl;
1841
1842 bool use_file_config = false;
1843
1844 if ( !configfile.empty() ) {
1845
1846 if (
exists(configfile) ) {
1847
1848 std::cout <<
argv[0] <<
":\treading configuration file " << configfile << std::endl;
1849
1851
1853
1854 std::cout << "searching for panels" << std::endl;
1855
1857
1858 if (
rc.isTagDefined(
"panels" ) ) {
1859
1860 std::cout <<
argv[0] <<
":\treading histogram panel configuration from file " << configfile << std::endl;
1861
1862 use_file_config = true;
1863
1864 std::vector<std::string> panel_config =
rc.GetStringVector(
"panels" );
1865
1866 std::vector<string> panel_columns;
1867
1868 if (
rc.isTagDefined(
"panel_columns") ) {
1869 panel_columns =
rc.GetStringVector(
"panel_columns" );
1870 if ( panel_columns.size()%2 )
return usage( argv[0], -1,
"incorrect panel settings" );
1871 }
1872
1873
1874 for ( size_t ipanel=panel_config.size() ; ipanel-- ; ) {
1875
1876 std::vector<std::string> raw_input =
rc.GetStringVector( panel_config[ipanel] );
1877
1878 int tncols = ncols;
1879
1880 if ( panel_columns.size() ) {
1881 std::vector<string>::iterator itr =
find( panel_columns.begin(), panel_columns.end(), panel_config[ipanel] );
1882 if ( itr!=panel_columns.end() ) tncols = std::atoi( (++itr)->c_str() );
1883 }
1884
1885 Panel p( panel_config[ipanel], tncols );
1886
1887 if ( raw_input.empty() ) {
1888 std::cerr << "no plots provided" << std::endl;
1889 return 1;
1890 }
1891
1892 for (
size_t iraw=0 ; iraw+6<=raw_input.size() ; iraw += 6 )
p.push_back( raw_input.begin()+iraw, raw_input.begin()+iraw+6 );
1893
1894 panels.push_back( p );
1895
1896 }
1897
1898 }
1899 else if (
rc.isTagDefined(
"histos" ) ) {
1900
1901 std::cout <<
argv[0] <<
":\treading histogram configuration from file " << configfile << std::endl;
1902
1903 use_file_config = true;
1904
1905 std::vector<std::string> raw_input =
rc.GetStringVector(
"histos" );
1906
1907 for ( size_t iraw=0 ; iraw+6<=raw_input.size() ; iraw += 6) {
1908 HistDetails h( raw_input.begin()+iraw, raw_input.begin()+iraw+6 );
1911 panels.push_back( p );
1912 }
1913
1914 }
1915
1916 if (
rc.isTagDefined(
"Bands" ) &&
rc.isTagDefined(
"Labels" ) ) {
1917 bnd =
bands(
rc.GetVector(
"Bands"),
rc.GetStringVector(
"Labels" ) );
1918 }
1919
1920
1921 if (
rc.isTagDefined(
"Colours") ) {
1922
1923 std::vector<int> ccolours =
rc.GetIntVector(
"Colours");
1924
1925 std::cout << "remap colours: " << ccolours << std::endl;
1926
1927 int new_colours[6];
1928
1929 for (
size_t i=6 ;
i-- ; ) new_colours[i] =
colours[i];
1930
1931 for (
size_t i=0 ;
i<ccolours.size() && i<6 ;
i++ ) {
1932 if ( ccolours[i]<6 ) new_colours[
i] =
colours[ccolours[
i]];
1933 }
1934
1935 for (
size_t i=6 ;
i-- ; )
colours[i] = new_colours[i];
1936
1937 }
1938
1939
1940 if (
rc.isTagDefined(
"Styles") ) {
1941
1942 std::vector<int> cstyles =
rc.GetIntVector(
"Styles");
1943
1944 std::cout << "remap markers: " << cstyles << std::endl;
1945
1946 int new_markers[6];
1947
1948 for (
size_t i=6 ;
i-- ; ) new_markers[i] =
markers[i];
1949
1950 for (
size_t i=0 ;
i<cstyles.size() && i<6 ;
i++ ) {
1951 if ( cstyles[i]<6 ) new_markers[
i] =
markers[cstyles[
i]];
1952 }
1953
1954 for (
size_t i=6 ;
i-- ; )
markers[i] = new_markers[i];
1955
1956 }
1957
1959 for (
int i=6 ;
i-- ; ) std::cout <<
"\tcolours[" << i <<
"] = " <<
colours[i] << std::endl;
1960 for (
int i=6 ;
i-- ; ) std::cout <<
"\tmarkers[" << i <<
"] = " <<
markers[i] << std::endl;
1961 }
1962
1963 if (
rc.isTagDefined(
"Tags") ) ctags =
rc.GetStringVector(
"Tags");
1964 if (
rc.isTagDefined(
"TagLabels") ) ctaglabels =
rc.GetStringVector(
"TagLabels");
1965 if (
rc.isTagDefined(
"TagLabels") ) usrlabels =
rc.GetStringVector(
"TagLabels");
1966
1967
1968 if (
rc.isTagDefined(
"Styles") ) {
1969 for ( size_t is=0 ; is<cstyles.size() && is<6 ; is++ ) {
1971 }
1972 }
1973
1974
1975 uselabels = true;
1976
1977
1978 std::cout <<
argv[0] <<
"\tuserlabels :" << usrlabels <<
":" << std::endl;
1979
1980 if (
rc.isTagDefined(
"RANGEMAP") ) RANGEMAP =
true;
1981 if (
rc.isTagDefined(
"ALLRANGEMAP") ) ALLRANGEMAP =
true;
1982
1983 std::cout <<
"Extra: " <<
rc.isTagDefined(
"Extra") << std::endl;
1984
1985 if (
rc.isTagDefined(
"Extra") ) taglabels.push_back(
fullreplace(
rc.GetString(
"Extra"),
"__",
" " ) );
1986
1987
1988 }
1989 else {
1990 std::cerr <<
argv[0] <<
":\t config file not found: " << configfile << std::endl;
1991 return -1;
1992 }
1993
1994 }
1995
1996 if ( !use_file_config ) {
1997
1998 std::cout << "using default panels" << std::endl;
1999
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011 scale_eff = 1;
2012 scale_eff_ref = 1;
2013
2015
2017
2018 std::string pnames[3] = { "eff", "res", "diff" };
2019
2020 for (
size_t ip=0 ;
ip<inpanels.size() ;
ip++ ) {
2021 Panel p( pnames[ip]+
"_panel", 2 );
2022 for (
size_t ih=0 ; ih<inpanels[
ip].size() ; ih++ )
p.push_back( inpanels[ip][ih] );
2023 panels.push_back( p );
2024 }
2025
2026 }
2027
2028
2029 std::cout << "taglabels" << std::endl;
2030
2031 for (
size_t it=0 ;
it<taglabels.size() ;
it++ ) std::cout << taglabels[it] << std::endl;
2032 for (
size_t it=0 ;
it<taglabels2.size() ;
it++ ) std::cout << taglabels2[it] << std::endl;
2033
2034
2035 std::cout << "\npanels: " << panels.size() << std::endl;
2036
2037 if ( panels.size()==0 )
return usage(argv[0], -1,
"no panels to plot");
2038
2039 for (
size_t ip=0 ;
ip<panels.size() ;
ip++ ) std::cout << panels[ip] << std::endl;
2040
2041
2043 if ( true ) {
2044 gStyle->SetPadRightMargin(0.05);
2045 gStyle->SetPadTopMargin(0.05);
2046
2048 const Int_t Number = 3;
2049 Double_t
Red[Number] = { 0.00, 0.00, 1.00 };
2050 Double_t
Green[Number] = { 0.00, 5.00, 1.00 };
2051 Double_t Blue[Number] = { 0.00, 0.50, 0.00 };
2052 Double_t Length[Number] = { 0.00, 0.50, 1.00 };
2054 TColor::CreateGradientColorTable( Number, Length, Red, Green, Blue, nb );
2055 }
2056 else gStyle->SetPalette(1);
2057
2058 if (
fulldbg ) std::cout << __LINE__ << std::endl;
2059
2060 double rightmargin = gStyle->GetPadRightMargin();
2061 gStyle->SetPadRightMargin(0.1);
2062
2064
2065 gStyle->SetPadRightMargin(rightmargin);
2066
2067
2068
2069 for ( size_t ipanel=0 ; ipanel<panels.size() ; ipanel++ ) {
2070
2071 Panel& panel = panels[ipanel];
2072
2073 std::cout <<
blue <<
"\n\n---------------------------------------------\n" <<
reset;
2074
2075 std::cout << panel << "\n" << std::endl;
2076
2077 int ncolsp = panel.
ncols();
2078 int nrowsp = panel.
nrows();
2079
2080 double extraw = 1;
2081
2082 std::cout << "\nncols: " << ncolsp << "\tnrows: " << nrowsp << std::endl;
2083
2084 bool multipanel = ( panel.
size() > 1 );
2085
2086 if ( panel.
size()==0 ) {
2087 std::cout <<
"panel empty: " << panel.
name() << std::endl;
2088 continue;
2089 }
2090
2091 gStyle->cd();
2092
2093 if ( panel.
size()>4 ) gStyle->SetLineScalePS(0.5);
2094
2095 if ( multipanel ) extraw = 1.05;
2096
2097 TCanvas*
tc =
new TCanvas(
"tc",
"", extraw*ncolsp*800, nrowsp*600 );
2098
2100
2101 const std::string& atlaslabel = atlaslabel_tmp;
2102
2103 if ( multipanel ) {
2104
2105 gStyle->SetLineScalePS(1);
2106
2109
2117
2120
2121 tc->Divide( ncolsp, nrowsp, 0.0001, 0.0003 );
2122
2123 }
2124
2126
2127 std::string plotname = "";
2128
2129 for (
size_t i=0 ;
i<panel.
size() ;
i++ ) {
2130
2132
2133 bool drawmeans = false;
2134 bool drawresiduals = true;
2135
2136
2138 if (
contains(
histo.detail(),
"-residual") ) drawresiduals =
false;
2139
2140 std::string xaxis =
histo.xtitle();
2141 std::string yaxis =
histo.ytitle();
2142
2143 if ( !xregex.empty() ) {
2144 size_t pos = xaxis.find(xregex);
2145 if ( pos!=std::string::npos ) xaxis.replace( pos, xregex.size(), xpattern );
2146 pos = yaxis.find(xregex);
2147 if ( pos!=std::string::npos ) yaxis.replace( pos, xregex.size(), xpattern );
2148 }
2149
2152
2153
2154
2155
2158
2159 bool translate_x = false;
2160
2161 if ( ( lumiref_trans || lumitest_trans ) &&
contains(
histo.xtitle(),
"Pile-up" ) ) translate_x =
true;
2162
2163#if 0
2165 if ( translate_x ) {
2166 xinfo.
lo( xinfo.
lo()*(1-0.054) );
2168 xinfo.
hi( xinfo.
hi()*(1-0.054) );
2169 }
2170#endif
2171
2173
2174#ifdef D0REBIN
2175 bool d0rebin_flag = false;
2176
2178#endif
2179
2182 }
2183
2186 }
2187
2188 int labelcolour = kBlack;
2189
2190 int npanel = nrowsp*(
i/nrowsp) + i%nrowsp + 1 ;
2191
2192 std::cout <<
"panel: panel: " << panel.
name() <<
"\tsubpanel: " << npanel << std::endl;
2193
2194 if ( multipanel )
tc->cd( npanel );
2195
2197
2198 noreftmp = noref;
2199
2201
2202 if (
fulldbg ) std::cout << __LINE__ << std::endl;
2203
2204 std::cout <<
"main() processing histo[" <<
i <<
"] " << (
i<10 ?
" " :
"" ) <<
histo.name() <<
"\t" <<
histo.xaxis() << std::endl;
2205
2207 plots_eff.clear();
2208
2211
2212 std::string noreflabel=defreflabel;
2213
2214 double xpos = 0.18;
2215 double ypos = 0.91;
2216
2218
2219
2220
2223
2224 if ( atlasstyle ) {
2225 xpos = 0.18;
2226 if ( ypos>0.5 ) ypos = 0.85;
2227 else ypos = 0.18;
2228 }
2229
2230 if ( ypos_in!=0 ) ypos = ypos_in;
2231
2232 double xpos_original = xpos;
2233
2234 xpos += xoffset;
2235
2236 if ( xinfo.
offset() != 0 ) {
2237
2238 std::cout <<
"HA ! xinfo.offset: " << xinfo.
offset() << std::endl;
2239
2241
2242 }
2243
2244
2245 if ( yinfo.
offset() != 0 ) {
2246
2247 std::cout <<
"HA ! yinfo.offset: " << yinfo.
offset() << std::endl;
2248
2250
2251 }
2252
2253
2254
2256
2257 size_t Nrows =
chains.size();
2258
2259 if ( ALLRANGEMAP || (RANGEMAP && xaxis.find("p_{T}")!=std::string::npos && ccolours.size() ) ) {
2260 Nrows = ( Nrows < ccolours.size() ? Nrows : ccolours.size() );
2261 }
2262
2263 int Nlines = Nrows + taglabels.size();
2264
2265 std::vector<double> ypositions;
2266 std::vector<double> ypositions2;
2267
2268 double deltay = (Nrows*0.055-0.005)/Nrows;
2269
2271 double yhi = ypos-0.01;
2272
2273 if ( ypos>0.5 )
ylo -= Nlines*deltay;
2274 else yhi += Nlines*deltay;
2275
2276 ypositions.reserve(Nlines);
2277 for ( int ilines=0 ; ilines<Nlines ; ilines++ ) {
2278 ypositions.push_back( yhi - deltay*(ilines+0.5) );
2279 ypositions2.push_back( yhi - deltay*(ilines-0.5) );
2280 }
2281
2282
2283
2285
2288 }
2289 else {
2291 }
2292
2293 Legend legend( xpos, xpos+0.1, ylo, ylo+Nrows*0.06-0.005 );
2294 Legend legend_eff( xpos, xpos+0.1, ylo, ylo+Nrows*0.06-0.005 );
2295
2296
2297 std::vector<std::string>
Mean;
2298 std::vector<std::string> MeanLF;
2299 std::vector<std::string>
RMS;
2300
2302 MeanLF.clear();
2304
2305 std::vector<std::string> Chi2;
2306 std::vector<std::string> MeanRef;
2307 std::vector<std::string> RMSRef;
2308
2309
2310
2311 Chi2.clear();
2312 MeanRef.clear();
2313 RMSRef.clear();
2314
2315 int mean_power = 0;
2316 int rms_power = 0;
2317 bool power_set = false;
2318
2320
2322
2323
2324
2325 for (
unsigned int j=0;
j<
chains.size();
j++) {
2326
2327 bool d0mod = false;
2328
2329 TFile* fftest = ftest;
2330 TFile* ffref = fref;
2331
2332 std::string
cc = ftest->GetName();
2333 std::string cr = "";
2334
2335 if ( fref ) cr = fref->GetName();
2336
2337 if ( chainfiles.size()>0 && chainfiles.size()>j ) ffref = fftest = chainTFiles[
j];
2338
2341
2342 std::cout <<
"chain: " <<
chains[
j] <<
"\taddchains: " << addchains << std::endl;
2343 std::cout <<
"chainref: " << chainref[
j] << std::endl;
2344
2345 noreftmp = noref;
2347
2350
2354
2355 TH2D* h2test = 0;
2356
2357 TGraphAsymmErrors* tgtest = 0;
2358
2359 std::cout << "refchain.size() " << refchain.size() << std::endl;
2360
2361 std::cout <<
"refchain: " << refchain[
j] << std::endl;
2362
2364
2365 gPad->SetRightMargin(0.03);
2366
2367 bool do2D = false;
2368
2369 labelcolour = kBlack;
2370
2371
2373
2374 do2D = true;
2375 labelcolour = kWhite;
2376
2377 gPad->SetRightMargin(0.13);
2378
2379 std::cout <<
"\n\nsee! it is a 2d histograms !!! " <<
histo.name() <<
"\n\n" << std::endl;
2380
2382
2383 std::cout << "\t2d: " << h2test << std::endl;
2384
2386
2387 h2test->GetYaxis()->SetTitleOffset(1.55);
2388 h2test->GetXaxis()->SetTitleOffset(1.5);
2389 h2test->GetXaxis()->SetTitle(xaxis.c_str());
2390 h2test->GetYaxis()->SetTitle(yaxis.c_str());
2391
2394
2395 std::cout << xinfo << std::endl;
2396 std::cout << yinfo << std::endl;
2397
2399 h2test->GetYaxis()->SetRangeUser( yinfo.
lo(), yinfo.
hi() );
2400 }
2401
2403
2405 h2test->GetXaxis()->SetRangeUser( xinfo.
lo(), xinfo.
hi() );
2406 }
2407
2410
2412
2413 h2test->DrawCopy("colz");
2414
2415 if (
histo.detail().find(
"logz")!=std::string::npos ) gPad->SetLogz(
true);
2416 else gPad->SetLogz(false);
2417
2418
2419 }
2421
2424
2425 std::cout <<
red <<
"fetch 2d: " <<
histo.name() <<
reset << std::endl;
2426
2427 bool bsigma = false;
2429
2430 bool bmean = false;
2432
2433 std::string tmp_ =
histo.name();
2435
2436 if ( bsigma )
base =
chop( tmp_,
"/sigma" );
2437 if ( bmean )
base =
chop( tmp_,
"/mean" );
2438
2439 std::cout <<
"refitting: " <<
histo.name() <<
"\tbase: " <<
base <<
"\tbsigma: " << bsigma <<
"\tbmean: " << bmean << std::endl;
2440
2442
2444
2445
2446 TH2D* href2d = 0;
2447
2448 if ( ffref ) href2d =
Get<TH2D>( *ffref, chains[j]+
"/"+
base+
"/2d", testrun, chainmap );
2449
2450 if ( href2d==0 ) href2d =
Get<TH2D>( *ffref, chains[j]+
"/"+
base+
"/2D", testrun, chainmap );
2451
2452 if ( htest2d==0 ) continue;
2453 if ( !noreftmp && href2d==0 ) noreftmp = true;
2454
2455 std::cout << "href2d : " << href2d << std::endl;
2456
2458
2459 std::cout << "plotter" << std::endl;
2460
2462
2464
2465 std::cout << "Resplot rtest\t" << rtest.finalised() << std::endl;
2466
2467 if ( rtest.finalised() ) {
2468 std::cout << "refitting ..." << std::endl;
2471 }
2472 else {
2473 std::cout << "refitting (finalising) ..." << std::endl;
2476
2477 rtest.Mean()->DrawCopy();
2478 gPad->Print("Duff.pdf");
2479 }
2480
2481 std::cout << "bsigma: " << bsigma << std::endl;
2482 std::cout << "bmean: " << bmean << std::endl;
2483
2484 if ( bsigma ) {
htest = (
TH1F*)rtest.Sigma()->Clone(
"rtest_sigma");
htest->SetDirectory(0); }
2485 if ( bmean ) {
htest = (
TH1F*)rtest.Mean()->Clone(
"rtest_mean");
htest->SetDirectory(0); }
2486
2487 std::cout <<
reset << std::endl;
2488
2489 if ( htest==0 ) {
2490 std::cerr <<
red <<
"missing test histogram: " << (refchain[
j]+
" / "+
histo.name()) <<
" " <<
htest
2491 <<
"(test)" <<
reset << std::endl;
2492 continue;
2493 }
2494 else {
2495 std::cout <<
green <<
"htest: " <<
htest->GetName() <<
reset << std::endl;
2496 }
2497
2498 std::cout <<
"\nhisto.name(): " <<
histo.name() << std::endl;
2499
2500 std::cout <<
reset << std::endl;
2501
2502 if ( !d0mod &&
histo.name().find(
"d0_vs_phi")!=std::string::npos ) {
2503
2504 d0mod = true;
2505
2506 std::cout <<
green <<
"\n\nbeam fitting !!" <<
histo.name() <<
reset << std::endl;
2507
2508 TVirtualPad*
old = gPad;
2509
2510 std::cout << "old canvas: " << gPad << std::endl;
2511
2512 std::cout <<
"dbg histo name: " <<
histo.name() << std::endl;
2513
2515
2517
2518 if (
histo.name().find(
"_rec")!=std::string::npos ) {
2519
2522
2524 }
2525
2526 if (
histo.name().find(
"_rec")==std::string::npos ) {
2527
2528 fitcanvas =
new TCanvas(
"fit",
"", 700, 600 );
2530
2532 }
2533
2534 TVirtualPad* tp = gPad;
2535
2537
2539
2540
2541
2542 rtest.Mean()->SetDirectory(0);
2543
2545
2546 if (
histo.name().find(
"_rec")!=std::string::npos ) hf->SetTitle(
";Trigger #phi;Trigger d_{0} [mm]");
2547 else hf->SetTitle(";Offline #phi;Offline d_{0} [mm]");
2548
2549 TF1* tf = new TF1( "sinus", "[0]*sin(x+[1])+[2]" );
2550
2551 tf->SetLineWidth(1);
2552
2553 hf->GetYaxis()->SetTitleOffset( hf->GetYaxis()->GetTitleOffset()*1.1 );
2554
2555 {
2556 TCanvas* tfc = new TCanvas( "tmp", "", 700, 600 );
2557 tfc->cd();
2558 hf->Fit( tf );
2559 delete tfc;
2560 }
2561
2562 double phi0 = tf->GetParameter(1);
2563
2564
2565 double x = tf->GetParameter(0)*
cos(phi0);
2566 double y = tf->GetParameter(0)*
sin(phi0);
2567 double off = tf->GetParameter(2);
2568
2569 std::cout <<
"\tx = " <<
x << std::endl;
2570 std::cout <<
"\ty = " <<
y << std::endl;
2571 std::cout << "\toffset = " << off << std::endl;
2572
2573 std::string cckstr =
chains[
j];
2574
2575 cckstr = cckstr.substr( cckstr.find("HLT_IDTrack") );
2576
2578
2579 vstr.resize(vstr.find("_boffperf"));
2580 vstr.resize(vstr.find("_L1"));
2581
2582 hf->SetMinimum( -0.03 );
2583 hf->SetMaximum( 0.03 );
2584
2586
2587 if ( first ) hf->DrawCopy();
2588
2589 hf->DrawCopy("same");
2590 hf->DrawCopy("samee");
2591
2592
2595
2599
2600 std::string sht =
chains[
j]+
"-"+
histo.name()+
"-fit.pdf";
2601
2602 size_t p = sht.find(
"/");
2603
2604 while ( p!=std::string::npos ) {
2605 sht.erase( p, 1 );
2607 }
2608
2609
2610 gPad->Print( sht.c_str() );
2611 gPad->Print( "sht.pdf" );
2612
2613 std::cout << "CNT !!!" << std::endl;
2614
2615 delete tf;
2616
2617 tp->cd();
2618
2620
2621 }
2622
2623
2626
2628
2629 std::cout << "Resplot noreftmp " << noreftmp << " ... " << std::endl;
2630
2631 if ( !noreftmp ) {
2632 if ( refitref_resplots ) {
2633
2634 std::cout << "Resplot rref: " << href2d << std::endl;
2635
2637
2638 std::cout << "Resplot rref: " << href2d << " (2)" << std::endl;
2639
2640 if ( rref.finalised() ) {
2641 std::cout << "refitting (2) ..." << std::endl;
2644 }
2645 else {
2646 std::cout << "refitting (2 - finalising) ..." << std::endl;
2649 }
2650
2651 std::cout << "Resplot rref: " << href2d << " (3)" << std::endl;
2652
2653 if ( bsigma ) { hreft = (
TH1F*)rref.Sigma()->Clone(
"rref_sigma"); hreft->SetDirectory(0); }
2654 if ( bmean ) { hreft = (
TH1F*)rref.Mean()->Clone(
"rref_mean"); hreft->SetDirectory(0); }
2655
2656 std::cout << "Resplot rref: " << href2d << " (4)" << std::endl;
2657
2658 }
2659 else {
2660
2661 std::cout <<
"Resplot rref: " << href2d <<
" (5)" <<
reset << std::endl;
2662
2663 hreft =
Get( *ffref, refchain[j]+
"/"+
histo.name(), rawrefrun, chainmap );
2664 if ( hreft==0 ) {
2665 std::cerr <<
"ERROR: could not find " << (refchain[
j]+
"/"+
histo.name()) << std::endl;
2666 }
2667
2668
2669 }
2670 }
2671
2672 std::cout << "Resplot rref: " << href2d << " (6)" << std::endl;
2673
2674
2675 if ( !noreftmp && hreft==0 ) {
2676
2677 std::cerr <<
"missing ref histogram: " << (refchain[
j]+
" / "+
histo.name()) <<
" " <<
htest <<
"(ref)" << std::endl;
2678
2679 noreftmp = true;
2681 noreflabel="reference not found";
2684
2685 }
2686
2687 if ( !noreftmp ) {
2688
2689 std::cout << "Resplot rref: " << href2d << " (7)" << std::endl;
2690
2692 href->SetDirectory(0);
2693
2694 std::cout <<
"Resplot href: " <<
href <<
" (7a)" << std::endl;
2695
2696 }
2697
2698 std::cout << "Resplot rref: " << href2d << " (8)" << std::endl;
2699
2700
2702
2703
2705
2706 std::cout << "Resplot rref: " << href2d << " (9)" << std::endl;
2707
2708 }
2709 else {
2710
2712
2713 std::string reghist =
histo.name();
2714
2715 std::cout <<
"hist: " << (
chains[
j]+
"/"+reghist) <<
"\tftest " << ftest << std::endl;
2716
2717
2718
2720
2721 std::cout <<
"\nhist: " <<
htest << std::endl;
2722
2723 std::cout << "fftest: " << fftest->GetName() << std::endl;
2724
2726
2727
2728 if ( lumitest_trans && translate_x && !
contains( cc,
"-mc" ) )
htest =
trans( htest, translate_x );
2729
2730 std::cout << xaxis << std::endl;
2731
2732 if ( htest==0 ) {
2733 std::cerr <<
"missing test histogram: " << (
chains[
j]+
" / "+reghist) <<
" " << htest<< std::endl;
2734 continue;
2735 }
2736
2738
2740
2741 if ( ffref ) hreft =
Get( *ffref, refchain[j]+
"/"+reghist, rawrefrun, chainmap );
2742 else noreftmp = true;
2743
2744 if ( hreft && lumiref_trans && translate_x && !
contains( cr,
"-mc" ) ) hreft =
trans( hreft, translate_x );
2745
2746 std::cout << "hreft: " << hreft << std::endl;
2747
2748 if ( std::string(
htest->ClassName()).find(
"TH2")!=std::string::npos ) {
2749 std::cout <<
"Class TH2: " <<
htest->GetName() << std::endl;
2750 continue;
2751 }
2752
2753
2754 if ( std::string(
htest->ClassName()).find(
"TH1")!=std::string::npos ) {
2755 std::cout <<
"Class TH1: " <<
htest->GetName() << std::endl;
2756 }
2757 else if ( std::string(
htest->ClassName()).find(
"TProfile")!=std::string::npos ) {
2758 std::cout <<
"Class TProf: " <<
htest->GetName() << std::endl;
2759 }
2760 else if ( std::string(
htest->ClassName()).find(
"TEfficiency")!=std::string::npos ) {
2761 std::cout <<
"Class TEff: " <<
htest->GetName() << std::endl;
2762 }
2763
2764
2765 std::cout << "Resplot hreft: " << hreft << " (10)" << " " << noreftmp << std::endl;
2766
2767 if ( !noreftmp && hreft==0 ) {
2768 std::cerr <<
"missing ref histogram: " << (refchain[
j]+
" / "+reghist)
2769 << " " << hreft << std::endl;
2770
2771 noreftmp = true;
2773 noreflabel="reference not found";
2776
2777
2778 }
2779
2780 std::cout << "Resplot hreft: " << hreft << " (10)" << std::endl;
2781
2782 if ( hreft!=0 ) {
2783
2784 std::cout << "Resplot hreft: " << hreft->ClassName() << " (11)" << std::endl;
2785
2786 if ( std::string(hreft->ClassName()).find("TH1")!=std::string::npos ) {
2788 href->SetDirectory(0);
2789 }
2792 }
2793 }
2794 else {
2795 noreftmp = true;
2797 }
2798
2799 std::cout <<
" \tget " << (
chains[
j]+
"/"+reghist) <<
"\thtest " << htest << std::endl;
2800 std::cout <<
" \tget " << (refchain[
j]+
"/"+reghist) <<
"\thref " << href << std::endl;
2801
2802 if ( htest==0 ) continue;
2803
2804 if ( !noreftmp && href==0 ) {
2805 noreftmp = true;
2807 }
2808
2809 if (
fulldbg ) std::cout << __LINE__ << std::endl;
2810
2811
2812 if ( rebin!=1 ) {
2813 std::cout <<
"rebin: " <<
hname <<
"\t" <<
rebin << std::endl;
2814 if ( htest )
htest->Rebin(rebin);
2815 if ( href )
href->Rebin(rebin);
2816 for (
int ip=0 ;
ip<10 ;
ip++ ) std::cout << std::endl;
2817 }
2818
2819#if 0
2822 std::cout <<
"Rebinning histogram: " <<
histo.name() << std::endl;
2823 if (
htest->GetNbinsX()>500 )
htest->Rebin(10);
2824 if ( href &&
href->GetNbinsX()>500 )
href->Rebin(10);
2825 }
2826#endif
2827
2828
2829 if ( make_efficiencies &&
histo.name().find(
"zed_eff")!=std::string::npos ) {
2830 if (
htest->GetNbinsX()>100 )
htest->Rebin(5);
2831 if ( href &&
href->GetNbinsX()>100 )
href->Rebin(5);
2832 }
2833
2834
2835 if (
fulldbg ) std::cout << __LINE__ << std::endl;
2836
2837 if ( scalepix && std::string(
htest->GetName()).find(
"npix")!=std::string::npos )
Scale(htest,0.5);
2838 if ( scalepix && href && std::string(
htest->GetName()).find(
"npix")!=std::string::npos )
Scale(href,0.5);
2839
2840 if (
fulldbg ) std::cout << __LINE__ << std::endl;
2841
2842 if ( notitle ) {
2843 htest->SetTitle(
"");
2844 if( href )
href->SetTitle(
"");
2845 }
2846
2847 if (
fulldbg ) std::cout << __LINE__ << std::endl;
2848
2849 }
2850
2851 std::cout << "done else" << std::endl;
2852
2853 if ( do2D ) continue;
2854
2855 std::cout <<
"done else:\t" <<
htest << std::endl;
2856 std::cout <<
"done else:\t" <<
htest->GetName() << std::endl;
2857
2858 if (
fulldbg ) std::cout << __LINE__ << std::endl;
2859
2860 if ( !d0mod &&
histo.name().find(
"d0_vs_phi")!=std::string::npos ) {
2861 d0mod = true;
2862 if ( htest )
d0fit( histo, htest, chains[j] );
2863 if ( href )
d0fit( histo, href, chains[j] );
2864 }
2865
2866 if ( !do2D && make_ref_efficiencies ) {
2867
2868 std::cout << "make ref efficiencies" << std::endl;
2869
2870 if ( htest && href ) {
2871
2873
2874
2876
2877 std::string effhist =
histo.name();
2878
2879
2880
2881 htestnum =
Get( *fftest, chains[j]+
"/"+effhist+
"_n", testrun, 0, &
savedhistos );
2882
2883
2884
2885 TH1F* hrefnumt =
Get( *ffref, refchain[j]+
"/"+effhist+
"_n", rawrefrun, chainmap, &
savedhistos );
2886
2887
2888
2889 if ( !noreftmp && hrefnumt!=0 ) {
2890 hrefnum = (
TH1F*)hrefnumt->Clone();
2891 hrefnum->SetDirectory(0);
2892 }
2893
2894 }
2895 }
2896
2897 }
2898
2899 std::cout <<
"done effs ? " << bayes <<
"\thtest: " <<
htest <<
" :: " <<
htest->GetName() << std::endl;
2900
2901 if ( bayes ) {
2902
2903 std::cout <<
"make ref efficiencies " <<
htest->GetName() << std::endl;
2904
2905 if ( make_efficiencies && htest &&
contains( std::string(
htest->GetName()),
"eff" ) && !
contains( std::string(
htest->GetName()),
"_d" ) ) {
2906
2907 std::string effhist =
histo.name();
2908
2910
2911 if ( rebin!=1 ) std::cout << effhist <<
"\trebin: " <<
rebin << std::endl;
2912
2913
2914 htestnum =
Get( *fftest, chains[j]+
"/"+effhist+
"_n", testrun, 0, &
savedhistos ) ;
2915 htestden =
Get( *fftest, chains[j]+
"/"+effhist+
"_d", testrun, 0, &
savedhistos ) ;
2916
2917 if ( htestnum==0 && htestden==0 ) {
2918 TEfficiency*
eff = 0;
2919
2921
2922 if ( eff ) {
2923 htestnum = (
TH1F*)
eff->GetPassedHistogram();
2924 htestden = (
TH1F*)
eff->GetTotalHistogram();
2925 }
2926
2927 }
2928
2929 std::cout << "eff: htestnum: " << htestnum << "\thtestden: " << htestden << std::endl;
2930
2931
2933
2934 std::cout <<
"heff: " << effhist <<
"\t" <<
ars << std::endl;
2935
2936
2937 std::cout << "1: Bayesian error calculation " << htestnum << " " << htestden << "\tscale " << scale_eff << std::endl;
2938
2939 if ( htestnum && htestden ) {
2940
2941#ifdef D0REBIN
2944 if ( d0rebin_flag ) {
2945 htestnum =
d0rebin( htestnum );
2946 htestden =
d0rebin( htestden );
2947 }
2948 else if ( rebin!=1 ) {
2949 htestnum =
Rebin(htestnum, rebin );
2950 htestden =
Rebin(htestden, rebin );
2951 }
2952#endif
2953 std::cout << "test histogram name: : " << htestnum->GetName() << "\txaxis: " << xaxis << "\t" << std::endl;
2954
2955 if ( make_efficiencies && std::string(htestnum->GetName()).find("ntrax_eff")!=std::string::npos ) {
2956
2957 bool low = true;
2958
2961 }
2962
2963#if 0
2967 std::cout <<
"rebin " <<
histo.name() << std::endl;
2968 htestnum->Rebin(3);
2969 htestden->Rebin(3);
2970 }
2971
2972 if ( make_efficiencies &&
contains(
htest->GetName(),
"eta_eff" ) ) {
2973 std::cout <<
"rebin " <<
histo.name() << std::endl;
2974 htestnum->Rebin(2);
2975 htestden->Rebin(2);
2976 }
2977
2978#endif
2979
2980
2981 if ( RANGEMAP && (effhist.find("ET")!=std::string::npos ) ) {
2982 std::cout <<
"\trange: " <<
j <<
" " <<
htest << std::endl;
2983 bnd.
range( chains[j], htestnum );
2984 bnd.
range( chains[j], htestden );
2985 }
2986
2987 if ( lumitest_trans && translate_x && !
contains( cc,
"-mc" ) ) {
2988 htestnum =
trans( htestnum, translate_x );
2989 htestden =
trans( htestden, translate_x );
2990 }
2991
2993
2994 tgtest =
e.Bayes(scale_eff);
2995
2997
2998 htest->SetName( (std::string(htestnum->GetName())+
"_eff").c_str() );
2999
3000 std::cout << "effhist: " << effhist << std::endl;
3001
3002 }
3003
3005
3006 std::cout << "recalculating reference efficiencies ..." << std::endl;
3007
3008 if ( href ) {
3009
3010 std::cout << "doin ..." << std::endl;
3011
3012
3013 TH1F* hrefnum =
Get( *ffref, refchain[j]+
"/"+
histo.name()+
"_n", rawrefrun, chainmap );
3014 TH1F* hrefden =
Get( *ffref, refchain[j]+
"/"+
histo.name()+
"_d", rawrefrun, chainmap );
3015
3016
3017 if ( hrefnum==0 && hrefden==0 ) {
3018 TEfficiency*
eff = 0;
3019
3021
3022 if ( eff ) {
3023 hrefnum = (
TH1F*)
eff->GetPassedHistogram();
3024 hrefden = (
TH1F*)
eff->GetTotalHistogram();
3025 }
3026
3027 }
3028
3029
3030
3031 std::cout << "2. Bayesian error calculation " << htestnum << " " << htestden << "\tscale " << scale_eff << std::endl;
3032 std::cout << "3. Bayesian error calculation " << hrefnum << " " << hrefden << "\tscale " << scale_eff_ref << std::endl;
3033
3034
3035 if ( hrefnum && hrefden ) {
3036
3037 if ( lumiref_trans && translate_x && !
contains( cr,
"-mc" ) ) {
3038 hrefnum =
trans( hrefnum, translate_x );
3039 hrefden =
trans( hrefden, translate_x );
3040 }
3041
3042#ifdef D0REBIN
3045 if ( d0rebin_flag ) {
3048 }
3049 else if ( rebin!=1 ) {
3050 hrefnum =
Rebin(hrefnum, rebin );
3051 hrefden =
Rebin(hrefden, rebin );
3052 }
3053#endif
3054
3055 std::cout << hrefnum << " " << hrefden << std::endl;
3056
3059
3060
3062
3063 }
3064 }
3065 }
3066
3067 std::cout <<
"dbg: htest: " <<
htest << std::endl;
3068 std::cout <<
"dbg: htest name " <<
htest->GetName() << std::endl;
3069
3070 if (
true &&
histo.name().find(
"invmass")!=std::string::npos ) {
3072 }
3073
3074
3075 }
3076
3077
3078 std::cout <<
"chains[j] " <<
chains[
j] << std::endl;
3079 std::cout <<
"histo.name() " <<
histo.name() << std::endl;
3080 std::cout <<
"href " <<
href <<
"\t (TEfficiency " <<
isTEfficiency(href) <<
")" << std::endl;
3081
3083
3086 std::cout << "efficiency" << std::endl;
3087 }
3088
3089 std::cout <<
"href " <<
href <<
"\t (TEfficiency " <<
isTEfficiency(href) <<
")" << std::endl;
3090
3091
3092 if ( htest==0 ) {
3093 std::cout <<
" no test histogram : " << (
chains[
j]+
"/"+
histo.name()) << std::endl;
3094 continue;
3095 }
3096
3097
3098 if ( !noreftmp && href==0 ) {
3099 std::cout <<
" no ref histogram : " << (
chains[
j]+
"/"+
histo.name()) << std::endl;
3100 noreftmp = true;
3102 noreflabel="reference not found";
3105
3106 }
3107
3108 std::cout <<
"htest: " <<
isTEfficiency(htest) << std::endl;
3109
3111
3112 htest->GetYaxis()->SetTitleOffset(1.55);
3113 htest->GetXaxis()->SetTitleOffset(1.5);
3114 htest->GetXaxis()->SetTitle(xaxis.c_str());
3115 htest->GetYaxis()->SetTitle(yaxis.c_str());
3116
3117 std::cout <<
"htest: " <<
htest <<
"\t" << __LINE__ << std::endl;
3118
3119
3120 if ( !noreftmp ) {
3121
3122 href->GetYaxis()->SetTitleOffset(1.5);
3123 href->GetXaxis()->SetTitleOffset(1.5);
3124 std::cout <<
"xaxis: " <<
href->GetXaxis()->GetTitle() << std::endl;
3125
3126 }
3127
3128 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3129
3130#if 0
3132
3133 double xm =
htest->GetMean();
3134
3135 if ( xm>=10 ) {
3136 double lxm = std::log10(xm);
3137 int newbins = int(0.5+xm/std::pow(10,
int(lxm)))*
pow(10,
int(lxm));
3138 int nrebin = int( (newbins+5)/10 );
3139
3140 if ( nrebin>1 ) {
3141 std::cout <<
"rebin: " <<
htest->GetName() <<
"\tbins: " << nrebin << std::endl;
3142 htest->Rebin(nrebin);
3144 if ( !noreftmp ) {
3145 href->Rebin(nrebin);
3147 }
3148 }
3149 }
3150 }
3151#endif
3152
3153 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3154
3155
3157 if ( plotname == "" ) {
3158
3159 if ( key!="" ) {
3160 htest->SetTitle(
"");
3161 if ( href )
href->SetTitle(
"");
3163 }
3165 htest->SetTitle(
"");
3166 if ( href )
href->SetTitle(
"");
3167 plotname = "HLT_";
3168 }
3170 htest->SetTitle(
"");
3171 if ( href )
href->SetTitle(
"");
3172 plotname = "EF_";
3173 }
3175 htest->SetTitle(
"");
3176 if ( href )
href->SetTitle(
"");
3177 plotname = "L2_";
3178 }
3180 htest->SetTitle((
"FTK "+
histo.name()).c_str());
3181 if ( href )
href->SetTitle((
"FTK "+
histo.name()).c_str());
3182 plotname = "FTK_";
3183 }
3184
3185 plotname +=
histo.name();
3186
3190
3191 }
3192
3193
3194 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3195
3197
3199
3200 std::string collection =
basename( chains[j] );
3201
3203
3204 if ( collection.find("_InDet")!=std::string::npos ) collection.erase( 0, collection.find("_InDet")+1 );
3205 if ( actual_chain.find("_InDet")!=std::string::npos ) actual_chain.erase( actual_chain.find("_InDet") );
3206
3207
3208 std::cout <<
"raw: " <<
chains[
j] << std::endl;
3209 std::cout << "track collection: " << collection << std::endl;
3210 std::cout << "actual chain: " << actual_chain << std::endl;
3211
3212 std::regex rx("_HLT_[^_]*RoI.*");
3213 std::regex
rx1(
"_HLT_[^_]*_RoI.*");
3214
3215 std::cout << "\n\n\nactual_chain: " << actual_chain << std::endl;
3216
3217 arsaway( actual_chain,
"_L1.*",
"" );
3218 arsaway( actual_chain,
"L1.*",
"" );
3219
3220 actual_chain = std::regex_replace( actual_chain, std::regex( "L1.*:" ), "" );
3221
3222 if ( actual_chain.find("jvt")!=std::string::npos ) actual_chain.erase(
3223 actual_chain.find("jvt"),
3224 actual_chain.find("HLT_IDTrack")-actual_chain.find("jvt") );
3225
3226 std::cout << " : " << actual_chain << "\n\n\n" << std::endl;
3227
3228
3229 actual_chain = std::regex_replace( actual_chain, std::regex( "_HLT_IDTrack.*" ), "" );
3230
3231
3232 collection = std::regex_replace( collection, std::regex(".*HLT_IDTrack_"), "IDTrack " );
3233 collection = std::regex_replace( collection, std::regex("IDTrack "), "" );
3234 collection = std::regex_replace( std::regex_replace( collection, rx, "" ), rx1, "" );
3235
3236 if ( actual_chain.find("HLT_IDTrack_")!=std::string::npos ) actual_chain.erase( actual_chain.find("HLT_IDTrack_"), 12 );
3237 if ( actual_chain.find("_IDTrack_")!=std::string::npos ) actual_chain.erase( actual_chain.find("_IDTrack_"), 9 );
3238 if ( actual_chain.find("IDTrack")!=std::string::npos ) actual_chain.erase( actual_chain.find("IDTrack"), 7 );
3239 if ( actual_chain.find("_idperf")!=std::string::npos ) actual_chain.erase( actual_chain.find("_idperf"), 7 );
3240 if ( actual_chain.find("_bperf")!=std::string::npos ) actual_chain.erase( actual_chain.find("_bperf"), 6 );
3241 if ( actual_chain.find("_boffperf")!=std::string::npos ) actual_chain.erase( actual_chain.find("_boffperf"), 9 );
3242 if ( actual_chain.find("_HLT_")!=std::string::npos ) actual_chain.replace( actual_chain.find("_HLT_"), 5, " " );
3243 if ( actual_chain.find("HLT_")!=std::string::npos ) actual_chain.erase( actual_chain.find("HLT_"), 4 );
3244
3245
3246
3247 if ( collection.find("_IDTrkNoCut")!=std::string::npos ) collection.erase( collection.find("_IDTrkNoCut"), 11 );
3248 if ( collection.find("xAODCnv")!=std::string::npos ) collection.erase( collection.find("xAODCnv"), 7 );
3249 if ( collection.find("HLT_IDTrack_")!=std::string::npos ) collection.erase( collection.find("HLT_IDTrack_"), 12 );
3250 if ( collection.find("HLT_IDTrack")!=std::string::npos ) collection.erase( collection.find("HLT_IDTrack"), 11 );
3251 if ( collection.find("Tracking")!=std::string::npos ) collection.replace( collection.find("Tracking"), 8, "Trk" );
3252 if ( collection.find("InDetTrigTrk_")!=std::string::npos ) collection.erase( collection.find("InDetTrigTrk_"), 13 );
3253 if ( collection.find("HLT_xAODTracks_")!=std::string::npos ) collection.erase( collection.find("HLT_xAODTracks_"), 15 );
3254 if ( collection.find("_HLT_")!=std::string::npos ) collection.replace( collection.find("_HLT_"), 5, " " );
3255 if ( collection.find("HLT_")!=std::string::npos ) collection.erase( collection.find("HLT_"), 4 );
3256 if ( collection.find("_extra")!=std::string::npos ) collection.resize( collection.find("_extra") );
3257
3258 if ( actual_chain.size()>25 ) {
3259 size_t pos = actual_chain.find_last_of(
"_");
3260 while ( pos!=std::string::npos && actual_chain.size()>25 ) {
3261 actual_chain.resize(pos);
3262 pos = actual_chain.find_last_of(
"_");
3263 }
3264 }
3265
3266 std::cout <<
blue <<
"actual chain: " << actual_chain <<
"\tcollection: " << collection <<
reset << std::endl;
3267
3268 std::string
c = actual_chain +
" : " + collection;
3269
3270 std::cout << "track collection: " << collection << " <-" << std::endl;
3271 std::cout << "actual chain: " << actual_chain << " <-" << std::endl;
3272
3274
3276
3277 std::cout <<
"use label: " <<
c <<
"\tchains size " <<
chains.size() <<
"\t" << usrlabels.size() << std::endl;
3278
3279 std::cout <<
"chains.size() " <<
chains.size() <<
" " <<
j << std::endl;
3280 std::cout <<
"chains.size() " <<
chains.size() <<
" " <<
j << std::endl;
3281
3282 std::cout <<
"chains[j] : " <<
j <<
" " <<
chains[
j] << std::endl;
3283
3284 std::cout << "userlabels.size() " << usrlabels.size() << std::endl;
3285
3286 if ( usrlabels.size() < j+1 ) {
3287 if ( usrlabels.size()!=0 ) std::cerr << "userlabels not large enough - not using userlabels" << std::endl;
3288 }
3289 else c = usrlabels[
j ];
3290
3291 std::cout <<
"use label: c: " <<
c << std::endl;
3292
3294
3295 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3296
3297 std::cout <<
blue <<
"xaxis: " << xaxis <<
reset << std::endl;
3298
3299 if ( ALLRANGEMAP || xaxis.find("p_{T}")!=std::string::npos || xaxis.find("E_{T}")!=std::string::npos ) {
3300
3301 if ( RANGEMAP && xaxis.find("p_{T}")!=std::string::npos ) {
3302 bnd.
range( chains[j], htest );
3303 if ( href ) bnd.
range( chains[j], href );
3304 }
3305
3306 if ( RANGEMAP || ALLRANGEMAP ) {
3307
3309
3310 std::cout << "\n\n\nctags " << ctags.size() << "\n\n" << std::endl;
3311
3312 for (
size_t ic=0 ;
ic<ctags.size() ;
ic++ ) {
3313
3314 std::cout <<
"\n\nic: " <<
ic <<
" " << ctags[
ic] <<
" " << ccolours[
ic] <<
"\n\n" << std::endl;
3315
3316 if ( chains[j].
find(ctags[ic])!=std::string::npos ) {
3317 std::cout <<
"\ttag " << ctags[
ic] <<
" \tcolour: " << ccolours[
ic] <<
"\tstyle: " << cstyles[
ic] << std::endl;
3318 htest->SetLineColor( ccolours[ic] );
3319 htest->SetMarkerColor( ccolours[ic] );
3320 htest->SetMarkerStyle( cstyles[ic] );
3322 if ( tgtest ) {
3323 tgtest->SetLineColor(
htest->GetMarkerColor());
3324 tgtest->SetMarkerStyle(
htest->GetMarkerStyle());
3325 tgtest->SetMarkerColor(
htest->GetMarkerColor());
3326 }
3327 break;
3328 }
3329 }
3330
3331 }
3332
3333 std::cout <<
"test: " <<
chains[
j] <<
"chains colour: " <<
htest->GetMarkerColor() << std::endl;
3334
3335 }
3336
3337
3338 std::cout << "movin' on ..." << std::endl;
3339
3340 std::cout <<
"chain: " <<
chains[
j] <<
" \t marker colour: " <<
htest->GetMarkerColor() << std::endl;
3341
3342 std::cout <<
"Plotter marker : " <<
htest->GetMarkerColor() <<
" " <<
htest->GetMarkerStyle() << std::endl;
3343
3344
3345 if ( uselabels )
plots.push_back(
Plotter( htest, href,
" " + chain_name[j] + c, tgtest ) );
3346 else {
3347 std::cout <<
"using label: " <<
c << std::endl;
3349 }
3350
3351 std::cout << "AxisInfo: " << xaxis << std::endl;
3352
3355
3356 std::cout <<
"c: " <<
c <<
"\t" << ftest->GetName() << std::endl;
3357
3358 if ( refbands ) {
3359 std::cout << "refbands: " << refbands << std::endl;
3360 plots.back().mc(
true );
3361 translate_x = false;
3362 }
3363
3364 if ( ALLRANGEMAP || ( RANGEMAP && xaxis.find(
"p_{T}")!=std::string::npos ) )
plots.back().max_entries( ccolours.size() );
3365
3366 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3367
3368 if ( make_ref_efficiencies ) {
3369
3370 if ( htestnum && hrefnum ) {
3372
3374
3375 double range =
h->GetMaximum()-
h->GetMinimum();
3376
3377 if ( range<0.2*scale_eff ) {
3378
3379 double fmax = int( (
h->GetMaximum() + 20)*0.1 )*0.1*scale_eff;
3380 double fmin = int( (
h->GetMinimum() - 10)*0.1 )*0.1*scale_eff;
3381
3382 if ( fmax>1*scale_eff ) fmax = 1.02*scale_eff;
3383 if ( fmin<0 ) fmin = 0;
3384
3385 h->SetMinimum(fmin);
3386 h->SetMaximum(fmax);
3387
3388 }
3389
3390 plots_eff.push_back(
Plotter(
e.Hist(), 0, c ) );
3391
3392 }
3393 }
3394
3395
3396 std::cout << "means: " << drawmeans << " " << means << std::endl;
3397
3398 std::cout << "chi2: " << std::endl;
3399
3400 std::cout <<
"htest " <<
htest << std::endl;
3401 std::cout <<
"href " <<
href << std::endl;
3402
3403 std::cout <<
"chi2: " <<
chi2( htest, href ) <<
"\t histo name: " <<
histo.name() << std::endl;
3404
3406
3407
3408 if ( href ) Chi2.push_back(
label(
"chi2 = %5.2lf / %2.0lf",
chi2( htest, href ),
double(
htest->GetNbinsX()) ) );
3409
3410 std::cout << "Chi2.push_back()" << std::endl;
3411
3412 if ( drawmeans || means ) {
3413
3414 double mean_95 =
htest->GetMean();
3415 double dmean_95 =
htest->GetMeanError();
3416 double rms_95 =
htest->GetRMS();
3417 double drms_95 =
htest->GetRMSError();
3418
3419 Mean.push_back(
label(
" mean = %4.2lf #pm %4.2lf", mean_95, dmean_95) );
3420 MeanLF.push_back(
label(
"mean = %6.4lf #pm %6.4lf", mean_95, dmean_95) );
3421 RMS.push_back(
label(
" rms = %4.2lf #pm %4.2lf", rms_95, drms_95 ) );
3422
3423 }
3424
3425 std::cout <<
"residual: " <<
residual <<
" " << drawresiduals << std::endl;
3426
3427 if ( residual && drawresiduals ) {
3428
3430
3431 xpos = xpos_original;
3432
3433 std::cout <<
"calculating resolutions : " <<
histo.name() <<
" " <<
htest->GetName() << std::endl;
3434
3436
3437 double mean_95 = d95->GetParameter(1);
3438 double dmean_95 = d95->GetParError(1);
3439 double rms_95 = d95->GetParameter(2);
3440 double drms_95 = d95->GetParError(2);
3441
3442 std::cout <<
"\t\t" <<
histo.name()
3443 << "\tmean: " << mean_95 << " +- " << dmean_95
3444 << "\trms: " << rms_95 << " +- " << drms_95 << std::endl;
3445
3447
3448 if ( !power_set ) {
3449 for (
int ip=-2 ;
ip<9 ;
ip++ ) {
3450 if ( std::fabs(mean_95) >= std::pow( 10., double(-ip) ) ) {
3452 break;
3453 }
3454 }
3455
3456 for (
int ip=-2 ;
ip<9 ;
ip++ ) {
3457 if ( std::fabs(rms_95) >= std::pow( 10., double(-ip) ) ) {
3459 break;
3460 }
3461 }
3462 }
3463
3464 power_set = true;
3465
3466 std::cout <<
"\t\t" <<
histo.name()
3467 << "\tmean: " << mean_95 << " +- " << dmean_95 << " : pow " << mean_power
3468 << "\trms: " << rms_95 << " +- " << drms_95 << " : pow " << rms_power << std::endl;
3469
3470
3471 if ( mean_power == 0 ) {
3472 Mean.push_back(
label(
"mean_{95} = %4.2lf #pm %4.2lf", mean_95, dmean_95) );
3473 }
3474 else {
3475 Mean.push_back(
label(
"mean_{95} = ( %4.2lf #pm %4.2lf ) #times 10^{%d}",
3476 mean_95*std::pow(10.,double(mean_power)), dmean_95*std::pow(10,double(mean_power)), -mean_power ) );
3477
3478 }
3479
3480 if ( rms_power == 0 ) {
3481 RMS.push_back(
label(
"rms_{95} = %4.2lf #pm %4.2lf", rms_95, drms_95 ) );
3482 }
3483 else {
3484 RMS.push_back(
label(
"rms_{95} = ( %4.2lf #pm %4.2lf ) #times 10^{%d}",
3485 rms_95*std::pow(10.,double(rms_power)), drms_95*std::pow(10,double(rms_power)), -rms_power ) );
3486 }
3487
3488 if ( href ) {
3490
3491 double mean_95ref = d95ref->GetParameter(1);
3492 double dmean_95ref = d95ref->GetParError(1);
3493 double rms_95ref = d95ref->GetParameter(2);
3494 double drms_95ref = d95ref->GetParError(2);
3495
3496 std::cout <<
"\t\t" <<
histo.name()
3497 << "\tmean ref: " << mean_95ref << " +- " << dmean_95ref << " : pow " << mean_power
3498 << "\trms ref: " << rms_95ref << " +- " << drms_95ref << " : pow " << rms_power << std::endl;
3499
3500 if ( mean_power == 0 ) {
3501 MeanRef.push_back(
label(
"mean_{95} ref = %4.2lf #pm %4.2lf", mean_95ref, dmean_95ref) );
3502 }
3503 else {
3504 MeanRef.push_back(
label(
"mean_{95} ref = ( %4.2lf #pm %4.2lf ) #times 10^{%d}",
3505 mean_95ref*std::pow(10,double(mean_power)), dmean_95ref*std::pow(10,double(mean_power)), -mean_power ) );
3506
3507 }
3508
3509
3510 if ( rms_power == 0 ) {
3511 RMSRef.push_back(
label(
"rms_{95} ref = %4.2lf #pm %4.2lf", rms_95ref, drms_95ref ) );
3512 }
3513 else {
3514 RMSRef.push_back(
label(
"rms_{95} ref = ( %4.2lf #pm %4.2lf ) #times 10^{%d}",
3515 rms_95ref*std::pow(10,double(rms_power)), drms_95ref*std::pow(10,double(rms_power)), -rms_power ) );
3516 }
3517 }
3518
3520 if ( href )
href->Sumw2();
3521 }
3522
3525 if ( href )
Norm( href );
3527 Norm( htest, 1, xinfo.
lo(), xinfo.
hi() );
3528 if ( href )
Norm( href, 1, xinfo.
lo(), xinfo.
hi() );
3529 }
3530 }
3532 if ( href ) {
3535 Norm( href, 1, xinfo.
lo(), xinfo.
hi() );
3536 }
3537 }
3538 }
3539
3543 }
3544
3545 if ( !noreftmp && normref &&
3550 }
3551
3552 }
3553
3554 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3555
3556 if ( !noplots ) {
3557
3560
3561 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3562
3563 std::cout << "duff: " << xinfo << std::endl;
3564
3566 plots.sortx( xinfo );
3567
3568 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3569
3570 double yminset = 0;
3571 double ymaxset = 0;
3572
3573 double rmin = 0;
3574 double rmax = 0;
3575
3581
3582
3583
3584
3585 }
3586 else {
3587 rmin =
plots.realmin();
3588 rmax =
plots.realmax();
3589 }
3590
3592
3593 int csize =
chains.size() + taglabels.size() + ( atlasstyle ? 1 : 0 );
3594
3595 if ( yinfo.
log() && rmin>0 && rmax>0 ) {
3596
3598 double delta = std::log10(rmax)-std::log10(rmin);
3599
3601
3602
3603 yminset = rmin*std::pow(10,-delta*0.1);
3604
3605 double newdelta = std::log10(rmax) - std::log10(yminset) + 0.05*delta;
3606
3607 if ( csize<10 ) ymaxset = rmin*std::pow(10,newdelta/(1-0.07*csize));
3608 else ymaxset = rmin*std::pow(10,newdelta*2);
3609
3610 if ( yminset!=yminset ) {
3611 std::cerr << " range error " << delta << " " << yminset << " " << ymaxset << "\t(" << rmin << " " << rmax << ")" << std::endl;
3615 continue;
3616 }
3617
3618 }
3619 else {
3620
3623
3624 if ( ypos>0.5 ) {
3625 double delta = rmax-rmin;
3626
3627 yminset = rmin-0.1*delta;
3628
3629 if ( rmin>=0 && yminset<=0 ) yminset = 0;
3630
3631 double newdelta = rmax - yminset + 0.05*delta;
3632
3633 if ( csize<10 ) ymaxset = yminset + newdelta/(1-0.09*csize);
3634 else ymaxset = yminset + newdelta*2;
3635 }
3636 else {
3637 double delta = rmax-rmin;
3638
3639 ymaxset = rmax+0.1*delta;
3640
3641 double newdelta = ymaxset - rmin - 0.05*delta;
3642
3643 if ( csize<10 ) yminset = ymaxset - newdelta/(1-0.09*csize);
3644 else yminset = ymaxset - newdelta*2;
3645
3646 if ( rmin>=0 && yminset<=0 ) yminset = 0;
3647
3648 }
3649
3650 }
3651
3652 }
3653 else {
3655 yminset = yinfo.
lo();
3656 ymaxset = yinfo.
hi();
3657 }
3658 }
3659
3660 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3661
3662
3663
3664
3665
3666
3668
3669 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3670
3671 if ( yminset>yinfo.
lo() ) yminset = yinfo.
lo();
3672 if ( ymaxset<yinfo.
hi() ) ymaxset = yinfo.
hi();
3673 }
3674
3675
3677
3678 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3679
3680 if ( effset ) {
3681 ymaxset = effmax;
3682 yminset = effmin;
3683 }
3684 }
3685
3686 if ( ymaxset!=0 || yminset!=0 ) {
3687
3688 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3689
3690 plots.Max( ymaxset );
3691 plots.Min( yminset );
3692 }
3693
3694 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3695
3696 if ( yminset!=0 || ymaxset!=0 ) {
3697 if ( yminset>0 )
plots.SetLogy(yinfo.
log());
3698 else plots.SetLogy(
false);
3699 }
3701
3702
3703
3704 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3705
3706
3707
3709
3710 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3711
3712 plots.Draw( legend );
3713
3714 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3715
3716 if ( atlasstyle )
ATLASLabel( xpos, ypositions[0]+deltay, atlaslabel, labelcolour, ncolsp, nrowsp );
3717
3718 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3719
3720 for (
unsigned it=0 ;
it<taglabels.size() ;
it++ ) {
3721 DrawLabel( xpos, ypositions[it], taglabels[it], labelcolour, 0.04 );
3722 }
3723
3724 for (
unsigned it=0 ;
it<taglabels2.size() ;
it++ ) {
3725 DrawLabel( xpos+0.35, ypositions2[it], taglabels2[it], labelcolour, 0.04 );
3726 }
3727
3728 }
3729
3730 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3731
3732 std::cout << "means: " << means << std::endl;
3733
3734
3735 if ( means ) {
3737 for (
unsigned j=0 ;
j<MeanLF.size() ;
j++ )
DrawLabel( 0.2, (0.85-(j+
chains.size()-1)*0.035), MeanLF[j],
colours[j%6] );
3738 }
3739
3740
3741
3742 double ytop = 0.5;
3743
3744 if ( ( !nostats || !nomeans ) && !noplots ) {
3745 if ( dochi2 )
for (
unsigned j=0 ;
j<Chi2.size() ;
j++ )
DrawLabel( 0.75, 0.85-j*0.035, Chi2[j],
colours[j%6] );
3748 histo.name()==
"pT" ||
3751
3753 for (
unsigned j=0 ;
j<
chains.size() ;
j++ ) {
3754 if ( !noreftmp ) {
3755 if ( j<MeanRef.size() ) {
3756 if ( !nomeans )
DrawLabel( xpos_original, (ytop-j*0.035), MeanRef[j],
colours[j%6] );
3758 }
3759 }
3760 if ( j<
Mean.size() ) {
3763 }
3764 }
3765 }
3766 }
3767 }
3768
3769 if ( xinfo.
log() ) gPad->SetLogx(
true);
3770 else gPad->SetLogx(false);
3771
3772 if ( yinfo.
log() ) gPad->SetLogy(
true);
3773 else gPad->SetLogy(false);
3774
3775 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3776
3777 if ( !noplots ) {
3778
3779 if ( make_ref_efficiencies ) {
3780
3781 plots_eff.SetXaxisTitle(
plots.GetXaxisTitle() );
3782 plots_eff.SetYaxisTitle(
plots.GetYaxisTitle() );
3783
3784 plots_eff.Draw( legend_eff );
3785 }
3786
3787 if ( !noreflabel.empty() )
DrawLabel(0.1, 0.06, noreflabel, kRed, 0.03 );
3788
3789 }
3790
3791 }
3792
3793
3799
3800 if ( !noplots ) {
3801
3803
3805
3806 std::string useplotname;
3807
3808 if ( panel.
size()>1 ) {
3809 useplotname = panel.
name();
3810 replace( useplotname,
'/',
'_' );
3811 }
3812 else {
3813 useplotname = plotname;
3814 }
3815
3816 useplotname.erase(
std::remove( useplotname.begin(), useplotname.end(),
'+' ), useplotname.end() );
3817
3818 std::string printbase =
dir + useplotname +
tag;
3819
3821
3822 if ( !nopdf )
print_pad( printbase+
".pdf" );
3823 if ( !nopng )
print_pad( printbase+
".png" );
3824 if ( Cfile )
print_pad( printbase+
".C" );
3825
3826 std::cout << std::endl;
3827 }
3828
3829 }
3830
3831 if (
tc )
delete tc;
3832
3833 }
3834
3835
3836 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3837
3839
3840
3842 bool files_duplicated = ( fref_==ftest_ );
3843
3844 if ( deleteref && !files_duplicated ) {
3845
3846 if ( fref_ ) {
3847
3849
3850 std::cout << "main() cleaning up reference file" << std::endl;
3851
3852 TFile* newout = new TFile(".newout.root","recreate");
3853 newout->cd();
3854
3857
3859
3861
3863
3864
3866
3867 for (
unsigned j=0 ;
j<
dirs.size()-1 ;
j++ ) {
3868 std::cout <<
"\t" <<
dirs[
j] << std::endl;
3869 TDirectory* renedir =
gDirectory->GetDirectory(
dirs[j].c_str() );
3872 }
3873
3874
3876 if ( !noreftmp && href ) {
3878 href->Write(
dirs.back().c_str() );
3879 }
3880
3881
3883 }
3884
3885 newout->Close();
3886
3887 }
3888 }
3889
3890
3891 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3892
3894
3895 if ( fref_ && !files_duplicated ) fref_->Close();
3896 if ( ftest_ ) ftest_->Close();
3897
3899
3900 if ( deleteref && !noref ) {
3901 std::cout << "ref " << frefname << "\ttest " << ftestname << std::endl;
3902 if ( frefname != ftestname && !files_duplicated ) {
3903 std::string
cmd = std::string(
"mv ") + frefname +
" " + frefname +
".bak";
3904 std::system(
cmd.c_str() );
3905
3906 cmd = std::string(
"mv .newout.root ") + std::string(frefname);
3907 std::system(
cmd.c_str() );
3908 }
3909 else {
3910 std::cerr << "reference file and test file are the same - not replacing" << std::endl;
3911 }
3912 }
3913
3914 std::cout << "deleting at " << __LINE__ << std::endl;
3915
3916 if ( fref_ && !files_duplicated ) delete fref_;
3917 if ( ftest_ ) delete ftest_;
3918
3919 return 0;
3920}
void ATLASLabel(Double_t x, Double_t y, char *text=NULL, Color_t color=1)
class to store information about axes, limits, whether it is log or linear scale etc
static std::vector< std::string > split(const std::string &s, const std::string &t=":")
details of the histogram axes etc
slightly more convenient legend class
const std::string & name() const
static void setwatermark(bool b)
Get tag-value pairs from a file.
void range(const std::string &chain, TH1F *h)
static void setplotref(bool b)
void d0fit(const HistDetails &histo, TH1 *ht, const std::string &chain="")
void autoy(TH2 *h)
get the auto y range of a 2d histogram
TH1F * rebin_log(TH1F *h, bool low=false)
void normy(TH2 *h)
zero the contents of a 2d histogram
TH1F * trans(TH1F *h, bool t=false)
void print_pad(const std::string &s)
void arsaway(std::string &s, const std::string &pattern, const std::string &rep)
void testfit(TH1 *htest, const std::string &s)
double total_eff(TH1 *hn, TH1 *hd)
std::string fullreplace(std::string s, const std::string &s2, const std::string &s3)
void ifdbg(const std::string &)
void autox(TH2 *h, bool t=false)
get the auto x range of a 2d histogram
std::map< std::string, std::string > chainmap_t
global typedef here is ok, since this is a standalone executable, including a main().
double chi2(TH1 *h0, TH1 *h1)
TH1F * makeplot(TObject *hreft)
TH1F * Rebin(TH1F *h, double f)
void Scale(TH1 *h, double d=1)
T * Get(TFile &f, const std::string &n, const std::string &dir="", const chainmap_t *chainmap=0, std::vector< std::string > *saved=0)
get a histogram given a path, and an optional initial directory if histogram is not found,...
void copyReleaseInfo(TFile *finput, TFile *foutdir)
copy the release info TTree
void Norm(TH1 *h, double scale, double xmin, double xmax)
std::string findrun(TFile *f)
bool exists(const std::string &filename)
does a file exist
bool fcontains(const std::string &s, const std::string &p)
contains a string at the beginning of the string
static std::string release
std::vector< std::string > savedhistos
std::string replace(std::string s, const std::string &s2, const std::string &s3)
std::string find(const std::string &s)
return a remapped string
std::map< std::string, int > dirs
list of directories to be explicitly included, together with corresponding depths of subdirectories
std::string chop(std::string &s1, const std::string &s2)
static std::vector< uint32_t > runnumber
std::string label(const std::string &format, int i)
const std::regex rx1(R"(_v[0-9]+$)")
TF1 * FitNull(TH1D *s, double a=-999, double b=-999)
bool setscalerms95(bool b)
TF1 * FitNull95(TH1D *s, double a=0, double b=0)
mkdir(path, recursive=True)
DataModel_detail::iterator< DVL > remove(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, const T &value)
Specialization of remove for DataVector/List.
std::string dirname(std::string name)
std::string basename(std::string name)