Skip to content
Snippets Groups Projects
Commit a27b6bb4 authored by Rosen Matev's avatar Rosen Matev :sunny:
Browse files

Merge branch 'RichPIDChecker-FixHistoIDs' into 'master'

RichPIDQC - Prebook histograms and explicitly define IDs

See merge request !2345
parents 466c09ac 119c0016
No related branches found
No related tags found
1 merge request!2345RichPIDQC - Prebook histograms and explicitly define IDs
Pipeline #2328475 passed
......@@ -69,6 +69,39 @@ namespace Rich::Future::Rec::MC::Moni {
} );
}
protected:
/// Book histograms
StatusCode prebookHistograms() override {
bool ok = true;
const BinLabels pidTypes = {"unknown", "electron", "muon", "pion", "kaon", "proton", "deuteron", "below_thres"};
ok &= saveAndCheck( h_pidTable, //
richHisto2D( HID( "pidTable" ), //
"PID Performance Table", //
-1.5, Rich::NParticleTypes - 0.5, Rich::NParticleTypes + 1, //
-1.5, Rich::NParticleTypes - 0.5, Rich::NParticleTypes + 1, //
"Reco. PID Type", "MC PID Type", "Entries", //
pidTypes, pidTypes ) );
ok &= saveAndCheck( h_npids, //
richHisto1D( HID( "nPIDs" ), "# PIDs per event", //
-0.5, 200.5, 201, //
"# PIDs per event", "Entries" ) );
ok &= saveAndCheck( h_evOK, //
richHisto1D( HID( "evOK" ), "Event Success V Failures", //
-0.5, 1.5, 2, //
"Event has PIDs", "Entries", {"false", "true"} ) );
ok &= saveAndCheck( h_tkFrac, //
richHisto1D( HID( "pidFrac" ), "Fraction of Tracks with PIDs", //
0, 1, nBins1D(), //
"Track Fraction with PID information", "Entries" ) );
return StatusCode{ok};
}
public:
/// Functional operator
void operator()( const LHCb::Track::Selection& tracks, //
......@@ -80,11 +113,7 @@ namespace Rich::Future::Rec::MC::Moni {
inline void fillTable( const Rich::ParticleIDType recopid, //
const Rich::ParticleIDType mcpid, //
const double weight = 1.0 ) const {
plot2D( (int)recopid, (int)mcpid, //
"pidTable", "PID Performance Table", //
-1.5, Rich::NParticleTypes + 0.5, -1.5, //
Rich::NParticleTypes + 0.5, Rich::NParticleTypes + 1, Rich::NParticleTypes + 1, //
weight );
fillHisto( h_pidTable, (int)recopid, (int)mcpid, weight );
}
private:
......@@ -104,7 +133,19 @@ namespace Rich::Future::Rec::MC::Moni {
Gaudi::Property<bool> m_fillPIDplots{this, "FillPIDPlots", false, "Enable the filling of detailed PID plots"};
private:
// Gaudi counters
// Gaudi counters and histos
/// PID table
AIDA::IHistogram2D* h_pidTable{nullptr};
/// PIDs per event
AIDA::IHistogram1D* h_npids{nullptr};
/// Event success / fail
AIDA::IHistogram1D* h_evOK{nullptr};
/// Track fraction with PID
AIDA::IHistogram1D* h_tkFrac{nullptr};
/// Proton heavy ID efficiency
mutable Gaudi::Accumulators::BinomialCounter<> m_protonEff{this, "Pr DLL(Pr)>0 ID Efficiency"};
......@@ -236,12 +277,9 @@ void PIDQC::operator()( const LHCb::Track::Selection& tracks,
} // pid loop
plot1D( pidCount, "# PIDs per event", -0.5, 200.5, 201 );
plot1D( ( pids.empty() ? 0 : 1 ), "Event Success V Failures", -0.5, 1.5, 2 );
if ( nTks > 0 ) {
plot1D( static_cast<double>( pidCount ) / static_cast<double>( nTks ), "Fraction of Tracks with PIDs", 0, 1,
nBins1D() );
}
fillHisto( h_npids, pidCount );
fillHisto( h_evOK, ( pids.empty() ? 0 : 1 ) );
if ( nTks > 0 ) { fillHisto( h_tkFrac, static_cast<double>( pidCount ) / static_cast<double>( nTks ) ); }
}
//-----------------------------------------------------------------------------
......
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