From 90afeb6c1f36eaa25608dbb25c34f4e4e826bc91 Mon Sep 17 00:00:00 2001 From: Anil Sonay <anil.sonay@cern.ch> Date: Mon, 28 Sep 2020 11:26:23 +0000 Subject: [PATCH] Fix for MT-safe mon in L1Topo ATR-19783 --- .../L1TopoAlgorithms/DeltaEtaIncl1.h | 3 - .../L1TopoAlgorithms/DeltaEtaIncl2.h | 3 - .../L1TopoAlgorithms/DeltaEtaPhiIncl1.h | 2 - .../L1TopoAlgorithms/DeltaEtaPhiIncl2.h | 2 - .../L1TopoAlgorithms/DeltaPhiIncl1.h | 2 - .../L1TopoAlgorithms/DeltaPhiIncl2.h | 2 - .../DeltaRApproxBoxCutIncl1.h | 2 - .../DeltaRApproxBoxCutIncl2.h | 2 - .../L1TopoAlgorithms/DeltaRSqrIncl1.h | 4 +- .../L1TopoAlgorithms/DeltaRSqrIncl2.h | 2 - .../L1TopoAlgorithms/EtaPhiWindow.h | 2 - .../L1TopoAlgorithms/ExclusiveJets.h | 5 +- .../InvariantMassDeltaPhiInclusive2.h | 5 -- .../InvariantMassInclusive1.h | 3 - .../InvariantMassInclusive2.h | 4 -- .../InvariantMassInclusiveDeltaRSqrIncl1.h | 5 +- .../InvariantMassInclusiveDeltaRSqrIncl2.h | 4 +- .../InvariantMassThreeTOBsIncl.h | 5 +- .../L1TopoAlgorithms/L1TopoAlgorithms/JetHT.h | 3 - .../L1TopoAlgorithms/MinDeltaPhiIncl2.h | 3 - .../L1TopoAlgorithms/SimpleCone.h | 3 - .../TransverseMassInclusive1.h | 2 - .../L1TopoAlgorithms/Root/DeltaEtaIncl1.cxx | 44 ++++++-------- .../L1TopoAlgorithms/Root/DeltaEtaIncl2.cxx | 33 ++++------- .../Root/DeltaEtaPhiIncl1.cxx | 40 ++++++------- .../Root/DeltaEtaPhiIncl2.cxx | 28 ++++----- .../L1TopoAlgorithms/Root/DeltaPhiIncl1.cxx | 48 ++++++--------- .../L1TopoAlgorithms/Root/DeltaPhiIncl2.cxx | 35 ++++------- .../Root/DeltaRApproxBoxCutIncl1.cxx | 31 +++++----- .../Root/DeltaRApproxBoxCutIncl2.cxx | 24 ++++---- .../L1TopoAlgorithms/Root/DeltaRSqrIncl1.cxx | 41 +++++++------ .../L1TopoAlgorithms/Root/DeltaRSqrIncl2.cxx | 31 +++++----- .../Root/DisambiguationDRIncl2.cxx | 3 +- .../Root/DisambiguationDRIncl3.cxx | 3 +- .../Root/DisambiguationDetaDPhiIncl3.cxx | 3 +- .../Root/DisambiguationIncl2.cxx | 3 +- .../Root/DisambiguationIncl3.cxx | 3 +- .../Root/DisambiguationInvmIncl2.cxx | 3 +- .../L1Topo/L1TopoAlgorithms/Root/EtCut.cxx | 3 - .../L1TopoAlgorithms/Root/EtaPhiWindow.cxx | 31 +++++----- .../L1TopoAlgorithms/Root/ExclusiveJets.cxx | 58 ++++++++----------- .../Root/InvariantMassDeltaPhiInclusive2.cxx | 6 +- .../Root/InvariantMassInclusive1.cxx | 41 ++++++------- .../Root/InvariantMassInclusive2.cxx | 37 +++++------- .../InvariantMassInclusiveDeltaRSqrIncl1.cxx | 51 ++++++---------- .../InvariantMassInclusiveDeltaRSqrIncl2.cxx | 32 ++++------ .../Root/InvariantMassThreeTOBsIncl.cxx | 41 ++++++------- .../L1Topo/L1TopoAlgorithms/Root/JetHT.cxx | 32 ++++------ .../L1Topo/L1TopoAlgorithms/Root/JetMatch.cxx | 5 +- .../L1Topo/L1TopoAlgorithms/Root/LAr.cxx | 3 - .../L1Topo/L1TopoAlgorithms/Root/METCut.cxx | 2 - .../Root/MinDeltaPhiIncl2.cxx | 40 +++++-------- .../L1TopoAlgorithms/Root/Multiplicity.cxx | 5 +- .../Root/MultiplicityCustom.cxx | 5 +- .../L1Topo/L1TopoAlgorithms/Root/NotMatch.cxx | 5 +- .../L1Topo/L1TopoAlgorithms/Root/Ratio.cxx | 4 +- .../L1Topo/L1TopoAlgorithms/Root/Ratio2.cxx | 4 +- .../L1TopoAlgorithms/Root/RatioMatch.cxx | 3 +- .../L1Topo/L1TopoAlgorithms/Root/RatioSum.cxx | 4 +- .../L1TopoAlgorithms/Root/SimpleCone.cxx | 32 ++++------ .../Root/TransverseMassInclusive1.cxx | 33 +++++------ .../L1TopoInterfaces/DecisionAlg.h | 11 ++++ .../L1TopoInterfaces/Root/ConfigurableAlg.cxx | 6 +- .../share/L1TopoSimulationTest.py | 2 +- .../src/AthenaL1TopoHistSvc.cxx | 18 ++---- .../L1TopoSimulation/src/L1TopoSimulation.cxx | 5 ++ .../L1TopoSimulation/src/L1TopoSimulation.h | 4 ++ 67 files changed, 369 insertions(+), 595 deletions(-) diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaIncl1.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaIncl1.h index f03bbf78af4..ba41b04f1da 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaIncl1.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaIncl1.h @@ -38,9 +38,6 @@ namespace TCS { parType_t p_MinET1[4] = { 0,0,0,0 }; parType_t p_MinET2[4] = { 0,0,0,0 }; - TH1 * m_histAcceptDEta1[4] = {}; - TH1 * m_histRejectDEta1[4] = {}; - }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaIncl2.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaIncl2.h index fe2ac2afdbc..dfa342c9560 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaIncl2.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaIncl2.h @@ -38,9 +38,6 @@ namespace TCS { parType_t p_MinET1[4] = { 0,0,0,0 }; parType_t p_MinET2[4] = { 0,0,0,0 }; - TH1 * m_histAcceptDEta2[4] = {}; - TH1 * m_histRejectDEta2[4] = {}; - }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaPhiIncl1.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaPhiIncl1.h index a2c8c720b06..f57dc339704 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaPhiIncl1.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaPhiIncl1.h @@ -42,8 +42,6 @@ namespace TCS { parType_t p_MinET1[3] = { 0,0,0 }; parType_t p_MinET2[3] = { 0,0,0 }; - TH2 * m_histAccept[3] = {}; - TH2 * m_histReject[3] = {}; }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaPhiIncl2.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaPhiIncl2.h index eb4210f4c5b..0d29a003b6d 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaPhiIncl2.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaPhiIncl2.h @@ -42,8 +42,6 @@ namespace TCS { parType_t p_MinET1[3] = { 0,0,0 }; parType_t p_MinET2[3] = { 0,0,0 }; - TH2 * m_histAccept[3] = {}; - TH2 * m_histReject[3] = {}; }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaPhiIncl1.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaPhiIncl1.h index ac91c479fc9..d46c76c946b 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaPhiIncl1.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaPhiIncl1.h @@ -38,8 +38,6 @@ namespace TCS { parType_t p_MinET1[2] = { 0,0 }; parType_t p_MinET2[2] = { 0,0 }; - TH1 * m_histAcceptDPhi2[2] = {}; - TH1 * m_histRejectDPhi2[2] = {}; }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaPhiIncl2.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaPhiIncl2.h index 8e2e650e18b..2cc72ab6ffd 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaPhiIncl2.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaPhiIncl2.h @@ -39,8 +39,6 @@ namespace TCS { parType_t p_MinET1[2] = { 0,0 }; parType_t p_MinET2[2] = { 0,0 }; - TH1 * m_histAcceptDPhi2[2] = {}; - TH1 * m_histRejectDPhi2[2] = {}; }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRApproxBoxCutIncl1.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRApproxBoxCutIncl1.h index 29909d87d60..0c45fcc56c7 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRApproxBoxCutIncl1.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRApproxBoxCutIncl1.h @@ -44,8 +44,6 @@ namespace TCS { parType_t p_MinET1 = { 0 }; parType_t p_MinET2 = { 0 }; - TH2 * m_histAccept[3] = {}; - TH2 * m_histReject[3] = {}; }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRApproxBoxCutIncl2.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRApproxBoxCutIncl2.h index 72a5340a2fa..5ff724ab747 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRApproxBoxCutIncl2.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRApproxBoxCutIncl2.h @@ -44,8 +44,6 @@ namespace TCS { parType_t p_MinET1 = { 0 }; parType_t p_MinET2 = { 0 }; - TH2 * m_histAccept[3] = {}; - TH2 * m_histReject[3] = {}; }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRSqrIncl1.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRSqrIncl1.h index ff0bb5a9e02..5f3fb11c08c 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRSqrIncl1.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRSqrIncl1.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // DeltaRSqrIncl1.h // TopoCore @@ -42,8 +42,6 @@ namespace TCS { parType_t p_MinET2 = { 0 }; parType_t p_OneBarrel = { 0 }; - TH1 * m_histAccept[3] = {}; - TH1 * m_histReject[3] = {}; }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRSqrIncl2.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRSqrIncl2.h index 0d6a6d90163..0cfcc0fe883 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRSqrIncl2.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRSqrIncl2.h @@ -38,8 +38,6 @@ namespace TCS { parType_t p_MinET1[3] = { 0,0,0 }; parType_t p_MinET2[3] = { 0,0,0 }; - TH1 * m_histAccept[3] = {}; - TH1 * m_histReject[3] = {}; }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/EtaPhiWindow.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/EtaPhiWindow.h index 1052ac618e5..e0f7e402748 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/EtaPhiWindow.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/EtaPhiWindow.h @@ -46,8 +46,6 @@ private: parType_t p_PhiMax = { 0 }; parType_t p_PhiMin = { 0 }; - TH2 * m_histAccept[1] = {}; - TH2 * m_histReject[1] = {}; }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/ExclusiveJets.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/ExclusiveJets.h index f72a0c33d87..e320f0a3e1a 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/ExclusiveJets.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/ExclusiveJets.h @@ -33,10 +33,7 @@ namespace TCS { parType_t p_MaxEta1[6] = { 0,0,0,0,0,0 }; parType_t p_MinEta2[6] = { 0,0,0,0,0,0 }; parType_t p_MaxEta2[6] = { 0,0,0,0,0,0 }; - TH2F * m_histAcceptExclusiveJets[6] = {}; - TH2F * m_histRejectExclusiveJets[6] = {}; - TH2F * m_histAcceptEta1Eta2[6] = {}; - TH2F * m_histRejectEta1Eta2[6] = {}; + }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassDeltaPhiInclusive2.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassDeltaPhiInclusive2.h index d00c38f82c0..7bf79acd2f9 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassDeltaPhiInclusive2.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassDeltaPhiInclusive2.h @@ -48,11 +48,6 @@ namespace TCS { parType_t p_DeltaPhiMin[6] = { 0,0,0,0,0,0 }; parType_t p_DeltaPhiMax[6] = { 0,0,0,0,0,0 }; - std::vector<std::string> m_histAcceptM; - std::vector<std::string> m_histRejectM; - std::vector<std::string> m_histAcceptEta1Eta2; - std::vector<std::string> m_histRejectEta1Eta2; - }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusive1.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusive1.h index 50e59d76394..90d9a232486 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusive1.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusive1.h @@ -39,9 +39,6 @@ namespace TCS { parType_t p_MinET2[6] = { 0 ,0,0,0,0,0}; parType_t p_OneBarrel = { 0 }; - TH1 * m_histAcceptINV1[6] = {}; - TH1 * m_histRejectINV1[6] = {}; - }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusive2.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusive2.h index d391e15f862..ed99534d88e 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusive2.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusive2.h @@ -46,10 +46,6 @@ namespace TCS { parType_t p_MinEta2 = { 0 }; parType_t p_MaxEta2 = { 0 }; - TH1 * m_histAcceptM[6] = {}; - TH1 * m_histRejectM[6] = {}; - TH2 * m_histAcceptEta1Eta2[6] = {}; - TH2 * m_histRejectEta1Eta2[6] = {}; }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusiveDeltaRSqrIncl1.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusiveDeltaRSqrIncl1.h index ef091aaf640..0e0725160b3 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusiveDeltaRSqrIncl1.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusiveDeltaRSqrIncl1.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // InvariantMassInclusiveDeltaRSqrIncl1.h // TopoCore @@ -43,9 +43,6 @@ namespace TCS { parType_t p_DeltaRMin[6] = { 0,0,0,0,0,0 }; parType_t p_DeltaRMax[6] = { 0,0,0,0,0,0 }; - TH2 * m_histAcceptM[6] = {}; - TH2 * m_histRejectM[6] = {}; - }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusiveDeltaRSqrIncl2.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusiveDeltaRSqrIncl2.h index 6d26d069e1b..4c540658875 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusiveDeltaRSqrIncl2.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusiveDeltaRSqrIncl2.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // InvariantMassInclusiveDeltaRSqrIncl2.h // TopoCore @@ -48,8 +48,6 @@ namespace TCS { parType_t p_DeltaRMin[6] = { 0,0,0,0,0,0 }; parType_t p_DeltaRMax[6] = { 0,0,0,0,0,0 }; - TH2 * m_histAcceptM[6] = {}; - TH2 * m_histRejectM[6] = {}; }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassThreeTOBsIncl.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassThreeTOBsIncl.h index 12665a8684b..f2836d898d8 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassThreeTOBsIncl.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassThreeTOBsIncl.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // InvariantMassThreeTOBsIncl.h // TopoCore @@ -37,9 +37,6 @@ namespace TCS { parType_t p_MinET1[6] = { 0 ,0,0,0,0,0}; parType_t p_OneBarrel = { 0 }; - TH1 * m_histAcceptINVThree[6] = {}; - TH1 * m_histRejectINVThree[6] = {}; - }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/JetHT.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/JetHT.h index 902dc290c87..f7b2c55803b 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/JetHT.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/JetHT.h @@ -36,9 +36,6 @@ namespace TCS { parType_t p_EtaMax = { 49 }; parType_t p_HT[6] = { 0 , 0,0,0,0,0 }; - TH1 * m_histAcceptHT[6] = {}; - TH1 * m_histRejectHT[6] = {}; - }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/MinDeltaPhiIncl2.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/MinDeltaPhiIncl2.h index 44eecaccf2d..68a52b9a1c1 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/MinDeltaPhiIncl2.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/MinDeltaPhiIncl2.h @@ -38,9 +38,6 @@ namespace TCS { parType_t p_MinET1 = { 0 }; parType_t p_MinET2 = { 0 }; - TH1 * m_histAcceptMinDPhi2[3]= {}; - TH1 * m_histRejectMinDPhi2[3] = {}; - }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/SimpleCone.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/SimpleCone.h index 65e58b368f0..86db60881f0 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/SimpleCone.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/SimpleCone.h @@ -35,9 +35,6 @@ namespace TCS { parType_t p_EtaMax = { 49 }; parType_t p_MinSumET[6] = { 0 , 0,0,0,0,0 }; - TH1 * m_histAcceptSimpleCone[6] = {}; - TH1 * m_histRejectSimpleCone[6] = {}; - }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/TransverseMassInclusive1.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/TransverseMassInclusive1.h index a0a58c9294f..106205fa92e 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/TransverseMassInclusive1.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/TransverseMassInclusive1.h @@ -36,8 +36,6 @@ namespace TCS { parType_t p_MinET1[6] = { 0,0,0,0,0,0 }; parType_t p_MinET2[6] = { 0,0,0,0,0,0 }; - TH1 * m_histAcceptM[6] = {}; - TH1 * m_histRejectM[6] = {}; }; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaIncl1.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaIncl1.cxx index 4fe5a5b27ff..df377622a24 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaIncl1.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaIncl1.cxx @@ -25,8 +25,6 @@ REGISTER_ALG_TCS(DeltaEtaIncl1) -using namespace std; - // not the best solution but we will move to athena where this comes for free #define LOG cout << fullname() << ": " @@ -89,23 +87,15 @@ TCS::DeltaEtaIncl1::initialize() { } TRG_MSG_INFO("number output : " << numberOutputBits()); - // create strings for histogram names - std::vector<std::ostringstream> MyAcceptHist(numberOutputBits()); - std::vector<std::ostringstream> MyRejectHist(numberOutputBits()); - - for (unsigned int i=0;i<numberOutputBits();i++) { - MyAcceptHist[i] << "Accept" << p_DeltaEtaMin[i] << "DEta"; - MyRejectHist[i] << "Reject" << p_DeltaEtaMin[i] << "DEta"; + // book histograms + for(unsigned int i=0; i<numberOutputBits(); ++i) { + std::string hname_accept = "hDeltaEtaIncl1_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hDeltaEtaIncl1_reject_bit"+std::to_string((int)i); + // mass + bookHist(m_histAccept, hname_accept, "DETA", 100, p_DeltaEtaMin[i], p_DeltaEtaMax[i]); + bookHist(m_histReject, hname_reject, "DETA", 100, p_DeltaEtaMin[i], p_DeltaEtaMax[i]); } - for (unsigned int i=0; i<numberOutputBits();i++) { - - const std::string& MyTitle1 = MyAcceptHist[i].str(); - const std::string& MyTitle2 = MyRejectHist[i].str(); - - registerHist(m_histAcceptDEta1[i] = new TH1F(MyTitle1.c_str(),MyTitle1.c_str(),100,0.,4.)); - registerHist(m_histRejectDEta1[i] = new TH1F(MyTitle2.c_str(),MyTitle2.c_str(),100,0.,4.)); - } return StatusCode::SUCCESS; } @@ -130,9 +120,9 @@ TCS::DeltaEtaIncl1::processBitCorrect( const std::vector<TCS::TOBArray const *> ++tob2) { for(unsigned int i=0; i < numberOutputBits(); ++i) { bool accept = false; - if( parType_t((*tob1)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( parType_t((*tob2)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( (parType_t((*tob1)->Et()) <= max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= max(p_MinET1[i],p_MinET2[i]))) continue; + if( parType_t((*tob1)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( parType_t((*tob2)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= std::max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= std::max(p_MinET1[i],p_MinET2[i]))) continue; // DeltaEta cuts unsigned int deltaEta = TSU::Kinematics::calcDeltaEtaBW( *tob1, *tob2 ); std::stringstream msgss; @@ -150,9 +140,9 @@ TCS::DeltaEtaIncl1::processBitCorrect( const std::vector<TCS::TOBArray const *> output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAcceptDEta1[i]->GetName(),(float)deltaEta*0.10); + fillHist1D(m_histAccept[i],(float)deltaEta); } else if(fillReject) { - fillHist1D(m_histRejectDEta1[i]->GetName(),(float)deltaEta*0.10); + fillHist1D(m_histReject[i],(float)deltaEta); } msgss << (accept?"pass":"fail") << "|"; TRG_MSG_DEBUG(msgss.str()); @@ -184,9 +174,9 @@ TCS::DeltaEtaIncl1::process( const std::vector<TCS::TOBArray const *> & input, ++tob2) { for(unsigned int i=0; i < numberOutputBits(); ++i) { bool accept = false; - if( parType_t((*tob1)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( parType_t((*tob2)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( (parType_t((*tob1)->Et()) <= max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= max(p_MinET1[i],p_MinET2[i]))) continue; + if( parType_t((*tob1)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( parType_t((*tob2)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= std::max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= std::max(p_MinET1[i],p_MinET2[i]))) continue; // DeltaEta cuts unsigned int deltaEta = TSU::Kinematics::calcDeltaEta( *tob1, *tob2 ); std::stringstream msgss; @@ -204,9 +194,9 @@ TCS::DeltaEtaIncl1::process( const std::vector<TCS::TOBArray const *> & input, output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAcceptDEta1[i]->GetName(),(float)deltaEta*0.10); + fillHist1D(m_histAccept[i],(float)deltaEta); } else if(fillReject) { - fillHist1D(m_histRejectDEta1[i]->GetName(),(float)deltaEta*0.10); + fillHist1D(m_histReject[i],(float)deltaEta); } msgss << (accept?"pass":"fail") << "|"; TRG_MSG_DEBUG(msgss.str()); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaIncl2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaIncl2.cxx index a081723593d..4ec3f32b1c8 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaIncl2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaIncl2.cxx @@ -25,8 +25,6 @@ REGISTER_ALG_TCS(DeltaEtaIncl2) -using namespace std; - // not the best solution but we will move to athena where this comes for free #define LOG cout << fullname() << ": " @@ -88,26 +86,17 @@ TCS::DeltaEtaIncl2::initialize() { TRG_MSG_INFO("MinET2 : " << p_MinET2[i]); } TRG_MSG_INFO("number output : " << numberOutputBits()); - - // create strings for histogram names - std::vector<std::ostringstream> MyAcceptHist(numberOutputBits()); - std::vector<std::ostringstream> MyRejectHist(numberOutputBits()); - for (unsigned int i=0;i<numberOutputBits();i++) { - MyAcceptHist[i] << "Accept" << p_DeltaEtaMin[i] << "DEta"; - MyRejectHist[i] << "Reject" << p_DeltaEtaMin[i] << "DEta"; + // book histograms + for(unsigned int i=0; i<numberOutputBits(); ++i) { + std::string hname_accept = "hDeltaEtaIncl2_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hDeltaEtaIncl2_reject_bit"+std::to_string((int)i); + // mass + bookHist(m_histAccept, hname_accept, "DETA", 100, p_DeltaEtaMin[i], p_DeltaEtaMax[i]); + bookHist(m_histReject, hname_reject, "DETA", 100, p_DeltaEtaMin[i], p_DeltaEtaMax[i]); } - for (unsigned int i=0; i<numberOutputBits();i++) { - const std::string& MyTitle1 = MyAcceptHist[i].str(); - const std::string& MyTitle2 = MyRejectHist[i].str(); - - registerHist(m_histAcceptDEta2[i] = new TH1F(MyTitle1.c_str(),MyTitle1.c_str(),100,0.,4.)); - registerHist(m_histRejectDEta2[i] = new TH1F(MyTitle2.c_str(),MyTitle2.c_str(),100,0.,4.)); - } - - return StatusCode::SUCCESS; } @@ -140,9 +129,9 @@ TCS::DeltaEtaIncl2::processBitCorrect( const std::vector<TCS::TOBArray const *> output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAcceptDEta2[i]->GetName(),(float)deltaEta*0.10); + fillHist1D(m_histAccept[i],(float)deltaEta); } else if(fillReject) { - fillHist1D(m_histRejectDEta2[i]->GetName(),(float)deltaEta*0.10); + fillHist1D(m_histReject[i],(float)deltaEta); } TRG_MSG_DEBUG("DeltaEta = " << deltaEta << " -> accept bit " << i << " -> " << (accept?"pass":"fail")); @@ -183,9 +172,9 @@ TCS::DeltaEtaIncl2::process( const std::vector<TCS::TOBArray const *> & input, output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAcceptDEta2[i]->GetName(),(float)deltaEta*0.10); + fillHist1D(m_histAccept[i],(float)deltaEta); } else if(fillReject) { - fillHist1D(m_histRejectDEta2[i]->GetName(),(float)deltaEta*0.10); + fillHist1D(m_histReject[i],(float)deltaEta); } TRG_MSG_DEBUG("DeltaEta = " << deltaEta << " -> accept bit " << i << " -> " << (accept?"pass":"fail")); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaPhiIncl1.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaPhiIncl1.cxx index e4216037631..f367d26cd34 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaPhiIncl1.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaPhiIncl1.cxx @@ -22,7 +22,6 @@ REGISTER_ALG_TCS(DeltaEtaPhiIncl1) -using namespace std; TCS::DeltaEtaPhiIncl1::DeltaEtaPhiIncl1(const std::string & name) : DecisionAlg(name) { @@ -83,19 +82,16 @@ TCS::DeltaEtaPhiIncl1::initialize() { TRG_MSG_INFO("NumberLeading1 : " << p_NumberLeading1); // note that the reading of generic parameters doesn't work yet TRG_MSG_INFO("NumberLeading2 : " << p_NumberLeading2); TRG_MSG_INFO("number output : " << numberOutputBits()); + // book histograms for(unsigned int i=0; i<numberOutputBits(); ++i) { - const int buf_len = 512; - char hname_accept[buf_len], hname_reject[buf_len]; - int EtaPhi_bin=100; - float EtaPhi_min=0; - float EtaPhi_max=70; - // eta2 vs. eta1 - snprintf(hname_accept, buf_len, "Accept_DeltaEtaPhiIncl1_bit%d", i); - snprintf(hname_reject, buf_len, "Reject_DeltaEtaPhiIncl1_bit%d", i); - registerHist(m_histAccept[i] = new TH2F(hname_accept, hname_accept, EtaPhi_bin, EtaPhi_min, EtaPhi_max, EtaPhi_bin, EtaPhi_min, EtaPhi_max)); - registerHist(m_histReject[i] = new TH2F(hname_reject, hname_reject, EtaPhi_bin, EtaPhi_min, EtaPhi_max, EtaPhi_bin, EtaPhi_min, EtaPhi_max)); - } + std::string hname_accept = "hDeltaEtaPhiIncl1_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hDeltaEtaPhiIncl1_reject_bit"+std::to_string((int)i); + // deta vs dphi + bookHist(m_histAccept, hname_accept, "DETA vs DPHI", 100, p_DeltaEtaMin[i], p_DeltaEtaMax[i], 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]); + bookHist(m_histReject, hname_reject, "DETA vs DPHI", 100, p_DeltaEtaMin[i], p_DeltaEtaMax[i], 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]); + } + return StatusCode::SUCCESS; } @@ -128,9 +124,9 @@ TCS::DeltaEtaPhiIncl1::processBitCorrect( const std::vector<TCS::TOBArray const << ", DeltaPhi = " << deltaPhi << ", DeltaEta = " << deltaEta << " -> "; for(unsigned int i=0; i<numberOutputBits(); ++i) { bool accept = false; - if( parType_t((*tob1)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( parType_t((*tob2)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( (parType_t((*tob1)->Et()) <= max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= max(p_MinET1[i],p_MinET2[i]))) continue; + if( parType_t((*tob1)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( parType_t((*tob2)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= std::max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= std::max(p_MinET1[i],p_MinET2[i]))) continue; accept = ( deltaEta >= p_DeltaEtaMin[i] || deltaPhi >= p_DeltaPhiMin[i] ) && deltaPhi <= p_DeltaPhiMax[i] && deltaEta <= p_DeltaEtaMax[i]; const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(i) : accept); const bool fillReject = fillHistos() and not fillAccept; @@ -140,9 +136,9 @@ TCS::DeltaEtaPhiIncl1::processBitCorrect( const std::vector<TCS::TOBArray const output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist2D(m_histAccept[i]->GetName(),(float)deltaEta,(float)deltaPhi); + fillHist2D(m_histAccept[i],(float)deltaEta,(float)deltaPhi); } else if(fillReject) { - fillHist2D(m_histReject[i]->GetName(),(float)deltaEta,(float)deltaPhi); + fillHist2D(m_histReject[i],(float)deltaEta,(float)deltaPhi); } msgss << "DeltaEtaPhiIncl1 alg bit" << i << (accept?" pass":" fail") << "|"; } @@ -186,9 +182,9 @@ TCS::DeltaEtaPhiIncl1::process( const std::vector<TCS::TOBArray const *> & input << ", DeltaEta = " << deltaEta << " -> "; for(unsigned int i=0; i<numberOutputBits(); ++i) { bool accept = false; - if( parType_t((*tob1)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( parType_t((*tob2)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( (parType_t((*tob1)->Et()) <= max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= max(p_MinET1[i],p_MinET2[i]))) continue; + if( parType_t((*tob1)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( parType_t((*tob2)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= std::max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= std::max(p_MinET1[i],p_MinET2[i]))) continue; accept = ( deltaEta >= p_DeltaEtaMin[i] || deltaPhi >= p_DeltaPhiMin[i] ) && deltaPhi <= p_DeltaPhiMax[i] && deltaEta <= p_DeltaEtaMax[i]; const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(i) : accept); const bool fillReject = fillHistos() and not fillAccept; @@ -198,9 +194,9 @@ TCS::DeltaEtaPhiIncl1::process( const std::vector<TCS::TOBArray const *> & input output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist2D(m_histAccept[i]->GetName(),(float)deltaEta,(float)deltaPhi); + fillHist2D(m_histAccept[i],(float)deltaEta,(float)deltaPhi); } else if(fillReject) { - fillHist2D(m_histReject[i]->GetName(),(float)deltaEta,(float)deltaPhi); + fillHist2D(m_histReject[i],(float)deltaEta,(float)deltaPhi); } msgss << "DeltaEtaPhiIncl1 alg bit" << i << (accept?" pass":" fail") << "|"; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaPhiIncl2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaPhiIncl2.cxx index a78706b0d03..acb8953eb78 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaPhiIncl2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaPhiIncl2.cxx @@ -22,7 +22,6 @@ REGISTER_ALG_TCS(DeltaEtaPhiIncl2) -using namespace std; TCS::DeltaEtaPhiIncl2::DeltaEtaPhiIncl2(const std::string & name) : DecisionAlg(name) { @@ -84,19 +83,16 @@ TCS::DeltaEtaPhiIncl2::initialize() { TRG_MSG_INFO("NumberLeading2 : " << p_NumberLeading2); TRG_MSG_INFO("number output : " << numberOutputBits()); + // book histograms for(unsigned int i=0; i<numberOutputBits(); ++i) { - const int buf_len = 512; - char hname_accept[buf_len], hname_reject[buf_len]; - int EtaPhi_bin=100; - float EtaPhi_min=0; - float EtaPhi_max=70; - // eta2 vs. eta1 - snprintf(hname_accept, buf_len, "Accept_DeltaEtaPhiIncl2_bit%d", i); - snprintf(hname_reject, buf_len, "Reject_DeltaEtaPhiIncl2_bit%d", i); - registerHist(m_histAccept[i] = new TH2F(hname_accept, hname_accept, EtaPhi_bin, EtaPhi_min, EtaPhi_max, EtaPhi_bin, EtaPhi_min, EtaPhi_max)); - registerHist(m_histReject[i] = new TH2F(hname_reject, hname_reject, EtaPhi_bin, EtaPhi_min, EtaPhi_max, EtaPhi_bin, EtaPhi_min, EtaPhi_max)); - } + std::string hname_accept = "hDeltaEtaPhiIncl2_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hDeltaEtaPhiIncl2_reject_bit"+std::to_string((int)i); + // deta vs dphi + bookHist(m_histAccept, hname_accept, "DETA vs DPHI", 100, p_DeltaEtaMin[i], p_DeltaEtaMax[i], 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]); + bookHist(m_histReject, hname_reject, "DETA vs DPHI", 100, p_DeltaEtaMin[i], p_DeltaEtaMax[i], 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]); + } + return StatusCode::SUCCESS; } @@ -139,9 +135,9 @@ TCS::DeltaEtaPhiIncl2::processBitCorrect( const std::vector<TCS::TOBArray const output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist2D(m_histAccept[i]->GetName(),(float)deltaEta,(float)deltaPhi); + fillHist2D(m_histAccept[i],(float)deltaEta,(float)deltaPhi); } else if(fillReject) { - fillHist2D(m_histReject[i]->GetName(),(float)deltaEta,(float)deltaPhi); + fillHist2D(m_histReject[i],(float)deltaEta,(float)deltaPhi); } msgss << "DeltaRApproxBoxCutIncl2 alg bit" << i << (accept?" pass":" fail") << "|"; } @@ -192,9 +188,9 @@ TCS::DeltaEtaPhiIncl2::process( const std::vector<TCS::TOBArray const *> & input output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist2D(m_histAccept[i]->GetName(),(float)deltaEta,(float)deltaPhi); + fillHist2D(m_histAccept[i],(float)deltaEta,(float)deltaPhi); } else if(fillReject) { - fillHist2D(m_histReject[i]->GetName(),(float)deltaEta,(float)deltaPhi); + fillHist2D(m_histReject[i],(float)deltaEta,(float)deltaPhi); } msgss << "DeltaRApproxBoxCutIncl2 alg bit" << i << (accept?" pass":" fail") << "|"; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaPhiIncl1.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaPhiIncl1.cxx index c2f3500f901..115e4b6df41 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaPhiIncl1.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaPhiIncl1.cxx @@ -21,7 +21,6 @@ REGISTER_ALG_TCS(DeltaPhiIncl1) -using namespace std; TCS::DeltaPhiIncl1::DeltaPhiIncl1(const std::string & name) : DecisionAlg(name) { @@ -71,27 +70,16 @@ TCS::DeltaPhiIncl1::initialize() { TRG_MSG_INFO("NumberLeading2 : " << p_NumberLeading2); TRG_MSG_INFO("number output : " << numberOutputBits()); - // create strings for histogram names - std::vector<std::ostringstream> MyAcceptHist(numberOutputBits()); - std::vector<std::ostringstream> MyRejectHist(numberOutputBits()); - int dphi_bin=100; - float dphi_min=0; - float dphi_max=3.4; - - for (unsigned int i=0;i<numberOutputBits();i++) { - MyAcceptHist[i] << "Accept" << p_DeltaPhiMin[i] << "DPHI" << p_DeltaPhiMax[i]; - MyRejectHist[i] << "Reject" << p_DeltaPhiMin[i] << "DPHI" << p_DeltaPhiMax[i]; + // book histograms + for(unsigned int i=0; i<numberOutputBits(); ++i) { + std::string hname_accept = "hDeltaPhiIncl1_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hDeltaPhiIncl1_reject_bit"+std::to_string((int)i); + // mass + bookHist(m_histAccept, hname_accept, "DPHI", 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]); + bookHist(m_histReject, hname_reject, "DPHI", 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]); } - - for (unsigned int i=0; i<numberOutputBits();i++) { - - const std::string& MyTitle1 = MyAcceptHist[i].str(); - const std::string& MyTitle2 = MyRejectHist[i].str(); - - registerHist(m_histAcceptDPhi2[i] = new TH1F(MyTitle1.c_str(),MyTitle1.c_str(),dphi_bin,dphi_min,dphi_max)); - registerHist(m_histRejectDPhi2[i] = new TH1F(MyTitle2.c_str(),MyTitle2.c_str(),dphi_bin,dphi_min,dphi_max)); - } + return StatusCode::SUCCESS; } @@ -121,9 +109,9 @@ TCS::DeltaPhiIncl1::processBitCorrect( const std::vector<TCS::TOBArray const *> << ", DeltaPhi = " << deltaPhi << " -> "; for(unsigned int i=0; i<numberOutputBits(); ++i) { bool accept = false; - if( parType_t((*tob1)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( parType_t((*tob2)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( (parType_t((*tob1)->Et()) <= max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= max(p_MinET1[i],p_MinET2[i]))) continue; + if( parType_t((*tob1)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( parType_t((*tob2)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= std::max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= std::max(p_MinET1[i],p_MinET2[i]))) continue; accept = deltaPhi >= p_DeltaPhiMin[i] && deltaPhi <= p_DeltaPhiMax[i]; const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(i) : accept); const bool fillReject = fillHistos() and not fillAccept; @@ -133,9 +121,9 @@ TCS::DeltaPhiIncl1::processBitCorrect( const std::vector<TCS::TOBArray const *> output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAcceptDPhi2[i]->GetName(),deltaPhi); + fillHist1D(m_histAccept[i],deltaPhi); } else if(fillReject) { - fillHist1D(m_histRejectDPhi2[i]->GetName(),deltaPhi); + fillHist1D(m_histReject[i],deltaPhi); } TRG_MSG_DEBUG("DeltaPhiIncl1 = " << deltaPhi << " -> " << (accept?"pass":"fail")); @@ -175,9 +163,9 @@ TCS::DeltaPhiIncl1::process( const std::vector<TCS::TOBArray const *> & input, << ", DeltaPhi = " << deltaPhi << " -> "; for(unsigned int i=0; i<numberOutputBits(); ++i) { bool accept = false; - if( parType_t((*tob1)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( parType_t((*tob2)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( (parType_t((*tob1)->Et()) <= max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= max(p_MinET1[i],p_MinET2[i]))) continue; + if( parType_t((*tob1)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( parType_t((*tob2)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= std::max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= std::max(p_MinET1[i],p_MinET2[i]))) continue; accept = deltaPhi >= p_DeltaPhiMin[i] && deltaPhi <= p_DeltaPhiMax[i]; const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(i) : accept); const bool fillReject = fillHistos() and not fillAccept; @@ -187,9 +175,9 @@ TCS::DeltaPhiIncl1::process( const std::vector<TCS::TOBArray const *> & input, output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAcceptDPhi2[i]->GetName(),deltaPhi); + fillHist1D(m_histAccept[i],deltaPhi); } else if(fillReject) { - fillHist1D(m_histRejectDPhi2[i]->GetName(),deltaPhi); + fillHist1D(m_histReject[i],deltaPhi); } TRG_MSG_DEBUG("DeltaPhiIncl1 = " << deltaPhi << " -> " << (accept?"pass":"fail")); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaPhiIncl2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaPhiIncl2.cxx index 9977142d1cd..cd782796a49 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaPhiIncl2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaPhiIncl2.cxx @@ -71,27 +71,16 @@ TCS::DeltaPhiIncl2::initialize() { TRG_MSG_INFO("NumberLeading2 : " << p_NumberLeading2); TRG_MSG_INFO("number output : " << numberOutputBits()); - // create strings for histogram names - std::vector<std::ostringstream> MyAcceptHist(numberOutputBits()); - std::vector<std::ostringstream> MyRejectHist(numberOutputBits()); - int dphi_bin=100; - float dphi_min=0; - float dphi_max=3.4; - - for (unsigned int i=0;i<numberOutputBits();i++) { - MyAcceptHist[i] << "Accept" << p_DeltaPhiMin[i] << "DPHI" << p_DeltaPhiMax[i]; - MyRejectHist[i] << "Reject" << p_DeltaPhiMin[i] << "DPHI" << p_DeltaPhiMax[i]; + // book histograms + for(unsigned int i=0; i<numberOutputBits(); ++i) { + std::string hname_accept = "hDeltaPhiIncl2_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hDeltaPhiIncl2_reject_bit"+std::to_string((int)i); + // mass + bookHist(m_histAccept, hname_accept, "DPHI", 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]); + bookHist(m_histReject, hname_reject, "DPHI", 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]); } - - for (unsigned int i=0; i<numberOutputBits();i++) { - - const std::string& MyTitle1 = MyAcceptHist[i].str(); - const std::string& MyTitle2 = MyRejectHist[i].str(); - - registerHist(m_histAcceptDPhi2[i] = new TH1F(MyTitle1.c_str(),MyTitle1.c_str(),dphi_bin,dphi_min,dphi_max)); - registerHist(m_histRejectDPhi2[i] = new TH1F(MyTitle2.c_str(),MyTitle2.c_str(),dphi_bin,dphi_min,dphi_max)); - } + return StatusCode::SUCCESS; } @@ -126,9 +115,9 @@ TCS::DeltaPhiIncl2::processBitCorrect( const std::vector<TCS::TOBArray const *> output[i]->push_back(TCS::CompositeTOB(*tob1, *tob2)); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAcceptDPhi2[i]->GetName(),deltaPhi); + fillHist1D(m_histAccept[i],deltaPhi); } else if(fillReject) { - fillHist1D(m_histRejectDPhi2[i]->GetName(),deltaPhi); + fillHist1D(m_histReject[i],deltaPhi); } TRG_MSG_DEBUG("DeltaPhiIncl2 = " << deltaPhi << " -> " << (accept?"pass":"fail")); @@ -171,9 +160,9 @@ TCS::DeltaPhiIncl2::process( const std::vector<TCS::TOBArray const *> & input, output[i]->push_back(TCS::CompositeTOB(*tob1, *tob2)); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAcceptDPhi2[i]->GetName(),deltaPhi); + fillHist1D(m_histAccept[i],deltaPhi); } else if(fillReject) { - fillHist1D(m_histRejectDPhi2[i]->GetName(),deltaPhi); + fillHist1D(m_histReject[i],deltaPhi); } TRG_MSG_DEBUG("DeltaPhiIncl2 = " << deltaPhi << " -> " << (accept?"pass":"fail")); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl1.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl1.cxx index fbf50fdc782..f1ac7e20fee 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl1.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl1.cxx @@ -21,8 +21,6 @@ REGISTER_ALG_TCS(DeltaRApproxBoxCutIncl1) -using namespace std; - namespace { unsigned int calcDeltaPhi(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { @@ -96,19 +94,16 @@ TCS::DeltaRApproxBoxCutIncl1::initialize() { TRG_MSG_INFO("MinET1 : " << p_MinET1); TRG_MSG_INFO("MinET2 : " << p_MinET2); TRG_MSG_INFO("number output : " << numberOutputBits()); + // book histograms for(unsigned int i=0; i<numberOutputBits(); ++i) { - const int buf_len = 512; - char hname_accept[buf_len], hname_reject[buf_len]; - int EtaPhi_bin=100; - float EtaPhi_min=0; - float EtaPhi_max=70; - // eta2 vs. eta1 - snprintf(hname_accept, buf_len, "Accept_DeltaRApproxBoxCutIncl1_bit%d", i); - snprintf(hname_reject, buf_len, "Reject_DeltaRApproxBoxCutIncl1_bit%d", i); - registerHist(m_histAccept[i] = new TH2F(hname_accept, hname_accept, EtaPhi_bin, EtaPhi_min, EtaPhi_max, EtaPhi_bin, EtaPhi_min, EtaPhi_max)); - registerHist(m_histReject[i] = new TH2F(hname_reject, hname_reject, EtaPhi_bin, EtaPhi_min, EtaPhi_max, EtaPhi_bin, EtaPhi_min, EtaPhi_max)); - } + std::string hname_accept = "hDeltaRApproxBoxCutIncl1_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hDeltaRApproxBoxCutIncl1_reject_bit"+std::to_string((int)i); + // deta vs dphi + bookHist(m_histAccept, hname_accept, "DETA vs DPHI", 100, p_DeltaEtaMin[i], p_DeltaEtaMax[i], 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]); + bookHist(m_histReject, hname_reject, "DETA vs DPHI", 100, p_DeltaEtaMin[i], p_DeltaEtaMax[i], 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]); + } + return StatusCode::SUCCESS; } @@ -135,13 +130,13 @@ TCS::DeltaRApproxBoxCutIncl1::process( const std::vector<TCS::TOBArray const *> tob1 != input[0]->end() && distance( input[0]->begin(), tob1) < nLeading; ++tob1) { - if( parType_t((*tob1)->Et()) <= min(p_MinET1,p_MinET2)) continue; // ET cut + if( parType_t((*tob1)->Et()) <= std::min(p_MinET1,p_MinET2)) continue; // ET cut TCS::TOBArray::const_iterator tob2 = tob1; ++tob2; for( ; tob2 != input[0]->end() && distance( input[0]->begin(), tob2) < p_NumberLeading2; ++tob2) { - if( parType_t((*tob2)->Et()) <= min(p_MinET1,p_MinET2)) continue; // ET cut - if( (parType_t((*tob1)->Et()) <= max(p_MinET1,p_MinET2)) && (parType_t((*tob2)->Et()) <= max(p_MinET1,p_MinET2))) continue; + if( parType_t((*tob2)->Et()) <= std::min(p_MinET1,p_MinET2)) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= std::max(p_MinET1,p_MinET2)) && (parType_t((*tob2)->Et()) <= std::max(p_MinET1,p_MinET2))) continue; // DeltaPhi cuts unsigned int deltaPhi = calcDeltaPhi( *tob1, *tob2 ); // DeltaEta cuts @@ -166,9 +161,9 @@ TCS::DeltaRApproxBoxCutIncl1::process( const std::vector<TCS::TOBArray const *> output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist2D(m_histAccept[i]->GetName(),(float)deltaEta,(float)deltaPhi); + fillHist2D(m_histAccept[i],(float)deltaEta,(float)deltaPhi); } else if(fillReject) { - fillHist2D(m_histReject[i]->GetName(),(float)deltaEta,(float)deltaPhi); + fillHist2D(m_histReject[i],(float)deltaEta,(float)deltaPhi); } msgss << "DeltaRApproxBoxCutIncl1 alg bit" << i << (accept?" pass":" fail") << "|"; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl2.cxx index e1deabde6e3..adca231c445 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl2.cxx @@ -20,7 +20,6 @@ REGISTER_ALG_TCS(DeltaRApproxBoxCutIncl2) -using namespace std; namespace { unsigned int @@ -98,19 +97,16 @@ TCS::DeltaRApproxBoxCutIncl2::initialize() { TRG_MSG_INFO("MinET2 : " << p_MinET2); TRG_MSG_INFO("number output : " << numberOutputBits()); + // book histograms for(unsigned int i=0; i<numberOutputBits(); ++i) { - const int buf_len = 512; - char hname_accept[buf_len], hname_reject[buf_len]; - int EtaPhi_bin=100; - float EtaPhi_min=0; - float EtaPhi_max=70; - // eta2 vs. eta1 - snprintf(hname_accept, buf_len, "Accept_DeltaRApproxBoxCutIncl2_bit%d", i); - snprintf(hname_reject, buf_len, "Reject_DeltaRApproxBoxCutIncl2_bit%d", i); - registerHist(m_histAccept[i] = new TH2F(hname_accept, hname_accept, EtaPhi_bin, EtaPhi_min, EtaPhi_max, EtaPhi_bin, EtaPhi_min, EtaPhi_max)); - registerHist(m_histReject[i] = new TH2F(hname_reject, hname_reject, EtaPhi_bin, EtaPhi_min, EtaPhi_max, EtaPhi_bin, EtaPhi_min, EtaPhi_max)); - } + std::string hname_accept = "hDeltaRApproxBoxCutIncl2_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hDeltaRApproxBoxCutIncl2_reject_bit"+std::to_string((int)i); + // deta vs dphi + bookHist(m_histAccept, hname_accept, "DETA vs DPHI", 100, p_DeltaEtaMin[i], p_DeltaEtaMax[i], 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]); + bookHist(m_histReject, hname_reject, "DETA vs DPHI", 100, p_DeltaEtaMin[i], p_DeltaEtaMax[i], 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]); + } + return StatusCode::SUCCESS; } @@ -166,9 +162,9 @@ TCS::DeltaRApproxBoxCutIncl2::process( const std::vector<TCS::TOBArray const *> output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist2D(m_histAccept[i]->GetName(),(float)deltaEta,(float)deltaPhi); + fillHist2D(m_histAccept[i],(float)deltaEta,(float)deltaPhi); } else if(fillReject) { - fillHist2D(m_histReject[i]->GetName(),(float)deltaEta,(float)deltaPhi); + fillHist2D(m_histReject[i],(float)deltaEta,(float)deltaPhi); } msgss << "DeltaRApproxBoxCutIncl2 alg bit" << i << (accept?" pass":" fail") << "|"; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRSqrIncl1.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRSqrIncl1.cxx index 24afe630d30..693ed074373 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRSqrIncl1.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRSqrIncl1.cxx @@ -21,10 +21,9 @@ REGISTER_ALG_TCS(DeltaRSqrIncl1) -using namespace std; // not the best solution but we will move to athena where this comes for free -#define LOG cout << "TCS::DeltaRSqrIncl1: " +#define LOG std::cout << "TCS::DeltaRSqrIncl1: " TCS::DeltaRSqrIncl1::DeltaRSqrIncl1(const std::string & name) : DecisionAlg(name) { @@ -76,16 +75,16 @@ TCS::DeltaRSqrIncl1::initialize() { TRG_MSG_INFO("MinET2 : " << p_MinET2); TRG_MSG_INFO("number output : " << numberOutputBits()); - for (unsigned int i=0; i<numberOutputBits();i++) { - const int buf_len = 512; - char hname_accept[buf_len], hname_reject[buf_len]; - int deltaR_max = sqrt(p_DeltaRMax[i]); - // mass - snprintf(hname_accept, buf_len, "Accept_DeltaRSqrIncl1_bit%d", i); - snprintf(hname_reject, buf_len, "Reject_DeltaRSqrIncl1_bit%d", i); - registerHist(m_histAccept[i] = new TH1F(hname_accept, hname_accept, 100, 0.0, 2*deltaR_max)); - registerHist(m_histReject[i] = new TH1F(hname_reject, hname_reject, 100, 0.0, 2*deltaR_max)); + + // book histograms + for(unsigned int i=0; i<numberOutputBits(); ++i) { + std::string hname_accept = "hDeltaRSqrIncl1_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hDeltaRSqrIncl1_reject_bit"+std::to_string((int)i); + // dR + bookHist(m_histAccept, hname_accept, "DR", 100, sqrt(p_DeltaRMin[i]), sqrt(p_DeltaRMax[i])); + bookHist(m_histReject, hname_reject, "DR", 100, sqrt(p_DeltaRMin[i]), sqrt(p_DeltaRMax[i])); } + return StatusCode::SUCCESS; } @@ -102,13 +101,13 @@ TCS::DeltaRSqrIncl1::processBitCorrect( const std::vector<TCS::TOBArray const *> tob1 != input[0]->end() && distance( input[0]->begin(), tob1) < p_NumberLeading1; ++tob1) { - if( parType_t((*tob1)->Et()) <= min(p_MinET1,p_MinET2)) continue; // ET cut + if( parType_t((*tob1)->Et()) <= std::min(p_MinET1,p_MinET2)) continue; // ET cut TCS::TOBArray::const_iterator tob2 = tob1; ++tob2; for( ; tob2 != input[0]->end() && distance( input[0]->begin(), tob2) < p_NumberLeading2; ++tob2) { - if( parType_t((*tob2)->Et()) <= min(p_MinET1,p_MinET2)) continue; // ET cut - if( (parType_t((*tob1)->Et()) <= max(p_MinET1,p_MinET2)) && (parType_t((*tob2)->Et()) <= max(p_MinET1,p_MinET2))) continue; + if( parType_t((*tob2)->Et()) <= std::min(p_MinET1,p_MinET2)) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= std::max(p_MinET1,p_MinET2)) && (parType_t((*tob2)->Et()) <= std::max(p_MinET1,p_MinET2))) continue; // OneBarrel if (p_OneBarrel && parType_t(abs((*tob1)->eta())) > 10 && parType_t(abs((*tob2)->eta())) > 10 ) continue; // DeltaR2 cuts @@ -124,9 +123,9 @@ TCS::DeltaRSqrIncl1::processBitCorrect( const std::vector<TCS::TOBArray const *> output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAccept[i]->GetName(),sqrt((float)deltaR2)); + fillHist1D(m_histAccept[i],sqrt((float)deltaR2)); } else if(fillReject) { - fillHist1D(m_histReject[i]->GetName(),sqrt((float)deltaR2)); + fillHist1D(m_histReject[i],sqrt((float)deltaR2)); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " deltaR2 = " << deltaR2); } @@ -148,13 +147,13 @@ TCS::DeltaRSqrIncl1::process( const std::vector<TCS::TOBArray const *> & input, tob1 != input[0]->end() && distance( input[0]->begin(), tob1) < p_NumberLeading1; ++tob1) { - if( parType_t((*tob1)->Et()) <= min(p_MinET1,p_MinET2)) continue; // ET cut + if( parType_t((*tob1)->Et()) <= std::min(p_MinET1,p_MinET2)) continue; // ET cut TCS::TOBArray::const_iterator tob2 = tob1; ++tob2; for( ; tob2 != input[0]->end() && distance( input[0]->begin(), tob2) < p_NumberLeading2; ++tob2) { - if( parType_t((*tob2)->Et()) <= min(p_MinET1,p_MinET2)) continue; // ET cut - if( (parType_t((*tob1)->Et()) <= max(p_MinET1,p_MinET2)) && (parType_t((*tob2)->Et()) <= max(p_MinET1,p_MinET2))) continue; + if( parType_t((*tob2)->Et()) <= std::min(p_MinET1,p_MinET2)) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= std::max(p_MinET1,p_MinET2)) && (parType_t((*tob2)->Et()) <= std::max(p_MinET1,p_MinET2))) continue; // OneBarrel if (p_OneBarrel && parType_t(abs((*tob1)->eta())) > 10 && parType_t(abs((*tob2)->eta())) > 10 ) continue; // DeltaR2 cuts @@ -170,9 +169,9 @@ TCS::DeltaRSqrIncl1::process( const std::vector<TCS::TOBArray const *> & input, output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAccept[i]->GetName(),sqrt((float)deltaR2)); + fillHist1D(m_histAccept[i],sqrt((float)deltaR2)); } else if(fillReject) { - fillHist1D(m_histReject[i]->GetName(),sqrt((float)deltaR2)); + fillHist1D(m_histReject[i],sqrt((float)deltaR2)); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " deltaR2 = " << deltaR2); } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRSqrIncl2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRSqrIncl2.cxx index ee55070db2f..e6213716dbb 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRSqrIncl2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRSqrIncl2.cxx @@ -21,10 +21,9 @@ REGISTER_ALG_TCS(DeltaRSqrIncl2) -using namespace std; // not the best solution but we will move to athena where this comes for free -#define LOG cout << "TCS::DeltaRSqrIncl2: " +#define LOG std::cout << "TCS::DeltaRSqrIncl2: " TCS::DeltaRSqrIncl2::DeltaRSqrIncl2(const std::string & name) : DecisionAlg(name) { @@ -76,16 +75,16 @@ TCS::DeltaRSqrIncl2::initialize() { TRG_MSG_INFO("NumberLeading2 : " << p_NumberLeading2); TRG_MSG_INFO("number output : " << numberOutputBits()); - for (unsigned int i=0; i<numberOutputBits();i++) { - const int buf_len = 512; - char hname_accept[buf_len], hname_reject[buf_len]; - int deltaR_max = sqrt(p_DeltaRMax[i]); - // mass - snprintf(hname_accept, buf_len, "Accept_DeltaRSqrIncl2_bit%d", i); - snprintf(hname_reject, buf_len, "Reject_DeltaRSqrIncl2_bit%d", i); - registerHist(m_histAccept[i] = new TH1F(hname_accept, hname_accept, 100, 0.0, 2*deltaR_max)); - registerHist(m_histReject[i] = new TH1F(hname_reject, hname_reject, 100, 0.0, 2*deltaR_max)); - } + + // book histograms + for(unsigned int i=0; i<numberOutputBits(); ++i) { + std::string hname_accept = "hDeltaRSqrIncl2_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hDeltaRSqrIncl2_reject_bit"+std::to_string((int)i); + // dR + bookHist(m_histAccept, hname_accept, "DR", 100, sqrt(p_DeltaRMin[i]), sqrt(p_DeltaRMax[i])); + bookHist(m_histReject, hname_reject, "DR", 100, sqrt(p_DeltaRMin[i]), sqrt(p_DeltaRMax[i])); + } + return StatusCode::SUCCESS; } @@ -121,9 +120,9 @@ TCS::DeltaRSqrIncl2::processBitCorrect( const std::vector<TCS::TOBArray const *> output[i]->push_back(TCS::CompositeTOB(*tob1, *tob2)); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAccept[i]->GetName(),sqrt((float)deltaR2)); + fillHist1D(m_histAccept[i],sqrt((float)deltaR2)); } else if(fillReject) { - fillHist1D(m_histReject[i]->GetName(),sqrt((float)deltaR2)); + fillHist1D(m_histReject[i],sqrt((float)deltaR2)); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " deltaR2 = " << deltaR2); } @@ -169,9 +168,9 @@ TCS::DeltaRSqrIncl2::process( const std::vector<TCS::TOBArray const *> & input, output[i]->push_back(TCS::CompositeTOB(*tob1, *tob2)); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAccept[i]->GetName(),sqrt((float)deltaR2)); + fillHist1D(m_histAccept[i],sqrt((float)deltaR2)); } else if(fillReject) { - fillHist1D(m_histReject[i]->GetName(),sqrt((float)deltaR2)); + fillHist1D(m_histReject[i],sqrt((float)deltaR2)); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " deltaR2 = " << deltaR2); } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDRIncl2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDRIncl2.cxx index 01acb089162..5e19282c200 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDRIncl2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDRIncl2.cxx @@ -20,10 +20,9 @@ REGISTER_ALG_TCS(DisambiguationDRIncl2) -using namespace std; // not the best solution but we will move to athena where this comes for free -#define LOG cout << "TCS::DisambiguationDRIncl2: " +#define LOG std::cout << "TCS::DisambiguationDRIncl2: " TCS::DisambiguationDRIncl2::DisambiguationDRIncl2(const std::string & name) : DecisionAlg(name) diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDRIncl3.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDRIncl3.cxx index b1cb3646128..66281666584 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDRIncl3.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDRIncl3.cxx @@ -20,10 +20,9 @@ REGISTER_ALG_TCS(DisambiguationDRIncl3) -using namespace std; // not the best solution but we will move to athena where this comes for free -#define LOG cout << "TCS::DisambiguationDRIncl3: " +#define LOG std::cout << "TCS::DisambiguationDRIncl3: " TCS::DisambiguationDRIncl3::DisambiguationDRIncl3(const std::string & name) : DecisionAlg(name) { diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDetaDPhiIncl3.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDetaDPhiIncl3.cxx index 9b079155c5f..f9c0909cb06 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDetaDPhiIncl3.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDetaDPhiIncl3.cxx @@ -20,10 +20,9 @@ REGISTER_ALG_TCS(DisambiguationDetaDPhiIncl3) -using namespace std; // not the best solution but we will move to athena where this comes for free -#define LOG cout << "TCS::DisambiguationDetaDPhiIncl3: " +#define LOG std::cout << "TCS::DisambiguationDetaDPhiIncl3: " TCS::DisambiguationDetaDPhiIncl3::DisambiguationDetaDPhiIncl3(const std::string & name) : DecisionAlg(name) diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationIncl2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationIncl2.cxx index bd71ac1513b..66e7e66fa8f 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationIncl2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationIncl2.cxx @@ -19,10 +19,9 @@ REGISTER_ALG_TCS(DisambiguationIncl2) -using namespace std; // not the best solution but we will move to athena where this comes for free -#define LOG cout << "TCS::DisambiguationIncl2: " +#define LOG std::cout << "TCS::DisambiguationIncl2: " TCS::DisambiguationIncl2::DisambiguationIncl2(const std::string & name) : DecisionAlg(name) { diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationIncl3.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationIncl3.cxx index 40aae7cfee8..871f282dc91 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationIncl3.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationIncl3.cxx @@ -19,10 +19,9 @@ REGISTER_ALG_TCS(DisambiguationIncl3) -using namespace std; // not the best solution but we will move to athena where this comes for free -#define LOG cout << "TCS::DisambiguationIncl3: " +#define LOG std::cout << "TCS::DisambiguationIncl3: " TCS::DisambiguationIncl3::DisambiguationIncl3(const std::string & name) : DecisionAlg(name) { diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationInvmIncl2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationInvmIncl2.cxx index c2364e3bfc1..3b575685bb6 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationInvmIncl2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationInvmIncl2.cxx @@ -24,10 +24,9 @@ REGISTER_ALG_TCS(DisambiguationInvmIncl2) -using namespace std; // not the best solution but we will move to athena where this comes for free -#define LOG cout << "TCS::DisambiguationInvmIncl2: " +#define LOG std::cout << "TCS::DisambiguationInvmIncl2: " namespace { unsigned int diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/EtCut.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/EtCut.cxx index bc27f4d188b..58bdcd3528d 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/EtCut.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/EtCut.cxx @@ -19,9 +19,6 @@ REGISTER_ALG_TCS(EtCut) -using namespace std; - - TCS::EtCut::EtCut(const std::string & name) : DecisionAlg(name) { diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/EtaPhiWindow.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/EtaPhiWindow.cxx index da1cfb5169d..16653c8f83e 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/EtaPhiWindow.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/EtaPhiWindow.cxx @@ -61,19 +61,16 @@ TCS::EtaPhiWindow::initialize() TRG_MSG_INFO("PhiMin : "<<p_PhiMin); TRG_MSG_INFO("PhiMax : "<<p_PhiMax); TRG_MSG_INFO("number of output bits : "<<numberOutputBits()); - // book histograms - for(unsigned int i=0; i<numberOutputBits(); ++i) { - const int buf_len = 512; - char hname_accept[buf_len], hname_reject[buf_len]; - int EtaPhi_bin=100; - float EtaPhi_min=-50; - float EtaPhi_max=50; - // eta2 vs. eta1 - snprintf(hname_accept, buf_len, "Accept_EtaPhiWindow_bit%d", i); - snprintf(hname_reject, buf_len, "Reject_EtaPhiWindow_bit%d", i); - registerHist(m_histAccept[i] = new TH2F(hname_accept, hname_accept, EtaPhi_bin, EtaPhi_min, EtaPhi_max, EtaPhi_bin, EtaPhi_min, EtaPhi_max)); - registerHist(m_histReject[i] = new TH2F(hname_reject, hname_reject, EtaPhi_bin, EtaPhi_min, EtaPhi_max, EtaPhi_bin, EtaPhi_min, EtaPhi_max)); - } + + // book histograms + for(unsigned int i=0; i<numberOutputBits(); ++i) { + std::string hname_accept = "hEtaPhiWindow_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hEtaPhiWindow_reject_bit"+std::to_string((int)i); + // deta vs dphi + bookHist(m_histAccept, hname_accept, "ETA vs PHI", 100, p_EtaMin, p_EtaMax, 100, p_PhiMin, p_PhiMax); + bookHist(m_histReject, hname_reject, "ETA vs PHI", 100, p_EtaMin, p_EtaMax, 100, p_PhiMin, p_PhiMax); + } + return StatusCode::SUCCESS; } //---------------------------------------------------------- @@ -103,9 +100,9 @@ TCS::EtaPhiWindow::processBitCorrect(const std::vector<TCS::TOBArray const *> &i const bool alreadyFilled = decision.bit(0); output[0]->push_back(TCS::CompositeTOB(*tob1)); if(fillAccept and not alreadyFilled) { - fillHist2D(m_histAccept[0]->GetName(),(float)(*tob1)->eta(),(float)(*tob1)->phi()); + fillHist2D(m_histAccept[0],(float)(*tob1)->eta(),(float)(*tob1)->phi()); } else if(fillReject) { - fillHist2D(m_histReject[0]->GetName(),(float)(*tob1)->eta(),(float)(*tob1)->phi()); + fillHist2D(m_histReject[0],(float)(*tob1)->eta(),(float)(*tob1)->phi()); } TRG_MSG_DEBUG("TOB "<<iTob <<" ET = "<<(*tob1)->Et() @@ -144,9 +141,9 @@ TCS::EtaPhiWindow::process(const std::vector<TCS::TOBArray const *> &input, const bool alreadyFilled = decision.bit(0); output[0]->push_back(TCS::CompositeTOB(*tob1)); if(fillAccept and not alreadyFilled) { - fillHist2D(m_histAccept[0]->GetName(),(float)(*tob1)->eta(),(float)(*tob1)->phi()); + fillHist2D(m_histAccept[0],(float)(*tob1)->eta(),(float)(*tob1)->phi()); } else if(fillReject) { - fillHist2D(m_histReject[0]->GetName(),(float)(*tob1)->eta(),(float)(*tob1)->phi()); + fillHist2D(m_histReject[0],(float)(*tob1)->eta(),(float)(*tob1)->phi()); } TRG_MSG_DEBUG("TOB "<<iTob <<" ET = "<<(*tob1)->Et() diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/ExclusiveJets.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/ExclusiveJets.cxx index 2bc20b4478b..7d55c20175d 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/ExclusiveJets.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/ExclusiveJets.cxx @@ -28,8 +28,8 @@ #include "L1TopoSimulationUtils/Kinematics.h" // REGISTER_ALG_TCS(ExclusiveJets) -using namespace std; -TCS::ExclusiveJets::ExclusiveJets(const string & name) : DecisionAlg(name) + +TCS::ExclusiveJets::ExclusiveJets(const std::string & name) : DecisionAlg(name) { defineParameter("InputWidth", 3); defineParameter("MaxTob", 0); @@ -84,33 +84,25 @@ TCS::ExclusiveJets::initialize() { } TRG_MSG_INFO("number output : " << numberOutputBits()); - for (unsigned int i=0; i<numberOutputBits();i++) { - const int buf_len = 512; - char hname_accept[buf_len], hname_reject[buf_len]; - int eta1_min = p_MinEta1[i]; - int eta1_max = p_MaxEta1[i]; - int eta2_min = p_MinEta1[i]; - int eta2_max = p_MaxEta1[i]; - int et_min = p_MinET1[i]; - int xi_min = p_XiMin[i]; - int xi_max = p_XiMax[i]; - // mass histograms - snprintf(hname_accept, buf_len, "Accept_%s-J%d-%dETA%d-%dETA%d_%s_bit%d_%dM%d", name().c_str(), et_min, eta1_min, eta1_max, eta2_min, eta2_max, className().c_str(), i, xi_min, xi_max); - snprintf(hname_reject, buf_len, "Reject_%s-J%d-%dETA%d-%dETA%d_%s_bit%d_%dM%d", name().c_str(), et_min, eta1_min, eta1_max, eta2_min, eta2_max, className().c_str(), i, xi_min, xi_max); - registerHist(m_histAcceptExclusiveJets[i] = new TH2F(hname_accept, hname_accept, 100, 0.0, 2*xi_max, 100, 0.0, 2*xi_max)); - registerHist(m_histRejectExclusiveJets[i] = new TH2F(hname_reject, hname_reject, 100, 0.0, 2*xi_max, 100, 0.0, 2*xi_max)); + + // book histograms + for(unsigned int i=0; i<numberOutputBits(); ++i) { + std::string hname_accept = "hExclusiveJets_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hExclusiveJets_reject_bit"+std::to_string((int)i); + // mass + bookHist(m_histAcceptX, hname_accept, "Xi1 vs Xi2", 100, p_XiMin[i], p_XiMax[i], 100, p_XiMin[i], p_XiMax[i]); + bookHist(m_histRejectX, hname_reject, "Xi1 vs Xi2", 100, p_XiMin[i], p_XiMax[i], 100, p_XiMin[i], p_XiMax[i]); // eta2 vs. eta1 - snprintf(hname_accept, buf_len, "Accept_%s-J%d-%dETA%d-%dETA%d_%s_bit%d_%dM%d_Eta1Eta2", name().c_str(), et_min, eta1_min, eta1_max, eta2_min, eta2_max, className().c_str(), i, xi_min, xi_max); - snprintf(hname_reject, buf_len, "Reject_%s-J%d-%dETA%d-%dETA%d_%s_bit%d_%dM%d_Eta1Eta2", name().c_str(), et_min, eta1_min, eta1_max, eta2_min, eta2_max, className().c_str(), i, xi_min, xi_max); - registerHist(m_histAcceptEta1Eta2[i] = new TH2F(hname_accept, hname_accept, 100, -50.0, +50.0, 100, -50.0, +50.0)); - registerHist(m_histRejectEta1Eta2[i] = new TH2F(hname_reject, hname_reject, 100, -50.0, +50.0, 100, -50.0, +50.0)); + bookHist(m_histAcceptEta1Eta2, hname_accept, "ETA vs ETA", 100, p_MinEta1[i], p_MaxEta1[i], 100, p_MinEta2[i], p_MaxEta2[i]); + bookHist(m_histRejectEta1Eta2, hname_reject, "ETA vs ETA", 100, p_MinEta1[i], p_MaxEta1[i], 100, p_MinEta2[i], p_MaxEta2[i]); } + return StatusCode::SUCCESS; } TCS::StatusCode -TCS::ExclusiveJets::processBitCorrect( const vector<TCS::TOBArray const *> & input, - const vector<TCS::TOBArray *> & output, +TCS::ExclusiveJets::processBitCorrect( const std::vector<TCS::TOBArray const *> & input, + const std::vector<TCS::TOBArray *> & output, Decision & decision ) // Not really bitwise, keep the name for the future { if(input.size() == 1) { @@ -151,11 +143,11 @@ TCS::ExclusiveJets::processBitCorrect( const vector<TCS::TOBArray const *> & inp output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist2D(m_histAcceptExclusiveJets[i]->GetName(),xi_1,xi_2); - fillHist2D(m_histAcceptEta1Eta2[i]->GetName(),eta1, eta2); + fillHist2D(m_histAcceptX[i],xi_1,xi_2); + fillHist2D(m_histAcceptEta1Eta2[i],eta1, eta2); } else if(fillReject) { - fillHist2D(m_histRejectExclusiveJets[i]->GetName(),xi_1,xi_2); - fillHist2D(m_histRejectEta1Eta2[i]->GetName(),eta1, eta2); + fillHist2D(m_histRejectX[i],xi_1,xi_2); + fillHist2D(m_histRejectEta1Eta2[i],eta1, eta2); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " xi_1 = " << xi_1); @@ -168,8 +160,8 @@ TCS::ExclusiveJets::processBitCorrect( const vector<TCS::TOBArray const *> & inp return TCS::StatusCode::SUCCESS; } TCS::StatusCode -TCS::ExclusiveJets::process( const vector<TCS::TOBArray const *> & input, - const vector<TCS::TOBArray *> & output, +TCS::ExclusiveJets::process( const std::vector<TCS::TOBArray const *> & input, + const std::vector<TCS::TOBArray *> & output, Decision & decision ) { if(input.size() == 1) { @@ -210,11 +202,11 @@ TCS::ExclusiveJets::process( const vector<TCS::TOBArray const *> & input, output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist2D(m_histAcceptExclusiveJets[i]->GetName(),xi_1,xi_2); - fillHist2D(m_histAcceptEta1Eta2[i]->GetName(),eta1, eta2); + fillHist2D(m_histAcceptX[i],xi_1,xi_2); + fillHist2D(m_histAcceptEta1Eta2[i],eta1, eta2); } else if(fillReject) { - fillHist2D(m_histRejectExclusiveJets[i]->GetName(),xi_1,xi_2); - fillHist2D(m_histRejectEta1Eta2[i]->GetName(),eta1, eta2); + fillHist2D(m_histRejectX[i],xi_1,xi_2); + fillHist2D(m_histRejectEta1Eta2[i],eta1, eta2); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " xi_1 = " << xi_1); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassDeltaPhiInclusive2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassDeltaPhiInclusive2.cxx index 44de5924af6..d80b2f82644 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassDeltaPhiInclusive2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassDeltaPhiInclusive2.cxx @@ -27,8 +27,6 @@ REGISTER_ALG_TCS(InvariantMassDeltaPhiInclusive2) -using namespace std; - TCS::InvariantMassDeltaPhiInclusive2::InvariantMassDeltaPhiInclusive2(const std::string & name) : DecisionAlg(name) { @@ -127,8 +125,8 @@ TCS::InvariantMassDeltaPhiInclusive2::initialize() { // book histograms for(unsigned int i=0; i<numberOutputBits(); ++i) { - string hname_accept = "hInvariantMassDeltaPhiInclusive2_accept_bit"+to_string((int)i); - string hname_reject = "hInvariantMassDeltaPhiInclusive2_reject_bit"+to_string((int)i); + std::string hname_accept = "hInvariantMassDeltaPhiInclusive2_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hInvariantMassDeltaPhiInclusive2_reject_bit"+std::to_string((int)i); // mass bookHist(m_histAcceptM, hname_accept, "INVM vs DPHI", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i]), 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]); bookHist(m_histRejectM, hname_reject, "INVM vs DPHI", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i]), 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusive1.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusive1.cxx index 697e5640075..1ebdf15ae71 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusive1.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusive1.cxx @@ -30,7 +30,6 @@ REGISTER_ALG_TCS(InvariantMassInclusive1) -using namespace std; // not the best solution but we will move to athena where this comes for free #define LOG cout << "TCS::InvariantMassInclusive1: " @@ -105,19 +104,15 @@ TCS::InvariantMassInclusive1::initialize() { } TRG_MSG_INFO("number output : " << numberOutputBits()); - for (unsigned int i=0; i<numberOutputBits();i++) { - const int buf_len = 512; - char hname_accept[buf_len], hname_reject[buf_len]; - int mass_min = sqrt(p_InvMassMin[i]); - int mass_max = sqrt(p_InvMassMax[i]); - // mass histograms - snprintf(hname_accept, buf_len, "Accept_%s_%s_bit%d_%dM%d", name().c_str(), className().c_str(), i, mass_min, mass_max); - snprintf(hname_reject, buf_len, "Reject_%s_%s_bit%d_%dM%d", name().c_str(), className().c_str(), i, mass_min, mass_max); - registerHist(m_histAcceptINV1[i] = new TH1F(hname_accept, hname_accept, 100, 0.0, 2*mass_max)); - registerHist(m_histRejectINV1[i] = new TH1F(hname_reject, hname_reject, 100, 0.0, 2*mass_max)); + // book histograms + for(unsigned int i=0; i<numberOutputBits(); ++i) { + std::string hname_accept = "hInvariantMassInclusive1_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hInvariantMassInclusive1_reject_bit"+std::to_string((int)i); + // mass + bookHist(m_histAccept, hname_accept, "INVM", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i])); + bookHist(m_histReject, hname_reject, "INVM", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i])); } - - + return StatusCode::SUCCESS; } @@ -150,9 +145,9 @@ TCS::InvariantMassInclusive1::processBitCorrect( const std::vector<TCS::TOBArray unsigned int invmass2 = TSU::Kinematics::calcInvMassBW( *tob1, *tob2 ); for(unsigned int i=0; i<numberOutputBits(); ++i) { bool accept = false; - if( parType_t((*tob1)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( parType_t((*tob2)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( (parType_t((*tob1)->Et()) <= max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= max(p_MinET1[i],p_MinET2[i]))) continue; + if( parType_t((*tob1)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( parType_t((*tob2)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= std::max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= std::max(p_MinET1[i],p_MinET2[i]))) continue; accept = invmass2 >= p_InvMassMin[i] && invmass2 <= p_InvMassMax[i]; // const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(i) : accept); const bool fillReject = fillHistos() and not fillAccept; @@ -162,9 +157,9 @@ TCS::InvariantMassInclusive1::processBitCorrect( const std::vector<TCS::TOBArray output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAcceptINV1[i]->GetName(),sqrt((float)invmass2)); + fillHist1D(m_histAccept[i],sqrt((float)invmass2)); } else if(fillReject) { - fillHist1D(m_histRejectINV1[i]->GetName(),sqrt((float)invmass2)); + fillHist1D(m_histReject[i],sqrt((float)invmass2)); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " invmass2 = " << invmass2); } @@ -209,9 +204,9 @@ TCS::InvariantMassInclusive1::process( const std::vector<TCS::TOBArray const *> for(unsigned int i=0; i<numberOutputBits(); ++i) { bool accept = false; - if( parType_t((*tob1)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( parType_t((*tob2)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( (parType_t((*tob1)->Et()) <= max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= max(p_MinET1[i],p_MinET2[i]))) continue; + if( parType_t((*tob1)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( parType_t((*tob2)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= std::max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= std::max(p_MinET1[i],p_MinET2[i]))) continue; accept = invmass2 >= p_InvMassMin[i] && invmass2 <= p_InvMassMax[i]; // const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(i) : accept); const bool fillReject = fillHistos() and not fillAccept; @@ -221,9 +216,9 @@ TCS::InvariantMassInclusive1::process( const std::vector<TCS::TOBArray const *> output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAcceptINV1[i]->GetName(),sqrt((float)invmass2)); + fillHist1D(m_histAccept[i],sqrt((float)invmass2)); } else if(fillReject) { - fillHist1D(m_histRejectINV1[i]->GetName(),sqrt((float)invmass2)); + fillHist1D(m_histReject[i],sqrt((float)invmass2)); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " invmass2 = " << invmass2); } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusive2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusive2.cxx index 6daa338dbba..9291d1cb3a3 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusive2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusive2.cxx @@ -28,7 +28,6 @@ REGISTER_ALG_TCS(InvariantMassInclusive2) -using namespace std; // not the best solution but we will move to athena where this comes for free #define LOG cout << "TCS::InvariantMassInclusive2: " @@ -112,23 +111,19 @@ TCS::InvariantMassInclusive2::initialize() { TRG_MSG_INFO("MaxEta2 : "<<p_MaxEta2 ); TRG_MSG_INFO("number output : " << numberOutputBits()); + // book histograms for(unsigned int i=0; i<numberOutputBits(); ++i) { - const int buf_len = 512; - char hname_accept[buf_len], hname_reject[buf_len]; - int mass_min = sqrt(p_InvMassMin[i]); - int mass_max = sqrt(p_InvMassMax[i]); + std::string hname_accept = "hInvariantMassDeltaPhiInclusive2_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hInvariantMassDeltaPhiInclusive2_reject_bit"+std::to_string((int)i); // mass - snprintf(hname_accept, buf_len, "Accept_InvariantMassInclusive2_bit%d_%dM%d_Mass", i, mass_min, mass_max); - snprintf(hname_reject, buf_len, "Reject_InvariantMassInclusive2_bit%d_%dM%d_Mass", i, mass_min, mass_max); - registerHist(m_histAcceptM[i] = new TH1F(hname_accept, hname_accept, 100, 0.0, 2*mass_max)); - registerHist(m_histRejectM[i] = new TH1F(hname_reject, hname_reject, 100, 0.0, 2*mass_max)); + bookHist(m_histAcceptM, hname_accept, "INVM", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i])); + bookHist(m_histRejectM, hname_reject, "INVM", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i])); // eta2 vs. eta1 - snprintf(hname_accept, buf_len, "Accept_InvariantMassInclusive2_bit%d_%dM%d_Eta1Eta2", i, mass_min, mass_max); - snprintf(hname_reject, buf_len, "Reject_InvariantMassInclusive2_bit%d_%dM%d_Eta1Eta2", i, mass_min, mass_max); - registerHist(m_histAcceptEta1Eta2[i] = new TH2F(hname_accept, hname_accept, 100, -50.0, +50.0, 100, -50.0, +50.0)); - registerHist(m_histRejectEta1Eta2[i] = new TH2F(hname_reject, hname_reject, 100, -50.0, +50.0, 100, -50.0, +50.0)); + bookHist(m_histAcceptEta1Eta2, hname_accept, "ETA vs ETA", 100, p_MinEta1, p_MaxEta1, 100, p_MinEta2, p_MaxEta2); + bookHist(m_histRejectEta1Eta2, hname_reject, "ETA vs ETA", 100, p_MinEta1, p_MaxEta1, 100, p_MinEta2, p_MaxEta2); } + return StatusCode::SUCCESS; } @@ -172,11 +167,11 @@ TCS::InvariantMassInclusive2::processBitCorrect( const std::vector<TCS::TOBArray output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAcceptM[i]->GetName(),sqrt((float)invmass2)); - fillHist2D(m_histAcceptEta1Eta2[i]->GetName(),eta1, eta2); + fillHist1D(m_histAcceptM[i],sqrt((float)invmass2)); + fillHist2D(m_histAcceptEta1Eta2[i],eta1, eta2); } else if(fillReject) { - fillHist1D(m_histRejectM[i]->GetName(),sqrt((float)invmass2)); - fillHist2D(m_histRejectEta1Eta2[i]->GetName(),eta1, eta2); + fillHist1D(m_histRejectM[i],sqrt((float)invmass2)); + fillHist2D(m_histRejectEta1Eta2[i],eta1, eta2); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " invmass2 = " << invmass2); } @@ -227,11 +222,11 @@ TCS::InvariantMassInclusive2::process( const std::vector<TCS::TOBArray const *> output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAcceptM[i]->GetName(),sqrt((float)invmass2)); - fillHist2D(m_histAcceptEta1Eta2[i]->GetName(),eta1, eta2); + fillHist1D(m_histAcceptM[i],sqrt((float)invmass2)); + fillHist2D(m_histAcceptEta1Eta2[i],eta1, eta2); } else if(fillReject) { - fillHist1D(m_histRejectM[i]->GetName(),sqrt((float)invmass2)); - fillHist2D(m_histRejectEta1Eta2[i]->GetName(),eta1, eta2); + fillHist1D(m_histRejectM[i],sqrt((float)invmass2)); + fillHist2D(m_histRejectEta1Eta2[i],eta1, eta2); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept ?"pass":"fail") << " invmass2 = " << invmass2); } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusiveDeltaRSqrIncl1.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusiveDeltaRSqrIncl1.cxx index 9b570754bdb..df634f59ae7 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusiveDeltaRSqrIncl1.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusiveDeltaRSqrIncl1.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /********************************* * Based on InvariantMassInclusive1 and DeltaRSqrIncl1. 01/03/2019. @@ -32,7 +32,6 @@ REGISTER_ALG_TCS(InvariantMassInclusiveDeltaRSqrIncl1) -using namespace std; TCS::InvariantMassInclusiveDeltaRSqrIncl1::InvariantMassInclusiveDeltaRSqrIncl1(const std::string & name) : DecisionAlg(name) { @@ -118,28 +117,16 @@ TCS::InvariantMassInclusiveDeltaRSqrIncl1::initialize() { TRG_MSG_INFO("number output : " << numberOutputBits()); - for (unsigned int i=0; i<numberOutputBits();i++) { - const int buf_len = 512; - char hname_accept[buf_len], hname_reject[buf_len]; - int n_bin = 100; - int MassDeltaR_min = 0; - int mass_min = sqrt(p_InvMassMin[i]); - int mass_max = sqrt(p_InvMassMax[i]); - // if minimum mass requirement less than twice of bin length, - // adjust to range by changing maximum mass with the 10 time of bin length. - // This is necessary when range is too wide and minimum cut unvisible. - // Later will be changed with more automated way. - if ( 2*(mass_max-mass_min)/n_bin > mass_min && mass_min != 0.0 ) - { mass_max=10*(mass_max-mass_min)/n_bin; } - int deltaR_max = sqrt(p_DeltaRMax[i]); + // book histograms + for(unsigned int i=0; i<numberOutputBits(); ++i) { + std::string hname_accept = "hInvariantMassDeltaRSqrIncl1_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hInvariantMassDeltaRSqrIncl1_reject_bit"+std::to_string((int)i); // mass - snprintf(hname_accept, buf_len, "Accept_InvariantMassInclusiveDeltaRSqrIncl1_bit%d_%dM%d_Mass", i, mass_min, mass_max); - snprintf(hname_reject, buf_len, "Reject_InvariantMassInclusiveDeltaRSqrIncl1_bit%d_%dM%d_Mass", i, mass_min, mass_max); - registerHist(m_histAcceptM[i] = new TH2F(hname_accept, hname_accept, n_bin, MassDeltaR_min, 2*mass_max, n_bin, MassDeltaR_min, 2*deltaR_max)); - registerHist(m_histRejectM[i] = new TH2F(hname_reject, hname_reject, n_bin, MassDeltaR_min, 2*mass_max, n_bin, MassDeltaR_min, 2*deltaR_max)); - } + bookHist(m_histAcceptM, hname_accept, "INVM vs DR", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i]), 100, p_DeltaRMin[i], p_DeltaRMax[i]); + bookHist(m_histRejectM, hname_reject, "INVM vs DR", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i]), 100, p_DeltaRMin[i], p_DeltaRMax[i]); + + } - return StatusCode::SUCCESS; } @@ -175,9 +162,9 @@ TCS::InvariantMassInclusiveDeltaRSqrIncl1::processBitCorrect( const std::vector< TRG_MSG_DEBUG("Jet1 = " << **tob1 << ", Jet2 = " << **tob2 << ", invmass2 = " << invmass2 << ", deltaR2 = " << deltaR2); for(unsigned int i=0; i<numberOutputBits(); ++i) { bool accept = false; - if( parType_t((*tob1)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( parType_t((*tob2)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( (parType_t((*tob1)->Et()) <= max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= max(p_MinET1[i],p_MinET2[i]))) continue; + if( parType_t((*tob1)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( parType_t((*tob2)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= std::max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= std::max(p_MinET1[i],p_MinET2[i]))) continue; accept = invmass2 >= p_InvMassMin[i] && invmass2 <= p_InvMassMax[i] && deltaR2 >= p_DeltaRMin[i] && deltaR2 <= p_DeltaRMax[i]; const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(i) : accept); const bool fillReject = fillHistos() and not fillAccept; @@ -187,9 +174,9 @@ TCS::InvariantMassInclusiveDeltaRSqrIncl1::processBitCorrect( const std::vector< output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist2D(m_histAcceptM[i]->GetName(),sqrt((float)invmass2),sqrt((float)deltaR2)); + fillHist2D(m_histAcceptM[i],sqrt((float)invmass2),sqrt((float)deltaR2)); } else if(fillReject) { - fillHist2D(m_histRejectM[i]->GetName(),sqrt((float)invmass2),sqrt((float)deltaR2)); + fillHist2D(m_histRejectM[i],sqrt((float)invmass2),sqrt((float)deltaR2)); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " invmass2 = " << invmass2 << " deltaR2 = " << deltaR2 ); } @@ -235,9 +222,9 @@ TCS::InvariantMassInclusiveDeltaRSqrIncl1::process( const std::vector<TCS::TOBAr for(unsigned int i=0; i<numberOutputBits(); ++i) { bool accept = false; - if( parType_t((*tob1)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( parType_t((*tob2)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut - if( (parType_t((*tob1)->Et()) <= max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= max(p_MinET1[i],p_MinET2[i]))) continue; + if( parType_t((*tob1)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( parType_t((*tob2)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= std::max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= std::max(p_MinET1[i],p_MinET2[i]))) continue; accept = invmass2 >= p_InvMassMin[i] && invmass2 <= p_InvMassMax[i] && deltaR2 >= p_DeltaRMin[i] && deltaR2 <= p_DeltaRMax[i]; const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(i) : accept); const bool fillReject = fillHistos() and not fillAccept; @@ -247,9 +234,9 @@ TCS::InvariantMassInclusiveDeltaRSqrIncl1::process( const std::vector<TCS::TOBAr output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist2D(m_histAcceptM[i]->GetName(),sqrt((float)invmass2),sqrt((float)deltaR2)); + fillHist2D(m_histAcceptM[i],sqrt((float)invmass2),sqrt((float)deltaR2)); } else if(fillReject) { - fillHist2D(m_histRejectM[i]->GetName(),sqrt((float)invmass2),sqrt((float)deltaR2)); + fillHist2D(m_histRejectM[i],sqrt((float)invmass2),sqrt((float)deltaR2)); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " invmass2 = " << invmass2 << " deltaR2 = " << deltaR2 ); } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusiveDeltaRSqrIncl2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusiveDeltaRSqrIncl2.cxx index 73fb49af41d..f7cf29606e5 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusiveDeltaRSqrIncl2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusiveDeltaRSqrIncl2.cxx @@ -29,7 +29,6 @@ REGISTER_ALG_TCS(InvariantMassInclusiveDeltaRSqrIncl2) -using namespace std; TCS::InvariantMassInclusiveDeltaRSqrIncl2::InvariantMassInclusiveDeltaRSqrIncl2(const std::string & name) : DecisionAlg(name) @@ -130,25 +129,14 @@ TCS::InvariantMassInclusiveDeltaRSqrIncl2::initialize() { // book histograms for(unsigned int i=0; i<numberOutputBits(); ++i) { - const int buf_len = 512; - char hname_accept[buf_len], hname_reject[buf_len]; - int n_bin = 100; - int MassDeltaR_min = 0; - int mass_min = sqrt(p_InvMassMin[i]); - int mass_max = sqrt(p_InvMassMax[i]); - // if minimum mass requirement less than twice of bin length, - // adjust to range by changing maximum mass with the 10 time of bin length. - // This is necessary when range is too wide and minimum cut unvisible. - // Later will be changed with more automated way. - if ( 2*(mass_max-mass_min)/n_bin > mass_min && mass_min != 0.0 ) - { mass_max=10*(mass_max-mass_min)/n_bin; } - int deltaR_max = sqrt(p_DeltaRMax[i]); + std::string hname_accept = "hInvariantMassDeltaRSqrIncl2_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hInvariantMassDeltaRSqrIncl2_reject_bit"+std::to_string((int)i); // mass - snprintf(hname_accept, buf_len, "Accept_InvariantMassInclusiveDeltaRSqrIncl2_bit%d_%dM%d_Mass", i, mass_min, mass_max); - snprintf(hname_reject, buf_len, "Reject_InvariantMassInclusiveDeltaRSqrIncl2_bit%d_%dM%d_Mass", i, mass_min, mass_max); - registerHist(m_histAcceptM[i] = new TH2F(hname_accept, hname_accept, n_bin, MassDeltaR_min, 2*mass_max, n_bin, MassDeltaR_min, 2*deltaR_max)); - registerHist(m_histRejectM[i] = new TH2F(hname_reject, hname_reject, n_bin, MassDeltaR_min, 2*mass_max, n_bin, MassDeltaR_min, 2*deltaR_max)); + bookHist(m_histAcceptM, hname_accept, "INVM vs DR", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i]), 100, p_DeltaRMin[i], p_DeltaRMax[i]); + bookHist(m_histRejectM, hname_reject, "INVM vs DR", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i]), 100, p_DeltaRMin[i], p_DeltaRMax[i]); + } + return StatusCode::SUCCESS; } @@ -195,9 +183,9 @@ TCS::InvariantMassInclusiveDeltaRSqrIncl2::processBitCorrect( const std::vector< output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist2D(m_histAcceptM[i]->GetName(),sqrt((float)invmass2),sqrt((float)deltaR2)); + fillHist2D(m_histAcceptM[i],sqrt((float)invmass2),sqrt((float)deltaR2)); } else if(fillReject) { - fillHist2D(m_histRejectM[i]->GetName(),sqrt((float)invmass2),sqrt((float)deltaR2)); + fillHist2D(m_histRejectM[i],sqrt((float)invmass2),sqrt((float)deltaR2)); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " invmass2 = " << invmass2 << " deltaR2 = " << deltaR2 ); } @@ -251,9 +239,9 @@ TCS::InvariantMassInclusiveDeltaRSqrIncl2::process( const std::vector<TCS::TOBAr output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist2D(m_histAcceptM[i]->GetName(),sqrt((float)invmass2),sqrt((float)deltaR2)); + fillHist2D(m_histAcceptM[i],sqrt((float)invmass2),sqrt((float)deltaR2)); } else if(fillReject) { - fillHist2D(m_histRejectM[i]->GetName(),sqrt((float)invmass2),sqrt((float)deltaR2)); + fillHist2D(m_histRejectM[i],sqrt((float)invmass2),sqrt((float)deltaR2)); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " invmass2 = " << invmass2 << " deltaR2 = " << deltaR2 ); } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassThreeTOBsIncl.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassThreeTOBsIncl.cxx index 8950ab01bda..2803a8db97c 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassThreeTOBsIncl.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassThreeTOBsIncl.cxx @@ -39,9 +39,8 @@ REGISTER_ALG_TCS(InvariantMassThreeTOBsIncl) -using namespace std; -TCS::InvariantMassThreeTOBsIncl::InvariantMassThreeTOBsIncl(const string & name) : DecisionAlg(name) +TCS::InvariantMassThreeTOBsIncl::InvariantMassThreeTOBsIncl(const std::string & name) : DecisionAlg(name) { defineParameter("InputWidth", 3); defineParameter("MaxTob", 0); @@ -98,17 +97,15 @@ TCS::InvariantMassThreeTOBsIncl::initialize() { } TRG_MSG_INFO("number output : " << numberOutputBits()); - for (unsigned int i=0; i<numberOutputBits();i++) { - const int buf_len = 512; - char hname_accept[buf_len], hname_reject[buf_len]; - int mass_min = sqrt(p_InvMassMin[i]); - int mass_max = sqrt(p_InvMassMax[i]); - // mass histograms - snprintf(hname_accept, buf_len, "Accept_%s_%s_bit%d_%dM%d", name().c_str(), className().c_str(), i, mass_min, mass_max); - snprintf(hname_reject, buf_len, "Reject_%s_%s_bit%d_%dM%d", name().c_str(), className().c_str(), i, mass_min, mass_max); - registerHist(m_histAcceptINVThree[i] = new TH1F(hname_accept, hname_accept, 100, 0.0, 2*mass_max)); - registerHist(m_histRejectINVThree[i] = new TH1F(hname_reject, hname_reject, 100, 0.0, 2*mass_max)); + // book histograms + for(unsigned int i=0; i<numberOutputBits(); ++i) { + std::string hname_accept = "hInvariantMassThreeTOBsIncl_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hInvariantMassThreeTOBsIncl_reject_bit"+std::to_string((int)i); + // mass + bookHist(m_histAccept, hname_accept, "INVM", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i])); + bookHist(m_histReject, hname_reject, "INVM", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i])); } + return StatusCode::SUCCESS; @@ -117,8 +114,8 @@ TCS::InvariantMassThreeTOBsIncl::initialize() { TCS::StatusCode -TCS::InvariantMassThreeTOBsIncl::processBitCorrect( const vector<TCS::TOBArray const *> & input, - const vector<TCS::TOBArray *> & output, +TCS::InvariantMassThreeTOBsIncl::processBitCorrect( const std::vector<TCS::TOBArray const *> & input, + const std::vector<TCS::TOBArray *> & output, Decision & decision ) { @@ -158,7 +155,7 @@ TCS::InvariantMassThreeTOBsIncl::processBitCorrect( const vector<TCS::TOBArray c const bool fillReject = fillHistos() and not fillAccept; const bool alreadyFilled = decision.bit(i); if( accept ) { - vector<TCS::GenericTOB*> TOBvector; + std::vector<TCS::GenericTOB*> TOBvector; TOBvector.push_back( *tob1 ); TOBvector.push_back( *tob2 ); TOBvector.push_back( *tob3 ); @@ -167,9 +164,9 @@ TCS::InvariantMassThreeTOBsIncl::processBitCorrect( const vector<TCS::TOBArray c TOBvector.clear(); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAcceptINVThree[i]->GetName(),sqrt(invmass2)); + fillHist1D(m_histAccept[i],sqrt(invmass2)); } else if(fillReject) { - fillHist1D(m_histRejectINVThree[i]->GetName(),sqrt(invmass2)); + fillHist1D(m_histReject[i],sqrt(invmass2)); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " invmass2 = " << invmass2); @@ -188,8 +185,8 @@ TCS::InvariantMassThreeTOBsIncl::processBitCorrect( const vector<TCS::TOBArray c } TCS::StatusCode -TCS::InvariantMassThreeTOBsIncl::process( const vector<TCS::TOBArray const *> & input, - const vector<TCS::TOBArray *> & output, +TCS::InvariantMassThreeTOBsIncl::process( const std::vector<TCS::TOBArray const *> & input, + const std::vector<TCS::TOBArray *> & output, Decision & decision ) { @@ -230,7 +227,7 @@ TCS::InvariantMassThreeTOBsIncl::process( const vector<TCS::TOBArray const *> & const bool fillReject = fillHistos() and not fillAccept; const bool alreadyFilled = decision.bit(i); if( accept ) { - vector<TCS::GenericTOB*> TOBvector; + std::vector<TCS::GenericTOB*> TOBvector; TOBvector.push_back( *tob1 ); TOBvector.push_back( *tob2 ); TOBvector.push_back( *tob3 ); @@ -239,9 +236,9 @@ TCS::InvariantMassThreeTOBsIncl::process( const vector<TCS::TOBArray const *> & TOBvector.clear(); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAcceptINVThree[i]->GetName(),sqrt(invmass2)); + fillHist1D(m_histAccept[i],sqrt(invmass2)); } else if(fillReject) { - fillHist1D(m_histRejectINVThree[i]->GetName(),sqrt(invmass2)); + fillHist1D(m_histReject[i],sqrt(invmass2)); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " invmass2 = " << invmass2); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetHT.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetHT.cxx index c017583ee11..ef4d3f5a881 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetHT.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetHT.cxx @@ -24,10 +24,8 @@ REGISTER_ALG_TCS(JetHT) -using namespace std; - // not the best solution but we will move to athena where this comes for free -#define LOG cout << name() << ": " +#define LOG std::cout << name() << ": " TCS::JetHT::JetHT(const std::string & name) : DecisionAlg(name) @@ -70,25 +68,15 @@ TCS::JetHT::initialize() { } TRG_MSG_INFO("number output : " << numberOutputBits()); - // create strings for histogram names - std::vector<std::ostringstream> MyAcceptHist(numberOutputBits()); - std::vector<std::ostringstream> MyRejectHist(numberOutputBits()); - - for (unsigned int i=0;i<numberOutputBits();i++) { - MyAcceptHist[i] << "Accept" << p_HT[i] << "HT"; - MyRejectHist[i] << "Reject" << p_HT[i] << "HT"; - } - - for (unsigned int i=0; i<numberOutputBits();i++) { - - const std::string& MyTitle1 = MyAcceptHist[i].str(); - const std::string& MyTitle2 = MyRejectHist[i].str(); - - registerHist(m_histAcceptHT[i] = new TH1F(MyTitle1.c_str(),MyTitle1.c_str(),100,0,p_HT[i]*2)); - registerHist(m_histRejectHT[i] = new TH1F(MyTitle2.c_str(),MyTitle2.c_str(),100,0,p_HT[i]*2)); + // book histograms + for(unsigned int i=0; i<numberOutputBits(); ++i) { + std::string hname_accept = "hJetHT_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hJetHT_reject_bit"+std::to_string((int)i); + // mass + bookHist(m_histAccept, hname_accept, "HT", 100, 0, p_HT[i]); + bookHist(m_histReject, hname_reject, "HT", 100, 0, p_HT[i]); } - return StatusCode::SUCCESS; } @@ -141,9 +129,9 @@ TCS::JetHT::process( const std::vector<TCS::TOBArray const *> & input, output[i]->push_back( CompositeTOB( GenericTOB::createOnHeap( GenericTOB(sumET,0,0) ) )); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAcceptHT[i]->GetName(),sumET); + fillHist1D(m_histAccept[i],sumET); } else if(fillReject) { - fillHist1D(m_histRejectHT[i]->GetName(),sumET); + fillHist1D(m_histReject[i],sumET); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " HT = " << sumET); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetMatch.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetMatch.cxx index bb8371872bb..9f1359db892 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetMatch.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetMatch.cxx @@ -19,10 +19,9 @@ REGISTER_ALG_TCS(JetMatch) -using namespace std; // not the best solution but we will move to athena where this comes for free -#define LOG cout << name() << ": " +#define LOG std::cout << name() << ": " TCS::JetMatch::JetMatch(const std::string & name) : DecisionAlg(name) @@ -80,7 +79,7 @@ TCS::JetMatch::process( const std::vector<TCS::TOBArray const *> & input, } // vector of passing tob - vector<TCS::GenericTOB*> TOBvector; + std::vector<TCS::GenericTOB*> TOBvector; // loop over all jets unsigned int objC(0); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/LAr.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/LAr.cxx index 6de767b978c..2b9908f1355 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/LAr.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/LAr.cxx @@ -19,9 +19,6 @@ REGISTER_ALG_TCS(LAr) -using namespace std; - - TCS::LAr::LAr(const std::string & name) : DecisionAlg(name) { diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/METCut.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/METCut.cxx index fc3e8d43c3a..e9638d1eafa 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/METCut.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/METCut.cxx @@ -20,8 +20,6 @@ REGISTER_ALG_TCS(METCut) -using namespace std; - TCS::METCut::METCut(const std::string & name) : DecisionAlg(name) { diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MinDeltaPhiIncl2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MinDeltaPhiIncl2.cxx index 435efb2196b..9844bfbf9d4 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MinDeltaPhiIncl2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MinDeltaPhiIncl2.cxx @@ -26,10 +26,8 @@ REGISTER_ALG_TCS(MinDeltaPhiIncl2) -using namespace std; - // not the best solution but we will move to athena where this comes for free -#define LOG cout << "TCS::MinDeltaPhiIncl2: " +#define LOG std::cout << "TCS::MinDeltaPhiIncl2: " TCS::MinDeltaPhiIncl2::MinDeltaPhiIncl2(const std::string & name) : DecisionAlg(name) { @@ -70,23 +68,15 @@ TCS::MinDeltaPhiIncl2::initialize() { TRG_MSG_INFO("MinET2 : " << p_MinET2); TRG_MSG_INFO("nummber output : " << numberOutputBits()); - // create strings for histogram names - std::vector<std::ostringstream> MyAcceptHist(numberOutputBits()); - std::vector<std::ostringstream> MyRejectHist(numberOutputBits()); - - for (unsigned int i=0;i< numberOutputBits();i++) { - MyAcceptHist[i] << "Accept" << p_DeltaPhiMin[i] << "MinDPhi2"; - MyRejectHist[i] << "Reject" << p_DeltaPhiMin[i] << "MinDPhi2"; - } - - for (unsigned int i=0; i<numberOutputBits();i++) { - const std::string& MyTitle1 = MyAcceptHist[i].str(); - const std::string& MyTitle2 = MyRejectHist[i].str(); - - registerHist(m_histAcceptMinDPhi2[i] = new TH1F(MyTitle1.c_str(),MyTitle1.c_str(),100,0,3.5)); - registerHist(m_histRejectMinDPhi2[i] = new TH1F(MyTitle2.c_str(),MyTitle2.c_str(),100,0,3.5)); + // book histograms + for(unsigned int i=0; i<numberOutputBits(); ++i) { + std::string hname_accept = "hMinDeltaPhiIncl2_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hMinDeltaPhiIncl2_reject_bit"+std::to_string((int)i); + // mass + bookHist(m_histAccept, hname_accept, "DPHI", 100, p_DeltaPhiMin[i], 70); + bookHist(m_histReject, hname_reject, "DPHI", 100, p_DeltaPhiMin[i], 70); } - + return StatusCode::SUCCESS; } @@ -99,7 +89,7 @@ TCS::MinDeltaPhiIncl2::processBitCorrect( const std::vector<TCS::TOBArray const { // mindphi - unsigned int mindphi = *min_element(begin(p_DeltaPhiMin),end(p_DeltaPhiMin)); + unsigned int mindphi = *std::min_element(std::begin(p_DeltaPhiMin),std::end(p_DeltaPhiMin)); bool firstphi = true; // declare iterator for the tob with min dphi @@ -151,9 +141,9 @@ TCS::MinDeltaPhiIncl2::processBitCorrect( const std::vector<TCS::TOBArray const output[i]->push_back(TCS::CompositeTOB(*tobmin1, *tobmin2)); } if(fillAccept and not alreadyFilled){ - fillHist1D(m_histAcceptMinDPhi2[i]->GetName(),(float)mindphi*0.10); + fillHist1D(m_histAccept[i],(float)mindphi); } else if(fillReject){ - fillHist1D(m_histRejectMinDPhi2[i]->GetName(),(float)mindphi*0.10); + fillHist1D(m_histReject[i],(float)mindphi); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail")); } // for(i) @@ -171,7 +161,7 @@ TCS::MinDeltaPhiIncl2::process( const std::vector<TCS::TOBArray const *> & input { // mindphi - unsigned int mindphi = *min_element(begin(p_DeltaPhiMin),end(p_DeltaPhiMin)); + unsigned int mindphi = *std::min_element(std::begin(p_DeltaPhiMin),std::end(p_DeltaPhiMin)); bool firstphi = true; // declare iterator for the tob with min dphi @@ -223,9 +213,9 @@ TCS::MinDeltaPhiIncl2::process( const std::vector<TCS::TOBArray const *> & input output[i]->push_back(TCS::CompositeTOB(*tobmin1, *tobmin2)); } if(fillAccept and not alreadyFilled){ - fillHist1D(m_histAcceptMinDPhi2[i]->GetName(),(float)mindphi*0.10); + fillHist1D(m_histAccept[i],(float)mindphi); } else if(fillReject) { - fillHist1D(m_histRejectMinDPhi2[i]->GetName(),(float)mindphi*0.10); + fillHist1D(m_histReject[i],(float)mindphi); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail")); } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Multiplicity.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Multiplicity.cxx index 75f6f565faa..56f0d5e9ffd 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Multiplicity.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Multiplicity.cxx @@ -20,9 +20,6 @@ REGISTER_ALG_TCS(Multiplicity) -using namespace std; - - TCS::Multiplicity::Multiplicity(const std::string & name) : DecisionAlg(name) { @@ -72,7 +69,7 @@ TCS::Multiplicity::process( const std::vector<TCS::TOBArray const *> & input, // counter int nmuon = 0; // vector of tobs passing cuts - vector<TCS::GenericTOB*> TOBvector; + std::vector<TCS::GenericTOB*> TOBvector; for( TOBArray::const_iterator tob1 = input[0]->begin(); tob1 != input[0]->end() && distance( input[0]->begin(), tob1) < nLeading; diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MultiplicityCustom.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MultiplicityCustom.cxx index 110d71dbad2..e3ad9c24060 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MultiplicityCustom.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MultiplicityCustom.cxx @@ -18,9 +18,6 @@ REGISTER_ALG_TCS(MultiplicityCustom) -using namespace std; - - TCS::MultiplicityCustom::MultiplicityCustom(const std::string & name) : DecisionAlg(name) { @@ -82,7 +79,7 @@ TCS::MultiplicityCustom::process( const std::vector<TCS::TOBArray const *> & inp // counter unsigned int nmult = 0; // vector of tobs passing cuts - vector<TCS::GenericTOB*> TOBvector; + std::vector<TCS::GenericTOB*> TOBvector; for( TOBArray::const_iterator tob1 = input[0]->begin(); tob1 != input[0]->end() && distance( input[0]->begin(), tob1) < nLeading; diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/NotMatch.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/NotMatch.cxx index 12ab5e8d858..3dda9a616d7 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/NotMatch.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/NotMatch.cxx @@ -18,7 +18,6 @@ REGISTER_ALG_TCS(NotMatch) -using namespace std; // not the best solution but we will move to athena where this comes for free #define LOG cout << "TCS::NotMatch: " @@ -122,7 +121,7 @@ TCS::NotMatch::processBitCorrect( const std::vector<TCS::TOBArray const *> & inp unsigned int deltaR2= 999; for(unsigned int i=0; i<numberOutputBits(); ++i) { bool all_unmatched = true; - vector<GenericTOB*> unmatched_tobs; + std::vector<GenericTOB*> unmatched_tobs; for( TOBArray::const_iterator tob1 = input[0]->begin(); tob1 != input[0]->end() && distance(input[0]->begin(), tob1) < p_NumberLeading1; ++tob1) @@ -172,7 +171,7 @@ TCS::NotMatch::process( const std::vector<TCS::TOBArray const *> & input, unsigned int deltaR2= 999; for(unsigned int i=0; i<numberOutputBits(); ++i) { bool all_unmatched = true; - vector<GenericTOB*> unmatched_tobs; + std::vector<GenericTOB*> unmatched_tobs; for( TOBArray::const_iterator tob1 = input[0]->begin(); tob1 != input[0]->end() && distance(input[0]->begin(), tob1) < p_NumberLeading1; ++tob1) diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio.cxx index 2b927a3450b..37ce171f4ec 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio.cxx @@ -19,10 +19,8 @@ REGISTER_ALG_TCS(Ratio) -using namespace std; - // not the best solution but we will move to athena where this comes for free -#define LOG cout << name() << ": " +#define LOG std::cout << name() << ": " TCS::Ratio::Ratio(const std::string & name) : DecisionAlg(name) diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio2.cxx index 68d98a05da3..befccb97171 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio2.cxx @@ -19,10 +19,8 @@ REGISTER_ALG_TCS(Ratio2) -using namespace std; - // not the best solution but we will move to athena where this comes for free -#define LOG cout << name() << ": " +#define LOG std::cout << name() << ": " TCS::Ratio2::Ratio2(const std::string & name) : DecisionAlg(name) diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioMatch.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioMatch.cxx index fe3a84986c5..90e8ae3ed8e 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioMatch.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioMatch.cxx @@ -19,10 +19,9 @@ REGISTER_ALG_TCS(RatioMatch) -using namespace std; // not the best solution but we will move to athena where this comes for free -#define LOG cout << name() << ": " +#define LOG std::cout << name() << ": " /* NOT USED namespace { diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioSum.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioSum.cxx index 164f4e7f0d4..687f150a671 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioSum.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioSum.cxx @@ -22,10 +22,8 @@ REGISTER_ALG_TCS(RatioSum) -using namespace std; - // not the best solution but we will move to athena where this comes for free -#define LOG cout << name() << ": " +#define LOG std::cout << name() << ": " TCS::RatioSum::RatioSum(const std::string & name) : DecisionAlg(name) diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/SimpleCone.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/SimpleCone.cxx index 923961e4fab..4adc5950207 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/SimpleCone.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/SimpleCone.cxx @@ -24,10 +24,8 @@ REGISTER_ALG_TCS(SimpleCone) -using namespace std; - // not the best solution but we will move to athena where this comes for free -#define LOG cout << name() << ": " +#define LOG std::cout << name() << ": " TCS::SimpleCone::SimpleCone(const std::string & name) : DecisionAlg(name) @@ -73,25 +71,15 @@ TCS::SimpleCone::initialize() { } TRG_MSG_INFO("number output : " << numberOutputBits()); - // create strings for histogram names - std::vector<std::ostringstream> MyAcceptHist(numberOutputBits()); - std::vector<std::ostringstream> MyRejectHist(numberOutputBits()); - - for (unsigned int i=0;i<numberOutputBits();i++) { - MyAcceptHist[i] << "Accept" << p_MinSumET[i] << "SimpleCone"; - MyRejectHist[i] << "Reject" << p_MinSumET[i] << "SimpleCone"; - } - - for (unsigned int i=0; i<numberOutputBits();i++) { - - const std::string& MyTitle1 = MyAcceptHist[i].str(); - const std::string& MyTitle2 = MyRejectHist[i].str(); - - registerHist(m_histAcceptSimpleCone[i] = new TH1F(MyTitle1.c_str(),MyTitle1.c_str(),100,0,p_MinSumET[i]*2)); - registerHist(m_histRejectSimpleCone[i] = new TH1F(MyTitle2.c_str(),MyTitle2.c_str(),100,0,p_MinSumET[i]*2)); + // book histograms + for(unsigned int i=0; i<numberOutputBits(); ++i) { + std::string hname_accept = "hSimpleCone_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hSimpleCone_reject_bit"+std::to_string((int)i); + // mass + bookHist(m_histAccept, hname_accept, "ET", 100, 0, p_MinSumET[i]); + bookHist(m_histReject, hname_reject, "ET", 100, 0, p_MinSumET[i]); } - return StatusCode::SUCCESS; } @@ -163,9 +151,9 @@ TCS::SimpleCone::process( const std::vector<TCS::TOBArray const *> & input, output[i]->push_back( CompositeTOB( GenericTOB::createOnHeap( GenericTOB(leadingET,0,0) ) )); } if(fillAccept) - fillHist1D(m_histAcceptSimpleCone[i]->GetName(),leadingET); + fillHist1D(m_histAccept[i],leadingET); else if(fillReject) - fillHist1D(m_histRejectSimpleCone[i]->GetName(),leadingET); + fillHist1D(m_histReject[i],leadingET); TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " SimpleCone = " << leadingET); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/TransverseMassInclusive1.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/TransverseMassInclusive1.cxx index ed473fb2fcc..13194780a8a 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/TransverseMassInclusive1.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/TransverseMassInclusive1.cxx @@ -28,10 +28,8 @@ // REGISTER_ALG_TCS(TransverseMassInclusive1) -using namespace std; - // not the best solution but we will move to athena where this comes for free -#define LOG cout << "TCS::TransverseMassInclusive1: " +#define LOG std::cout << "TCS::TransverseMassInclusive1: " @@ -113,18 +111,15 @@ TCS::TransverseMassInclusive1::initialize() { TRG_MSG_INFO("NumberLeading1 : " << p_NumberLeading1); TRG_MSG_INFO("number output : " << numberOutputBits()); - for (unsigned int i=0; i<numberOutputBits();i++) { - const int buf_len = 512; - char hname_accept[buf_len], hname_reject[buf_len]; - int Tmass_min = p_TMassMin[i]; - int Tmass_max = 1000; - // Tmass - snprintf(hname_accept, buf_len, "Accept_TransverseMassInclusive1_bit%d_%dM%d_Mass", i, Tmass_min, Tmass_max); - snprintf(hname_reject, buf_len, "Reject_TransverseMassInclusive1_bit%d_%dM%d_Mass", i, Tmass_min, Tmass_max); - registerHist(m_histAcceptM[i] = new TH1F(hname_accept, hname_accept, 100, 0.0, 2*Tmass_max)); - registerHist(m_histRejectM[i] = new TH1F(hname_reject, hname_reject, 100, 0.0, 2*Tmass_max)); - } - + // book histograms + for(unsigned int i=0; i<numberOutputBits(); ++i) { + std::string hname_accept = "hTransverseMassInclusive1_accept_bit"+std::to_string((int)i); + std::string hname_reject = "hTransverseMassInclusive1_reject_bit"+std::to_string((int)i); + // mass + bookHist(m_histAccept, hname_accept, "MT", 100, p_TMassMin[i], 2000); + bookHist(m_histReject, hname_reject, "MT", 100, p_TMassMin[i], 2000); + } + return StatusCode::SUCCESS; } @@ -168,9 +163,9 @@ TCS::TransverseMassInclusive1::processBitCorrect( const std::vector<TCS::TOBArra output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAcceptM[i]->GetName(),(float)tmass2); + fillHist1D(m_histAccept[i],(float)tmass2); } else if(fillReject) { - fillHist1D(m_histRejectM[i]->GetName(),(float)tmass2); + fillHist1D(m_histReject[i],(float)tmass2); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " tmass2 = " << tmass2); } @@ -224,9 +219,9 @@ TCS::TransverseMassInclusive1::process( const std::vector<TCS::TOBArray const *> output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); } if(fillAccept and not alreadyFilled) { - fillHist1D(m_histAcceptM[i]->GetName(),(float)tmass2); + fillHist1D(m_histAccept[i],(float)tmass2); } else if(fillReject) { - fillHist1D(m_histRejectM[i]->GetName(),(float)tmass2); + fillHist1D(m_histReject[i],(float)tmass2); } TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " tmass2 = " << tmass2); diff --git a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h index ca75e662c20..90ea57bc761 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h +++ b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h @@ -69,6 +69,17 @@ namespace TCS { */ bool fillHistos() const; + protected: + std::vector<std::string> m_histAccept; + std::vector<std::string> m_histReject; + std::vector<std::string> m_histAcceptM; + std::vector<std::string> m_histRejectM; + std::vector<std::string> m_histAcceptX; + std::vector<std::string> m_histRejectX; + std::vector<std::string> m_histAcceptEta1Eta2; + std::vector<std::string> m_histRejectEta1Eta2; + + private: virtual StatusCode doReset(); diff --git a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/ConfigurableAlg.cxx b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/ConfigurableAlg.cxx index 04beaa2184e..a38063fe9ef 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/ConfigurableAlg.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/ConfigurableAlg.cxx @@ -206,7 +206,7 @@ void ConfigurableAlg::bookHist(std::vector<std::string> ®Name, const std::str xmin_new=-70; xmax_new=70; } - if ( title.find("DETA") != std::string::npos || title.find("DPHI") != std::string::npos ){ + if ( title.find("DETA") != std::string::npos || title.find("DPHI") != std::string::npos || title.find("DR") != std::string::npos ){ xmin_new=0; xmax_new=70; } @@ -263,11 +263,11 @@ void ConfigurableAlg::bookHist(std::vector<std::string> ®Name, const std::str ymin_new=-70; ymax_new=70; } - if ( xName.find("DETA") != std::string::npos || xName.find("DPHI") != std::string::npos ){ + if ( xName.find("DETA") != std::string::npos || xName.find("DPHI") != std::string::npos || xName.find("DR") != std::string::npos ){ xmin_new=0; xmax_new=70; } - if ( yName.find("DETA") != std::string::npos || yName.find("DPHI") != std::string::npos ){ + if ( yName.find("DETA") != std::string::npos || yName.find("DPHI") != std::string::npos || yName.find("DR") != std::string::npos ){ ymin_new=0; ymax_new=70; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/share/L1TopoSimulationTest.py b/Trigger/TrigT1/L1Topo/L1TopoSimulation/share/L1TopoSimulationTest.py index 9af066f0d83..b9a4f1ddca2 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/share/L1TopoSimulationTest.py +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/share/L1TopoSimulationTest.py @@ -7,7 +7,7 @@ import os,psutil,sys from AthenaCommon.Logging import logging log = logging.getLogger('L1TopoSimulationTest.py') -fmenu ,fTOBs = 'L1Topoconfig_MC_pp_v8_OnlyThreadSaveAlgs.xml','eventdump_new.txt' +fmenu ,fTOBs = 'L1Topoconfig_MC_pp_v8_NewNaming.xml','eventdump_new.txt' print ('File for menu :',fmenu) print ('File for TOBs :',fTOBs) diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/AthenaL1TopoHistSvc.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/AthenaL1TopoHistSvc.cxx index 425c475ff08..031f2706a02 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/AthenaL1TopoHistSvc.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/AthenaL1TopoHistSvc.cxx @@ -41,10 +41,9 @@ public: if(m_histSvc) { string histName = h->GetName(); auto colPos = histName.find_first_of('/'); - //Key will use original name when all algorithms changed with bookHist() - const string key = histName.substr(colPos+1); + const string key = histName; const string fullName( m_baseDir + histName ); - h->SetName(key.c_str()); + h->SetName(histName.substr(colPos+1).c_str()); std::unique_ptr<TH1> uhist(h); LockedHandle<TH1> lh; if( ! m_histSvc->regShared(fullName, std::move(uhist), lh).isSuccess() ) { @@ -62,10 +61,9 @@ public: if(m_histSvc) { string histName = h->GetName(); auto colPos = histName.find_first_of('/'); - //Key will use original name when all algorithms changed with bookHist() - const string key = histName.substr(colPos+1); + const string key = histName; const string fullName( m_baseDir + histName ); - h->SetName(key.c_str()); + h->SetName(histName.substr(colPos+1).c_str()); std::unique_ptr<TH2> uhist(h); LockedHandle<TH2> lh; if( ! m_histSvc->regShared(fullName, std::move(uhist), lh).isSuccess() ) { @@ -89,9 +87,7 @@ public: } void fillHist1D(const std::string & histName,double x) { - //This will be removed when all algorithms changed with bookHist() - auto colPos = histName.find_first_of('/'); - const string key = histName.substr(colPos+1); + const string key = histName; if(m_hist1D.find(key) == m_hist1D.end()) { TRG_MSG_ERROR("1D-hist with registration key " << key << " does not exist"); } @@ -99,9 +95,7 @@ public: } void fillHist2D(const std::string & histName,double x,double y) { - //This will be removed when all algorithms changed with bookHist() - auto colPos = histName.find_first_of('/'); - const string key = histName.substr(colPos+1); + const string key = histName; if(m_hist2D.find(key) == m_hist2D.end()) { TRG_MSG_ERROR("2D-hist with registration key " << key << " does not exist"); } diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.cxx index c01d89f3cb0..c3578f93e54 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.cxx @@ -104,6 +104,11 @@ L1TopoSimulation::L1TopoSimulation(const std::string &name, ISvcLocator *pSvcLoc LVL1::L1TopoSimulation::~L1TopoSimulation() {} +bool +LVL1::L1TopoSimulation::isClonable() const +{ + return true; +} StatusCode LVL1::L1TopoSimulation::initialize() { diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.h b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.h index 79baea4c52a..c49166093cb 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.h +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.h @@ -53,6 +53,10 @@ namespace LVL1 { virtual StatusCode execute() override; virtual StatusCode finalize() override; + + // make algorithm is clonable + virtual bool isClonable() const override; + /** @brief Retrieve the L1Topo hardware bits from the DAQ RODs -- GitLab