Skip to content
Snippets Groups Projects
Commit 88139a9c authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'fix/muon_CFE_plot' into 'master'

Flow Element validation: Fix dE (PFO,FE) plot

See merge request atlas/athena!42103
parents d04cb9df dea31470
No related branches found
No related tags found
No related merge requests found
...@@ -129,6 +129,7 @@ namespace PFO { ...@@ -129,6 +129,7 @@ namespace PFO {
} }
for (ElementLink<xAOD::MuonContainer> MuonLink: MuonLinks){ for (ElementLink<xAOD::MuonContainer> MuonLink: MuonLinks){
//get Muon from link by de-referencing it //get Muon from link by de-referencing it
const xAOD::Muon* muon = *MuonLink; const xAOD::Muon* muon = *MuonLink;
TLorentzVector muon_fourvec=muon->p4(); TLorentzVector muon_fourvec=muon->p4();
...@@ -146,7 +147,7 @@ namespace PFO { ...@@ -146,7 +147,7 @@ namespace PFO {
m_CFE_muon_largeDR_debug_type->Fill(type,eventInfo.beamSpotWeight()); m_CFE_muon_largeDR_debug_type->Fill(type,eventInfo.beamSpotWeight());
} }
}// end of CFE fill block for muon_dR code }// end of CFE fill block for muon_dR code
} }
}// end of muon acc block }// end of muon acc block
// Electron block // Electron block
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
#include "PFOHistUtils/PFO_FE_Comparison_PlotMaker.h" #include "PFOHistUtils/PFO_FE_Comparison_PlotMaker.h"
#include <math.h> #include <math.h>
// some debug libraries for cluster moment floating point checks
#include <bitset>
#include <climits>
namespace PFO { namespace PFO {
PFO_FE_Comparison_PlotMaker::PFO_FE_Comparison_PlotMaker(PlotBase* pParent,std::string sDir, std::string sPFOContainerName, std::string sFEContainerName, bool isNeutral): PlotBase(pParent,sDir), asg::AsgMessaging("PFO_FE_Comparison_PlotMaker"), m_sPFOContainerName(sPFOContainerName), m_sFEContainerName(sFEContainerName), m_isNeutral(isNeutral) { PFO_FE_Comparison_PlotMaker::PFO_FE_Comparison_PlotMaker(PlotBase* pParent,std::string sDir, std::string sPFOContainerName, std::string sFEContainerName, bool isNeutral): PlotBase(pParent,sDir), asg::AsgMessaging("PFO_FE_Comparison_PlotMaker"), m_sPFOContainerName(sPFOContainerName), m_sFEContainerName(sFEContainerName), m_isNeutral(isNeutral) {
// init all hists as nullptrs // init all hists as nullptrs
...@@ -87,11 +90,11 @@ namespace PFO { ...@@ -87,11 +90,11 @@ namespace PFO {
void PFO_FE_Comparison_PlotMaker::Fill(const xAOD::PFO* pfo, const xAOD::FlowElement* fe){ void PFO_FE_Comparison_PlotMaker::Fill(const xAOD::PFO* pfo, const xAOD::FlowElement* fe){
TLorentzVector fe_tlv=fe->p4(); TLorentzVector fe_tlv=fe->p4();
TLorentzVector pfo_tlv=pfo->p4(); TLorentzVector pfo_tlv=pfo->p4EM(); // default PFO is LC scale, switch to EM scale for comparison
double pfo_pt=pfo_tlv.Pt(); double pfo_pt=pfo_tlv.Pt();
double pfo_eta=pfo_tlv.Eta(); double pfo_eta=pfo_tlv.Eta();
double pfo_e=pfo_tlv.E(); double pfo_e=pfo_tlv.E(); // get correct scale
double fe_pt=fe_tlv.Pt(); double fe_pt=fe_tlv.Pt();
double fe_eta=fe_tlv.Eta(); double fe_eta=fe_tlv.Eta();
...@@ -106,7 +109,26 @@ namespace PFO { ...@@ -106,7 +109,26 @@ namespace PFO {
double abs_dEta=std::abs(fe_eta-pfo_eta); double abs_dEta=std::abs(fe_eta-pfo_eta);
double dphi=fe_tlv.DeltaPhi(pfo_tlv); double dphi=fe_tlv.DeltaPhi(pfo_tlv);
double dE=fe_e-pfo_e; double dE=fe_e-pfo_e;
double ERatio=-9999999999;
if(pfo_e!=0)
ERatio=fe_e/pfo_e;
if(m_isNeutral){
// debug of scale
double pfo_e_LC=pfo->p4().E(); // pfo LC scale energy
double pfo_eEM=pfo->eEM(); // pfo EM scale energy
ATH_MSG_DEBUG("PFO E(): "<<pfo_e_LC<<"PFO eEM()"<<pfo_eEM<<" FE E(): "<<fe_e);
if(ERatio>-999999999)
ATH_MSG_INFO("Ratio (PFO_e/FE_e): "<<ERatio);
if(dE!=0)
ATH_MSG_INFO("FE_e - PFO_e : "<<dE);
// assume all edge cases/nullptr catches for clusters were already vetoed
double fe_clus_e=(fe->otherObjects()).at(0)->p4().E();
double pfo_clus_e=pfo->cluster(0)->p4().E();
ATH_MSG_INFO("PFO_clus E(): "<<pfo_clus_e<<" FE_clus E(): "<<fe_clus_e);
}
// now fill the histos // now fill the histos
m_PFO_FE_dE->Fill(dE); m_PFO_FE_dE->Fill(dE);
...@@ -166,9 +188,22 @@ namespace PFO { ...@@ -166,9 +188,22 @@ namespace PFO {
if(acc_FE_moment_N_BAD_CELLS.isAvailable(*fe)) if(acc_FE_moment_N_BAD_CELLS.isAvailable(*fe))
FE_moment_N_BAD_CELLS=acc_FE_moment_N_BAD_CELLS(*fe); FE_moment_N_BAD_CELLS=acc_FE_moment_N_BAD_CELLS(*fe);
if(acc_FE_moment_BADLARQ_FRAC.isAvailable(*fe)) if(acc_FE_moment_BADLARQ_FRAC.isAvailable(*fe)){
FE_moment_BADLARQ_FRAC=acc_FE_moment_BADLARQ_FRAC(*fe); FE_moment_BADLARQ_FRAC=acc_FE_moment_BADLARQ_FRAC(*fe);
// this section is a debug of floating point compression
ATH_MSG_DEBUG("BADLARQ_FRAC "<<FE_moment_BADLARQ_FRAC);
union{ //using union and bitset to read the binary
//representation of the floating point number (to check compression effects)
float input; //
int output;
} indata;
indata.input=FE_moment_BADLARQ_FRAC;
std::bitset<sizeof(float) * CHAR_BIT> bits(indata.output);
ATH_MSG_DEBUG("BADLARQ_FRAC bits (binary rep) "<<bits<<"");
}
if(acc_FE_moment_ENG_POS.isAvailable(*fe)) if(acc_FE_moment_ENG_POS.isAvailable(*fe))
FE_moment_ENG_POS=acc_FE_moment_ENG_POS(*fe); FE_moment_ENG_POS=acc_FE_moment_ENG_POS(*fe);
......
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