Skip to content
Snippets Groups Projects

Performance Updates to RICH Reconstruction

Compare and
37 files
+ 2113
1117
Compare changes
  • Side-by-side
  • Inline
Files
37
@@ -22,6 +22,8 @@
#include <sstream>
#include <boost/filesystem.hpp>
GlobalPID::PIDType GlobalPID::getMcType() const {
if ( 0 == MCParticleType ) {
return NoMCInfo;
@@ -139,13 +141,27 @@ void GlobalPID::makeCurve( const Long64_t nTracks ) {
//------------------------------------------------------------------------------
// pid det selection
if ( !passBasicPIDDet() ) continue;
if ( !passBasicPIDDet() ) { continue; }
// run the track selection
if ( !passTrackSelection() ) continue;
if ( !passTrackSelection() ) { continue; }
// reject below threshold tracks
if ( config.rejectBThypos && //
( ( Pion == RichBestPID && !RichAbovePiThres ) || //
( Kaon == RichBestPID && !RichAboveKaThres ) || //
( Proton == RichBestPID && !RichAbovePrThres ) ) ) {
continue;
}
// Get the MC type
const PIDType mcType = getMcType();
if ( config.rejectBThypos && //
( ( Pion == mcType && !RichAbovePiThres ) || //
( Kaon == mcType && !RichAboveKaThres ) || //
( Proton == mcType && !RichAbovePrThres ) ) ) {
continue;
}
// Get the physical cut variable
const double thisVar = selectionVar();
@@ -169,7 +185,7 @@ void GlobalPID::makeCurve( const Long64_t nTracks ) {
//------------------------------------------------------------------------------
}
std::cout << " Done." << std::endl << "Creating " << config.title << std::endl;
std::cout << " Done." << std::endl << "Creating '" << config.title << "'" << std::endl;
// figure file name
std::string figName = imageName();
@@ -215,23 +231,25 @@ void GlobalPID::makeCurve( const Long64_t nTracks ) {
const double partMisIDEff = 100 * ( totPartMisID > 0 ? selPartMisID / totPartMisID : 0 );
const double partMisIDEffErr = 100 * poisError( selPartMisID, totPartMisID );
if ( partEff >= config.minIDeff && partEff <= config.maxIDeff && partMisIDEff >= config.minMisIDeff &&
if ( partEff >= config.minIDeff && //
partEff <= config.maxIDeff && //
partMisIDEff >= config.minMisIDeff && //
partMisIDEff <= config.maxMisIDeff ) {
ideff.push_back( partEff );
idefferr.push_back( partEffErr );
misideff.push_back( partMisIDEff );
misidefferr.push_back( partMisIDEffErr );
}
// add label ?
if ( config.writeCutValues && iLabel >= labelRate ) {
iLabel = labelOffset;
std::ostringstream label;
// label << "cut=";
label << iStep->first;
labels.push_back( Label( partEff, partMisIDEff, label.str() ) );
}
} // in plot range
} // step loop
// label ?
if ( config.writeCutValues && iLabel >= labelRate ) {
iLabel = labelOffset;
std::ostringstream label;
// label << "cut=";
label << iStep->first;
labels.push_back( Label( partEff, partMisIDEff, label.str() ) );
}
}
labelOffset += 1;
if ( config.useFixedGraphRange && !config.superImpose ) {
@@ -538,11 +556,12 @@ void GlobalPID::fillLabelBox() const {
static double yOffset( 0 );
if ( !config.superImpose ) yOffset = 0.88;
if ( !config.subtitle.empty() ) { text->DrawText( xOffset, yOffset -= yInc, line0.str().c_str() ); }
text->DrawText( xOffset, yOffset -= yInc, line1.str().c_str() );
if ( config.secvar1 != NoVar ) { text->DrawText( xOffset, yOffset -= yInc, line2.str().c_str() ); }
text->DrawText( xOffset, yOffset -= yInc, line3.str().c_str() );
text->DrawText( xOffset, yOffset -= yInc, line5.str().c_str() );
text->DrawText( xOffset, yOffset -= yInc, line6.str().c_str() );
// text->DrawText( xOffset, yOffset -= yInc, line1.str().c_str() );
// if ( config.secvar1 != NoVar ) { text->DrawText( xOffset, yOffset -= yInc, line2.str().c_str() ); }
// text->DrawText( xOffset, yOffset -= yInc, line3.str().c_str() );
// text->DrawText( xOffset, yOffset -= yInc, line5.str().c_str() );
// text->DrawText( xOffset, yOffset -= yInc, line6.str().c_str() );
std::cout << line6.str() << std::endl;
yOffset -= yInc / 2;
}
@@ -681,8 +700,6 @@ void GlobalPID::Init( TTree* tree ) {
fChain->SetBranchAddress( "CaloChargedSpd", &CaloChargedSpd, &b_CaloChargedSpd );
fChain->SetBranchAddress( "CaloChargedPrs", &CaloChargedPrs, &b_CaloChargedPrs );
fChain->SetBranchAddress( "CaloChargedEcal", &CaloChargedEcal, &b_CaloChargedEcal );
fChain->SetBranchAddress( "CaloSpdE", &CaloSpdE, &b_CaloSpdE );
fChain->SetBranchAddress( "CaloPrsE", &CaloPrsE, &b_CaloPrsE );
fChain->SetBranchAddress( "CaloEcalChi2", &CaloEcalChi2, &b_CaloEcalChi2 );
fChain->SetBranchAddress( "CaloClusChi2", &CaloClusChi2, &b_CaloClusChi2 );
fChain->SetBranchAddress( "CaloBremChi2", &CaloBremChi2, &b_CaloBremChi2 );
@@ -748,6 +765,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() );
}
}
Loading