diff --git a/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.cxx b/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.cxx index c0761ca3ec1ad0751d8328aa9fad6fa9c6ef7f1a..6e4c2aae531c6feee89df6102a90d118f6276dff 100644 --- a/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.cxx +++ b/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.cxx @@ -185,10 +185,12 @@ StatusCode NtupleDumperAlg::initialize() addCalibratedBranches("Calo",4,0); addBranch("Calo_total_nMIP", &m_calo_total_nMIP); addBranch("Calo_total_E_dep", &m_calo_total_E_dep); - addBranch("Calo_total_E_EM", &m_calo_total_E_EM); + addBranch("Calo_total_fit_E_EM", &m_calo_total_fit_E_EM); addBranch("Calo_total_raw_E_EM", &m_calo_total_raw_E_EM); - addBranch("Calo_total_E_EM_fudged", &m_calo_total_E_EM_fudged); + addBranch("Calo_total_E_EM", &m_calo_total_E_EM); + addBranch("Calo_total_fit_E_EM_fudged", &m_calo_total_fit_E_EM_fudged); addBranch("Calo_total_raw_E_EM_fudged", &m_calo_total_raw_E_EM_fudged); + addBranch("Calo_total_E_EM_fudged", &m_calo_total_E_EM_fudged); addCalibratedBranches("Preshower",2,12); addBranch("Preshower_total_nMIP", &m_preshower_total_nMIP); @@ -783,9 +785,15 @@ StatusCode NtupleDumperAlg::execute(const EventContext &ctx) const m_calo_total_nMIP += hit->Nmip(); m_calo_total_E_dep += hit->E_dep(); - m_calo_total_E_EM += hit->E_EM(); + m_calo_total_fit_E_EM += hit->E_EM(); m_calo_total_raw_E_EM += (hit->E_EM()*hit->fit_to_raw_ratio()); + if (m_wave_status[ch]&4) { + m_calo_total_E_EM += hit->E_EM(); + } else { + m_calo_total_E_EM += (hit->E_EM()*hit->fit_to_raw_ratio()); + } + ATH_MSG_DEBUG("Calibrated calo: ch is " << ch << ", edep is " << hit->E_dep() << ", E_EM is " << hit->E_EM() << ", Nmip is " << hit->Nmip() << ", fit_to_raw_ratio is " << hit->fit_to_raw_ratio()); //// the following is an example of how to access the linked waveform data from the calibrated data @@ -801,11 +809,13 @@ StatusCode NtupleDumperAlg::execute(const EventContext &ctx) const } // add a fudged energy variable that corrects the MC to agree with the testbeam results - m_calo_total_E_EM_fudged = m_calo_total_E_EM; + m_calo_total_fit_E_EM_fudged = m_calo_total_fit_E_EM; m_calo_total_raw_E_EM_fudged = m_calo_total_raw_E_EM; + m_calo_total_E_EM_fudged = m_calo_total_E_EM; if (isMC) { - m_calo_total_E_EM_fudged = m_calo_total_E_EM_fudged * m_caloMC_FudgeFactor; + m_calo_total_fit_E_EM_fudged = m_calo_total_fit_E_EM_fudged * m_caloMC_FudgeFactor; m_calo_total_raw_E_EM_fudged = m_calo_total_raw_E_EM_fudged * m_caloMC_FudgeFactor; + m_calo_total_E_EM_fudged = m_calo_total_E_EM_fudged * m_caloMC_FudgeFactor; } // load in calibrated preshower container @@ -813,11 +823,11 @@ StatusCode NtupleDumperAlg::execute(const EventContext &ctx) const ATH_CHECK(preshowerCalibratedContainer.isValid()); for (auto hit : *preshowerCalibratedContainer) { int ch=hit->channel(); - m_calibrated_nMIP[ch] = hit->Nmip(); - m_calibrated_E_dep[ch] = hit->E_dep(); + m_calibrated_nMIP[ch] = hit->Nmip() * hit->fit_to_raw_ratio(); + m_calibrated_E_dep[ch] = hit->E_dep() * hit->fit_to_raw_ratio(); - m_preshower_total_nMIP += hit->Nmip(); - m_preshower_total_E_dep += hit->E_dep(); + m_preshower_total_nMIP += hit->Nmip() * hit->fit_to_raw_ratio(); + m_preshower_total_E_dep += hit->E_dep() * hit->fit_to_raw_ratio(); ATH_MSG_DEBUG("Calibrated preshower: ch is " << ch << ", edep is " << hit->E_dep() << ", E_EM is " << hit->E_EM() << ", Nmip is " << hit->Nmip() << ", fit_to_raw_ratio is " << hit->fit_to_raw_ratio()); } @@ -1288,10 +1298,12 @@ NtupleDumperAlg::clearTree() const m_calo_total_nMIP=0; m_calo_total_E_dep=0; - m_calo_total_E_EM=0; + m_calo_total_fit_E_EM=0; m_calo_total_raw_E_EM=0; - m_calo_total_E_EM_fudged=0; + m_calo_total_E_EM=0; + m_calo_total_fit_E_EM_fudged=0; m_calo_total_raw_E_EM_fudged=0; + m_calo_total_E_EM_fudged=0; m_preshower_total_nMIP=0; m_preshower_total_E_dep=0; diff --git a/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.h b/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.h index 339c0838b22047dd146d71163acebdc472f7d1f3..67f3bacf8c8f4a6ef134741637d093fdea60c24b 100644 --- a/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.h +++ b/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.h @@ -174,11 +174,13 @@ private: mutable float m_calo_total_nMIP; mutable float m_calo_total_E_dep; - mutable float m_calo_total_E_EM; + mutable float m_calo_total_fit_E_EM; mutable float m_calo_total_raw_E_EM; + mutable float m_calo_total_E_EM; - mutable float m_calo_total_E_EM_fudged; + mutable float m_calo_total_fit_E_EM_fudged; mutable float m_calo_total_raw_E_EM_fudged; + mutable float m_calo_total_E_EM_fudged; mutable float m_preshower_total_nMIP; mutable float m_preshower_total_E_dep;