Skip to content
Snippets Groups Projects
Commit 76230800 authored by Christopher Rob Jones's avatar Christopher Rob Jones
Browse files

GlobalReco: Update root scripts for PID plots

parent 4a853f9c
No related branches found
No related tags found
2 merge requests!3788Draft: Update SciFi cluster monitoring,!3642Performance Updates to RICH Reconstruction
......@@ -22,6 +22,8 @@
#include <sstream>
#include <boost/filesystem.hpp>
GlobalPID::PIDType GlobalPID::getMcType() const {
if ( 0 == MCParticleType ) {
return NoMCInfo;
......@@ -765,6 +767,11 @@ void GlobalPID::saveImage( TCanvas* canvas, const std::string& filename ) {
}
fileMap[_name] = true;
std::cout << "Printing image " << _name << std::endl;
// make parent path if needed
if ( _name.find( "/" ) != std::string::npos ) {
const auto dir = boost::filesystem::path( _name ).parent_path();
if ( !boost::filesystem::exists( dir ) ) { boost::filesystem::create_directories( dir ); }
}
canvas->SaveAs( _name.c_str() );
}
}
......
......@@ -14,6 +14,8 @@
#include <sstream>
#include <string>
#include <boost/algorithm/string.hpp>
#include "TCanvas.h"
#include "TCut.h"
#include "TFile.h"
......@@ -25,16 +27,15 @@ void MakeRichPlots() {
const std::string imageType = "pdf";
// const std::string dir = "/usera/jonesc/LHCbCMake/Feature/Brunel/output/Upgrade/PhotonSelOpt";
const std::string dir = "/Users/chris/cernbox/LHCb/RICH/ParameterisedCKRes";
const std::string dir = "/usera/jonesc/LHCb/output/U2/InclB/WithSpill";
const std::string fName = "RichFuture-Feature-x86_64-centos7-gcc9-opt-Expert-ProtoTuple.root";
const std::string fName = "RichFuture-Feature-x86_64_v2-centos7-gcc12+detdesc-opt-Expert-ProtoTuple.root";
const std::vector<std::string> nametags = {
"FunctionalCKRes-PIDPerf-OnlinePhotonSel", "PtotParameterisedCKRes-PIDPerf-OnlinePhotonSel",
"FunctionalCKRes-PIDPerf-NominalPhotonSel", "PtotParameterisedCKRes-PIDPerf-NominalPhotonSel"};
const std::vector<std::string> nametags = {"FromMCHits/3D/lumi-2.0e33", "FromMCHits/3D/lumi-1.2e34",
"FromMCHits/4D/lumi-2.0e33/PixWin-3.000/PhotWin-0.100",
"FromMCHits/4D/lumi-1.2e34/PixWin-3.000/PhotWin-0.100"};
for ( const auto& nametag : nametags ) {
for ( auto nametag : nametags ) {
// load the file and TTree
auto f = TFile::Open( ( dir + "/" + nametag + "/" + fName ).c_str() );
......@@ -58,6 +59,8 @@ void MakeRichPlots() {
TCut kAboveThres = "RichAboveKaThres";
TCut piAboveThres = "RichAbovePiThres";
boost::replace_all( nametag, "/", "-" );
auto c = std::make_unique<TCanvas>( nametag.c_str(), nametag.c_str(), 1400, 1000 );
const std::vector<double> cuts = {-10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10};
......
......@@ -19,48 +19,56 @@
void RichKaonIDCompareFiles() {
// const std::string dir = "/usera/jonesc/LHCb/output/U2/InclB/WithSpill";
const std::string dir = "/usera/jonesc/LHCbCMake/Feature/Rec/output/test";
const std::string dir = "/usera/jonesc/LHCb/output/U2/InclB/WithSpill";
// const std::string dir = "/usera/jonesc/LHCbCMake/Feature/Rec/output/test";
// const std::string fName = "RichFuture-Feature-x86_64_v2-centos7-gcc12+detdesc-opt-Expert-ProtoTuple.root";
const std::string fName = "RichFuture-Feature-x86_64_v3-centos7-gcc12+detdesc-opt-Expert-ProtoTuple.root";
const std::string fName = "RichFuture-Feature-x86_64_v2-centos7-gcc12+detdesc-opt-Expert-ProtoTuple.root";
// const std::string fName = "RichFuture-Feature-x86_64_v3-centos7-gcc12+detdesc-opt-Expert-ProtoTuple.root";
std::map<std::string, std::vector<std::string>> dataSets;
dataSets["Run3Tracking-3D"].push_back( "NominalDSTs" );
dataSets["Run3Tracking-3D"].push_back( "NominalDSTs-MCFilteredTks" );
// dataSets["Run3Tracking-3D"].push_back( "DSTs-MCTracks" );
// dataSets["Run3Tracking-3D"].push_back( "DSTs-RecoTracks" );
// const std::string bName = "FromMCHits";
// for ( const std::string lumi : {"2.0e32", "2.0e33", "3.0e33", "1.0e34", "1.2e34", "1.5e34"} ) {
// // 3D
// const std::string bName = "FromMCHits-V2";
// for ( const std::string lumi : {"1.5e34", "1.2e34", "1.0e34", "3.0e33", "2.0e33", "2.0e32"} ) {
// dataSets[bName + "-3D"].push_back( bName + "/3D/lumi-" + lumi );
// // 4D
// for ( const std::string pixWin : {"3.000"} ) {
// for ( const std::string photWin : {"1.000", "0.500", "0.250", "0.100", "0.050", "0.010"} ) {
// const auto n = bName + "/4D/lumi-" + lumi + "/PixWin-" + pixWin + "/PhotWin-" + photWin;
// dataSets[bName + "-4D-PhotWin_" + photWin].push_back( n );
// dataSets[bName + "-4D-Lumi_" + lumi].push_back( n );
// dataSets[bName + "-4D-PixW_" + pixWin + "-PhoW_" + photWin].push_back( n );
// dataSets[bName + "-4D-PixW_" + pixWin + "-Lumi_" + lumi].push_back( n );
// }
// }
// }
// const std::string lumi = "1.2e34";
// {
// const std::string bName = "Rich1BckTune";
// for ( const std::string w : {"0.500", "0.400", "0.300", "0.200", "0.100", "0.050"} ) {
// dataSets[bName + "-3D"].push_back( bName + "/3D/lumi-" + lumi + "/R1PixBckW-" + w );
// dataSets[bName + "-4D"].push_back( bName + "/4D/lumi-" + lumi + "/R1PixBckW-" + w +
// "/PixWin-3.000/PhotWin-0.100" );
// }
// }
// {
// const std::string bName = "Rich2BckTune";
// for ( const std::string w : {"0.500", "0.400", "0.300", "0.200", "0.100", "0.050"} ) {
// dataSets[bName + "-3D"].push_back( bName + "/3D/lumi-" + lumi + "/R2PixBckW-" + w );
// dataSets[bName + "-4D"].push_back( bName + "/4D/lumi-" + lumi + "/R2PixBckW-" + w +
// "/PixWin-3.000/PhotWin-0.100" );
// }
// }
for ( const std::string lumi : {"1.2e34", "2.0e33", "2.0e32"} ) {
const std::string bName = "BkgTuneRich1";
for ( const std::string w : {"0.600", "0.800", "1.000", "1.200", "1.400"} ) {
dataSets["3D/lumi-" + lumi + "/" + bName].push_back( bName + "/3D/lumi-" + lumi + "/R1PixBckW-" + w );
for ( const std::string pixWin : {"1.000"} ) {
for ( const std::string photWin : {"0.250", "0.100", "0.050"} ) {
const auto name = "4D/lumi-" + lumi + "/PixWin-" + pixWin + "/" + bName + "_PhotWin-" + photWin;
dataSets[name].push_back( bName + "/4D/lumi-" + lumi + "/R1PixBckW-" + w + "/PixWin-" + pixWin + "/PhotWin-" +
photWin );
}
}
}
}
for ( const std::string lumi : {"1.2e34", "2.0e33", "2.0e32"} ) {
const std::string bName = "BkgTuneRich2";
for ( const std::string w : {"0.600", "0.800", "1.000", "1.200", "1.400"} ) {
dataSets["3D/lumi-" + lumi + "/" + bName].push_back( bName + "/3D/lumi-" + lumi + "/R2PixBckW-" + w );
for ( const std::string pixWin : {"1.000"} ) {
for ( const std::string photWin : {"0.250", "0.100", "0.050"} ) {
const auto name = "4D/lumi-" + lumi + "/PixWin-" + pixWin + "/" + bName + "_PhotWin-" + photWin;
dataSets[name].push_back( bName + "/4D/lumi-" + lumi + "/R2PixBckW-" + w + "/PixWin-" + pixWin + "/PhotWin-" +
photWin );
}
}
}
}
const Long64_t nTracks = 1e6;
......@@ -108,9 +116,9 @@ void RichKaonIDCompareFiles() {
}
// Stepping options
gConf.minCut = -50;
gConf.maxCut = 30;
gConf.nSteps = 70;
gConf.minCut = -100;
gConf.maxCut = 40;
gConf.nSteps = 100;
gConf.minMisIDeff = gConf.minGraphY;
// Momentum range
......@@ -153,7 +161,7 @@ void RichKaonIDCompareFiles() {
const std::array<Color_t, 11> colors{kYellow - 1, kRed + 1, kGreen + 2, kBlue + 1, kMagenta + 2, kBlack,
kRed - 6, kBlue - 1, kCyan + 2, kGreen - 5, kGray + 2};
auto lastColor = colors.end();
auto lastColor = colors.begin();
auto genTuple = [&]( const auto& tag ) {
if ( colors.end() == lastColor ) { lastColor = colors.begin(); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment