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 ...
975 {
976
978
980 std::cout << "\n---------------------------------\n";
981 std::cout << "\n comparitor is off ...\n";
982
983 if ( argc<4 )
return usage(argv[0], -1,
"too few arguments");
984
986
988
989 std::string
tag =
"";
990 std::string
key =
"";
991
992 std::string
dir =
"";
993
994 std::string ftestname = "";
995 std::string frefname = "";
996
997 TFile* ftest_ = 0;
998 TFile* fref_ = 0;
999
1000 bool effset = false;
1001 double effmin = 90;
1002 double effmax = 102;
1003
1004 std::string defreflabel = "";
1005
1007
1008 std::vector<std::string> usrlabels;
1009 bool uselabels = false;
1010 bool addinglabels = false;
1011
1012 std::vector<std::string> taglabels;
1013 std::vector<std::string> taglabels2;
1014 bool addingtags = false;
1015 bool addingtags2 = false;
1016
1017 bool lumiref_trans = false;
1018 bool lumitest_trans = false;
1019
1020 bool make_efficiencies = true;
1021
1022 bool make_ref_efficiencies = false;
1023 bool refit_resplots = false;
1024 bool refitref_resplots = false;
1025 bool bayes = true;
1026 bool nostats = false;
1027 bool nomeans = false;
1028 bool means = false;
1029 bool noref = false;
1030 bool atlasstyle = false;
1031 bool deleteref = false;
1032 bool nowatermark = false;
1033 bool noplots = false;
1034 bool nopng = false;
1035 bool nopdf = false;
1036 bool Cfile = false;
1037 bool notitle = true;
1038 bool dochi2 = false;
1039 bool normref = false;
1040 bool scalepix = false;
1041 bool oldrms = false;
1042 bool addchains = false;
1043 bool usechainref = false;
1045
1046 bool RANGEMAP = false;
1047 bool ALLRANGEMAP = false;
1048
1049 double xerror = 0;
1050
1051 std::string atlaslabel_tmp = "Internal";
1052
1053
1054 double scale_eff = -1;
1055 double scale_eff_ref = -1;
1056
1057 std::string configfile = "";
1058
1059 double xoffset = 0;
1060
1061
1062 double ypos_in = 0;
1063
1065 std::string
regex =
"";
1066
1067 std::string patternr = "";
1068 std::string regexr = "";
1069
1070 std::string patternt = "";
1071 std::string regext = "";
1072
1073 std::string basedir = "";
1074
1075 std::string xpattern = "";
1076 std::string xregex = "";
1077
1078 std::vector<std::string>
chains;
1079 std::vector<std::string> refchains;
1080
1081 bool addingrefchains = false;
1082
1083 std::string mapfile = "";
1084
1085 std::vector<std::string> chainfiles;
1086
1087 int ncols = 2;
1088
1090
1091 bool refbands = false;
1092
1093 for(
int i=1;
i<
argc;
i++){
1095
1096 ifdbg(
"\ncnt: " + arg );
1097
1098
1099 if (
arg.find(
'-')!=0 && addinglabels ) {
1103 usrlabels.push_back(
label );
1104 continue;
1105 }
1106 else addinglabels = false;
1107
1108 if (
arg.find(
'-')!=0 && addingrefchains ) {
1109 refchains.push_back( arg );
1110 continue;
1111 }
1112 else addingrefchains = false;
1113
1114 if (
arg.find(
'-')!=0 && addingtags ) {
1115 taglabels.push_back(
fullreplace( arg,
"__",
" " ) );
1116 std::cout << "\tadding tag label: " << taglabels.back() << std::endl;
1117 continue;
1118 }
1119 else addingtags = false;
1120
1121 if (
arg.find(
'-')!=0 && addingtags2 ) {
1122 taglabels2.push_back(
fullreplace( arg,
"__",
" " ) );
1123 std::cout << "\tadding tag label: " << taglabels2.back() << std::endl;
1124 continue;
1125 }
1126 else addingtags2 = false;
1127
1128 ifdbg(
"starting if cascade: "+arg );
1129
1130 if ( arg=="-h" || arg=="--help" ) {
1131 return usage(argv[0], 0);
1132 }
1133 else if ( arg=="-c" || arg=="--config" ) {
1134 if ( ++i<argc ) configfile=
argv[
i];
1135 else return usage(argv[0], -1,
"no config file provided");
1137 }
1138 else if ( arg=="--jl" ) {
1141 }
1142 else if ( arg=="--eps" ) {
1145 }
1146 else if ( arg=="-t" || arg=="--tag" ) {
1147 if ( ++i<argc )
tag=std::string(
"-")+
argv[
i];
1148 else return usage(argv[0], -1,
"no tag provided");
1150 }
1151 else if ( arg=="-l" || arg=="--labels" ) {
1152 addinglabels = true;
1154 }
1155 else if ( arg=="-el" ) {
1158 }
1159 else if ( arg=="-k" || arg=="--key" ) {
1161 else return usage(argv[0], -1,
"no key provided");
1163 }
1164 else if ( arg=="--run" ) {
1166 else return usage(argv[0], -1,
"no run number provided");
1168 }
1169 else if ( arg=="-m" || arg=="--mapfile" ) {
1170 if ( ++i<argc ) mapfile=
argv[
i];
1171 else return usage(argv[0], -1,
"no mapfile provided");
1173 }
1174 else if ( arg=="-d" || arg=="--dir" ) {
1176 else return usage(argv[0], -1,
"no directory provided");
1178 }
1179 else if ( arg=="--lumi" ) {
1180 lumitest_trans = true;
1181 lumiref_trans = true;
1183 }
1184 else if ( arg=="--lumitest" ) {
1185 lumitest_trans = true;
1186 ifdbg(
"--lumitest");
1187 }
1188 else if ( arg=="--lumiref" ) {
1189 lumiref_trans = true;
1191 }
1192 else if ( arg=="-rb" || arg=="--refbands" ) {
1193 refbands = true;
1194 ifdbg(
"--refbands");
1195 }
1196 else if ( arg=="-b" || arg=="--bdir" ) {
1197 if ( ++i<argc ) basedir=
argv[
i];
1198 else return usage(argv[0], -1,
"no directory provided");
1200 }
1201 else if ( arg=="--taglabels" ) {
1202 addingtags = true;
1203 ifdbg(
"--taglabels");
1204 }
1205 else if ( arg=="--taglabels2" ) {
1206 addingtags2 = true;
1207 ifdbg(
"--taglabels2");
1208 }
1209 else if ( arg=="--unscalepix" ) {
1210 scalepix = false;
1211 ifdbg(
"--unscalepix");
1212 }
1213 else if ( arg=="--scalepix" ) {
1214 scalepix = true;
1215 ifdbg(
"--scalepix");
1216 }
1217 else if ( arg=="-ac" || arg=="--addchains" ) {
1218 addchains = true;
1219 ifdbg(
"--sddchains");
1220 }
1221 else if ( arg=="-yrange" ) {
1222 effset = true;
1223 if ( ++i<argc ) effmin=std::atof(argv[i]);
1224 else return usage(argv[0], -1,
"no range specified");
1225 if ( ++i<argc ) effmax=std::atof(argv[i]);
1226 else return usage(argv[0], -1,
"no upper y limit specified");
1228 }
1229 else if ( arg=="-e" || arg=="--efficiencies" ) {
1230 make_ref_efficiencies = true;
1231 ifdbg(
"--efficiencies");
1232 }
1233 else if ( arg=="-r" || arg=="--refit" ) {
1234 refit_resplots = true;
1236 }
1237 else if ( arg=="-rr" || arg=="--refitref" ) {
1238 refitref_resplots = true;
1239 ifdbg(
"--refitref");
1240 }
1241 else if ( arg=="--oldrms" ) {
1242 oldrms = true;
1244 }
1245 else if ( arg=="-nw" || arg=="--nowatermark" ) {
1246 nowatermark = true;
1248 ifdbg(
"--nowatermark");
1249 }
1250 else if ( arg=="--chi2" ) {
1251 dochi2 = true;
1253 }
1254 else if ( arg=="-ns" || arg=="--nostats" ) {
1255 nostats = true;
1257 }
1258 else if ( arg=="-nm" || arg=="--nomeans" ) {
1259 nomeans = true;
1261 }
1262 else if ( arg=="--means" ) {
1263 means = true;
1265 }
1266 else if ( arg=="-nt" || arg=="--notitle" ) {
1267 notitle = true;
1269 }
1270 else if ( arg=="-nr" || arg=="--noref" ) {
1272 noref = true;
1274 }
1275 else if ( arg=="--normref" ) {
1276 normref = true;
1278 }
1279 else if ( arg=="-rc" || arg=="--refchains" ) {
1280 addingrefchains = true;
1281 ifdbg(
"--refchains");
1282 }
1283 else if ( arg=="-uc" || arg=="--usechainref" ) {
1284 usechainref = true;
1285 ifdbg(
"--usechainref");
1286 }
1287 else if ( arg=="-nb" || arg=="--nobayes" ) {
1288 bayes = false;
1290 }
1291 else if ( arg=="-es" || arg=="--effscale" ) {
1292 if ( ++i<argc ) scale_eff=std::atof(argv[i]);
1293 else return usage(argv[0], -1,
"no efficiency scale provided");
1294 ifdbg(
"--effscale");
1295 }
1296 else if ( arg=="-er" || arg=="--effscaleref" ) {
1297 if ( ++i<argc ) scale_eff_ref=std::atof(argv[i]);
1298 else return usage(argv[0], -1,
"no efficiency scale for the reference histograms provided");
1299 ifdbg(
"--effscaleref");
1300 }
1301 else if ( arg=="--ncols" ) {
1302 if ( ++i<argc ) ncols=std::atoi(argv[i]);
1303 else return usage(argv[0], -1,
"no number of columns provided");
1305 }
1306 else if ( arg=="-np" || arg=="--noplots" ) {
1307 noplots = true;
1309 }
1310 else if ( arg=="-C" || arg=="--Cfiles" ) {
1311 Cfile = true;
1313 }
1314 else if ( arg=="--deleteref" ) {
1315 deleteref = true;
1316 ifdbg(
"--deleteref");
1317 }
1318 else if ( arg=="--nopng" ) {
1319 nopng = true;
1321 }
1322 else if ( arg=="--nopdf" ) {
1323 nopdf = true;
1325 }
1326 else if ( arg=="-as" || arg=="--atlasstyle" ) {
1327 atlasstyle = true;
1328
1329 ifdbg(
"--atlasstyle");
1330 }
1331 else if ( arg=="--tp" ) {
1332 make_efficiencies = false;
1334 }
1335 else if ( arg=="-q" || arg=="--quiet" ) {
1338 }
1339 else if ( arg=="-al" || arg=="--atlaslabel" ) {
1340 if ( ++i<argc ) atlaslabel_tmp=
argv[
i];
1341 else return usage(argv[0], -1,
"no label provided");
1342 ifdbg(
"--atlaslabel");
1343 }
1344 else if ( arg=="-xo" || arg=="--xoffset" ) {
1345 if ( ++i<argc ) xoffset=std::atof(argv[i]);
1346 else return usage(argv[0], -1,
"no xoffset provided");
1348 }
1349 else if ( arg=="-yp" || arg=="--ypos" ) {
1350 if ( ++i<argc ) ypos_in=std::atof(argv[i]);
1351 else return usage(argv[0], -1,
"no y position provided");
1353 }
1354 else if ( arg=="-xe" || arg=="--xerror" ) {
1355 if ( ++i<argc ) xerror=std::atof(argv[i]);
1356 else return usage(argv[0], -1,
"no x error provided");
1358 }
1359 else if ( arg=="-s" || arg=="--swap" ) {
1361 else return usage(argv[0], -1,
"no patterns provided");
1363 else return usage(argv[0], -1,
"no target pattern provided");
1365 }
1366 else if ( arg=="--swapt" ) {
1367 if ( ++i<argc ) patternt=
argv[
i];
1368 else return usage(argv[0], -1,
"no patterns provided");
1369 if ( ++i<argc ) regext=
argv[
i];
1370 else return usage(argv[0], -1,
"no target pattern provided");
1372 }
1373 else if ( arg=="--swapr" ) {
1374 if ( ++i<argc ) patternr=
argv[
i];
1375 else return usage(argv[0], -1,
"no patterns provided");
1376 if ( ++i<argc ) regexr=
argv[
i];
1377 else return usage(argv[0], -1,
"no target pattern provided");
1379 }
1380 else if ( arg=="-sx" || arg=="--swapaxtitles" ) {
1381 if ( ++i<argc ) xregex=
argv[
i];
1382 else return usage(argv[0], -1,
"no target pattern provided");
1383 if ( ++i<argc ) xpattern=
argv[
i];
1384 else return usage(argv[0], -1,
"no patterns provided");
1385 ifdbg(
"--swapxtitles");
1386 }
1387 else if (
arg.find(
'-')==0 ) {
1388 std::cerr <<
"unknown option: " <<
arg <<
"\n" << std::endl;
1389 return usage(argv[0], -4);
1390 }
1391 else {
1392 ifdbg(
"arg: + "+arg);
1393 if ( ftestname==
"" ) ftestname =
arg;
1394 else if ( frefname==
"" ) frefname =
arg;
1395 else {
1396 std::string
file =
"";
1397
1398 if (
arg.find(
":file:")!=std::string::npos ) {
1400 chainfiles.push_back(
file );
1402 }
1403
1405
1409
1410 std::cout <<
"file: " <<
file <<
"\tchain: " <<
chain << std::endl;
1411
1412 }
1413 }
1414 }
1415
1416 if ( ftestname.empty() ) {
1417 std::cerr << "main(): test file not specified " << std::endl;
1418 return -1;
1419 }
1420
1421 if ( !
exists(ftestname) ) {
1422 std::cerr << "main(): test file " << ftestname << " does not exist" << std::endl;
1423 return -1;
1424 }
1425
1426 std::vector<TFile*> chainTFiles;
1427
1428 if ( chainfiles.size()==0 ) ftest_ = TFile::Open( ftestname.c_str() );
1429 else {
1430 noref=true;
1431 chainTFiles.resize(chainfiles.size());
1432 for (
size_t i=0 ;
i<chainfiles.size() ;
i++ ) {
1433 chainTFiles[
i] = TFile::Open( chainfiles[i].c_str() );
1434 if ( chainTFiles[i] == 0 ) {
1435 std::cerr <<
"\tfile: " << chainfiles[
i] <<
" could not be opened" << std::endl;
1436 return -1;
1437 }
1438 else std::cout <<
"\tchainfiles: " << chainfiles[
i] <<
" " << chainTFiles[
i] << std::endl;
1439 }
1440 }
1441
1442
1443 if ( noref==false ) {
1444 if ( frefname.empty() ) {
1445 std::cerr << "main(): ref file not specified " << std::endl;
1447 noref = true;
1452
1453 }
1454
1455 if ( frefname==ftestname ) fref_ = ftest_;
1456 else if (
exists(frefname) ) fref_ = TFile::Open( frefname.c_str() );
1457 else {
1458 std::cerr << "main(): ref file " << frefname << " does not exist" << std::endl;
1459
1461 noref=true;
1462 }
1463 }
1464 else fref_ = ftest_;
1465
1466 if ( chainfiles.size()==0 ) {
1467 if ( ftest_==0 ) {
1468 std::cerr << "could not open test file " << ftestname << std::endl;
1469 return -1;
1470 }
1471
1472 if ( noref==false && fref_==0 ) {
1473 std::cerr << "could not open files " << std::endl;
1477 noref=true;
1478 fref_=ftest_;
1479 defreflabel = "failed to open reference file";
1480 }
1481
1482 }
1483
1484 if ( scale_eff == -1 ) scale_eff = 100;
1485 if ( scale_eff_ref == -1 ) scale_eff_ref = scale_eff;
1486
1487
1488 bool noreftmp = noref;
1489
1490 if (
chains.size()==0 )
return usage(argv[0], -1,
"no chains specified");
1491
1492
1493 if ( basedir.size()>0 ) {
1494 if ( basedir[basedir.size()-1]!='/' ) basedir += "/";
1496 }
1497
1498 if ( refchains.size()>0 && refchains.size()!=
chains.size() )
return usage(argv[0], -1,
"not enough chains specified");
1499
1500 if ( refchains.size()==0 ) refchains =
chains;
1501
1502 std::vector<std::string> chainref(
chains.size(),
"");
1503 std::vector<std::string> chain_name(
chains.size(),
"");
1504
1505 std::vector<std::string> refchain(chainref.size(),"");
1506
1507
1508
1509 std::cout <<
argv[0] <<
" options:" << std::endl;
1510 std::cout << "\tATLAS style: " << ( atlasstyle ? "true" : "false" ) << std::endl;
1511 std::cout << "\tBayesian uncertainties: " << ( bayes ? "true" : "false" ) << std::endl;
1512 std::cout << "\trefit resplot uncertainties: " << ( refit_resplots ? "true" : "false" ) << std::endl;
1513 std::cout << "\tsuppress mean and rms stats: " << ( nostats ? "true" : "false" ) << std::endl;
1514 if ( !nostats ) std::cout << "\tsuppress meanstats: " << ( nomeans ? "true" : "false" ) << std::endl;
1515 std::cout << "\tsuppress png output: " << ( nopng ? "true" : "false" ) << std::endl;
1516 std::cout << "\tsuppress pdf output: " << ( nopdf ? "true" : "false" ) << std::endl;
1517 std::cout << "\tsuppress reference output: " << ( noref ? "true" : "false" ) << std::endl;
1518 std::cout << "\tuse chain references: " << ( usechainref ? "true" : "false" ) << std::endl;
1519 std::cout << "\tpanel ncols: " << ncols << std::endl;
1520
1521 if ( usrlabels.size()>0 ) std::cout << "\tlabels: " << usrlabels.size() << std::endl;
1522 if ( taglabels.size()>0 ) std::cout << "\textra text: " << taglabels << std::endl;
1523 if ( taglabels2.size()>0 ) std::cout << "\textra text: " << taglabels2 << std::endl;
1524
1525
1526 for (
size_t il=0 ;
il<usrlabels.size() ;
il++ ) {
1527 std::cout <<
"usr label[" <<
il <<
"] : " << usrlabels[
il] << std::endl;
1528 }
1529
1530 std::cout << "atlas style : " << atlasstyle << std::endl;
1531
1532 if ( atlasstyle ) {
1535 gStyle->cd();
1536 }
1537 else {
1538 gROOT->SetStyle("Plain");
1539 gStyle->cd();
1540 gStyle->SetLineScalePS(1);
1541 xoffset += 0.02;
1542 }
1543
1544 gStyle->SetErrorX(xerror);
1545
1546 gStyle->SetPadLeftMargin(0.15);
1547 gStyle->SetPadBottomMargin(0.15);
1548
1549 gStyle->SetPadRightMargin(0.02);
1550 gStyle->SetPadTopMargin(0.05);
1551
1552 std::cout << "Chains: " << std::endl;
1553 for (
unsigned ic=0 ;
ic<
chains.size() ;
ic++ ) std::cout <<
"\t" << chains[ic] << std::endl;
1554
1555 if ( usrlabels.size()>0 ) std::cout << "labels: " << usrlabels << std::endl;
1556
1557 if ( usrlabels.size()>0 && usrlabels.size()==
chains.size() ) uselabels =
true;
1558
1560
1561 TTree* dataTree = 0;
1562 TString* releaseData = new TString("");
1563 std::vector<std::string> release_data;
1564
1565
1566 if ( !nowatermark && ftest_ ) {
1567
1568 dataTree = (TTree*)ftest_->Get("dataTree");
1569
1570 if ( dataTree ) {
1571 dataTree->SetBranchAddress( "ReleaseMetaData", &releaseData);
1572
1573 for (
unsigned int i=0;
i<dataTree->GetEntries() ;
i++ ) {
1574 dataTree->GetEntry(i);
1575 release_data.push_back( releaseData->Data() );
1576 std::cout << "main() release data: " << release_data.back() << " : " << *releaseData << std::endl;
1577 }
1578 }
1579
1580 std::cout << "release data size " << release_data.size() << std::endl;
1581
1582 if ( release_data.size()>0 ) {
1583 if ( release_data.size()>1 ) std::cerr << "main() more than one release - using only the first" << std::endl;
1584
1585
1586
1587 std::string rd = release_data[0];
1588
1589 while ( rd.size()>0 ) {
1590
1592
1593 if (
contains(nightly,
"private" ) ) {
1594 for (
int ic=0 ;
ic<4 ;
ic++ )
chop(release_data[0],
" " );
1595 release +=
" (" + release_data[0]+
")";
1596 break;
1597 }
1598 else {
1599
1600 if (
contains(nightly,
"nightly") ) {
1601 chop( nightly,
"/" );
1604 break;
1605 }
1606
1607 }
1608 }
1609 }
1610 }
1611
1612 std::cout <<
"release: " <<
release << std::endl;
1613
1614
1615
1617
1619
1620 std::cout << "trying to make directory" << std::endl;
1623 if (
mkdir(
dir.c_str(), 0777 ) ) std::cerr <<
"main() couldn't create directory " <<
dir << std::endl;
1624 else std::cout <<
"main() output will be sent to directory " <<
dir << std::endl;
1625 }
1626 }
1627
1628 if ( ftest_==0 && chainTFiles.size()>0 ) fref_ = ftest_ = chainTFiles[0];
1629
1630 TFile* ftest = ftest_;
1631 TFile* fref = fref_;
1632
1634
1635 std::string rawrefrun = "";
1636 std::string refrun = "";
1637
1638 if ( fref_ ) refrun = rawrefrun =
findrun( fref );
1639
1640 std::cout <<
"testrun: " <<
testrun <<
"\nrefrun: " << refrun << std::endl;
1641
1642 if ( !
testrun.empty() && refrun != testrun ) {
1646 }
1647
1648 }
1649
1650 if ( !refrun.empty() ) {
1651
1652 std::string newtag = "Reference: ";
1653
1654 std::cout << "refrun: " << refrun << std::endl;
1655
1657 while ( (pos=refrun.find('_'))!=std::string::npos ) refrun.replace( pos, 1, " " );
1658 newtag += refrun;
1659
1660 std::string rawrun = refrun.erase( refrun.find("run"), 4 );
1661
1662 if (
contains(frefname, rawrun) ) {
1663
1664 std::string
release = frefname;
1665
1667
1673
1674 newtag += " ";
1676
1677 }
1678
1679 taglabels.push_back( newtag );
1680
1681 std::cout << "tag labels: " << taglabels << std::endl;
1682
1683 }
1684
1689 int NeventTest = 1;
1690 int NeventRef = 1;
1691
1692
1694
1695
1696 if ( !nowatermark ) {
1697
1698
1699 TH1D* htestev = (TH1D*)ftest->Get("event") ;
1700 TH1D* hrefev = (TH1D*)fref->Get("event") ;
1701
1702
1703
1704 std::cout << "htestev " << htestev << " " << hrefev << std::endl;
1705
1706 if ( htestev ) NeventTest = htestev->GetEntries();
1707 if ( hrefev ) NeventRef = hrefev->GetEntries();
1708
1710 }
1711 else {
1712 NeventTest = 1;
1713 NeventRef = 1;
1714 }
1715
1716
1717 if ( NeventTest>1 ) std::cout << "Nevents Test: " << NeventTest << std::endl;
1718 if ( NeventRef>1 ) std::cout << "Nevents Ref: " << NeventRef << std::endl;
1719
1721
1722 if ( mapfile.empty() ) mapfile = configfile;
1723
1724
1725 std::cout << "mapfile: " << mapfile << std::endl;
1726
1727 if ( !mapfile.empty() ) {
1728
1730
1731 if (
m.isTagDefined(
"ChainMap" ) ) {
1732
1733 std::vector<std::string>
chains =
m.GetStringVector(
"ChainMap" );
1734
1735 for (
size_t i=0 ;
i<
chains.size() ;
i+=2 ) std::cout <<
"map: " << chains[i] <<
" -> " << chains[i+1] << std::endl;
1736
1738
1739 for (
size_t i=0 ;
i<
chains.size() ;
i+=2 ) {
1740 chainmap->insert( chainmap_t::value_type( chains[i], chains[i+1] ) );
1741 }
1742
1743 std::cout << "\nusing chain map:" << std::endl;
1744
1745 for ( chainmap_t::iterator itr=chainmap->begin() ; itr!=chainmap->end() ; itr++ ) {
1746 std::cout << "\t" << itr->first << "\t" << itr->second << std::endl;
1747 }
1748 }
1749 }
1750
1752
1753 std::cout << "\ncreating chain and reference information ..." << std::endl;
1754
1755 for (
size_t j=0;
j<
chains.size();
j++) {
1756
1759
1761
1763 std::cout <<
"chain: " <<
chains[
j] <<
"\taddchains: " << addchains << std::endl;
1764
1765 if ( addchains && (
contains(chains[j],
"Shifter") || ( !
contains(chains[j],
"HLT_") && !
contains(chains[j],
"Fullscan" ) ) ) ) {
1766
1767 TFile* fftest = ftest;
1768
1769 if ( chainfiles.size()>0 && chainfiles.size()>j ) fftest = chainTFiles[
j];
1770
1771 TH1F* hchain =
Get( *fftest, chains[j]+
"/Chain", testrun );
1772
1773 if ( hchain ) {
1774
1775 std::string
name = hchain->GetTitle();
1776
1777 if ( usechainref && !
contains(chains[j],
"Purity") ) {
1778
1780
1781 std::cout <<
"new chainref: " << chainref[
j] << std::endl;
1782
1783 std::string::size_type
pos = chainref[
j].find(
":for");
1784 if ( pos!=std::string::npos ) chainref[
j].replace( pos, 4,
"_for" );
1785 std::replace( chainref[j].
begin(), chainref[j].
end(),
':',
'/');
1786 std::string newchain =
dirname(
dirname( chains[j]) ) +
"/Expert/" + chainref[
j];
1787 chainref[
j] = newchain;
1788
1789 std::cout <<
"final chainref: " << chainref[
j] << std::endl;
1790
1791 }
1792
1793 std::cout <<
"chainref: " << chainref[
j] << std::endl;
1794
1796
1797 std::cout <<
"name: " <<
name << std::endl;
1798
1799 if (
contains( name,
":" ) ) chain_name[
j] =
name.substr( 0,
name.find(
':') ) +
" : ";
1800 else chain_name[
j] =
name;
1801
1802 if ( chain_name[j] ==
" : " ) chain_name[
j] =
"";
1803
1804 std::cout <<
"chain_name: " << chain_name[
j] << std::endl;
1805 }
1806 }
1807 }
1808
1809 std::cout << "chainref size: " << chainref.size() << " " << refchains.size() << std::endl;
1810
1811 for (
size_t j=0 ;
j<chainref.size() ;
j++ ) {
1812 std::cout <<
"chainref: " << chainref[
j] <<
" :: " << refchains[
j] << std::endl;
1813
1815 if ( chainref[j]!=
"" ) refchain[
j] =
fullreplace( chainref[j], pattern, regex );
1816 else refchain[
j] =
fullreplace( refchains[j], pattern, regex );
1817
1818 if ( !patternr.empty() ) {
1819 if ( chainref[j]!=
"" ) refchain[
j] =
fullreplace( chainref[j], patternr, regexr );
1820 else refchain[
j] =
fullreplace( refchains[j], patternr, regexr );
1821 }
1822
1823 std::cout <<
"refchain: " << refchain[
j] << std::endl;
1824 }
1825
1826 std::cout << "done chains" << std::endl;
1827
1829
1830 std::vector<Panel> panels;
1831
1833
1835
1836
1837 std::vector<int> ccolours;
1838 std::vector<int> cstyles;
1839
1840 std::vector<std::string> ctags;
1841 std::vector<std::string> ctaglabels;
1842
1843
1844 std::cout <<
"\n" <<
argv[0] <<
"\tconfigfile: " << configfile << std::endl;
1845
1846 bool use_file_config = false;
1847
1848 if ( !configfile.empty() ) {
1849
1850 if (
exists(configfile) ) {
1851
1852 std::cout <<
argv[0] <<
":\treading configuration file " << configfile << std::endl;
1853
1855
1857
1858 std::cout << "searching for panels" << std::endl;
1859
1861
1862 if (
rc.isTagDefined(
"panels" ) ) {
1863
1864 std::cout <<
argv[0] <<
":\treading histogram panel configuration from file " << configfile << std::endl;
1865
1866 use_file_config = true;
1867
1868 std::vector<std::string> panel_config =
rc.GetStringVector(
"panels" );
1869
1870 std::vector<string> panel_columns;
1871
1872 if (
rc.isTagDefined(
"panel_columns") ) {
1873 panel_columns =
rc.GetStringVector(
"panel_columns" );
1874 if ( panel_columns.size()%2 )
return usage( argv[0], -1,
"incorrect panel settings" );
1875 }
1876
1877
1878 for ( size_t ipanel=panel_config.size() ; ipanel-- ; ) {
1879
1880 std::vector<std::string> raw_input =
rc.GetStringVector( panel_config[ipanel] );
1881
1882 int tncols = ncols;
1883
1884 if ( panel_columns.size() ) {
1885 std::vector<string>::iterator itr =
find( panel_columns.begin(), panel_columns.end(), panel_config[ipanel] );
1886 if ( itr!=panel_columns.end() ) tncols = std::atoi( (++itr)->c_str() );
1887 }
1888
1889 Panel p( panel_config[ipanel], tncols );
1890
1891 if ( raw_input.empty() ) {
1892 std::cerr << "no plots provided" << std::endl;
1893 return 1;
1894 }
1895
1896 for (
size_t iraw=0 ; iraw+6<=raw_input.size() ; iraw += 6 )
p.push_back( raw_input.begin()+iraw, raw_input.begin()+iraw+6 );
1897
1898 panels.push_back( p );
1899
1900 }
1901
1902 }
1903 else if (
rc.isTagDefined(
"histos" ) ) {
1904
1905 std::cout <<
argv[0] <<
":\treading histogram configuration from file " << configfile << std::endl;
1906
1907 use_file_config = true;
1908
1909 std::vector<std::string> raw_input =
rc.GetStringVector(
"histos" );
1910
1911 for ( size_t iraw=0 ; iraw+6<=raw_input.size() ; iraw += 6) {
1912 HistDetails h( raw_input.begin()+iraw, raw_input.begin()+iraw+6 );
1915 panels.push_back( p );
1916 }
1917
1918 }
1919
1920 if (
rc.isTagDefined(
"Bands" ) &&
rc.isTagDefined(
"Labels" ) ) {
1921 bnd =
bands(
rc.GetVector(
"Bands"),
rc.GetStringVector(
"Labels" ) );
1922 }
1923
1924
1925 if (
rc.isTagDefined(
"Colours") ) {
1926
1927 std::vector<int> ccolours =
rc.GetIntVector(
"Colours");
1928
1929 std::cout << "remap colours: " << ccolours << std::endl;
1930
1931 int new_colours[6];
1932
1933 for (
size_t i=6 ;
i-- ; ) new_colours[i] =
colours[i];
1934
1935 for (
size_t i=0 ;
i<ccolours.size() && i<6 ;
i++ ) {
1936 if ( ccolours[i]<6 ) new_colours[
i] =
colours[ccolours[
i]];
1937 }
1938
1939 for (
size_t i=6 ;
i-- ; )
colours[i] = new_colours[i];
1940
1941 }
1942
1943
1944 if (
rc.isTagDefined(
"Styles") ) {
1945
1946 std::vector<int> cstyles =
rc.GetIntVector(
"Styles");
1947
1948 std::cout << "remap markers: " << cstyles << std::endl;
1949
1950 int new_markers[6];
1951
1952 for (
size_t i=6 ;
i-- ; ) new_markers[i] =
markers[i];
1953
1954 for (
size_t i=0 ;
i<cstyles.size() && i<6 ;
i++ ) {
1955 if ( cstyles[i]<6 ) new_markers[
i] =
markers[cstyles[
i]];
1956 }
1957
1958 for (
size_t i=6 ;
i-- ; )
markers[i] = new_markers[i];
1959
1960 }
1961
1963 for (
int i=6 ;
i-- ; ) std::cout <<
"\tcolours[" << i <<
"] = " <<
colours[i] << std::endl;
1964 for (
int i=6 ;
i-- ; ) std::cout <<
"\tmarkers[" << i <<
"] = " <<
markers[i] << std::endl;
1965 }
1966
1967 if (
rc.isTagDefined(
"Tags") ) ctags =
rc.GetStringVector(
"Tags");
1968 if (
rc.isTagDefined(
"TagLabels") ) ctaglabels =
rc.GetStringVector(
"TagLabels");
1969 if (
rc.isTagDefined(
"TagLabels") ) usrlabels =
rc.GetStringVector(
"TagLabels");
1970
1971
1972 if (
rc.isTagDefined(
"Styles") ) {
1973 for ( size_t is=0 ; is<cstyles.size() && is<6 ; is++ ) {
1975 }
1976 }
1977
1978
1979 uselabels = true;
1980
1981
1982 std::cout <<
argv[0] <<
"\tuserlabels :" << usrlabels <<
":" << std::endl;
1983
1984 if (
rc.isTagDefined(
"RANGEMAP") ) RANGEMAP =
true;
1985 if (
rc.isTagDefined(
"ALLRANGEMAP") ) ALLRANGEMAP =
true;
1986
1987 std::cout <<
"Extra: " <<
rc.isTagDefined(
"Extra") << std::endl;
1988
1989 if (
rc.isTagDefined(
"Extra") ) taglabels.push_back(
fullreplace(
rc.GetString(
"Extra"),
"__",
" " ) );
1990
1991
1992 }
1993 else {
1994 std::cerr <<
argv[0] <<
":\t config file not found: " << configfile << std::endl;
1995 return -1;
1996 }
1997
1998 }
1999
2000 if ( !use_file_config ) {
2001
2002 std::cout << "using default panels" << std::endl;
2003
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015 scale_eff = 1;
2016 scale_eff_ref = 1;
2017
2019
2021
2022 std::string pnames[3] = { "eff", "res", "diff" };
2023
2024 for (
size_t ip=0 ;
ip<inpanels.size() ;
ip++ ) {
2025 Panel p( pnames[ip]+
"_panel", 2 );
2026 for (
size_t ih=0 ; ih<inpanels[
ip].size() ; ih++ )
p.push_back( inpanels[ip][ih] );
2027 panels.push_back( p );
2028 }
2029
2030 }
2031
2032
2033 std::cout << "taglabels" << std::endl;
2034
2035 for (
size_t it=0 ;
it<taglabels.size() ;
it++ ) std::cout << taglabels[it] << std::endl;
2036 for (
size_t it=0 ;
it<taglabels2.size() ;
it++ ) std::cout << taglabels2[it] << std::endl;
2037
2038
2039 std::cout << "\npanels: " << panels.size() << std::endl;
2040
2041 if ( panels.size()==0 )
return usage(argv[0], -1,
"no panels to plot");
2042
2043 for (
size_t ip=0 ;
ip<panels.size() ;
ip++ ) std::cout << panels[ip] << std::endl;
2044
2045
2047 if ( true ) {
2048 gStyle->SetPadRightMargin(0.05);
2049 gStyle->SetPadTopMargin(0.05);
2050
2052 const Int_t Number = 3;
2053 Double_t
Red[Number] = { 0.00, 0.00, 1.00 };
2054 Double_t
Green[Number] = { 0.00, 5.00, 1.00 };
2055 Double_t Blue[Number] = { 0.00, 0.50, 0.00 };
2056 Double_t Length[Number] = { 0.00, 0.50, 1.00 };
2058 TColor::CreateGradientColorTable( Number, Length, Red, Green, Blue, nb );
2059 }
2060 else gStyle->SetPalette(1);
2061
2062 if (
fulldbg ) std::cout << __LINE__ << std::endl;
2063
2064 double rightmargin = gStyle->GetPadRightMargin();
2065 gStyle->SetPadRightMargin(0.1);
2066
2068
2069 gStyle->SetPadRightMargin(rightmargin);
2070
2071
2072
2073 for ( size_t ipanel=0 ; ipanel<panels.size() ; ipanel++ ) {
2074
2075 Panel& panel = panels[ipanel];
2076
2077 std::cout <<
blue <<
"\n\n---------------------------------------------\n" <<
reset;
2078
2079 std::cout << panel << "\n" << std::endl;
2080
2081 int ncolsp = panel.
ncols();
2082 int nrowsp = panel.
nrows();
2083
2084 double extraw = 1;
2085
2086 std::cout << "\nncols: " << ncolsp << "\tnrows: " << nrowsp << std::endl;
2087
2088 bool multipanel = ( panel.
size() > 1 );
2089
2090 if ( panel.
size()==0 ) {
2091 std::cout <<
"panel empty: " << panel.
name() << std::endl;
2092 continue;
2093 }
2094
2095 gStyle->cd();
2096
2097 if ( panel.
size()>4 ) gStyle->SetLineScalePS(0.5);
2098
2099 if ( multipanel ) extraw = 1.05;
2100
2101 TCanvas*
tc =
new TCanvas(
"tc",
"", extraw*ncolsp*800, nrowsp*600 );
2102
2104
2105 const std::string& atlaslabel = atlaslabel_tmp;
2106
2107 if ( multipanel ) {
2108
2109 gStyle->SetLineScalePS(1);
2110
2113
2121
2124
2125 tc->Divide( ncolsp, nrowsp, 0.0001, 0.0003 );
2126
2127 }
2128
2130
2131 std::string plotname = "";
2132
2133 for (
size_t i=0 ;
i<panel.
size() ;
i++ ) {
2134
2136
2137 bool drawmeans = false;
2138 bool drawresiduals = true;
2139
2140
2142 if (
contains(
histo.detail(),
"-residual") ) drawresiduals =
false;
2143
2144 std::string xaxis =
histo.xtitle();
2145 std::string yaxis =
histo.ytitle();
2146
2147 if ( !xregex.empty() ) {
2148 size_t pos = xaxis.find(xregex);
2149 if ( pos!=std::string::npos ) xaxis.replace( pos, xregex.size(), xpattern );
2150 pos = yaxis.find(xregex);
2151 if ( pos!=std::string::npos ) yaxis.replace( pos, xregex.size(), xpattern );
2152 }
2153
2156
2157
2158
2159
2162
2163 bool translate_x = false;
2164
2165 if ( ( lumiref_trans || lumitest_trans ) &&
contains(
histo.xtitle(),
"Pile-up" ) ) translate_x =
true;
2166
2167#if 0
2169 if ( translate_x ) {
2170 xinfo.
lo( xinfo.
lo()*(1-0.054) );
2172 xinfo.
hi( xinfo.
hi()*(1-0.054) );
2173 }
2174#endif
2175
2177
2178#ifdef D0REBIN
2179 bool d0rebin_flag = false;
2180
2182#endif
2183
2186 }
2187
2190 }
2191
2192 int labelcolour = kBlack;
2193
2194 int npanel = nrowsp*(
i/nrowsp) + i%nrowsp + 1 ;
2195
2196 std::cout <<
"panel: panel: " << panel.
name() <<
"\tsubpanel: " << npanel << std::endl;
2197
2198 if ( multipanel )
tc->cd( npanel );
2199
2201
2202 noreftmp = noref;
2203
2205
2206 if (
fulldbg ) std::cout << __LINE__ << std::endl;
2207
2208 std::cout <<
"main() processing histo[" <<
i <<
"] " << (
i<10 ?
" " :
"" ) <<
histo.name() <<
"\t" <<
histo.xaxis() << std::endl;
2209
2211 plots_eff.clear();
2212
2215
2216 std::string noreflabel=defreflabel;
2217
2218 double xpos = 0.18;
2219 double ypos = 0.91;
2220
2222
2223
2224
2227
2228 if ( atlasstyle ) {
2229 xpos = 0.18;
2230 if ( ypos>0.5 ) ypos = 0.85;
2231 else ypos = 0.18;
2232 }
2233
2234 if ( ypos_in!=0 ) ypos = ypos_in;
2235
2236 double xpos_original = xpos;
2237
2238 xpos += xoffset;
2239
2240 if ( xinfo.
offset() != 0 ) {
2241
2242 std::cout <<
"HA ! xinfo.offset: " << xinfo.
offset() << std::endl;
2243
2245
2246 }
2247
2248
2249 if ( yinfo.
offset() != 0 ) {
2250
2251 std::cout <<
"HA ! yinfo.offset: " << yinfo.
offset() << std::endl;
2252
2254
2255 }
2256
2257
2258
2260
2261 size_t Nrows =
chains.size();
2262
2263 if ( ALLRANGEMAP || (RANGEMAP && xaxis.find("p_{T}")!=std::string::npos && ccolours.size() ) ) {
2264 Nrows = ( Nrows < ccolours.size() ? Nrows : ccolours.size() );
2265 }
2266
2267 int Nlines = Nrows + taglabels.size();
2268
2269 std::vector<double> ypositions;
2270 std::vector<double> ypositions2;
2271
2272 double deltay = (Nrows*0.055-0.005)/Nrows;
2273
2275 double yhi = ypos-0.01;
2276
2277 if ( ypos>0.5 )
ylo -= Nlines*deltay;
2278 else yhi += Nlines*deltay;
2279
2280 ypositions.reserve(Nlines);
2281 for ( int ilines=0 ; ilines<Nlines ; ilines++ ) {
2282 ypositions.push_back( yhi - deltay*(ilines+0.5) );
2283 ypositions2.push_back( yhi - deltay*(ilines-0.5) );
2284 }
2285
2286
2287
2289
2292 }
2293 else {
2295 }
2296
2297 Legend legend( xpos, xpos+0.1, ylo, ylo+Nrows*0.06-0.005 );
2298 Legend legend_eff( xpos, xpos+0.1, ylo, ylo+Nrows*0.06-0.005 );
2299
2300
2301 std::vector<std::string>
Mean;
2302 std::vector<std::string> MeanLF;
2303 std::vector<std::string>
RMS;
2304
2306 MeanLF.clear();
2308
2309 std::vector<std::string> Chi2;
2310 std::vector<std::string> MeanRef;
2311 std::vector<std::string> RMSRef;
2312
2313
2314
2315 Chi2.clear();
2316 MeanRef.clear();
2317 RMSRef.clear();
2318
2319 int mean_power = 0;
2320 int rms_power = 0;
2321 bool power_set = false;
2322
2324
2326
2327
2328
2329 for (
unsigned int j=0;
j<
chains.size();
j++) {
2330
2331 bool d0mod = false;
2332
2333 TFile* fftest = ftest;
2334 TFile* ffref = fref;
2335
2336 std::string
cc = ftest->GetName();
2337 std::string cr = "";
2338
2339 if ( fref ) cr = fref->GetName();
2340
2341 if ( chainfiles.size()>0 && chainfiles.size()>j ) ffref = fftest = chainTFiles[
j];
2342
2345
2346 std::cout <<
"chain: " <<
chains[
j] <<
"\taddchains: " << addchains << std::endl;
2347 std::cout <<
"chainref: " << chainref[
j] << std::endl;
2348
2349 noreftmp = noref;
2351
2354
2358
2359 TH2D* h2test = 0;
2360
2361 TGraphAsymmErrors* tgtest = 0;
2362
2363 std::cout << "refchain.size() " << refchain.size() << std::endl;
2364
2365 std::cout <<
"refchain: " << refchain[
j] << std::endl;
2366
2368
2369 gPad->SetRightMargin(0.03);
2370
2371 bool do2D = false;
2372
2373 labelcolour = kBlack;
2374
2375
2377
2378 do2D = true;
2379 labelcolour = kWhite;
2380
2381 gPad->SetRightMargin(0.13);
2382
2383 std::cout <<
"\n\nsee! it is a 2d histograms !!! " <<
histo.name() <<
"\n\n" << std::endl;
2384
2386
2387 std::cout << "\t2d: " << h2test << std::endl;
2388
2390
2391 h2test->GetYaxis()->SetTitleOffset(1.55);
2392 h2test->GetXaxis()->SetTitleOffset(1.5);
2393 h2test->GetXaxis()->SetTitle(xaxis.c_str());
2394 h2test->GetYaxis()->SetTitle(yaxis.c_str());
2395
2398
2399 std::cout << xinfo << std::endl;
2400 std::cout << yinfo << std::endl;
2401
2403 h2test->GetYaxis()->SetRangeUser( yinfo.
lo(), yinfo.
hi() );
2404 }
2405
2407
2409 h2test->GetXaxis()->SetRangeUser( xinfo.
lo(), xinfo.
hi() );
2410 }
2411
2414
2416
2417 h2test->DrawCopy("colz");
2418
2419 if (
histo.detail().find(
"logz")!=std::string::npos ) gPad->SetLogz(
true);
2420 else gPad->SetLogz(false);
2421
2422
2423 }
2425
2428
2429 std::cout <<
red <<
"fetch 2d: " <<
histo.name() <<
reset << std::endl;
2430
2431 bool bsigma = false;
2433
2434 bool bmean = false;
2436
2437 std::string tmp_ =
histo.name();
2439
2440 if ( bsigma )
base =
chop( tmp_,
"/sigma" );
2441 if ( bmean )
base =
chop( tmp_,
"/mean" );
2442
2443 std::cout <<
"refitting: " <<
histo.name() <<
"\tbase: " <<
base <<
"\tbsigma: " << bsigma <<
"\tbmean: " << bmean << std::endl;
2444
2446
2448
2449
2450 TH2D* href2d = 0;
2451
2452 if ( ffref ) href2d =
Get<TH2D>( *ffref, chains[j]+
"/"+
base+
"/2d", testrun, chainmap );
2453
2454 if ( href2d==0 ) href2d =
Get<TH2D>( *ffref, chains[j]+
"/"+
base+
"/2D", testrun, chainmap );
2455
2456 if ( htest2d==0 ) continue;
2457 if ( !noreftmp && href2d==0 ) noreftmp = true;
2458
2459 std::cout << "href2d : " << href2d << std::endl;
2460
2462
2463 std::cout << "plotter" << std::endl;
2464
2466
2468
2469 std::cout << "Resplot rtest\t" << rtest.finalised() << std::endl;
2470
2471 if ( rtest.finalised() ) {
2472 std::cout << "refitting ..." << std::endl;
2475 }
2476 else {
2477 std::cout << "refitting (finalising) ..." << std::endl;
2480
2481 rtest.Mean()->DrawCopy();
2482 gPad->Print("Duff.pdf");
2483 }
2484
2485 std::cout << "bsigma: " << bsigma << std::endl;
2486 std::cout << "bmean: " << bmean << std::endl;
2487
2488 if ( bsigma ) {
htest = (
TH1F*)rtest.Sigma()->Clone(
"rtest_sigma");
htest->SetDirectory(0); }
2489 if ( bmean ) {
htest = (
TH1F*)rtest.Mean()->Clone(
"rtest_mean");
htest->SetDirectory(0); }
2490
2491 std::cout <<
reset << std::endl;
2492
2493 if ( htest==0 ) {
2494 std::cerr <<
red <<
"missing test histogram: " << (refchain[
j]+
" / "+
histo.name()) <<
" " <<
htest
2495 <<
"(test)" <<
reset << std::endl;
2496 continue;
2497 }
2498 else {
2499 std::cout <<
green <<
"htest: " <<
htest->GetName() <<
reset << std::endl;
2500 }
2501
2502 std::cout <<
"\nhisto.name(): " <<
histo.name() << std::endl;
2503
2504 std::cout <<
reset << std::endl;
2505
2506 if ( !d0mod &&
histo.name().find(
"d0_vs_phi")!=std::string::npos ) {
2507
2508 d0mod = true;
2509
2510 std::cout <<
green <<
"\n\nbeam fitting !!" <<
histo.name() <<
reset << std::endl;
2511
2512 TVirtualPad*
old = gPad;
2513
2514 std::cout << "old canvas: " << gPad << std::endl;
2515
2516 std::cout <<
"dbg histo name: " <<
histo.name() << std::endl;
2517
2519
2521
2522 if (
histo.name().find(
"_rec")!=std::string::npos ) {
2523
2526
2528 }
2529
2530 if (
histo.name().find(
"_rec")==std::string::npos ) {
2531
2532 fitcanvas =
new TCanvas(
"fit",
"", 700, 600 );
2534
2536 }
2537
2538 TVirtualPad* tp = gPad;
2539
2541
2543
2544
2545
2546 rtest.Mean()->SetDirectory(0);
2547
2549
2550 if (
histo.name().find(
"_rec")!=std::string::npos ) hf->SetTitle(
";Trigger #phi;Trigger d_{0} [mm]");
2551 else hf->SetTitle(";Offline #phi;Offline d_{0} [mm]");
2552
2553 TF1* tf = new TF1( "sinus", "[0]*sin(x+[1])+[2]" );
2554
2555 tf->SetLineWidth(1);
2556
2557 hf->GetYaxis()->SetTitleOffset( hf->GetYaxis()->GetTitleOffset()*1.1 );
2558
2559 {
2560 TCanvas* tfc = new TCanvas( "tmp", "", 700, 600 );
2561 tfc->cd();
2562 hf->Fit( tf );
2563 delete tfc;
2564 }
2565
2566 double phi0 = tf->GetParameter(1);
2567
2568
2569 double x = tf->GetParameter(0)*
cos(phi0);
2570 double y = tf->GetParameter(0)*
sin(phi0);
2571 double off = tf->GetParameter(2);
2572
2573 std::cout <<
"\tx = " <<
x << std::endl;
2574 std::cout <<
"\ty = " <<
y << std::endl;
2575 std::cout << "\toffset = " << off << std::endl;
2576
2577 std::string cckstr =
chains[
j];
2578
2579 cckstr = cckstr.substr( cckstr.find("HLT_IDTrack") );
2580
2582
2583 vstr.resize(vstr.find("_boffperf"));
2584 vstr.resize(vstr.find("_L1"));
2585
2586 hf->SetMinimum( -0.03 );
2587 hf->SetMaximum( 0.03 );
2588
2590
2591 if ( first ) hf->DrawCopy();
2592
2593 hf->DrawCopy("same");
2594 hf->DrawCopy("samee");
2595
2596
2599
2603
2604 std::string sht =
chains[
j]+
"-"+
histo.name()+
"-fit.pdf";
2605
2606 size_t p = sht.find(
"/");
2607
2608 while ( p!=std::string::npos ) {
2609 sht.erase( p, 1 );
2611 }
2612
2613
2614 gPad->Print( sht.c_str() );
2615 gPad->Print( "sht.pdf" );
2616
2617 std::cout << "CNT !!!" << std::endl;
2618
2619 delete tf;
2620
2621 tp->cd();
2622
2624
2625 }
2626
2627
2630
2632
2633 std::cout << "Resplot noreftmp " << noreftmp << " ... " << std::endl;
2634
2635 if ( !noreftmp ) {
2636 if ( refitref_resplots ) {
2637
2638 std::cout << "Resplot rref: " << href2d << std::endl;
2639
2641
2642 std::cout << "Resplot rref: " << href2d << " (2)" << std::endl;
2643
2644 if ( rref.finalised() ) {
2645 std::cout << "refitting (2) ..." << std::endl;
2648 }
2649 else {
2650 std::cout << "refitting (2 - finalising) ..." << std::endl;
2653 }
2654
2655 std::cout << "Resplot rref: " << href2d << " (3)" << std::endl;
2656
2657 if ( bsigma ) { hreft = (
TH1F*)rref.Sigma()->Clone(
"rref_sigma"); hreft->SetDirectory(0); }
2658 if ( bmean ) { hreft = (
TH1F*)rref.Mean()->Clone(
"rref_mean"); hreft->SetDirectory(0); }
2659
2660 std::cout << "Resplot rref: " << href2d << " (4)" << std::endl;
2661
2662 }
2663 else {
2664
2665 std::cout <<
"Resplot rref: " << href2d <<
" (5)" <<
reset << std::endl;
2666
2667 hreft =
Get( *ffref, refchain[j]+
"/"+
histo.name(), rawrefrun, chainmap );
2668 if ( hreft==0 ) {
2669 std::cerr <<
"ERROR: could not find " << (refchain[
j]+
"/"+
histo.name()) << std::endl;
2670 }
2671
2672
2673 }
2674 }
2675
2676 std::cout << "Resplot rref: " << href2d << " (6)" << std::endl;
2677
2678
2679 if ( !noreftmp && hreft==0 ) {
2680
2681 std::cerr <<
"missing ref histogram: " << (refchain[
j]+
" / "+
histo.name()) <<
" " <<
htest <<
"(ref)" << std::endl;
2682
2683 noreftmp = true;
2685 noreflabel="reference not found";
2688
2689 }
2690
2691 if ( !noreftmp ) {
2692
2693 std::cout << "Resplot rref: " << href2d << " (7)" << std::endl;
2694
2696 href->SetDirectory(0);
2697
2698 std::cout <<
"Resplot href: " <<
href <<
" (7a)" << std::endl;
2699
2700 }
2701
2702 std::cout << "Resplot rref: " << href2d << " (8)" << std::endl;
2703
2704
2706
2707
2709
2710 std::cout << "Resplot rref: " << href2d << " (9)" << std::endl;
2711
2712 }
2713 else {
2714
2716
2717 std::string reghist =
histo.name();
2718
2719 std::cout <<
"hist: " << (
chains[
j]+
"/"+reghist) <<
"\tftest " << ftest << std::endl;
2720
2721
2722
2724
2725 std::cout <<
"\nhist: " <<
htest << std::endl;
2726
2727 std::cout << "fftest: " << fftest->GetName() << std::endl;
2728
2730
2731
2732 if ( lumitest_trans && translate_x && !
contains( cc,
"-mc" ) )
htest =
trans( htest, translate_x );
2733
2734 std::cout << xaxis << std::endl;
2735
2736 if ( htest==0 ) {
2737 std::cerr <<
"missing test histogram: " << (
chains[
j]+
" / "+reghist) <<
" " << htest<< std::endl;
2738 continue;
2739 }
2740
2742
2744
2745 if ( ffref ) hreft =
Get( *ffref, refchain[j]+
"/"+reghist, rawrefrun, chainmap );
2746 else noreftmp = true;
2747
2748 if ( hreft && lumiref_trans && translate_x && !
contains( cr,
"-mc" ) ) hreft =
trans( hreft, translate_x );
2749
2750 std::cout << "hreft: " << hreft << std::endl;
2751
2752 if ( std::string(
htest->ClassName()).find(
"TH2")!=std::string::npos ) {
2753 std::cout <<
"Class TH2: " <<
htest->GetName() << std::endl;
2754 continue;
2755 }
2756
2757
2758 if ( std::string(
htest->ClassName()).find(
"TH1")!=std::string::npos ) {
2759 std::cout <<
"Class TH1: " <<
htest->GetName() << std::endl;
2760 }
2761 else if ( std::string(
htest->ClassName()).find(
"TProfile")!=std::string::npos ) {
2762 std::cout <<
"Class TProf: " <<
htest->GetName() << std::endl;
2763 }
2764 else if ( std::string(
htest->ClassName()).find(
"TEfficiency")!=std::string::npos ) {
2765 std::cout <<
"Class TEff: " <<
htest->GetName() << std::endl;
2766 }
2767
2768
2769 std::cout << "Resplot hreft: " << hreft << " (10)" << " " << noreftmp << std::endl;
2770
2771 if ( !noreftmp && hreft==0 ) {
2772 std::cerr <<
"missing ref histogram: " << (refchain[
j]+
" / "+reghist)
2773 << " " << hreft << std::endl;
2774
2775 noreftmp = true;
2777 noreflabel="reference not found";
2780
2781
2782 }
2783
2784 std::cout << "Resplot hreft: " << hreft << " (10)" << std::endl;
2785
2786 if ( hreft!=0 ) {
2787
2788 std::cout << "Resplot hreft: " << hreft->ClassName() << " (11)" << std::endl;
2789
2790 if ( std::string(hreft->ClassName()).find("TH1")!=std::string::npos ) {
2792 href->SetDirectory(0);
2793 }
2796 }
2797 }
2798 else {
2799 noreftmp = true;
2801 }
2802
2803 std::cout <<
" \tget " << (
chains[
j]+
"/"+reghist) <<
"\thtest " << htest << std::endl;
2804 std::cout <<
" \tget " << (refchain[
j]+
"/"+reghist) <<
"\thref " << href << std::endl;
2805
2806 if ( htest==0 ) continue;
2807
2808 if ( !noreftmp && href==0 ) {
2809 noreftmp = true;
2811 }
2812
2813 if (
fulldbg ) std::cout << __LINE__ << std::endl;
2814
2815
2816 if ( rebin!=1 ) {
2817 std::cout <<
"rebin: " <<
hname <<
"\t" <<
rebin << std::endl;
2818 if ( htest )
htest->Rebin(rebin);
2819 if ( href )
href->Rebin(rebin);
2820 for (
int ip=0 ;
ip<10 ;
ip++ ) std::cout << std::endl;
2821 }
2822
2823#if 0
2826 std::cout <<
"Rebinning histogram: " <<
histo.name() << std::endl;
2827 if (
htest->GetNbinsX()>500 )
htest->Rebin(10);
2828 if ( href &&
href->GetNbinsX()>500 )
href->Rebin(10);
2829 }
2830#endif
2831
2832
2833 if ( make_efficiencies &&
histo.name().find(
"zed_eff")!=std::string::npos ) {
2834 if (
htest->GetNbinsX()>100 )
htest->Rebin(5);
2835 if ( href &&
href->GetNbinsX()>100 )
href->Rebin(5);
2836 }
2837
2838
2839 if (
fulldbg ) std::cout << __LINE__ << std::endl;
2840
2841 if ( scalepix && std::string(
htest->GetName()).find(
"npix")!=std::string::npos )
Scale(htest,0.5);
2842 if ( scalepix && href && std::string(
htest->GetName()).find(
"npix")!=std::string::npos )
Scale(href,0.5);
2843
2844 if (
fulldbg ) std::cout << __LINE__ << std::endl;
2845
2846 if ( notitle ) {
2847 htest->SetTitle(
"");
2848 if( href )
href->SetTitle(
"");
2849 }
2850
2851 if (
fulldbg ) std::cout << __LINE__ << std::endl;
2852
2853 }
2854
2855 std::cout << "done else" << std::endl;
2856
2857 if ( do2D ) continue;
2858
2859 std::cout <<
"done else:\t" <<
htest << std::endl;
2860 std::cout <<
"done else:\t" <<
htest->GetName() << std::endl;
2861
2862 if (
fulldbg ) std::cout << __LINE__ << std::endl;
2863
2864 if ( !d0mod &&
histo.name().find(
"d0_vs_phi")!=std::string::npos ) {
2865 d0mod = true;
2866 if ( htest )
d0fit( histo, htest, chains[j] );
2867 if ( href )
d0fit( histo, href, chains[j] );
2868 }
2869
2870 if ( !do2D && make_ref_efficiencies ) {
2871
2872 std::cout << "make ref efficiencies" << std::endl;
2873
2874 if ( htest && href ) {
2875
2877
2878
2880
2881 std::string effhist =
histo.name();
2882
2883
2884
2885 htestnum =
Get( *fftest, chains[j]+
"/"+effhist+
"_n", testrun, 0, &
savedhistos );
2886
2887
2888
2889 TH1F* hrefnumt =
Get( *ffref, refchain[j]+
"/"+effhist+
"_n", rawrefrun, chainmap, &
savedhistos );
2890
2891
2892
2893 if ( !noreftmp && hrefnumt!=0 ) {
2894 hrefnum = (
TH1F*)hrefnumt->Clone();
2895 hrefnum->SetDirectory(0);
2896 }
2897
2898 }
2899 }
2900
2901 }
2902
2903 std::cout <<
"done effs ? " << bayes <<
"\thtest: " <<
htest <<
" :: " <<
htest->GetName() << std::endl;
2904
2905 if ( bayes ) {
2906
2907 std::cout <<
"make ref efficiencies " <<
htest->GetName() << std::endl;
2908
2909 if ( make_efficiencies && htest &&
contains( std::string(
htest->GetName()),
"eff" ) && !
contains( std::string(
htest->GetName()),
"_d" ) ) {
2910
2911 std::string effhist =
histo.name();
2912
2914
2915 if ( rebin!=1 ) std::cout << effhist <<
"\trebin: " <<
rebin << std::endl;
2916
2917
2918 htestnum =
Get( *fftest, chains[j]+
"/"+effhist+
"_n", testrun, 0, &
savedhistos ) ;
2919 htestden =
Get( *fftest, chains[j]+
"/"+effhist+
"_d", testrun, 0, &
savedhistos ) ;
2920
2921 if ( htestnum==0 && htestden==0 ) {
2922 TEfficiency*
eff = 0;
2923
2925
2926 if ( eff ) {
2927 htestnum = (
TH1F*)
eff->GetPassedHistogram();
2928 htestden = (
TH1F*)
eff->GetTotalHistogram();
2929 }
2930
2931 }
2932
2933 std::cout << "eff: htestnum: " << htestnum << "\thtestden: " << htestden << std::endl;
2934
2935
2937
2938 std::cout <<
"heff: " << effhist <<
"\t" <<
ars << std::endl;
2939
2940
2941 std::cout << "1: Bayesian error calculation " << htestnum << " " << htestden << "\tscale " << scale_eff << std::endl;
2942
2943 if ( htestnum && htestden ) {
2944
2945#ifdef D0REBIN
2948 if ( d0rebin_flag ) {
2949 htestnum =
d0rebin( htestnum );
2950 htestden =
d0rebin( htestden );
2951 }
2952 else if ( rebin!=1 ) {
2953 htestnum =
Rebin(htestnum, rebin );
2954 htestden =
Rebin(htestden, rebin );
2955 }
2956#endif
2957 std::cout << "test histogram name: : " << htestnum->GetName() << "\txaxis: " << xaxis << "\t" << std::endl;
2958
2959 if ( make_efficiencies && std::string(htestnum->GetName()).find("ntrax_eff")!=std::string::npos ) {
2960
2961 bool low = true;
2962
2965 }
2966
2967#if 0
2971 std::cout <<
"rebin " <<
histo.name() << std::endl;
2972 htestnum->Rebin(3);
2973 htestden->Rebin(3);
2974 }
2975
2976 if ( make_efficiencies &&
contains(
htest->GetName(),
"eta_eff" ) ) {
2977 std::cout <<
"rebin " <<
histo.name() << std::endl;
2978 htestnum->Rebin(2);
2979 htestden->Rebin(2);
2980 }
2981
2982#endif
2983
2984
2985 if ( RANGEMAP && (effhist.find("ET")!=std::string::npos ) ) {
2986 std::cout <<
"\trange: " <<
j <<
" " <<
htest << std::endl;
2987 bnd.
range( chains[j], htestnum );
2988 bnd.
range( chains[j], htestden );
2989 }
2990
2991 if ( lumitest_trans && translate_x && !
contains( cc,
"-mc" ) ) {
2992 htestnum =
trans( htestnum, translate_x );
2993 htestden =
trans( htestden, translate_x );
2994 }
2995
2997
2998 tgtest =
e.Bayes(scale_eff);
2999
3001
3002 htest->SetName( (std::string(htestnum->GetName())+
"_eff").c_str() );
3003
3004 std::cout << "effhist: " << effhist << std::endl;
3005
3006 }
3007
3009
3010 std::cout << "recalculating reference efficiencies ..." << std::endl;
3011
3012 if ( href ) {
3013
3014 std::cout << "doin ..." << std::endl;
3015
3016
3017 TH1F* hrefnum =
Get( *ffref, refchain[j]+
"/"+
histo.name()+
"_n", rawrefrun, chainmap );
3018 TH1F* hrefden =
Get( *ffref, refchain[j]+
"/"+
histo.name()+
"_d", rawrefrun, chainmap );
3019
3020
3021 if ( hrefnum==0 && hrefden==0 ) {
3022 TEfficiency*
eff = 0;
3023
3025
3026 if ( eff ) {
3027 hrefnum = (
TH1F*)
eff->GetPassedHistogram();
3028 hrefden = (
TH1F*)
eff->GetTotalHistogram();
3029 }
3030
3031 }
3032
3033
3034
3035 std::cout << "2. Bayesian error calculation " << htestnum << " " << htestden << "\tscale " << scale_eff << std::endl;
3036 std::cout << "3. Bayesian error calculation " << hrefnum << " " << hrefden << "\tscale " << scale_eff_ref << std::endl;
3037
3038
3039 if ( hrefnum && hrefden ) {
3040
3041 if ( lumiref_trans && translate_x && !
contains( cr,
"-mc" ) ) {
3042 hrefnum =
trans( hrefnum, translate_x );
3043 hrefden =
trans( hrefden, translate_x );
3044 }
3045
3046#ifdef D0REBIN
3049 if ( d0rebin_flag ) {
3052 }
3053 else if ( rebin!=1 ) {
3054 hrefnum =
Rebin(hrefnum, rebin );
3055 hrefden =
Rebin(hrefden, rebin );
3056 }
3057#endif
3058
3059 std::cout << hrefnum << " " << hrefden << std::endl;
3060
3063
3064
3066
3067 }
3068 }
3069 }
3070
3071 std::cout <<
"dbg: htest: " <<
htest << std::endl;
3072 std::cout <<
"dbg: htest name " <<
htest->GetName() << std::endl;
3073
3074 if (
true &&
histo.name().find(
"invmass")!=std::string::npos ) {
3076 }
3077
3078
3079 }
3080
3081
3082 std::cout <<
"chains[j] " <<
chains[
j] << std::endl;
3083 std::cout <<
"histo.name() " <<
histo.name() << std::endl;
3084 std::cout <<
"href " <<
href <<
"\t (TEfficiency " <<
isTEfficiency(href) <<
")" << std::endl;
3085
3087
3090 std::cout << "efficiency" << std::endl;
3091 }
3092
3093 std::cout <<
"href " <<
href <<
"\t (TEfficiency " <<
isTEfficiency(href) <<
")" << std::endl;
3094
3095
3096 if ( htest==0 ) {
3097 std::cout <<
" no test histogram : " << (
chains[
j]+
"/"+
histo.name()) << std::endl;
3098 continue;
3099 }
3100
3101
3102 if ( !noreftmp && href==0 ) {
3103 std::cout <<
" no ref histogram : " << (
chains[
j]+
"/"+
histo.name()) << std::endl;
3104 noreftmp = true;
3106 noreflabel="reference not found";
3109
3110 }
3111
3112 std::cout <<
"htest: " <<
isTEfficiency(htest) << std::endl;
3113
3115
3116 htest->GetYaxis()->SetTitleOffset(1.55);
3117 htest->GetXaxis()->SetTitleOffset(1.5);
3118 htest->GetXaxis()->SetTitle(xaxis.c_str());
3119 htest->GetYaxis()->SetTitle(yaxis.c_str());
3120
3121 std::cout <<
"htest: " <<
htest <<
"\t" << __LINE__ << std::endl;
3122
3123
3124 if ( !noreftmp ) {
3125
3126 href->GetYaxis()->SetTitleOffset(1.5);
3127 href->GetXaxis()->SetTitleOffset(1.5);
3128 std::cout <<
"xaxis: " <<
href->GetXaxis()->GetTitle() << std::endl;
3129
3130 }
3131
3132 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3133
3134#if 0
3136
3137 double xm =
htest->GetMean();
3138
3139 if ( xm>=10 ) {
3140 double lxm = std::log10(xm);
3141 int newbins = int(0.5+xm/std::pow(10,
int(lxm)))*
pow(10,
int(lxm));
3142 int nrebin = int( (newbins+5)/10 );
3143
3144 if ( nrebin>1 ) {
3145 std::cout <<
"rebin: " <<
htest->GetName() <<
"\tbins: " << nrebin << std::endl;
3146 htest->Rebin(nrebin);
3148 if ( !noreftmp ) {
3149 href->Rebin(nrebin);
3151 }
3152 }
3153 }
3154 }
3155#endif
3156
3157 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3158
3159
3161 if ( plotname == "" ) {
3162
3163 if ( key!="" ) {
3164 htest->SetTitle(
"");
3165 if ( href )
href->SetTitle(
"");
3167 }
3169 htest->SetTitle(
"");
3170 if ( href )
href->SetTitle(
"");
3171 plotname = "HLT_";
3172 }
3174 htest->SetTitle(
"");
3175 if ( href )
href->SetTitle(
"");
3176 plotname = "EF_";
3177 }
3179 htest->SetTitle(
"");
3180 if ( href )
href->SetTitle(
"");
3181 plotname = "L2_";
3182 }
3184 htest->SetTitle((
"FTK "+
histo.name()).c_str());
3185 if ( href )
href->SetTitle((
"FTK "+
histo.name()).c_str());
3186 plotname = "FTK_";
3187 }
3188
3189 plotname +=
histo.name();
3190
3194
3195 }
3196
3197
3198 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3199
3201
3203
3204 std::string collection =
basename( chains[j] );
3205
3207
3208 if ( collection.find("_InDet")!=std::string::npos ) collection.erase( 0, collection.find("_InDet")+1 );
3209 if ( actual_chain.find("_InDet")!=std::string::npos ) actual_chain.erase( actual_chain.find("_InDet") );
3210
3211
3212 std::cout <<
"raw: " <<
chains[
j] << std::endl;
3213 std::cout << "track collection: " << collection << std::endl;
3214 std::cout << "actual chain: " << actual_chain << std::endl;
3215
3216 std::regex rx("_HLT_[^_]*RoI.*");
3217 std::regex
rx1(
"_HLT_[^_]*_RoI.*");
3218
3219 std::cout << "\n\n\nactual_chain: " << actual_chain << std::endl;
3220
3221 arsaway( actual_chain,
"_L1.*",
"" );
3222 arsaway( actual_chain,
"L1.*",
"" );
3223
3224 actual_chain = std::regex_replace( actual_chain, std::regex( "L1.*:" ), "" );
3225
3226 if ( actual_chain.find("jvt")!=std::string::npos ) actual_chain.erase(
3227 actual_chain.find("jvt"),
3228 actual_chain.find("HLT_IDTrack")-actual_chain.find("jvt") );
3229
3230 std::cout << " : " << actual_chain << "\n\n\n" << std::endl;
3231
3232
3233 actual_chain = std::regex_replace( actual_chain, std::regex( "_HLT_IDTrack.*" ), "" );
3234
3235
3236 collection = std::regex_replace( collection, std::regex(".*HLT_IDTrack_"), "IDTrack " );
3237 collection = std::regex_replace( collection, std::regex("IDTrack "), "" );
3238 collection = std::regex_replace( std::regex_replace( collection, rx, "" ), rx1, "" );
3239
3240 if ( actual_chain.find("HLT_IDTrack_")!=std::string::npos ) actual_chain.erase( actual_chain.find("HLT_IDTrack_"), 12 );
3241 if ( actual_chain.find("_IDTrack_")!=std::string::npos ) actual_chain.erase( actual_chain.find("_IDTrack_"), 9 );
3242 if ( actual_chain.find("IDTrack")!=std::string::npos ) actual_chain.erase( actual_chain.find("IDTrack"), 7 );
3243 if ( actual_chain.find("_idperf")!=std::string::npos ) actual_chain.erase( actual_chain.find("_idperf"), 7 );
3244 if ( actual_chain.find("_bperf")!=std::string::npos ) actual_chain.erase( actual_chain.find("_bperf"), 6 );
3245 if ( actual_chain.find("_boffperf")!=std::string::npos ) actual_chain.erase( actual_chain.find("_boffperf"), 9 );
3246 if ( actual_chain.find("_HLT_")!=std::string::npos ) actual_chain.replace( actual_chain.find("_HLT_"), 5, " " );
3247 if ( actual_chain.find("HLT_")!=std::string::npos ) actual_chain.erase( actual_chain.find("HLT_"), 4 );
3248
3249
3250
3251 if ( collection.find("_IDTrkNoCut")!=std::string::npos ) collection.erase( collection.find("_IDTrkNoCut"), 11 );
3252 if ( collection.find("xAODCnv")!=std::string::npos ) collection.erase( collection.find("xAODCnv"), 7 );
3253 if ( collection.find("HLT_IDTrack_")!=std::string::npos ) collection.erase( collection.find("HLT_IDTrack_"), 12 );
3254 if ( collection.find("HLT_IDTrack")!=std::string::npos ) collection.erase( collection.find("HLT_IDTrack"), 11 );
3255 if ( collection.find("Tracking")!=std::string::npos ) collection.replace( collection.find("Tracking"), 8, "Trk" );
3256 if ( collection.find("InDetTrigTrk_")!=std::string::npos ) collection.erase( collection.find("InDetTrigTrk_"), 13 );
3257 if ( collection.find("HLT_xAODTracks_")!=std::string::npos ) collection.erase( collection.find("HLT_xAODTracks_"), 15 );
3258 if ( collection.find("_HLT_")!=std::string::npos ) collection.replace( collection.find("_HLT_"), 5, " " );
3259 if ( collection.find("HLT_")!=std::string::npos ) collection.erase( collection.find("HLT_"), 4 );
3260 if ( collection.find("_extra")!=std::string::npos ) collection.resize( collection.find("_extra") );
3261
3262 if ( actual_chain.size()>25 ) {
3263 size_t pos = actual_chain.find_last_of(
"_");
3264 while ( pos!=std::string::npos && actual_chain.size()>25 ) {
3265 actual_chain.resize(pos);
3266 pos = actual_chain.find_last_of(
"_");
3267 }
3268 }
3269
3270 std::cout <<
blue <<
"actual chain: " << actual_chain <<
"\tcollection: " << collection <<
reset << std::endl;
3271
3272 std::string
c = actual_chain +
" : " + collection;
3273
3274 std::cout << "track collection: " << collection << " <-" << std::endl;
3275 std::cout << "actual chain: " << actual_chain << " <-" << std::endl;
3276
3278
3280
3281 std::cout <<
"use label: " <<
c <<
"\tchains size " <<
chains.size() <<
"\t" << usrlabels.size() << std::endl;
3282
3283 std::cout <<
"chains.size() " <<
chains.size() <<
" " <<
j << std::endl;
3284 std::cout <<
"chains.size() " <<
chains.size() <<
" " <<
j << std::endl;
3285
3286 std::cout <<
"chains[j] : " <<
j <<
" " <<
chains[
j] << std::endl;
3287
3288 std::cout << "userlabels.size() " << usrlabels.size() << std::endl;
3289
3290 if ( usrlabels.size() < j+1 ) {
3291 if ( usrlabels.size()!=0 ) std::cerr << "userlabels not large enough - not using userlabels" << std::endl;
3292 }
3293 else c = usrlabels[
j ];
3294
3295 std::cout <<
"use label: c: " <<
c << std::endl;
3296
3298
3299 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3300
3301 std::cout <<
blue <<
"xaxis: " << xaxis <<
reset << std::endl;
3302
3303 if ( ALLRANGEMAP || xaxis.find("p_{T}")!=std::string::npos || xaxis.find("E_{T}")!=std::string::npos ) {
3304
3305 if ( RANGEMAP && xaxis.find("p_{T}")!=std::string::npos ) {
3306 bnd.
range( chains[j], htest );
3307 if ( href ) bnd.
range( chains[j], href );
3308 }
3309
3310 if ( RANGEMAP || ALLRANGEMAP ) {
3311
3313
3314 std::cout << "\n\n\nctags " << ctags.size() << "\n\n" << std::endl;
3315
3316 for (
size_t ic=0 ;
ic<ctags.size() ;
ic++ ) {
3317
3318 std::cout <<
"\n\nic: " <<
ic <<
" " << ctags[
ic] <<
" " << ccolours[
ic] <<
"\n\n" << std::endl;
3319
3320 if ( chains[j].
find(ctags[ic])!=std::string::npos ) {
3321 std::cout <<
"\ttag " << ctags[
ic] <<
" \tcolour: " << ccolours[
ic] <<
"\tstyle: " << cstyles[
ic] << std::endl;
3322 htest->SetLineColor( ccolours[ic] );
3323 htest->SetMarkerColor( ccolours[ic] );
3324 htest->SetMarkerStyle( cstyles[ic] );
3326 if ( tgtest ) {
3327 tgtest->SetLineColor(
htest->GetMarkerColor());
3328 tgtest->SetMarkerStyle(
htest->GetMarkerStyle());
3329 tgtest->SetMarkerColor(
htest->GetMarkerColor());
3330 }
3331 break;
3332 }
3333 }
3334
3335 }
3336
3337 std::cout <<
"test: " <<
chains[
j] <<
"chains colour: " <<
htest->GetMarkerColor() << std::endl;
3338
3339 }
3340
3341
3342 std::cout << "movin' on ..." << std::endl;
3343
3344 std::cout <<
"chain: " <<
chains[
j] <<
" \t marker colour: " <<
htest->GetMarkerColor() << std::endl;
3345
3346 std::cout <<
"Plotter marker : " <<
htest->GetMarkerColor() <<
" " <<
htest->GetMarkerStyle() << std::endl;
3347
3348
3349 if ( uselabels )
plots.push_back(
Plotter( htest, href,
" " + chain_name[j] + c, tgtest ) );
3350 else {
3351 std::cout <<
"using label: " <<
c << std::endl;
3353 }
3354
3355 std::cout << "AxisInfo: " << xaxis << std::endl;
3356
3359
3360 std::cout <<
"c: " <<
c <<
"\t" << ftest->GetName() << std::endl;
3361
3362 if ( refbands ) {
3363 std::cout << "refbands: " << refbands << std::endl;
3364 plots.back().mc(
true );
3365 translate_x = false;
3366 }
3367
3368 if ( ALLRANGEMAP || ( RANGEMAP && xaxis.find(
"p_{T}")!=std::string::npos ) )
plots.back().max_entries( ccolours.size() );
3369
3370 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3371
3372 if ( make_ref_efficiencies ) {
3373
3374 if ( htestnum && hrefnum ) {
3376
3378
3379 double range =
h->GetMaximum()-
h->GetMinimum();
3380
3381 if ( range<0.2*scale_eff ) {
3382
3383 double fmax = int( (
h->GetMaximum() + 20)*0.1 )*0.1*scale_eff;
3384 double fmin = int( (
h->GetMinimum() - 10)*0.1 )*0.1*scale_eff;
3385
3386 if ( fmax>1*scale_eff ) fmax = 1.02*scale_eff;
3387 if ( fmin<0 ) fmin = 0;
3388
3389 h->SetMinimum(fmin);
3390 h->SetMaximum(fmax);
3391
3392 }
3393
3394 plots_eff.push_back(
Plotter(
e.Hist(), 0, c ) );
3395
3396 }
3397 }
3398
3399
3400 std::cout << "means: " << drawmeans << " " << means << std::endl;
3401
3402 std::cout << "chi2: " << std::endl;
3403
3404 std::cout <<
"htest " <<
htest << std::endl;
3405 std::cout <<
"href " <<
href << std::endl;
3406
3407 std::cout <<
"chi2: " <<
chi2( htest, href ) <<
"\t histo name: " <<
histo.name() << std::endl;
3408
3410
3411
3412 if ( href ) Chi2.push_back(
label(
"chi2 = %5.2lf / %2.0lf",
chi2( htest, href ),
double(
htest->GetNbinsX()) ) );
3413
3414 std::cout << "Chi2.push_back()" << std::endl;
3415
3416 if ( drawmeans || means ) {
3417
3418 double mean_95 =
htest->GetMean();
3419 double dmean_95 =
htest->GetMeanError();
3420 double rms_95 =
htest->GetRMS();
3421 double drms_95 =
htest->GetRMSError();
3422
3423 Mean.push_back(
label(
" mean = %4.2lf #pm %4.2lf", mean_95, dmean_95) );
3424 MeanLF.push_back(
label(
"mean = %6.4lf #pm %6.4lf", mean_95, dmean_95) );
3425 RMS.push_back(
label(
" rms = %4.2lf #pm %4.2lf", rms_95, drms_95 ) );
3426
3427 }
3428
3429 std::cout <<
"residual: " <<
residual <<
" " << drawresiduals << std::endl;
3430
3431 if ( residual && drawresiduals ) {
3432
3434
3435 xpos = xpos_original;
3436
3437 std::cout <<
"calculating resolutions : " <<
histo.name() <<
" " <<
htest->GetName() << std::endl;
3438
3440
3441 double mean_95 = d95->GetParameter(1);
3442 double dmean_95 = d95->GetParError(1);
3443 double rms_95 = d95->GetParameter(2);
3444 double drms_95 = d95->GetParError(2);
3445
3446 std::cout <<
"\t\t" <<
histo.name()
3447 << "\tmean: " << mean_95 << " +- " << dmean_95
3448 << "\trms: " << rms_95 << " +- " << drms_95 << std::endl;
3449
3451
3452 if ( !power_set ) {
3453 for (
int ip=-2 ;
ip<9 ;
ip++ ) {
3454 if ( std::fabs(mean_95) >= std::pow( 10., double(-ip) ) ) {
3456 break;
3457 }
3458 }
3459
3460 for (
int ip=-2 ;
ip<9 ;
ip++ ) {
3461 if ( std::fabs(rms_95) >= std::pow( 10., double(-ip) ) ) {
3463 break;
3464 }
3465 }
3466 }
3467
3468 power_set = true;
3469
3470 std::cout <<
"\t\t" <<
histo.name()
3471 << "\tmean: " << mean_95 << " +- " << dmean_95 << " : pow " << mean_power
3472 << "\trms: " << rms_95 << " +- " << drms_95 << " : pow " << rms_power << std::endl;
3473
3474
3475 if ( mean_power == 0 ) {
3476 Mean.push_back(
label(
"mean_{95} = %4.2lf #pm %4.2lf", mean_95, dmean_95) );
3477 }
3478 else {
3479 Mean.push_back(
label(
"mean_{95} = ( %4.2lf #pm %4.2lf ) #times 10^{%d}",
3480 mean_95*std::pow(10.,double(mean_power)), dmean_95*std::pow(10,double(mean_power)), -mean_power ) );
3481
3482 }
3483
3484 if ( rms_power == 0 ) {
3485 RMS.push_back(
label(
"rms_{95} = %4.2lf #pm %4.2lf", rms_95, drms_95 ) );
3486 }
3487 else {
3488 RMS.push_back(
label(
"rms_{95} = ( %4.2lf #pm %4.2lf ) #times 10^{%d}",
3489 rms_95*std::pow(10.,double(rms_power)), drms_95*std::pow(10,double(rms_power)), -rms_power ) );
3490 }
3491
3492 if ( href ) {
3494
3495 double mean_95ref = d95ref->GetParameter(1);
3496 double dmean_95ref = d95ref->GetParError(1);
3497 double rms_95ref = d95ref->GetParameter(2);
3498 double drms_95ref = d95ref->GetParError(2);
3499
3500 std::cout <<
"\t\t" <<
histo.name()
3501 << "\tmean ref: " << mean_95ref << " +- " << dmean_95ref << " : pow " << mean_power
3502 << "\trms ref: " << rms_95ref << " +- " << drms_95ref << " : pow " << rms_power << std::endl;
3503
3504 if ( mean_power == 0 ) {
3505 MeanRef.push_back(
label(
"mean_{95} ref = %4.2lf #pm %4.2lf", mean_95ref, dmean_95ref) );
3506 }
3507 else {
3508 MeanRef.push_back(
label(
"mean_{95} ref = ( %4.2lf #pm %4.2lf ) #times 10^{%d}",
3509 mean_95ref*std::pow(10,double(mean_power)), dmean_95ref*std::pow(10,double(mean_power)), -mean_power ) );
3510
3511 }
3512
3513
3514 if ( rms_power == 0 ) {
3515 RMSRef.push_back(
label(
"rms_{95} ref = %4.2lf #pm %4.2lf", rms_95ref, drms_95ref ) );
3516 }
3517 else {
3518 RMSRef.push_back(
label(
"rms_{95} ref = ( %4.2lf #pm %4.2lf ) #times 10^{%d}",
3519 rms_95ref*std::pow(10,double(rms_power)), drms_95ref*std::pow(10,double(rms_power)), -rms_power ) );
3520 }
3521 }
3522
3524 if ( href )
href->Sumw2();
3525 }
3526
3529 if ( href )
Norm( href );
3531 Norm( htest, 1, xinfo.
lo(), xinfo.
hi() );
3532 if ( href )
Norm( href, 1, xinfo.
lo(), xinfo.
hi() );
3533 }
3534 }
3536 if ( href ) {
3539 Norm( href, 1, xinfo.
lo(), xinfo.
hi() );
3540 }
3541 }
3542 }
3543
3547 }
3548
3549 if ( !noreftmp && normref &&
3554 }
3555
3556 }
3557
3558 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3559
3560 if ( !noplots ) {
3561
3564
3565 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3566
3567 std::cout << "duff: " << xinfo << std::endl;
3568
3570 plots.sortx( xinfo );
3571
3572 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3573
3574 double yminset = 0;
3575 double ymaxset = 0;
3576
3577 double rmin = 0;
3578 double rmax = 0;
3579
3585
3586
3587
3588
3589 }
3590 else {
3591 rmin =
plots.realmin();
3592 rmax =
plots.realmax();
3593 }
3594
3596
3597 int csize =
chains.size() + taglabels.size() + ( atlasstyle ? 1 : 0 );
3598
3599 if ( yinfo.
log() && rmin>0 && rmax>0 ) {
3600
3602 double delta = std::log10(rmax)-std::log10(rmin);
3603
3605
3606
3607 yminset = rmin*std::pow(10,-delta*0.1);
3608
3609 double newdelta = std::log10(rmax) - std::log10(yminset) + 0.05*delta;
3610
3611 if ( csize<10 ) ymaxset = rmin*std::pow(10,newdelta/(1-0.07*csize));
3612 else ymaxset = rmin*std::pow(10,newdelta*2);
3613
3614 if ( yminset!=yminset ) {
3615 std::cerr << " range error " << delta << " " << yminset << " " << ymaxset << "\t(" << rmin << " " << rmax << ")" << std::endl;
3619 continue;
3620 }
3621
3622 }
3623 else {
3624
3627
3628 if ( ypos>0.5 ) {
3629 double delta = rmax-rmin;
3630
3631 yminset = rmin-0.1*delta;
3632
3633 if ( rmin>=0 && yminset<=0 ) yminset = 0;
3634
3635 double newdelta = rmax - yminset + 0.05*delta;
3636
3637 if ( csize<10 ) ymaxset = yminset + newdelta/(1-0.09*csize);
3638 else ymaxset = yminset + newdelta*2;
3639 }
3640 else {
3641 double delta = rmax-rmin;
3642
3643 ymaxset = rmax+0.1*delta;
3644
3645 double newdelta = ymaxset - rmin - 0.05*delta;
3646
3647 if ( csize<10 ) yminset = ymaxset - newdelta/(1-0.09*csize);
3648 else yminset = ymaxset - newdelta*2;
3649
3650 if ( rmin>=0 && yminset<=0 ) yminset = 0;
3651
3652 }
3653
3654 }
3655
3656 }
3657 else {
3659 yminset = yinfo.
lo();
3660 ymaxset = yinfo.
hi();
3661 }
3662 }
3663
3664 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3665
3666
3667
3668
3669
3670
3672
3673 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3674
3675 if ( yminset>yinfo.
lo() ) yminset = yinfo.
lo();
3676 if ( ymaxset<yinfo.
hi() ) ymaxset = yinfo.
hi();
3677 }
3678
3679
3681
3682 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3683
3684 if ( effset ) {
3685 ymaxset = effmax;
3686 yminset = effmin;
3687 }
3688 }
3689
3690 if ( ymaxset!=0 || yminset!=0 ) {
3691
3692 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3693
3694 plots.Max( ymaxset );
3695 plots.Min( yminset );
3696 }
3697
3698 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3699
3700 if ( yminset!=0 || ymaxset!=0 ) {
3701 if ( yminset>0 )
plots.SetLogy(yinfo.
log());
3702 else plots.SetLogy(
false);
3703 }
3705
3706
3707
3708 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3709
3710
3711
3713
3714 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3715
3716 plots.Draw( legend );
3717
3718 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3719
3720 if ( atlasstyle )
ATLASLabel( xpos, ypositions[0]+deltay, atlaslabel, labelcolour, ncolsp, nrowsp );
3721
3722 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3723
3724 for (
unsigned it=0 ;
it<taglabels.size() ;
it++ ) {
3725 DrawLabel( xpos, ypositions[it], taglabels[it], labelcolour, 0.04 );
3726 }
3727
3728 for (
unsigned it=0 ;
it<taglabels2.size() ;
it++ ) {
3729 DrawLabel( xpos+0.35, ypositions2[it], taglabels2[it], labelcolour, 0.04 );
3730 }
3731
3732 }
3733
3734 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3735
3736 std::cout << "means: " << means << std::endl;
3737
3738
3739 if ( means ) {
3741 for (
unsigned j=0 ;
j<MeanLF.size() ;
j++ )
DrawLabel( 0.2, (0.85-(j+
chains.size()-1)*0.035), MeanLF[j],
colours[j%6] );
3742 }
3743
3744
3745
3746 double ytop = 0.5;
3747
3748 if ( ( !nostats || !nomeans ) && !noplots ) {
3749 if ( dochi2 )
for (
unsigned j=0 ;
j<Chi2.size() ;
j++ )
DrawLabel( 0.75, 0.85-j*0.035, Chi2[j],
colours[j%6] );
3752 histo.name()==
"pT" ||
3755
3757 for (
unsigned j=0 ;
j<
chains.size() ;
j++ ) {
3758 if ( !noreftmp ) {
3759 if ( j<MeanRef.size() ) {
3760 if ( !nomeans )
DrawLabel( xpos_original, (ytop-j*0.035), MeanRef[j],
colours[j%6] );
3762 }
3763 }
3764 if ( j<
Mean.size() ) {
3767 }
3768 }
3769 }
3770 }
3771 }
3772
3773 if ( xinfo.
log() ) gPad->SetLogx(
true);
3774 else gPad->SetLogx(false);
3775
3776 if ( yinfo.
log() ) gPad->SetLogy(
true);
3777 else gPad->SetLogy(false);
3778
3779 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3780
3781 if ( !noplots ) {
3782
3783 if ( make_ref_efficiencies ) {
3784
3785 plots_eff.SetXaxisTitle(
plots.GetXaxisTitle() );
3786 plots_eff.SetYaxisTitle(
plots.GetYaxisTitle() );
3787
3788 plots_eff.Draw( legend_eff );
3789 }
3790
3791 if ( !noreflabel.empty() )
DrawLabel(0.1, 0.06, noreflabel, kRed, 0.03 );
3792
3793 }
3794
3795 }
3796
3797
3803
3804 if ( !noplots ) {
3805
3807
3809
3810 std::string useplotname;
3811
3812 if ( panel.
size()>1 ) {
3813 useplotname = panel.
name();
3814 replace( useplotname,
'/',
'_' );
3815 }
3816 else {
3817 useplotname = plotname;
3818 }
3819
3820 useplotname.erase(
std::remove( useplotname.begin(), useplotname.end(),
'+' ), useplotname.end() );
3821
3822 std::string printbase =
dir + useplotname +
tag;
3823
3825
3826 if ( !nopdf )
print_pad( printbase+
".pdf" );
3827 if ( !nopng )
print_pad( printbase+
".png" );
3828 if ( Cfile )
print_pad( printbase+
".C" );
3829
3830 std::cout << std::endl;
3831 }
3832
3833 }
3834
3835 if (
tc )
delete tc;
3836
3837 }
3838
3839
3840 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3841
3843
3844
3846 bool files_duplicated = ( fref_==ftest_ );
3847
3848 if ( deleteref && !files_duplicated ) {
3849
3850 if ( fref_ ) {
3851
3853
3854 std::cout << "main() cleaning up reference file" << std::endl;
3855
3856 TFile* newout = new TFile(".newout.root","recreate");
3857 newout->cd();
3858
3861
3863
3865
3867
3868
3870
3871 for (
unsigned j=0 ;
j<
dirs.size()-1 ;
j++ ) {
3872 std::cout <<
"\t" <<
dirs[
j] << std::endl;
3873 TDirectory* renedir =
gDirectory->GetDirectory(
dirs[j].c_str() );
3876 }
3877
3878
3880 if ( !noreftmp && href ) {
3882 href->Write(
dirs.back().c_str() );
3883 }
3884
3885
3887 }
3888
3889 newout->Close();
3890
3891 }
3892 }
3893
3894
3895 if (
fulldbg ) std::cout << __LINE__ << std::endl;
3896
3898
3899 if ( fref_ && !files_duplicated ) fref_->Close();
3900 if ( ftest_ ) ftest_->Close();
3901
3903
3904 if ( deleteref && !noref ) {
3905 std::cout << "ref " << frefname << "\ttest " << ftestname << std::endl;
3906 if ( frefname != ftestname && !files_duplicated ) {
3907 std::string
cmd = std::string(
"mv ") + frefname +
" " + frefname +
".bak";
3908 std::system(
cmd.c_str() );
3909
3910 cmd = std::string(
"mv .newout.root ") + std::string(frefname);
3911 std::system(
cmd.c_str() );
3912 }
3913 else {
3914 std::cerr << "reference file and test file are the same - not replacing" << std::endl;
3915 }
3916 }
3917
3918 std::cout << "deleting at " << __LINE__ << std::endl;
3919
3920 if ( fref_ && !files_duplicated ) delete fref_;
3921 if ( ftest_ ) delete ftest_;
3922
3923 return 0;
3924}
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::string datetimestamp(T(*func)(Args...))
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
int usage(std::ostream &s, int, char **argv, int status=-1)
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)