diff --git a/Calorimeter/CaloExample/CaloRecEx/share/CaloRecOutputItemList_jobOptions.py b/Calorimeter/CaloExample/CaloRecEx/share/CaloRecOutputItemList_jobOptions.py index d9e10e05a6cb253076b69baabd33abe06bc1768b..7f143f2ac818e6c606c55dff9ac5a75a5cff6176 100644 --- a/Calorimeter/CaloExample/CaloRecEx/share/CaloRecOutputItemList_jobOptions.py +++ b/Calorimeter/CaloExample/CaloRecEx/share/CaloRecOutputItemList_jobOptions.py @@ -110,7 +110,8 @@ AODMoments=[#"LATERAL" ,"EM_PROBABILITY" #,"PTD" ,"BadChannelList" - ,#"LATERAL" + #,"LATERAL" + ,"SECOND_TIME" ] if jobproperties.CaloRecFlags.doExtendedClusterMoments.get_Value(): @@ -215,8 +216,6 @@ if jobproperties.CaloRecFlags.doCaloFwdTopoTower.get_Value(): AuxListItem+="."+moment CaloClusterItemList+=[AuxListItem] - - CaloAODList+=CaloClusterItemList # E4' cells diff --git a/Calorimeter/CaloLocalHadCalib/share/GetH6LCSinglePionsPerf_cbt.py b/Calorimeter/CaloLocalHadCalib/share/GetH6LCSinglePionsPerf_cbt.py index 8c4e725d132a86ac773257f7b1862283be8c41d7..82263629bc3982e25e6b0c42ed5f5a9bb2d30391 100644 --- a/Calorimeter/CaloLocalHadCalib/share/GetH6LCSinglePionsPerf_cbt.py +++ b/Calorimeter/CaloLocalHadCalib/share/GetH6LCSinglePionsPerf_cbt.py @@ -126,17 +126,6 @@ if doTopoClusterAgain: "TileExt0", "TileExt1", "TileExt2", "TileGap1", "TileGap2", "TileGap3", "FCAL0", "FCAL1"] - # simple noise tool - SimpleNoiseFile = "sigmas_all.dat" - from CaloTools.CaloToolsConf import SimpleNoiseToolFromTextFile - SimpleNoiseTool = SimpleNoiseToolFromTextFile("SimpleNoiseTool") - SimpleNoiseTool.CellNoiseFileName = SimpleNoiseFile - ToolSvc += SimpleNoiseTool - - topSequence.CaloTopoCluster.TopoMaker.CaloNoiseTool = SimpleNoiseTool - topSequence.CaloTopoCluster.LocalCalib.LCWeight.CaloNoiseTool = SimpleNoiseTool - topSequence.CaloTopoCluster.DMCalib.LCDeadMaterial.CaloNoiseTool = SimpleNoiseTool - # remove annoying BadChannel tool tlist=[] for x in topSequence.CaloTopoCluster.ClusterCorrectionTools: diff --git a/Calorimeter/CaloLocalHadCalib/share/cl_w_ooc_H6.py b/Calorimeter/CaloLocalHadCalib/share/cl_w_ooc_H6.py index d0559bb8aeb9106e68b86bd0dd48be89c8460614..8102bdb397bebf6cde9de282225e3ef31e16babb 100644 --- a/Calorimeter/CaloLocalHadCalib/share/cl_w_ooc_H6.py +++ b/Calorimeter/CaloLocalHadCalib/share/cl_w_ooc_H6.py @@ -142,16 +142,6 @@ if doTopoClusterAgain: "TileExt0", "TileExt1", "TileExt2", "TileGap1", "TileGap2", "TileGap3", "FCAL0", "FCAL1"] - # simple noise tool - SimpleNoiseFile = "sigmas_ave.dat" - from CaloTools.CaloToolsConf import SimpleNoiseToolFromTextFile - SimpleNoiseTool = SimpleNoiseToolFromTextFile("SimpleNoiseTool") - SimpleNoiseTool.CellNoiseFileName = SimpleNoiseFile - ToolSvc += SimpleNoiseTool - - topSequence.CaloTopoCluster.TopoMaker.CaloNoiseTool = SimpleNoiseTool - topSequence.CaloTopoCluster.LocalCalib.LCWeight.CaloNoiseTool = SimpleNoiseTool - topSequence.CaloTopoCluster.DMCalib.LCDeadMaterial.CaloNoiseTool = SimpleNoiseTool # remove annoying BadChannel tool tlist=[] diff --git a/Calorimeter/CaloLocalHadCalib/share/deadmaterialtree_ctb.py b/Calorimeter/CaloLocalHadCalib/share/deadmaterialtree_ctb.py index 22ec5d145ca5cba291cd9988690306395c42998d..923413a389b63ac4b3f57c974c0f88fbd6cd3e35 100644 --- a/Calorimeter/CaloLocalHadCalib/share/deadmaterialtree_ctb.py +++ b/Calorimeter/CaloLocalHadCalib/share/deadmaterialtree_ctb.py @@ -137,16 +137,6 @@ if doTopoClusterAgain: "TileExt0", "TileExt1", "TileExt2", "TileGap1", "TileGap2", "TileGap3", "FCAL0", "FCAL1"] - # simple noise tool - SimpleNoiseFile = "sigmas_ave.dat" - from CaloTools.CaloToolsConf import SimpleNoiseToolFromTextFile - SimpleNoiseTool = SimpleNoiseToolFromTextFile("SimpleNoiseTool") - SimpleNoiseTool.CellNoiseFileName = SimpleNoiseFile - ToolSvc += SimpleNoiseTool - - topSequence.CaloTopoCluster.TopoMaker.CaloNoiseTool = SimpleNoiseTool - topSequence.CaloTopoCluster.LocalCalib.LCWeight.CaloNoiseTool = SimpleNoiseTool - topSequence.CaloTopoCluster.DMCalib.LCDeadMaterial.CaloNoiseTool = SimpleNoiseTool # remove annoying BadChannel tool tlist=[] diff --git a/Calorimeter/CaloRec/python/CaloClusterTopoGetter.py b/Calorimeter/CaloRec/python/CaloClusterTopoGetter.py index 0aeba2d994eafa79529ddcf103ba2d06351c1a6c..9f1d68111d0a4ada98513090a3e5255056ad1ef2 100644 --- a/Calorimeter/CaloRec/python/CaloClusterTopoGetter.py +++ b/Calorimeter/CaloRec/python/CaloClusterTopoGetter.py @@ -234,7 +234,7 @@ class CaloClusterTopoGetter ( Configured ) : ,"AVG_TILE_Q" ,"PTD" ,"MASS" - ,"EM_PROBABILITY" + ,"SECOND_TIME" ] doDigiTruthFlag = False diff --git a/Calorimeter/CaloRec/python/CaloTopoClusterConfig.py b/Calorimeter/CaloRec/python/CaloTopoClusterConfig.py index a7a9979864d8b45c86372e8db806fd3473cf1258..4bc3520529efcd70671293f87dfb5e34a81ad129 100644 --- a/Calorimeter/CaloRec/python/CaloTopoClusterConfig.py +++ b/Calorimeter/CaloRec/python/CaloTopoClusterConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory @@ -135,6 +135,7 @@ def getTopoMoments(configFlags): ,"AVG_TILE_Q" ,"PTD" ,"MASS" + , "SECOND_TIME" ] # Disable for now, as broken on MC diff --git a/Calorimeter/CaloRec/python/MakeTowersFromClusters.py b/Calorimeter/CaloRec/python/MakeTowersFromClusters.py index 4e312a59e41b4b764df4e8c97b0920c770199832..04293c4097d6af7465729fd897bea9c205fa3870 100644 --- a/Calorimeter/CaloRec/python/MakeTowersFromClusters.py +++ b/Calorimeter/CaloRec/python/MakeTowersFromClusters.py @@ -24,6 +24,7 @@ def TowersFromClustersDict(clusterBuilderName = 'TowerFromClusterTool', cellEnergyThreshold = 0., applyLCW = False, buildCombinedSignal = False, + removeSamplingData = True, clusterRange = 5.): ''' Configuration dictionary for tower-to-cluster converter ''' @@ -38,7 +39,8 @@ def TowersFromClustersDict(clusterBuilderName = 'TowerFromClusterTool', 'PrepareLCW' : applyLCW, ### (control) prepare (and apply) LCW 'DoCellIndexCheck' : doCellIndexCheck, ### (control) check cell hash indices 'BuildCombinedTopoSignal' : buildCombinedSignal, ### (control) build combined topo-cluster/topo-tower container - 'TopoClusterRange' : clusterRange, ### (control) range for topo-cluster in combined mode + 'TopoClusterRange' : clusterRange, ### (control) range for topo-cluster in combined mode + 'RemoveSamplingData' : removeSamplingData, ### (control) remove all sampling data from tower } return configDict @@ -146,15 +148,15 @@ def MakeTowersFromClusters(towerMakerName = 'CaloTowerBuilderAlg', # clusterMoments.TwoGaussianNoise = jobproperties.CaloTopoClusterFlags.doTwoGaussianNoise() clusterMoments.MinBadLArQuality = 4000 clusterMoments.MomentsNames = [ - "CENTER_LAMBDA", - #"CENTER_MAG", + # "CENTER_LAMBDA", + # "CENTER_MAG", "LONGITUDINAL", - #"FIRST_ENG_DENS", - #"ENG_FRAC_MAX", + # "FIRST_ENG_DENS", + # "ENG_FRAC_MAX", "ENG_FRAC_EM", - #"PTD", + # "PTD", "SIGNIFICANCE", - "ENG_POS" + # "ENG_POS", ] from IOVDbSvc.CondDB import conddb diff --git a/Calorimeter/CaloRec/share/CaloTopoSignalFragment.py b/Calorimeter/CaloRec/share/CaloTopoSignalFragment.py index 79bcb1076bdcb72859eae661db5c0a919ebea7c3..e43ade4a0b84450b9f92b61047f7978f003726bb 100644 --- a/Calorimeter/CaloRec/share/CaloTopoSignalFragment.py +++ b/Calorimeter/CaloRec/share/CaloTopoSignalFragment.py @@ -58,7 +58,7 @@ caloTowerMerger.TopoClusterRange = caloTowerDict['TopoClusterRange'] caloTowerMerger.TopoClusterContainerKey = caloTowerDict['CaloTopoClusterContainerKey'] #### caloTowerAlgo.CaloFwdTopoTowerBuilder.CaloTopoClusterContainerKey caloTowerMerger.TopoTowerContainerKey = caloTowerAlgo.TowersOutputName caloTowerMerger.TopoSignalContainerKey = 'CaloCalTopoSignals' -caloTowerMerger.OutputLevel = Lvl.DEBUG +## caloTowerMerger.OutputLevel = Lvl.DEBUG topSequence+=caloTowerAlgo topSequence+=caloTowerMerger diff --git a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx index 5c679d82e58c506c0e4c76db932c49fea9ee2a8a..1ebd1d49f9e8fa9ab2924c5df7d7c8e6534eb133 100644 --- a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx +++ b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ //----------------------------------------------------------------------- @@ -12,6 +12,7 @@ // // Author List: // Sven Menke +// Peter Loch // //----------------------------------------------------------------------- @@ -39,78 +40,98 @@ #include <limits> #include <sstream> +#include <map> +#include <string> +#include <cstdio> + using CLHEP::deg; using CLHEP::cm; +// Known moments namespace { - - - //FIXME, somehow make sure these names are in sync with the xAOD variable names -struct MomentName -{ - const char* name; - xAOD::CaloCluster::MomentType mom; -}; - - -// Must be sorted by name. -MomentName moment_names[] = { - { "AVG_LAR_Q", xAOD::CaloCluster::AVG_LAR_Q }, - { "AVG_TILE_Q", xAOD::CaloCluster::AVG_TILE_Q }, - { "BADLARQ_FRAC", xAOD::CaloCluster::BADLARQ_FRAC }, - { "BAD_CELLS_CORR_E", xAOD::CaloCluster::BAD_CELLS_CORR_E }, - { "CELL_SIGNIFICANCE", xAOD::CaloCluster::CELL_SIGNIFICANCE }, - { "CELL_SIG_SAMPLING", xAOD::CaloCluster::CELL_SIG_SAMPLING }, - { "CENTER_LAMBDA", xAOD::CaloCluster::CENTER_LAMBDA }, - { "CENTER_MAG", xAOD::CaloCluster::CENTER_MAG }, - { "CENTER_X", xAOD::CaloCluster::CENTER_X }, - { "CENTER_Y", xAOD::CaloCluster::CENTER_Y }, - { "CENTER_Z", xAOD::CaloCluster::CENTER_Z }, - { "DELTA_ALPHA", xAOD::CaloCluster::DELTA_ALPHA }, - { "DELTA_PHI", xAOD::CaloCluster::DELTA_PHI }, - { "DELTA_THETA", xAOD::CaloCluster::DELTA_THETA }, - { "ENG_BAD_CELLS", xAOD::CaloCluster::ENG_BAD_CELLS }, - { "ENG_BAD_HV_CELLS", xAOD::CaloCluster::ENG_BAD_HV_CELLS }, - { "ENG_FRAC_CORE", xAOD::CaloCluster::ENG_FRAC_CORE }, - { "ENG_FRAC_EM", xAOD::CaloCluster::ENG_FRAC_EM }, - { "ENG_FRAC_MAX", xAOD::CaloCluster::ENG_FRAC_MAX }, - { "ENG_POS", xAOD::CaloCluster::ENG_POS }, - { "FIRST_ENG_DENS", xAOD::CaloCluster::FIRST_ENG_DENS }, - { "FIRST_ETA", xAOD::CaloCluster::FIRST_ETA }, - { "FIRST_PHI", xAOD::CaloCluster::FIRST_PHI }, - { "ISOLATION", xAOD::CaloCluster::ISOLATION }, - { "LATERAL", xAOD::CaloCluster::LATERAL }, - { "LONGITUDINAL", xAOD::CaloCluster::LONGITUDINAL }, - { "MASS", xAOD::CaloCluster::MASS }, - { "N_BAD_CELLS", xAOD::CaloCluster::N_BAD_CELLS }, - { "N_BAD_HV_CELLS", xAOD::CaloCluster::N_BAD_HV_CELLS }, - { "N_BAD_CELLS_CORR", xAOD::CaloCluster::N_BAD_CELLS_CORR }, - { "PTD", xAOD::CaloCluster::PTD }, - { "SECOND_ENG_DENS", xAOD::CaloCluster::SECOND_ENG_DENS }, - { "SECOND_LAMBDA", xAOD::CaloCluster::SECOND_LAMBDA }, - { "SECOND_R", xAOD::CaloCluster::SECOND_R }, - { "SIGNIFICANCE", xAOD::CaloCluster::SIGNIFICANCE }, -}; - -MomentName* moment_names_end = - moment_names + sizeof(moment_names)/sizeof(moment_names[0]); - -#if 0 -bool operator< (const std::string& v, const MomentName& m) -{ - return strcmp (v.c_str(), m.name) < 0; -} -#endif -bool operator< (const MomentName& m, const std::string& v) -{ - return strcmp (m.name, v.c_str()) < 0; -} - - + // name -> enum translator + std::map<std::string,xAOD::CaloCluster::MomentType> momentNameToEnumMap = { + { "AVG_LAR_Q", xAOD::CaloCluster::AVG_LAR_Q }, + { "AVG_TILE_Q", xAOD::CaloCluster::AVG_TILE_Q }, + { "BADLARQ_FRAC", xAOD::CaloCluster::BADLARQ_FRAC }, + { "BAD_CELLS_CORR_E", xAOD::CaloCluster::BAD_CELLS_CORR_E }, + { "CELL_SIGNIFICANCE", xAOD::CaloCluster::CELL_SIGNIFICANCE }, + { "CELL_SIG_SAMPLING", xAOD::CaloCluster::CELL_SIG_SAMPLING }, + { "CENTER_LAMBDA", xAOD::CaloCluster::CENTER_LAMBDA }, + { "CENTER_MAG", xAOD::CaloCluster::CENTER_MAG }, + { "CENTER_X", xAOD::CaloCluster::CENTER_X }, + { "CENTER_Y", xAOD::CaloCluster::CENTER_Y }, + { "CENTER_Z", xAOD::CaloCluster::CENTER_Z }, + { "DELTA_ALPHA", xAOD::CaloCluster::DELTA_ALPHA }, + { "DELTA_PHI", xAOD::CaloCluster::DELTA_PHI }, + { "DELTA_THETA", xAOD::CaloCluster::DELTA_THETA }, + { "ENG_BAD_CELLS", xAOD::CaloCluster::ENG_BAD_CELLS }, + { "ENG_BAD_HV_CELLS", xAOD::CaloCluster::ENG_BAD_HV_CELLS }, + { "ENG_FRAC_CORE", xAOD::CaloCluster::ENG_FRAC_CORE }, + { "ENG_FRAC_EM", xAOD::CaloCluster::ENG_FRAC_EM }, + { "ENG_FRAC_MAX", xAOD::CaloCluster::ENG_FRAC_MAX }, + { "ENG_POS", xAOD::CaloCluster::ENG_POS }, + { "FIRST_ENG_DENS", xAOD::CaloCluster::FIRST_ENG_DENS }, + { "FIRST_ETA", xAOD::CaloCluster::FIRST_ETA }, + { "FIRST_PHI", xAOD::CaloCluster::FIRST_PHI }, + { "ISOLATION", xAOD::CaloCluster::ISOLATION }, + { "LATERAL", xAOD::CaloCluster::LATERAL }, + { "LONGITUDINAL", xAOD::CaloCluster::LONGITUDINAL }, + { "MASS", xAOD::CaloCluster::MASS }, + { "N_BAD_CELLS", xAOD::CaloCluster::N_BAD_CELLS }, + { "N_BAD_HV_CELLS", xAOD::CaloCluster::N_BAD_HV_CELLS }, + { "N_BAD_CELLS_CORR", xAOD::CaloCluster::N_BAD_CELLS_CORR }, + { "PTD", xAOD::CaloCluster::PTD }, + { "SECOND_ENG_DENS", xAOD::CaloCluster::SECOND_ENG_DENS }, + { "SECOND_LAMBDA", xAOD::CaloCluster::SECOND_LAMBDA }, + { "SECOND_R", xAOD::CaloCluster::SECOND_R }, + { "SECOND_TIME", xAOD::CaloCluster::SECOND_TIME }, + { "SIGNIFICANCE", xAOD::CaloCluster::SIGNIFICANCE }, + { "EM_PROBABILITY", xAOD::CaloCluster::EM_PROBABILITY } + }; + // enum -> name translator + std::map<xAOD::CaloCluster::MomentType,std::string> momentEnumToNameMap = { + { xAOD::CaloCluster::AVG_LAR_Q, "AVG_LAR_Q" }, + { xAOD::CaloCluster::AVG_TILE_Q, "AVG_TILE_Q" }, + { xAOD::CaloCluster::BADLARQ_FRAC, "BADLARQ_FRAC" }, + { xAOD::CaloCluster::BAD_CELLS_CORR_E, "BAD_CELLS_CORR_E" }, + { xAOD::CaloCluster::CELL_SIGNIFICANCE, "CELL_SIGNIFICANCE"}, + { xAOD::CaloCluster::CELL_SIG_SAMPLING, "CELL_SIG_SAMPLING"}, + { xAOD::CaloCluster::CENTER_LAMBDA, "CENTER_LAMBDA" }, + { xAOD::CaloCluster::CENTER_MAG, "CENTER_MAG" }, + { xAOD::CaloCluster::CENTER_X, "CENTER_X" }, + { xAOD::CaloCluster::CENTER_Y, "CENTER_Y" }, + { xAOD::CaloCluster::CENTER_Z, "CENTER_Z" }, + { xAOD::CaloCluster::DELTA_ALPHA, "DELTA_ALPHA" }, + { xAOD::CaloCluster::DELTA_PHI, "DELTA_PHI" }, + { xAOD::CaloCluster::DELTA_THETA, "DELTA_THETA" }, + { xAOD::CaloCluster::ENG_BAD_CELLS, "ENG_BAD_CELLS" }, + { xAOD::CaloCluster::ENG_BAD_HV_CELLS, "ENG_BAD_HV_CELLS" }, + { xAOD::CaloCluster::ENG_FRAC_CORE, "ENG_FRAC_CORE" }, + { xAOD::CaloCluster::ENG_FRAC_EM, "ENG_FRAC_EM" }, + { xAOD::CaloCluster::ENG_FRAC_MAX, "ENG_FRAC_MAX" }, + { xAOD::CaloCluster::ENG_POS, "ENG_POS" }, + { xAOD::CaloCluster::FIRST_ENG_DENS, "FIRST_ENG_DENS" }, + { xAOD::CaloCluster::FIRST_ETA, "FIRST_ETA" }, + { xAOD::CaloCluster::FIRST_PHI, "FIRST_PHI" }, + { xAOD::CaloCluster::ISOLATION, "ISOLATION" }, + { xAOD::CaloCluster::LATERAL, "LATERAL" }, + { xAOD::CaloCluster::LONGITUDINAL, "LONGITUDINAL" }, + { xAOD::CaloCluster::MASS, "MASS" }, + { xAOD::CaloCluster::N_BAD_CELLS, "N_BAD_CELLS" }, + { xAOD::CaloCluster::N_BAD_HV_CELLS, "N_BAD_HV_CELLS" }, + { xAOD::CaloCluster::N_BAD_CELLS_CORR, "N_BAD_CELLS_CORR" }, + { xAOD::CaloCluster::PTD, "PTD" }, + { xAOD::CaloCluster::SECOND_ENG_DENS, "SECOND_ENG_DENS" }, + { xAOD::CaloCluster::SECOND_LAMBDA, "SECOND_LAMBDA" }, + { xAOD::CaloCluster::SECOND_R, "SECOND_R" }, + { xAOD::CaloCluster::SECOND_TIME, "SECOND_TIME" }, + { xAOD::CaloCluster::SIGNIFICANCE, "SIGNIFICANCE" }, + { xAOD::CaloCluster::EM_PROBABILITY, "EM_PROBABILITY" } + }; } - //############################################################################### CaloClusterMomentsMaker::CaloClusterMomentsMaker(const std::string& type, @@ -134,117 +155,102 @@ CaloClusterMomentsMaker::CaloClusterMomentsMaker(const std::string& type, // Name(s) of Moments to calculate declareProperty("MomentsNames",m_momentsNames); - // Name(s) of Moments which can be stored on the AOD - all others go to ESD - // m_momentsNamesAOD.push_back(std::string("FIRST_PHI")); - // m_momentsNamesAOD.push_back(std::string("FIRST_ETA")); - // m_momentsNamesAOD.push_back(std::string("SECOND_R")); - // m_momentsNamesAOD.push_back(std::string("SECOND_LAMBDA")); - // m_momentsNamesAOD.push_back(std::string("CENTER_LAMBDA")); - // m_momentsNamesAOD.push_back(std::string("FIRST_ENG_DENS")); - // m_momentsNamesAOD.push_back(std::string("ENG_BAD_CELLS")); - // m_momentsNamesAOD.push_back(std::string("N_BAD_CELLS")); - - //declareProperty("AODMomentsNames",m_momentsNamesAOD); - // maximum allowed angle between shower axis and the vector pointing - // to the shower center from the IP in degrees. This property is need + // Maximum allowed angle between shower axis and the vector pointing + // to the shower center from the IP in degrees. This property is needed // to protect against cases where all significant cells are in one sampling - // and the shower axis can not be defined from them + // and the shower axis can thus not be defined. declareProperty("MaxAxisAngle",m_maxAxisAngle); declareProperty("MinRLateral",m_minRLateral); declareProperty("MinLLongitudinal",m_minLLongitudinal); declareProperty("MinBadLArQuality",m_minBadLArQuality); - // use 2-gaussian noise for Tile + // Use 2-gaussian noise for Tile declareProperty("TwoGaussianNoise",m_twoGaussianNoise); declareProperty("LArHVFraction",m_larHVFraction,"Tool Handle for LArHVFraction"); - - /// Not used anymore (with xAOD), but required when configured from COOL. + // Not used anymore (with xAOD), but required when configured from COOL. declareProperty("AODMomentsNames",m_momentsNamesAOD); // Use weighting of neg. clusters option? declareProperty("WeightingOfNegClusters", m_absOpt); - } //############################################################################### StatusCode CaloClusterMomentsMaker::initialize() { - m_calculateSignificance = false; - m_calculateIsolation = false; - - // translate all moment names specified in MomentsNames property to moment enums, - // check that they are all valid and there are no repeating names - for(const auto& name: m_momentsNames) { - const MomentName* it = - std::lower_bound (moment_names, moment_names_end, name); - if (it != moment_names_end) { - m_validMoments.push_back (it->mom); - switch (it->mom) { - case xAOD::CaloCluster::SIGNIFICANCE: - case xAOD::CaloCluster::CELL_SIGNIFICANCE: - m_calculateSignificance = true; - break; - case xAOD::CaloCluster::ISOLATION: - m_calculateIsolation = true; - break; - case xAOD::CaloCluster::ENG_BAD_HV_CELLS: - m_calculateLArHVFraction = true; - default: - break; - } - } - else { - msg(MSG::ERROR) << "Moment " << name - << " is not a valid Moment name and will be ignored! " - << "Valid names are:"; - int count = 0; - for (const MomentName& m : moment_names) - msg() << ((count++)==0?" ":", ") << m.name; - msg() << endmsg; - } - } - + // loop list of requested moments + std::string::size_type nstr(0); int nmom(0); + for ( const auto& mom : m_momentsNames ) { + // check if moment is known (enumerator available) + auto fmap(momentNameToEnumMap.find(mom)); + if ( fmap != momentNameToEnumMap.end() ) { + // valid moment found + nstr = std::max(nstr,mom.length()); ++nmom; + if ( fmap->second == xAOD::CaloCluster::SECOND_TIME ) { + // special flag for second moment of cell times - this moment is not + // calculated in this tool! Do not add to internal (!) valid moments list. + // Its value is available from xAOD::CaloCluster::secondTime()! + m_secondTime = true; + } else if ( fmap->second == xAOD::CaloCluster::EM_PROBABILITY ) { + ATH_MSG_WARNING( mom << " not calculated in this tool - misconfiguration?" ); + } else { + // all other valid moments + m_validMoments.push_back(fmap->second); + // flag some special requests + switch (fmap->second) { + case xAOD::CaloCluster::SIGNIFICANCE: + case xAOD::CaloCluster::CELL_SIGNIFICANCE: + m_calculateSignificance = true; + break; + case xAOD::CaloCluster::ISOLATION: + m_calculateIsolation = true; + break; + case xAOD::CaloCluster::ENG_BAD_HV_CELLS: + m_calculateLArHVFraction = true; + default: + break; + } // set special processing flags + } // moment calculated with this tool + } else { + ATH_MSG_ERROR( "Moment name " << mom << " not known; known moments are:" ); + char buffer[128]; std::string::size_type lstr(nstr); + // determine field size + for ( auto fmom : momentNameToEnumMap ) { lstr = std::max(lstr,fmom.first.length()); } + // print available moments + for ( auto fmom : momentNameToEnumMap ) { + sprintf(buffer,"moment name: %-*.*s - enumerator: %i",(int)lstr,(int)lstr,fmom.first.c_str(),(int)fmom.second); + ATH_MSG_INFO(buffer); + } + return StatusCode::FAILURE; + } // found unknown moment name + } // loop configured moment names - // sort and remove duplicates, order is not required for any of the code below - // but still may be useful property + // sort and remove duplicates std::sort(m_validMoments.begin(), m_validMoments.end()); - m_validMoments.erase(std::unique(m_validMoments.begin(), - m_validMoments.end()), - m_validMoments.end()); - - - /* - // translate moment names in AODMomentsNames property into set of enums, - // only take valid names which are also in MomentsNames property - m_momentsAOD.reserve(m_momentsNamesAOD.size()); - for(const auto& name: m_momentsNamesAOD) { - const MomentName* it = - std::lower_bound (moment_names, moment_names_end, name); - if (it != moment_names_end) { - if (std::find(m_validMoments.begin(), m_validMoments.end(), it->mom) - != m_validMoments.end()) - { - m_momentsAOD.push_back(it->mom); - } - } + m_validMoments.erase(std::unique(m_validMoments.begin(),m_validMoments.end()),m_validMoments.end()); + + // print configured moments + ATH_MSG_INFO( "Construct and save " << nmom << " cluster moments: " ); + char buffer[128]; + for ( auto menum : m_validMoments ) { + sprintf(buffer,"moment name: %-*.*s - enumerator: %i",(int)nstr,(int)nstr,momentEnumToNameMap.at(menum).c_str(),(int)menum); + ATH_MSG_INFO( buffer ); } - */ - + if ( m_secondTime ) { + auto fmom(momentNameToEnumMap.find("SECOND_TIME")); + sprintf(buffer,"moment name: %-*.*s - enumerator: %i (save only)",(int)nstr,(int)nstr,fmom->first.c_str(),(int)fmom->second); + ATH_MSG_INFO( buffer ); + } + + // retrieve CaloCell ID server CHECK(detStore()->retrieve(m_calo_id,"CaloCell_ID")); + // retrieve the calo depth tool CHECK(m_caloDepthTool.retrieve()); - if (m_calculateSignificance) { - ATH_CHECK(m_noiseCDOKey.initialize()); - } + // retrieve specific servers and tools for selected processes + if (m_calculateSignificance) { ATH_CHECK(m_noiseCDOKey.initialize()); } + if (m_calculateLArHVFraction) { ATH_CHECK(m_larHVFraction.retrieve()); } else { m_larHVFraction.disable(); } - if (m_calculateLArHVFraction) { - ATH_CHECK(m_larHVFraction.retrieve()); - } - else { - m_larHVFraction.disable(); - } return StatusCode::SUCCESS; - } StatusCode CaloClusterMomentsMaker::finalize() @@ -256,6 +262,7 @@ StatusCode CaloClusterMomentsMaker::finalize() namespace CaloClusterMomentsMaker_detail { + struct cellinfo { double x; double y; @@ -903,7 +910,7 @@ CaloClusterMomentsMaker::execute(const EventContext& ctx, } } } - + // normalize moments and copy to Cluster Moment Store size_t size= m_validMoments.size(); for (size_t iMoment = 0; iMoment != size; ++iMoment) { @@ -913,9 +920,11 @@ CaloClusterMomentsMaker::execute(const EventContext& ctx, if ( moment == xAOD::CaloCluster::FIRST_PHI ) myMoments[iMoment] = CaloPhiRange::fix(myMoments[iMoment]); theCluster->insertMoment(moment,myMoments[iMoment]); - } - } - } + } // loop on moments for cluster + } // check on requested moments + // check on second moment of time if requested + if ( m_secondTime ) { theCluster->insertMoment(xAOD::CaloCluster::SECOND_TIME,theCluster->secondTime()); } + } // loop on clusters return StatusCode::SUCCESS; } diff --git a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.h b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.h index 0f3622d0280b78d27007b6380495fe2ac22ed1a1..82e5f0e299c6a731c1ba19d2bc0100b80d725215 100644 --- a/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.h +++ b/Calorimeter/CaloRec/src/CaloClusterMomentsMaker.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ //Dear emacs, this is -*-c++-*- @@ -8,7 +8,8 @@ /** * @class CaloClusterMomentsMaker * @author Sven Menke <menke@mppmu.mpg.de> - * @date 28-February-2005 + * @author Peter Loch <loch@physics.arizona.edu> + * @date 23-March-2021 * @brief Calculate moments for CaloCluster objects * * This is a CaloClusterCollectionProcessor which can be plugged into a @@ -25,7 +26,10 @@ * Note that only cells with positive energy are used in this definition. * Common variables to calculate first and second moments of are * \f$\phi\f$, \f$\eta\f$, and radial and longitudinal distances from - * the shower axis and the shower center, respectively. */ + * the shower axis and the shower center, respectively. + * + * @since 23-March-2021: second moment of cell time distribution is calculated + */ #include "GaudiKernel/ToolHandle.h" @@ -133,6 +137,10 @@ class CaloClusterMomentsMaker: public AthAlgTool, virtual public CaloClusterColl * @brief if set to true use abs E value of cells to calculate * cluster moments */ bool m_absOpt; + + /** + * @brief Retreive second moment of cell times */ + bool m_secondTime = { false }; }; #endif // CALOCLUSTERMOMENTSMAKER_H diff --git a/Calorimeter/CaloRec/src/CaloTopoTowerFromClusterMaker.cxx b/Calorimeter/CaloRec/src/CaloTopoTowerFromClusterMaker.cxx index b3861bb3f862ca3ba15d134129f61c586380966b..563981cda3e3ee503b5c7a1cc44c919c666999ef 100644 --- a/Calorimeter/CaloRec/src/CaloTopoTowerFromClusterMaker.cxx +++ b/Calorimeter/CaloRec/src/CaloTopoTowerFromClusterMaker.cxx @@ -76,6 +76,7 @@ CaloTopoTowerFromClusterMaker::CaloTopoTowerFromClusterMaker(const std::string& declareProperty("DoCellIndexCheck", m_doCellIndexCheck, "Check cell hash indices for consistency"); declareProperty("BuildCombinedTopoSignal", m_buildCombinedSignal, "Build topo-clusters and topo-towers"); declareProperty("TopoClusterRange", m_clusterRange, "Rapidity range for using topo-clusters in combined signal mode"); + declareProperty("RemoveSamplingData", m_removeSamplingData, "Remove the associated sampling data"); } StatusCode CaloTopoTowerFromClusterMaker::initialize() @@ -183,6 +184,7 @@ StatusCode CaloTopoTowerFromClusterMaker::initialize() ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("BuildCombinedTopoSignal .... %s", blu[m_buildCombinedSignal].c_str()) ); ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("TopoClusterRange ........... %.2f", m_clusterRange) ); ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("ExcludedSamplings .......... %zu (number of)",m_excludedSamplingsName.size()) ); + ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("RemoveSamplingData ......... %s", blu[m_removeSamplingData].c_str()) ); return StatusCode::SUCCESS; } @@ -268,8 +270,11 @@ StatusCode CaloTopoTowerFromClusterMaker::execute(const EventContext& ctx, clptr->addCellLink(lptr); // transfer cell links to CaloCluster clptr->setClusterSize(csize); // set the cluster size spec CaloRec::Helpers::calculateKine(clptr,false); // calculate kinematics and other signals from cells - clptr->setEta0(m_towerGeometrySvc->towerEta(ipc)); // save the tower center eta - clptr->setPhi0(m_towerGeometrySvc->towerPhi(ipc)); // save the tower center phi + if ( m_removeSamplingData ) { // remove sampling data and invalidate tower center + clptr->clearSamplingData(); clptr->setEta0(0.); clptr->setPhi0(0.); + } else { // keep sampling data and valid tower center + clptr->setEta0(m_towerGeometrySvc->towerEta(ipc)); clptr->setPhi0(m_towerGeometrySvc->towerPhi(ipc)); + } } else { delete lptr; } diff --git a/Calorimeter/CaloRec/src/CaloTopoTowerFromClusterMaker.h b/Calorimeter/CaloRec/src/CaloTopoTowerFromClusterMaker.h index 9bfd45b6b7d50dcaba0513cb5351b7170a7e5084..328117f5b711b801d003af6879d9299c7c6ff401 100644 --- a/Calorimeter/CaloRec/src/CaloTopoTowerFromClusterMaker.h +++ b/Calorimeter/CaloRec/src/CaloTopoTowerFromClusterMaker.h @@ -69,6 +69,7 @@ private: bool m_buildCombinedSignal = { false }; ///< Build topo-clusters within given @f$ y @f$ range, else topo-towers double m_energyThreshold; ///< Cell energy threshold, default is set in @c m_energyThresholdDef double m_clusterRange; ///< Range where topo-clusters are used when <tt>m_buildCombinedSignal = true</tt> + bool m_removeSamplingData = { true }; ///< Remove sampling data for towers /// @} /// @name Constants and parameters diff --git a/Control/AthenaCommon/python/AthOptionsParser.py b/Control/AthenaCommon/python/AthOptionsParser.py index fc01a7ee194637c6e87a36434aca1f4618909e7f..5daf9bf6f761186b1928bc95b087bc17326d0b0c 100644 --- a/Control/AthenaCommon/python/AthOptionsParser.py +++ b/Control/AthenaCommon/python/AthOptionsParser.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # @file AthenaCommon.AthOptionsParser # @purpose the central module to parse command line options of athena.py @@ -30,7 +30,7 @@ _userlongopts = [ "enable-ers-hdlr=", "keep-configuration","drop-configuration", "drop-and-reload", "config-only=", "dump-configuration=", - "tcmalloc", "stdcmalloc", "stdcmath", "imf", "preloadlib=", + "tcmalloc", "stdcmalloc", "stdcmath", "imf", "exctrace", "preloadlib=", "nprocs=", "debugWorker", "pycintex_minvmem=", "cppyy_minvmem", @@ -94,6 +94,7 @@ Accepted command line options: --tcmalloc ... use tcmalloc.so for memory allocation [DEFAULT]. This disables leak-check --stdcmalloc ... use libc malloc for memory allocation --stdcmath ... use glibc math functions [DEFAULT] + --exctrace ... enable collecting tracebacks for exceptions --imf ... use Intel Math Function library: faster, but may give different numerical results from --stdcmath --preloadlib=<lib> ... localized preload of library <lib> --nprocs=n ... enable AthenaMP if n>=1 or n==-1 diff --git a/Control/AthenaCommon/share/athena.py b/Control/AthenaCommon/share/athena.py index 2140470dc9019f10a9995a392aee570bab31447b..088d1d09fc8cbf1bac7e5e878b4160ddd022ee64 100755 --- a/Control/AthenaCommon/share/athena.py +++ b/Control/AthenaCommon/share/athena.py @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # # athena.py is born as shell script to preload some optional libraries # @@ -9,6 +9,7 @@ # defaults export USETCMALLOC=0 export USEIMF=0 +export USEEXCTRACE=0 USECA=0 otherargs="" # but use tcmalloc by default if TCMALLOCDIR is defined @@ -26,6 +27,7 @@ do --tcmalloc) USETCMALLOC=1;; --stdcmath) USEIMF=0;; --imf) USEIMF=1;; + --exctrace) USEEXCTRACE=1;; --preloadlib*) export ATHENA_ADD_PRELOAD=${a#*=};; --drop-and-reload) ATHENA_DROP_RELOAD=1;; --CA) USECA=1;; @@ -33,6 +35,7 @@ do esac done + # Do the actual preloading via LD_PRELOAD source `which athena_preload.sh ` diff --git a/Control/AthenaCommon/share/athena_preload.sh b/Control/AthenaCommon/share/athena_preload.sh index 32bb6f5a0986c752ec349672a1b08d59bfb065c2..9e655fd2cead7b7156e0b735b56b2ea837bb68ee 100755 --- a/Control/AthenaCommon/share/athena_preload.sh +++ b/Control/AthenaCommon/share/athena_preload.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # # Script to set $LD_PRELOAD, steered by the following environment variables: # @@ -9,6 +9,7 @@ # $USETCMALLOCMINIMAL : use minimal version of tcmalloc # $ATLASMKLLIBDIR_PRELOAD : location of Intel math library # $USEIMF : use Intel math library +# $USEEXCTRACE : preload exception trace collector # $ATHENA_ADD_PRELOAD : preload user specific library # $ATHENA_DROP_RELOAD : are we in drop/reload mode? # @@ -81,6 +82,20 @@ if [ "$USEIMF" = "1" ] || [ "$USEIMF" = "true" ]; then fi fi +# +# Exception trace collector +# +if [ "$USEEXCTRACE" = "1" ] || [ "$USEEXCTRACE" = "true" ]; then + # Abuse which to search for the library. + EXCTRACE_LIB=`PATH=$LD_LIBRARY_PATH /usr/bin/which libexctrace_collector.so` + if [ "$EXCTRACE_LIB" = "" ]; then + error "ERROR: Cannot find libexctrace_collector.so" + exit 1 + fi + echo "Preloading `basename $EXCTRACE_LIB`" + ld_preload "$EXCTRACE_LIB" +fi + # # User specific preload # diff --git a/DataQuality/DataQualityConfigurations/config/HLT/HLTminbias/collisions_run.config b/DataQuality/DataQualityConfigurations/config/HLT/HLTminbias/collisions_run.config index 7b347a2a42d1e4ae4076dac766241be8f316ff4f..08b5c811f36d3f246db7bcefe579f76f784e8097 100644 --- a/DataQuality/DataQualityConfigurations/config/HLT/HLTminbias/collisions_run.config +++ b/DataQuality/DataQualityConfigurations/config/HLT/HLTminbias/collisions_run.config @@ -90,27 +90,38 @@ dir HLT { } dir Tracking { dir HLT_mb_sptrk_L1RD0_FILLED { - hist efficiency_low_mult { + hist efficiencyLowMult { output = HLT/Run3/TRMBI/SHIFTER - description = "Normal: Quick rise to almost 100% for 1,2 tracks, no eff. drop for higher multiplicities" + description = Normal: Quick rise to almost 100% for 1,2 tracks, no eff. drop for higher multiplicities } + hist nTrkOfflineLowMult { + output = HLT/Run3/TRMBI/SHIFTER + description = Normal: Quick rise to almost 100% for 1,2 tracks, no eff. drop for higher multiplicities + } + hist nTrkOnlineLowMult { + output = HLT/Run3/TRMBI/SHIFTER + description = Normal: Sharp rise at ntrk ==1, (literally has to be a step function) + } + } dir HLT_mb_sp.* { - hist efficiency_low_mult { - output = HLT/Run3/TRMBI/SHIFTER/SPTRK - description = "Normal: Quick rise to almost 100% for 1,2 tracks, no eff. drop for higher multiplicities" - } hist nTrkRatio { output = HLT/Run3/TRMBI/EXPERT/SPTRK - description = "Normal: narrow peak slightly below 1 (0.9), if much below it means online tracking has to many fakes" - + description = Normal: narrow peak slightly below 1 (0.9), if much below it means online tracking has to many fakes } } dir HLT_.*hmt.* { - hist nTrkOffline_vs_decision { + hist efficiencyAnyMult { output = HLT/Run3/TRMBI/SHIFTER/SPTRK - description = "Normal: Typical trigger turn-on, should be reaching max around the threshold specified in the trigger name" - + description = Normal: Typical trigger turn-on, should be reaching max around the threshold specified in the trigger name + } + hist nTrkOnline { + output = HLT/Run3/TRMBI/EXPERT/SPTRK + description = Normal: exponent like distribution with a hard cut from the left side + } + hist nTrkOffline { + output = HLT/Run3/TRMBI/EXPERT/SPTRK + description = Normal: exponent like distribution with a soft cut from the left side } } } diff --git a/DataQuality/DataQualityConfigurations/config/Tau/collisions_run.config b/DataQuality/DataQualityConfigurations/config/Tau/collisions_run.config index 3310343ca42a4433ae24246d6fffa0b9cdbb8cc0..b2c0b7329c1ca149f0059283dd1095da0ca66665 100644 --- a/DataQuality/DataQualityConfigurations/config/Tau/collisions_run.config +++ b/DataQuality/DataQualityConfigurations/config/Tau/collisions_run.config @@ -13,17 +13,25 @@ output top_level { output Tau { + output Calo { + } + output Physics { + output Z { + } + output W { + } + } + output Track { + } output TauB { output Calo { } output Track { } output Identification { - output tauJetBDTinputs { - } - output EleVetoBDTinputs { - } - output BDTLoose15GeV { + output RNNLoose { + } + output RNNMedium { } } output SubStructure { @@ -35,11 +43,9 @@ output top_level { output Track { } output Identification { - output tauJetBDTinputs { - } - output EleVetoBDTinputs { - } - output BDTLoose15GeV { + output RNNLoose { + } + output RNNMedium { } } output SubStructure { @@ -51,39 +57,27 @@ output top_level { output Track { } output Identification { - output tauJetBDTinputs { - } - output EleVetoBDTinputs { - } - output BDTLoose15GeV { + output RNNLoose { + } + output RNNMedium { } } output SubStructure { } } output Trigger { - output TauTrig { - output Calo { - } - output Track { - } - output Identification { - output tauJetBDTinputs { - } - output EleVetoBDTinputs { - } - output BDTLoose15GeV { - } - } - output SubStructure { - } - } - output JetTrig { - } - output EleTrig { - } + output TauTrig1 { + } + output EleTrig { + } + output JetTrig { + } + + + } + # output Expert { # output TauMerged { # } @@ -104,44 +98,18 @@ dir Tau { display = StatBox } - hist nHighPtTauCandidates { - algorithm = tauHists_Chi2NDF + hist tauCharge { + algorithm = tauHists_Chi2NDF_noEmpty display = StatBox,LogY } - hist tauPhi { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist tauEta { + hist RNNJetScore { algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist tauPhiVsEta { - algorithm = tauHists_Chi2Scatter - display = StatBox - } - - hist tauPhiVsEtaEt15 { - algorithm = tauHists_Chi2Scatter/Loose - display = StatBox - } - - hist tauPhiVsEtaEt15BDTLoose { - algorithm = tauHists_Chi2Scatter/Loose - display = StatBox - } - - hist tauCharge { - algorithm = tauHists_Chi2NDF_noEmpty display = StatBox,LogY } - hist nTauCandidates { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY + hist RNNJetScoreSigTrans { + display = StatBox,LogY } hist tauEt { @@ -149,27 +117,27 @@ dir Tau { display = StatBox,LogY } - hist tauEtVsPhi { - algorithm = tauHists_Chi2Scatter - display = StatBox + hist tauEta { + algorithm = tauHists_Chi2NDF + display = StatBox } - hist tauEtVsEta { - algorithm = tauHists_Chi2Scatter + hist tauEtaVsLB { + algorithm = tauHists_Chi2Scatter/Loose display = StatBox } - hist tauEtVsLB { - algorithm = tauHists_Chi2Scatter/Loose + hist tauPhi { + algorithm = tauHists_Chi2NDF display = StatBox } - - hist tauEtaVsLB { - algorithm = tauHists_Chi2Scatter/Loose + hist tauPhiVsEta { + algorithm = tauHists_Chi2Scatter display = StatBox } + hist tauPhiVsLB { algorithm = tauHists_Chi2Scatter/Loose display = StatBox @@ -180,145 +148,402 @@ dir Tau { display = StatBox } - hist NumTracks { + hist tauNumTracks { algorithm = tauHists_Chi2NDF display = StatBox } - hist NumCoreTrkVsLB { - algorithm = tauHists_Chi2Scatter/veryLoose + hist nCluster { + algorithm = tauHists_Chi2NDF/veryLoose display = StatBox } - - hist nCluster { - algorithm = tauHists_Chi2NDF/veryLoose + hist tauEtVsEta { + algorithm = tauHists_Chi2Scatter display = StatBox } - hist PtTESMVA { + hist tauEtVsPhi { + algorithm = tauHists_Chi2Scatter + display = StatBox + } + + + hist nTauCandidates { algorithm = tauHists_Chi2NDF - display = StatBox + display = StatBox,LogY } - hist Ptcombined { + + hist nHighPtTauCandidates { algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } + + + hist tauPhiVsEta_et15 { + algorithm = tauHists_Chi2Scatter/Loose display = StatBox } - dir TauB { - output = Tau/TauB + hist tauPhiVsEta_et15_RNNLoose { + algorithm = tauHists_Chi2Scatter/Loose + display = StatBox + } + + + dir Calo { + output = Tau/Calo algorithm = tauHists_Chi2NDF_noEmpty hist all_in_dir { display = StatBox } - hist Tau_TauB_tauPhiVsEta { - algorithm = tauHists_Chi2Scatter - display = StatBox + hist Tau_Calo_EMRadius { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY } - hist Tau_TauB_tauEtaVsLB { - algorithm = tauHists_Chi2Scatter - display = StatBox + hist Tau_Calo_hadRadius { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY + } + + hist Tau_Calo_stripWidth2 { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY } - hist Tau_TauB_tauPhiVsLB { - algorithm = tauHists_Chi2Scatter + hist Tau_Calo_isolFrac { + algorithm = tauHists_Chi2NDF_noEmpty display = StatBox + } + + hist Tau_Calo_nStrip { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } + + hist Tau_Calo_etEMAtEMScale { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY } - hist Tau_TauB_tauEtaVsLBet15BDTLoose { - algorithm = tauHists_Chi2Scatter/Loose + hist Tau_Calo_etHadAtEMScale { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY + } + + hist Tau_Calo_centFracVsLB { + algorithm = tauHists_Chi2Scatter_noEmpty display = StatBox } - hist Tau_TauB_tauPhiVsLBet15BDTLoose { - algorithm = tauHists_Chi2Scatter/Loose + hist Tau_Calo_isolFracVsLB { + algorithm = tauHists_Chi2Scatter_noEmpty + display = StatBox + } + + hist Tau_Calo_centralityFraction { +# algorithm = tauHists_Chi2NDF + display = StatBox + } + + hist Tau_Calo_dRmax { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } + + hist Tau_Calo_eta { + algorithm = tauHists_Chi2NDF + display = StatBox + } + + hist Tau_Calo_phi { + algorithm = tauHists_Chi2NDF + display = StatBox + } + + hist Tau_Calo_trkAvgDist { + algorithm = tauHists_Chi2NDF + display = StatBox + } + } + + dir Track { + output = Tau/Track + algorithm = tauHists_Chi2NDF/noMatch + + hist all_in_dir { display = StatBox } - hist Tau_TauB_nTauCandidates { + hist Tau_Track_leadTrkPt { algorithm = tauHists_Chi2NDF display = StatBox,LogY } - hist Tau_TauB_tauCharge { + hist Tau_Track_trkWidth2 { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } + hist Tau_Track_trkWidth2 { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } + + hist Tau_Track_ipZ0SinThetaSigLeadTrk { algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox + } + + hist Tau_Track_etOverPtLeadTrk { + algorithm = tauHists_Chi2NDF display = StatBox,LogY } - hist Tau_TauB_tauEt { + hist Tau_Track_ipSigLeadTrk { algorithm = tauHists_Chi2NDF display = StatBox,LogY } - hist Tau_TauB_tauEta { + hist Tau_Track_massTrkSys { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } + + hist Tau_Track_trFlightPathSig { algorithm = tauHists_Chi2NDF + display = StatBox + } + + hist Tau_Track_numberOfSCTHits { + display = StatBox,LogY + } + + + hist Tau_Track_numberOfPixelHits { + display = StatBox,LogY + } + + + hist Tau_Track_numberOfTRTHits { + display = StatBox,LogY + } + + hist Tau_Track_numberOfTRTHighThresholdHits { + display = StatBox,LogY + } + + hist Tau_Track_numberOfTRTHighThresholdOutliers { + display = StatBox,LogY + } + + hist Tau_Track_numberOfTRTOutliers { + display = StatBox,LogY + } + + + hist Tau_Track_d0 { + algorithm = tauHists_Chi2NDF_noEmpty/veryLoose + display = StatBox,<AxisRange(-5,5,"X")>,LogY + } + + hist Tau_Track_eta { + algorithm = tauHists_Chi2NDF/Loose display = StatBox } - hist Tau_TauB_tauPhi { + hist Tau_Track_pT { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } + + + hist Tau_Track_phi { algorithm = tauHists_Chi2NDF display = StatBox } - - dir Calo { - output = Tau/TauB/Calo - algorithm = tauHists_Chi2NDF_noEmpty - hist all_in_dir { - display = StatBox - } - hist Tau_TauB_Calo_jetSeedPt { - algorithm = tauHists_Chi2NDF - display = StatBox - } + hist Tau_Track_z0 { + algorithm = tauHists_Chi2NDF + display = StatBox + } + hist Tau_Track_nHighPtTaus { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } - hist Tau_TauB_Calo_jetSeedEta { - algorithm = tauHists_Chi2NDF + } + + dir Physics { + output = Tau/Physics + algorithm = tauHists_Chi2NDF/noMatch + + hist all_in_dir { + display = StatBox + } + + dir W { + output = Tau/Physics/W + algorithm = tauHists_Chi2NDF/noMatch + + hist all_in_dir { display = StatBox } - hist Tau_TauB_Calo_jetSeedPhi { + hist tau_pTVsEta { algorithm = tauHists_Chi2NDF display = StatBox - } - - hist Tau_TauB_Calo_etEMAtEMScale { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY } - hist Tau_TauB_Calo_etHadAtEMScale { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY - } + } - hist Tau_TauB_Calo_EMRadius { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY + dir Z { + output = Tau/Physics/Z + algorithm = tauHists_Chi2NDF/noMatch + + hist all_in_dir { + display = StatBox } - hist Tau_TauB_Calo_hadRadius { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY + hist tau_eta { + algorithm = tauHists_Chi2NDF + display = StatBox } - hist Tau_TauB_Calo_isolFrac { - algorithm = tauHists_Chi2NDF_noEmpty + hist tau_pTVsEta { + algorithm = tauHists_Chi2NDF display = StatBox - } + } - hist Tau_TauB_Calo_nStrip { + hist lepton_pTVsEta { algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } + display = StatBox + } - hist Tau_TauB_Calo_stripWidth2 { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY + } + + } + + + dir TauB { + output = Tau/TauB + algorithm = tauHists_Chi2NDF_noEmpty + hist all_in_dir { + display = StatBox + } + + hist Tau_TauB_tauCharge { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY + } + + hist Tau_TauB_RNNJetScore { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } + + hist Tau_TauB_RNNJetScoreSigTrans { + display = StatBox,LogY + } + + hist Tau_TauB_tauEt { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } + + hist Tau_TauB_tauEta { + algorithm = tauHists_Chi2NDF + display = StatBox + } + + hist Tau_TauB_tauEtaVsLB { + algorithm = tauHists_Chi2Scatter + display = StatBox + } + + + hist Tau_TauB_tauPhi { + algorithm = tauHists_Chi2NDF + display = StatBox + } + + + hist Tau_TauB_tauPhiVsEta { + algorithm = tauHists_Chi2Scatter + display = StatBox + } + + hist Tau_TauB_tauPhiVsLB { + algorithm = tauHists_Chi2Scatter + display = StatBox + } + + + hist Tau_TauB_nTauCandidates { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } + + + dir Calo { + output = Tau/TauB/Calo + algorithm = tauHists_Chi2NDF_noEmpty + hist all_in_dir { + display = StatBox + } + + hist Tau_TauB_Calo_jetSeedEta { + algorithm = tauHists_Chi2NDF + display = StatBox + } + + hist Tau_TauB_Calo_jetSeedPhi { + algorithm = tauHists_Chi2NDF + display = StatBox + } + + + hist Tau_TauB_Calo_jetSeedPt { + algorithm = tauHists_Chi2NDF + display = StatBox + } + + hist Tau_TauB_Calo_EMRadius { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY + } + + hist Tau_TauB_Calo_hadRadius { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY + } + + hist Tau_TauB_Calo_stripWidth2 { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY + } + + hist Tau_TauB_Calo_isolFrac { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox + } + + hist Tau_TauB_Calo_nStrip { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } + + hist Tau_TauB_Calo_etEMAtEMScale { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY + } + + hist Tau_TauB_Calo_etHadAtEMScale { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY } hist Tau_TauB_Calo_CentFracVsLB { @@ -330,109 +555,90 @@ dir Tau { algorithm = tauHists_Chi2Scatter_noEmpty display = StatBox } - } - dir Track { - output = Tau/TauB/Track - algorithm = tauHists_Chi2NDF/noMatch - - hist all_in_dir { + hist Tau_TauB_Calo_centralityFraction { +# algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauB_Track_pT { + hist Tau_TauB_Calo_dRmax { algorithm = tauHists_Chi2NDF display = StatBox,LogY } - hist Tau_TauB_Track_eta { - algorithm = tauHists_Chi2NDF/Loose + hist Tau_TauB_Calo_eta { + algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauB_Track_phi { + hist Tau_TauB_Calo_phi { algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauB_Track_leadTrkPt { + hist Tau_TauB_Calo_trkAvgDist { algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauB_Track_nHighPTtaus { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauB_Track_dRJetSeedAxis { - display = StatBox + display = StatBox } - hist Tau_TauB_Track_d0 { - algorithm = tauHists_Chi2NDF_noEmpty/veryLoose - display = StatBox,<AxisRange(-5,5,"X")>,LogY - } + } - hist Tau_TauB_Track_z0TJVA { - display = StatBox,<AxisRange(-35,35,"X")>,LogY + dir Track { + output = Tau/TauB/Track + algorithm = tauHists_Chi2NDF/noMatch + + hist all_in_dir { + display = StatBox } - hist Tau_TauB_Track_z0PriVtx { - display = StatBox,<AxisRange(-35,35,"X")>,LogY + hist Tau_TauB_Track_leadTrkPt { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY } hist Tau_TauB_Track_trkWidth2 { algorithm = tauHists_Chi2NDF display = StatBox,LogY } - - hist Tau_TauB_Track_rConv { - display = StatBox,LogY - } - - hist Tau_TauB_Track_rConvII { + hist Tau_TauB_Track_trkWidth2 { + algorithm = tauHists_Chi2NDF display = StatBox,LogY } - + hist Tau_TauB_Track_ipZ0SinThetaSigLeadTrk { algorithm = tauHists_Chi2NDF_noEmpty display = StatBox } - hist Tau_TauB_Track_leadTrackDeltaEta { - algorithm = tauHists_Chi2NDF + hist Tau_TauB_Track_etOverPtLeadTrk { +# algorithm = tauHists_Chi2NDF display = StatBox,LogY } - - hist Tau_TauB_Track_leadTrackDeltaPhi { + + hist Tau_TauB_Track_ipSigLeadTrk { algorithm = tauHists_Chi2NDF display = StatBox,LogY } - - hist Tau_TauB_Track_eProbabilityHT { - display = StatBox - } - - hist Tau_TauB_Track_numberOfPixelHits { - display = StatBox,LogY - } - hist Tau_TauB_Track_numberOfPixelSharedHits { + hist Tau_TauB_Track_massTrkSys { + algorithm = tauHists_Chi2NDF display = StatBox,LogY } - hist Tau_TauB_Track_numberOfInnermostPixelLayerHits { - display = StatBox,LogY + hist Tau_TauB_Track_trFlightPathSig { +# algorithm = tauHists_Chi2NDF + display = StatBox } hist Tau_TauB_Track_numberOfSCTHits { display = StatBox,LogY } - hist Tau_TauB_Track_numberOfSCTSharedHits { + + hist Tau_TauB_Track_numberOfPixelHits { display = StatBox,LogY - } + } + hist Tau_TauB_Track_numberOfTRTHits { display = StatBox,LogY @@ -449,187 +655,118 @@ dir Tau { hist Tau_TauB_Track_numberOfTRTOutliers { display = StatBox,LogY } - - hist Tau_TauB_Track_z0VsLB { - display = StatBox,<AxisRange(-35,35,"Y")> - } - - } - dir Identification { - output = Tau/TauB/Identification - algorthm = tauHists_Chi2NDF_noEmpty - hist all_in_dir { - display = StatBox - } - hist Tau_TauB_Identification_tauBDTLoose { - algorithm = tauHists_Chi2NDF/Loose - display = StatBox + hist Tau_TauB_Track_d0 { + algorithm = tauHists_Chi2NDF_noEmpty/veryLoose + display = StatBox,<AxisRange(-5,5,"X")>,LogY } - hist Tau_TauB_Identification_tauBDTMedium { + hist Tau_TauB_Track_eta { algorithm = tauHists_Chi2NDF/Loose - display = StatBox - } + display = StatBox + } - hist Tau_TauB_Identification_tauBDTTight { - algorithm = tauHists_Chi2NDF - display = StatBox + hist Tau_TauB_Track_pT { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY } - hist Tau_TauB_Identification_BDTEleScoreSigTrans { - algorithm = tauHists_Chi2NDF_noEmpty + + hist Tau_TauB_Track_phi { + algorithm = tauHists_Chi2NDF display = StatBox - } + } + + hist Tau_TauB_Track_z0 { + algorithm = tauHists_Chi2NDF + display = StatBox + } - hist Tau_TauB_Identification_BDTJetScore { + hist Tau_TauB_Track_nHighPtTaus { algorithm = tauHists_Chi2NDF display = StatBox,LogY } - hist Tau_TauB_Identification_BDTJetScoreSigTrans { - display = StatBox,LogY - } + + } - hist Tau_TauB_Identification_muonVeto { + dir Identification { + output = Tau/TauB/Identification + algorthm = tauHists_Chi2NDF_noEmpty + hist all_in_dir { display = StatBox } - hist Tau_TauB_Identification_eleBDTMedium { - algorithm = tauHists_Chi2NDF/veryLoose - display = StatBox + hist Tau_TauB_Identification_tauRNNLoose { + algorithm = tauHists_Chi2NDF/Loose + display = StatBox } - hist Tau_TauB_Identification_eleBDTTight { + hist Tau_TauB_Identification_tauRNNMedium { algorithm = tauHists_Chi2NDF/Loose - display = StatBox + display = StatBox } - dir tauJetBDTinputs { - output = Tau/TauB/Identification/tauJetBDTinputs - algoithm = tauHists_Chi2NDF_noEmpty + hist Tau_TauB_Identification_muonVeto { + display = StatBox + } - hist Tau_TauB_Identification_tauJetBDTinputs_CentFrac { -# algorithm = tauHists_Chi2NDF + dir RNNLoose { + output = Tau/TauB/Identification/RNNLoose + algorithm = tauHists_Chi2NDF + hist all_in_dir { display = StatBox } - hist Tau_TauB_Identification_tauJetBDTinputs_dRmax { + hist Tau_TauB_Identification_RNNLoose_phi { algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } + display = StatBox + } - hist Tau_TauB_Identification_tauJetBDTinputs_trkAvgDist { + hist Tau_TauB_Identification_RNNLoose_eta { algorithm = tauHists_Chi2NDF display = StatBox - } + } - hist Tau_TauB_Identification_tauJetBDTinputs_SumPtTrkFrac { + hist Tau_TauB_Identification_RNNLoose_et { algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauB_Identification_tauJetBDTinputs_etOverPtLeadTrk { -# algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } + display = StatBox + } - hist Tau_TauB_Identification_tauJetBDTinputs_absipSigLeadTrk { + hist Tau_TauB_Identification_RNNLoose_NumTracks { algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauB_Identification_tauJetBDTinputs_trFlightPathSig { -# algorithm = tauHists_Chi2NDF display = StatBox - } + } + } - hist Tau_TauB_Identification_tauJetBDTinputs_massTrkSys { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } + dir RNNMedium { - hist Tau_TauB_Identification_tauJetBDTinputs_EMPOverTrkSysP { -# algorithm = tauHists_Chi2NDF + output = Tau/TauB/Identification/RNNMedium + algorithm = tauHists_Chi2NDF + hist all_in_dir { display = StatBox } - hist Tau_TauB_Identification_tauJetBDTinputs_mEflowApprox { -# algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauB_Identification_tauJetBDTinputs_ptRatioEflowApprox { -# algorithm = tauHists_Chi2NDF + hist Tau_TauB_Identification_RNNMedium_phi { + algorithm = tauHists_Chi2NDF display = StatBox - } + } - hist Tau_TauB_Identification_tauJetBDTinputs_ptIntermediateAxis { + hist Tau_TauB_Identification_RNNMedium_eta { algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - } - - dir EleVetoBDTinputs { - output = Tau/TauB/Identification/EleVetoBDTinputs - algoithm = tauHists_Chi2NDF_noEmpty - - hist Tau_TauB_Identification_EleVetoBDTinputs_etHotShotWinOverPtLeadTrk { -# algorithm = tauHists_Chi2NDF display = StatBox - } - - hist Tau_TauB_Identification_EleVetoBDTinputs_EMFracFixed { -# algorithm = tauHists_Chi2NDF - display = StatBox - } + } - hist Tau_TauB_Identification_EleVetoBDTinputs_hadLeakFracFixed { -# algorithm = tauHists_Chi2NDF + hist Tau_TauB_Identification_RNNMedium_et { + algorithm = tauHists_Chi2NDF display = StatBox - } + } - hist Tau_TauB_Identification_EleVetoBDTinputs_PSSFrac { -# algorithm = tauHists_Chi2NDF + hist Tau_TauB_Identification_RNNMedium_NumTracks { + algorithm = tauHists_Chi2NDF display = StatBox - } - } - - dir BDTLoose15GeV { - output = Tau/TauB/Identification/BDTLoose15GeV - algoithm = tauHists_Chi2NDF - - hist Tau_TauB_Identification_BDTLoose15GeV_et { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauB_Identification_BDTLoose15GeV_eta { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauB_Identification_BDTLoose15GeV_phi { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauB_Identification_BDTLoose15GeV_numTracks { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauB_Identification_BDTLoose15GeV_nCluster { - algorithm = tauHists_Chi2NDF/Loose - display = StatBox,LogY - } - - hist Tau_TauB_Identification_BDTLoose15GeV_PanMode { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - + } } } @@ -641,12 +778,17 @@ dir Tau { display = StatBox } - hist Tau_TauB_SubStructure_nShot { - algorithm = tauHists_Chi2NDF + hist Tau_TauB_SubStructure_shots_pt3 { + algorithm = tauHists_Chi2NDF_noEmpty display = StatBox,LogY - } - - hist Tau_TauB_SubStructure_InvMassEffClusters { + } + + hist Tau_TauB_SubStructure_BDTscoreAsP0 { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox + } + + hist Tau_TauB_SubStructure_EMFracTrk { algorithm = tauHists_Chi2NDF_noEmpty display = StatBox } @@ -661,12 +803,7 @@ dir Tau { display = StatBox } - hist Tau_TauB_SubStructure_shots_pt3 { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY - } - - hist Tau_TauB_SubStructure_EMFracTrk { + hist Tau_TauB_SubStructure_InvMassEffClusters { algorithm = tauHists_Chi2NDF_noEmpty display = StatBox } @@ -676,27 +813,37 @@ dir Tau { display = StatBox,LogY } - hist Tau_TauB_SubStructure_BDTscoreAsP0 { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox + hist Tau_TauB_SubStructure_nShot { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } + + hist Tau_TauB_SubStructure_PSSFracEffCluster { + algorithm = tauHists_Chi2NDF + display = StatBox } - + + hist Tau_TauB_SubStructure_ptRatioApprox { + algorithm = tauHists_Chi2NDF + display = StatBox + } + hist Tau_TauB_SubStructure_PanMode { algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauB_SubStructure_PanPt { + hist Tau_TauB_SubStructure_PanEta { algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauB_SubStructure_PanEta { + hist Tau_TauB_SubStructure_PanPhi { algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauB_SubStructure_PanPhi { + hist Tau_TauB_SubStructure_PanPt { algorithm = tauHists_Chi2NDF display = StatBox } @@ -711,38 +858,17 @@ dir Tau { display = StatBox } - hist Tau_TauCR_tauPhiVsEta { - algorithm = tauHists_Chi2Scatter - display = StatBox - } - - hist Tau_TauCR_tauEtaVsLB { - algorithm = tauHists_Chi2Scatter - display = StatBox - } - - hist Tau_TauCR_tauPhiVsLB { - algorithm = tauHists_Chi2Scatter - display = StatBox - } - - hist Tau_TauCR_tauEtaVsLBet15BDTLoose { - algorithm = tauHists_Chi2Scatter/Loose - display = StatBox - } - - hist Tau_TauCR_tauPhiVsLBet15BDTLoose { - algorithm = tauHists_Chi2Scatter/Loose - display = StatBox + hist Tau_TauB_tauCharge { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY } - hist Tau_TauCR_nTauCandidates { + hist Tau_TauCR_RNNJetScore { algorithm = tauHists_Chi2NDF display = StatBox,LogY } - hist Tau_TauCR_tauCharge { - algorithm = tauHists_Chi2NDF_noEmpty + hist Tau_TauCR_RNNJetScoreSigTrans { display = StatBox,LogY } @@ -756,10 +882,35 @@ dir Tau { display = StatBox } + hist Tau_TauCR_tauEtaVsLB { + algorithm = tauHists_Chi2Scatter + display = StatBox + } + + hist Tau_TauCR_tauPhi { algorithm = tauHists_Chi2NDF display = StatBox } + + + hist Tau_TauCR_tauPhiVsEta { + algorithm = tauHists_Chi2Scatter + display = StatBox + } + + hist Tau_TauCR_tauPhiVsLB { + algorithm = tauHists_Chi2Scatter + display = StatBox + } + + + hist Tau_TauCR_nTauCandidates { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } + + dir Calo { output = Tau/TauCR/Calo @@ -767,13 +918,6 @@ dir Tau { hist all_in_dir { display = StatBox } - - hist Tau_TauCR_Calo_jetSeedPt { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauCR_Calo_jetSeedEta { algorithm = tauHists_Chi2NDF display = StatBox @@ -784,14 +928,10 @@ dir Tau { display = StatBox } - hist Tau_TauCR_Calo_etEMAtEMScale { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY - } - hist Tau_TauCR_Calo_etHadAtEMScale { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY + hist Tau_TauCR_Calo_jetSeedPt { + algorithm = tauHists_Chi2NDF + display = StatBox } hist Tau_TauCR_Calo_EMRadius { @@ -804,6 +944,11 @@ dir Tau { display = StatBox,LogY } + hist Tau_TauCR_Calo_stripWidth2 { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY + } + hist Tau_TauCR_Calo_isolFrac { algorithm = tauHists_Chi2NDF_noEmpty display = StatBox @@ -814,7 +959,12 @@ dir Tau { display = StatBox,LogY } - hist Tau_TauCR_Calo_stripWidth2 { + hist Tau_TauCR_Calo_etEMAtEMScale { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY + } + + hist Tau_TauCR_Calo_etHadAtEMScale { algorithm = tauHists_Chi2NDF_noEmpty display = StatBox,LogY } @@ -828,109 +978,90 @@ dir Tau { algorithm = tauHists_Chi2Scatter_noEmpty display = StatBox } - } - dir Track { - output = Tau/TauCR/Track - algorithm = tauHists_Chi2NDF/noMatch - - hist all_in_dir { + hist Tau_TauCR_Calo_centralityFraction { +# algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauCR_Track_pT { + hist Tau_TauCR_Calo_dRmax { algorithm = tauHists_Chi2NDF display = StatBox,LogY } - hist Tau_TauCR_Track_eta { - algorithm = tauHists_Chi2NDF/Loose + hist Tau_TauCR_Calo_eta { + algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauCR_Track_phi { + hist Tau_TauCR_Calo_phi { algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauCR_Track_leadTrkPt { + hist Tau_TauCR_Calo_trkAvgDist { algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauCR_Track_nHighPTtaus { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauCR_Track_dRJetSeedAxis { - display = StatBox + display = StatBox } - hist Tau_TauCR_Track_d0 { - algorithm = tauHists_Chi2NDF_noEmpty/veryLoose - display = StatBox,<AxisRange(-5,5,"X")>,LogY - } + } - hist Tau_TauCR_Track_z0TJVA { - display = StatBox,<AxisRange(-35,35,"X")>,LogY + dir Track { + output = Tau/TauCR/Track + algorithm = tauHists_Chi2NDF/noMatch + + hist all_in_dir { + display = StatBox } - hist Tau_TauCR_Track_z0PriVtx { - display = StatBox,<AxisRange(-35,35,"X")>,LogY + hist Tau_TauCR_Track_leadTrkPt { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY } hist Tau_TauCR_Track_trkWidth2 { algorithm = tauHists_Chi2NDF display = StatBox,LogY } - - hist Tau_TauCR_Track_rConv { - display = StatBox,LogY - } - - hist Tau_TauCR_Track_rConvII { + hist Tau_TauCR_Track_trkWidth2 { + algorithm = tauHists_Chi2NDF display = StatBox,LogY } - + hist Tau_TauCR_Track_ipZ0SinThetaSigLeadTrk { algorithm = tauHists_Chi2NDF_noEmpty display = StatBox } - hist Tau_TauCR_Track_leadTrackDeltaEta { - algorithm = tauHists_Chi2NDF + hist Tau_TauCR_Track_etOverPtLeadTrk { +# algorithm = tauHists_Chi2NDF display = StatBox,LogY } - - hist Tau_TauCR_Track_leadTrackDeltaPhi { + + hist Tau_TauCR_Track_ipSigLeadTrk { algorithm = tauHists_Chi2NDF display = StatBox,LogY } - - hist Tau_TauCR_Track_eProbabilityHT { - display = StatBox - } - - hist Tau_TauCR_Track_numberOfPixelHits { - display = StatBox,LogY - } - hist Tau_TauCR_Track_numberOfPixelSharedHits { + hist Tau_TauCR_Track_massTrkSys { + algorithm = tauHists_Chi2NDF display = StatBox,LogY } - hist Tau_TauCR_Track_numberOfInnermostPixelLayerHits { - display = StatBox,LogY + hist Tau_TauCR_Track_trFlightPathSig { +# algorithm = tauHists_Chi2NDF + display = StatBox } hist Tau_TauCR_Track_numberOfSCTHits { display = StatBox,LogY } - hist Tau_TauCR_Track_numberOfSCTSharedHits { + + hist Tau_TauCR_Track_numberOfPixelHits { display = StatBox,LogY - } + } + hist Tau_TauCR_Track_numberOfTRTHits { display = StatBox,LogY @@ -947,9 +1078,37 @@ dir Tau { hist Tau_TauCR_Track_numberOfTRTOutliers { display = StatBox,LogY } - - hist Tau_TauCR_Track_z0VsLB { - display = StatBox,<AxisRange(-35,35,"Y")> + + + hist Tau_TauCR_Track_d0 { + algorithm = tauHists_Chi2NDF_noEmpty/veryLoose + display = StatBox,<AxisRange(-5,5,"X")>,LogY + } + + hist Tau_TauCR_Track_eta { + algorithm = tauHists_Chi2NDF/Loose + display = StatBox + } + + hist Tau_TauCR_Track_pT { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } + + + hist Tau_TauCR_Track_phi { + algorithm = tauHists_Chi2NDF + display = StatBox + } + + hist Tau_TauCR_Track_z0 { + algorithm = tauHists_Chi2NDF + display = StatBox + } + + hist Tau_TauCR_Track_nHighPtTaus { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY } } @@ -961,173 +1120,74 @@ dir Tau { display = StatBox } - hist Tau_TauCR_Identification_tauBDTLoose { + hist Tau_TauCR_Identification_tauRNNLoose { algorithm = tauHists_Chi2NDF/Loose display = StatBox } - hist Tau_TauCR_Identification_tauBDTMedium { + hist Tau_TauCR_Identification_tauRNNMedium { algorithm = tauHists_Chi2NDF/Loose display = StatBox } - hist Tau_TauCR_Identification_tauBDTTight { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauCR_Identification_BDTEleScoreSigTrans { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox - } - - hist Tau_TauCR_Identification_BDTJetScore { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauCR_Identification_BDTJetScoreSigTrans { - display = StatBox,LogY - } - hist Tau_TauCR_Identification_muonVeto { display = StatBox } - hist Tau_TauCR_Identification_eleBDTMedium { - algorithm = tauHists_Chi2NDF/veryLoose - display = StatBox - } - - hist Tau_TauCR_Identification_eleBDTTight { - algorithm = tauHists_Chi2NDF/Loose - display = StatBox - } - - dir tauJetBDTinputs { - output = Tau/TauCR/Identification/tauJetBDTinputs - algoithm = tauHists_Chi2NDF_noEmpty - - hist Tau_TauCR_Identification_tauJetBDTinputs_CentFrac { -# algorithm = tauHists_Chi2NDF + dir RNNLoose { + output = Tau/TauCR/Identification/RNNLoose + algorithm = tauHists_Chi2NDF + hist all_in_dir { display = StatBox } - hist Tau_TauCR_Identification_tauJetBDTinputs_dRmax { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauCR_Identification_tauJetBDTinputs_trkAvgDist { + hist Tau_TauCR_Identification_RNNLoose_phi { algorithm = tauHists_Chi2NDF display = StatBox - } + } - hist Tau_TauCR_Identification_tauJetBDTinputs_SumPtTrkFrac { + hist Tau_TauCR_Identification_RNNLoose_eta { algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauCR_Identification_tauJetBDTinputs_etOverPtLeadTrk { -# algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } + display = StatBox + } - hist Tau_TauCR_Identification_tauJetBDTinputs_absipSigLeadTrk { + hist Tau_TauCR_Identification_RNNLoose_et { algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauCR_Identification_tauJetBDTinputs_trFlightPathSig { -# algorithm = tauHists_Chi2NDF display = StatBox - } - - hist Tau_TauCR_Identification_tauJetBDTinputs_massTrkSys { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } + } - hist Tau_TauCR_Identification_tauJetBDTinputs_EMPOverTrkSysP { -# algorithm = tauHists_Chi2NDF + hist Tau_TauCR_Identification_RNNLoose_NumTracks { + algorithm = tauHists_Chi2NDF display = StatBox - } - - hist Tau_TauCR_Identification_tauJetBDTinputs_mEflowApprox { -# algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } + } + } - hist Tau_TauCR_Identification_tauJetBDTinputs_ptRatioEflowApprox { -# algorithm = tauHists_Chi2NDF + dir RNNMedium { + output = Tau/TauCR/Identification/RNNMedium + algorithm = tauHists_Chi2NDF + hist all_in_dir { display = StatBox } - hist Tau_TauCR_Identification_tauJetBDTinputs_ptIntermediateAxis { + hist Tau_TauCR_Identification_RNNMedium_phi { algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - } - - dir EleVetoBDTinputs { - output = Tau/TauCR/Identification/EleVetoBDTinputs - algoithm = tauHists_Chi2NDF_noEmpty - - hist Tau_TauCR_Identification_EleVetoBDTinputs_etHotShotWinOverPtLeadTrk { -# algorithm = tauHists_Chi2NDF display = StatBox - } + } - hist Tau_TauCR_Identification_EleVetoBDTinputs_EMFracFixed { -# algorithm = tauHists_Chi2NDF + hist Tau_TauCR_Identification_RNNMedium_eta { + algorithm = tauHists_Chi2NDF display = StatBox - } + } - hist Tau_TauCR_Identification_EleVetoBDTinputs_hadLeakFracFixed { -# algorithm = tauHists_Chi2NDF + hist Tau_TauCR_Identification_RNNMedium_et { + algorithm = tauHists_Chi2NDF display = StatBox - } + } - hist Tau_TauCR_Identification_EleVetoBDTinputs_PSSFrac { -# algorithm = tauHists_Chi2NDF + hist Tau_TauCR_Identification_RNNMedium_NumTracks { + algorithm = tauHists_Chi2NDF display = StatBox - } - } - - dir BDTLoose15GeV { - output = Tau/TauCR/Identification/BDTLoose15GeV - algoithm = tauHists_Chi2NDF - - hist Tau_TauCR_Identification_BDTLoose15GeV_et { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauCR_Identification_BDTLoose15GeV_eta { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauCR_Identification_BDTLoose15GeV_phi { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauCR_Identification_BDTLoose15GeV_numTracks { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauCR_Identification_BDTLoose15GeV_nCluster { - algorithm = tauHists_Chi2NDF/Loose - display = StatBox,LogY - } - - hist Tau_TauCR_Identification_BDTLoose15GeV_PanMode { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - + } } } @@ -1139,12 +1199,17 @@ dir Tau { display = StatBox } - hist Tau_TauCR_SubStructure_nShot { - algorithm = tauHists_Chi2NDF + hist Tau_TauCR_SubStructure_shots_pt3 { + algorithm = tauHists_Chi2NDF_noEmpty display = StatBox,LogY - } - - hist Tau_TauCR_SubStructure_InvMassEffClusters { + } + + hist Tau_TauCR_SubStructure_BDTscoreAsP0 { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox + } + + hist Tau_TauCR_SubStructure_EMFracTrk { algorithm = tauHists_Chi2NDF_noEmpty display = StatBox } @@ -1159,12 +1224,7 @@ dir Tau { display = StatBox } - hist Tau_TauCR_SubStructure_shots_pt3 { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY - } - - hist Tau_TauCR_SubStructure_EMFracTrk { + hist Tau_TauCR_SubStructure_InvMassEffClusters { algorithm = tauHists_Chi2NDF_noEmpty display = StatBox } @@ -1174,27 +1234,37 @@ dir Tau { display = StatBox,LogY } - hist Tau_TauCR_SubStructure_BDTscoreAsP0 { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox + hist Tau_TauCR_SubStructure_nShot { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } + + hist Tau_TauCR_SubStructure_PSSFracEffCluster { + algorithm = tauHists_Chi2NDF + display = StatBox } - + + hist Tau_TauCR_SubStructure_ptRatioApprox { + algorithm = tauHists_Chi2NDF + display = StatBox + } + hist Tau_TauCR_SubStructure_PanMode { algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauCR_SubStructure_PanPt { + hist Tau_TauCR_SubStructure_PanEta { algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauCR_SubStructure_PanEta { + hist Tau_TauCR_SubStructure_PanPhi { algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauCR_SubStructure_PanPhi { + hist Tau_TauCR_SubStructure_PanPt { algorithm = tauHists_Chi2NDF display = StatBox } @@ -1209,38 +1279,17 @@ dir Tau { display = StatBox } - hist Tau_TauE_tauPhiVsEta { - algorithm = tauHists_Chi2Scatter - display = StatBox - } - - hist Tau_TauE_tauEtaVsLB { - algorithm = tauHists_Chi2Scatter - display = StatBox - } - - hist Tau_TauE_tauPhiVsLB { - algorithm = tauHists_Chi2Scatter - display = StatBox - } - - hist Tau_TauE_tauEtaVsLBet15BDTLoose { - algorithm = tauHists_Chi2Scatter/Loose - display = StatBox - } - - hist Tau_TauE_tauPhiVsLBet15BDTLoose { - algorithm = tauHists_Chi2Scatter/Loose - display = StatBox + hist Tau_TauE_tauCharge { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY } - hist Tau_TauE_nTauCandidates { + hist Tau_TauE_RNNJetScore { algorithm = tauHists_Chi2NDF display = StatBox,LogY } - hist Tau_TauE_tauCharge { - algorithm = tauHists_Chi2NDF_noEmpty + hist Tau_TauE_RNNJetScoreSigTrans { display = StatBox,LogY } @@ -1254,10 +1303,34 @@ dir Tau { display = StatBox } + hist Tau_TauE_tauEtaVsLB { + algorithm = tauHists_Chi2Scatter + display = StatBox + } + + hist Tau_TauE_tauPhi { algorithm = tauHists_Chi2NDF display = StatBox } + + + hist Tau_TauE_tauPhiVsEta { + algorithm = tauHists_Chi2Scatter + display = StatBox + } + + hist Tau_TauE_tauPhiVsLB { + algorithm = tauHists_Chi2Scatter + display = StatBox + } + + + hist Tau_TauE_nTauCandidates { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } + dir Calo { output = Tau/TauE/Calo @@ -1266,12 +1339,6 @@ dir Tau { display = StatBox } - hist Tau_TauE_Calo_jetSeedPt { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauE_Calo_jetSeedEta { algorithm = tauHists_Chi2NDF display = StatBox @@ -1282,14 +1349,10 @@ dir Tau { display = StatBox } - hist Tau_TauE_Calo_etEMAtEMScale { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY - } - hist Tau_TauE_Calo_etHadAtEMScale { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY + hist Tau_TauE_Calo_jetSeedPt { + algorithm = tauHists_Chi2NDF + display = StatBox } hist Tau_TauE_Calo_EMRadius { @@ -1302,6 +1365,11 @@ dir Tau { display = StatBox,LogY } + hist Tau_TauE_Calo_stripWidth2 { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY + } + hist Tau_TauE_Calo_isolFrac { algorithm = tauHists_Chi2NDF_noEmpty display = StatBox @@ -1312,7 +1380,12 @@ dir Tau { display = StatBox,LogY } - hist Tau_TauE_Calo_stripWidth2 { + hist Tau_TauE_Calo_etEMAtEMScale { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY + } + + hist Tau_TauE_Calo_etHadAtEMScale { algorithm = tauHists_Chi2NDF_noEmpty display = StatBox,LogY } @@ -1326,109 +1399,92 @@ dir Tau { algorithm = tauHists_Chi2Scatter_noEmpty display = StatBox } - } - dir Track { - output = Tau/TauE/Track - algorithm = tauHists_Chi2NDF/noMatch - - hist all_in_dir { + hist Tau_TauE_Calo_centralityFraction { +# algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauE_Track_pT { + hist Tau_TauE_Calo_dRmax { algorithm = tauHists_Chi2NDF display = StatBox,LogY } - hist Tau_TauE_Track_eta { - algorithm = tauHists_Chi2NDF/Loose + hist Tau_TauE_Calo_eta { + algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauE_Track_phi { + hist Tau_TauE_Calo_phi { algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauE_Track_leadTrkPt { + hist Tau_TauE_Calo_trkAvgDist { algorithm = tauHists_Chi2NDF - display = StatBox,LogY + display = StatBox } - hist Tau_TauE_Track_nHighPTtaus { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - hist Tau_TauE_Track_dRJetSeedAxis { - display = StatBox - } + } - hist Tau_TauE_Track_d0 { - algorithm = tauHists_Chi2NDF_noEmpty/veryLoose - display = StatBox,<AxisRange(-5,5,"X")>,LogY - } + dir Track { + output = Tau/TauE/Track + algorithm = tauHists_Chi2NDF/noMatch - hist Tau_TauE_Track_z0TJVA { - display = StatBox,<AxisRange(-35,35,"X")>,LogY + + hist all_in_dir { + display = StatBox } - hist Tau_TauE_Track_z0PriVtx { - display = StatBox,<AxisRange(-35,35,"X")>,LogY + hist Tau_TauE_Track_leadTrkPt { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY } hist Tau_TauE_Track_trkWidth2 { algorithm = tauHists_Chi2NDF display = StatBox,LogY } - - hist Tau_TauE_Track_rConv { - display = StatBox,LogY - } - - hist Tau_TauE_Track_rConvII { + hist Tau_TauE_Track_trkWidth2 { + algorithm = tauHists_Chi2NDF display = StatBox,LogY } - + hist Tau_TauE_Track_ipZ0SinThetaSigLeadTrk { algorithm = tauHists_Chi2NDF_noEmpty display = StatBox } - hist Tau_TauE_Track_leadTrackDeltaEta { - algorithm = tauHists_Chi2NDF + hist Tau_TauE_Track_etOverPtLeadTrk { +# algorithm = tauHists_Chi2NDF display = StatBox,LogY } - - hist Tau_TauE_Track_leadTrackDeltaPhi { + + hist Tau_TauE_Track_ipSigLeadTrk { algorithm = tauHists_Chi2NDF display = StatBox,LogY } - - hist Tau_TauE_Track_eProbabilityHT { - display = StatBox - } - - hist Tau_TauE_Track_numberOfPixelHits { - display = StatBox,LogY - } - hist Tau_TauE_Track_numberOfPixelSharedHits { + hist Tau_TauE_Track_massTrkSys { + algorithm = tauHists_Chi2NDF display = StatBox,LogY } - hist Tau_TauE_Track_numberOfInnermostPixelLayerHits { - display = StatBox,LogY + hist Tau_TauE_Track_trFlightPathSig { +# algorithm = tauHists_Chi2NDF + display = StatBox } hist Tau_TauE_Track_numberOfSCTHits { display = StatBox,LogY } - hist Tau_TauE_Track_numberOfSCTSharedHits { + + hist Tau_TauE_Track_numberOfPixelHits { display = StatBox,LogY - } + } + hist Tau_TauE_Track_numberOfTRTHits { display = StatBox,LogY @@ -1445,187 +1501,118 @@ dir Tau { hist Tau_TauE_Track_numberOfTRTOutliers { display = StatBox,LogY } - - hist Tau_TauE_Track_z0VsLB { - display = StatBox,<AxisRange(-35,35,"Y")> - } - - } - dir Identification { - output = Tau/TauE/Identification - algorthm = tauHists_Chi2NDF_noEmpty - hist all_in_dir { - display = StatBox - } - hist Tau_TauE_Identification_tauBDTLoose { - algorithm = tauHists_Chi2NDF/Loose - display = StatBox + hist Tau_TauE_Track_d0 { + algorithm = tauHists_Chi2NDF_noEmpty/veryLoose + display = StatBox,<AxisRange(-5,5,"X")>,LogY } - hist Tau_TauE_Identification_tauBDTMedium { + hist Tau_TauE_Track_eta { algorithm = tauHists_Chi2NDF/Loose - display = StatBox - } + display = StatBox + } - hist Tau_TauE_Identification_tauBDTTight { - algorithm = tauHists_Chi2NDF - display = StatBox + hist Tau_TauE_Track_pT { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY } - hist Tau_TauE_Identification_BDTEleScoreSigTrans { - algorithm = tauHists_Chi2NDF_noEmpty + + hist Tau_TauE_Track_phi { + algorithm = tauHists_Chi2NDF + display = StatBox + } + + hist Tau_TauE_Track_z0 { + algorithm = tauHists_Chi2NDF display = StatBox - } + } - hist Tau_TauE_Identification_BDTJetScore { + hist Tau_TauE_Track_nHighPtTaus { algorithm = tauHists_Chi2NDF display = StatBox,LogY } - hist Tau_TauE_Identification_BDTJetScoreSigTrans { - display = StatBox,LogY - } - hist Tau_TauE_Identification_muonVeto { + + } + + dir Identification { + output = Tau/TauE/Identification + algorthm = tauHists_Chi2NDF_noEmpty + hist all_in_dir { display = StatBox } - hist Tau_TauE_Identification_eleBDTMedium { - algorithm = tauHists_Chi2NDF/veryLoose - display = StatBox + hist Tau_TauE_Identification_tauRNNLoose { + algorithm = tauHists_Chi2NDF/Loose + display = StatBox } - hist Tau_TauE_Identification_eleBDTTight { + hist Tau_TauE_Identification_tauRNNMedium { algorithm = tauHists_Chi2NDF/Loose - display = StatBox + display = StatBox } - dir tauJetBDTinputs { - output = Tau/TauE/Identification/tauJetBDTinputs - algoithm = tauHists_Chi2NDF_noEmpty + hist Tau_TauE_Identification_muonVeto { + display = StatBox + } - hist Tau_TauE_Identification_tauJetBDTinputs_CentFrac { -# algorithm = tauHists_Chi2NDF + dir RNNLoose { + output = Tau/TauE/Identification/RNNLoose + algorithm = tauHists_Chi2NDF + hist all_in_dir { display = StatBox } - hist Tau_TauE_Identification_tauJetBDTinputs_dRmax { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauE_Identification_tauJetBDTinputs_trkAvgDist { + hist Tau_TauE_Identification_RNNLoose_phi { algorithm = tauHists_Chi2NDF display = StatBox - } + } - hist Tau_TauE_Identification_tauJetBDTinputs_SumPtTrkFrac { + hist Tau_TauE_Identification_RNNLoose_eta { algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauE_Identification_tauJetBDTinputs_etOverPtLeadTrk { -# algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } + display = StatBox + } - hist Tau_TauE_Identification_tauJetBDTinputs_absipSigLeadTrk { + hist Tau_TauE_Identification_RNNLoose_et { algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauE_Identification_tauJetBDTinputs_trFlightPathSig { -# algorithm = tauHists_Chi2NDF display = StatBox - } - - hist Tau_TauE_Identification_tauJetBDTinputs_massTrkSys { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } + } - hist Tau_TauE_Identification_tauJetBDTinputs_EMPOverTrkSysP { -# algorithm = tauHists_Chi2NDF + hist Tau_TauE_Identification_RNNLoose_NumTracks { + algorithm = tauHists_Chi2NDF display = StatBox - } - - hist Tau_TauE_Identification_tauJetBDTinputs_mEflowApprox { -# algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } + } + } - hist Tau_TauE_Identification_tauJetBDTinputs_ptRatioEflowApprox { -# algorithm = tauHists_Chi2NDF + dir RNNMedium { + output = Tau/TauE/Identification/RNNMedium + algorithm = tauHists_Chi2NDF + hist all_in_dir { display = StatBox } - hist Tau_TauE_Identification_tauJetBDTinputs_ptIntermediateAxis { + hist Tau_TauE_Identification_RNNMedium_phi { algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - } - - dir EleVetoBDTinputs { - output = Tau/TauE/Identification/EleVetoBDTinputs - algoithm = tauHists_Chi2NDF_noEmpty - - hist Tau_TauE_Identification_EleVetoBDTinputs_etHotShotWinOverPtLeadTrk { -# algorithm = tauHists_Chi2NDF display = StatBox - } + } - hist Tau_TauE_Identification_EleVetoBDTinputs_EMFracFixed { -# algorithm = tauHists_Chi2NDF + hist Tau_TauE_Identification_RNNMedium_eta { + algorithm = tauHists_Chi2NDF display = StatBox - } + } - hist Tau_TauE_Identification_EleVetoBDTinputs_hadLeakFracFixed { -# algorithm = tauHists_Chi2NDF + hist Tau_TauE_Identification_RNNMedium_et { + algorithm = tauHists_Chi2NDF display = StatBox - } + } - hist Tau_TauE_Identification_EleVetoBDTinputs_PSSFrac { -# algorithm = tauHists_Chi2NDF + hist Tau_TauE_Identification_RNNMedium_NumTracks { + algorithm = tauHists_Chi2NDF display = StatBox - } - } - - dir BDTLoose15GeV { - output = Tau/TauE/Identification/BDTLoose15GeV - algoithm = tauHists_Chi2NDF - - hist Tau_TauE_Identification_BDTLoose15GeV_et { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauE_Identification_BDTLoose15GeV_eta { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauE_Identification_BDTLoose15GeV_phi { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauE_Identification_BDTLoose15GeV_numTracks { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauE_Identification_BDTLoose15GeV_nCluster { - algorithm = tauHists_Chi2NDF/Loose - display = StatBox,LogY - } - - hist Tau_TauE_Identification_BDTLoose15GeV_PanMode { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - + } } } @@ -1637,12 +1624,17 @@ dir Tau { display = StatBox } - hist Tau_TauE_SubStructure_nShot { - algorithm = tauHists_Chi2NDF + hist Tau_TauE_SubStructure_shots_pt3 { + algorithm = tauHists_Chi2NDF_noEmpty display = StatBox,LogY - } - - hist Tau_TauE_SubStructure_InvMassEffClusters { + } + + hist Tau_TauE_SubStructure_BDTscoreAsP0 { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox + } + + hist Tau_TauE_SubStructure_EMFracTrk { algorithm = tauHists_Chi2NDF_noEmpty display = StatBox } @@ -1657,12 +1649,7 @@ dir Tau { display = StatBox } - hist Tau_TauE_SubStructure_shots_pt3 { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY - } - - hist Tau_TauE_SubStructure_EMFracTrk { + hist Tau_TauE_SubStructure_InvMassEffClusters { algorithm = tauHists_Chi2NDF_noEmpty display = StatBox } @@ -1672,34 +1659,43 @@ dir Tau { display = StatBox,LogY } - hist Tau_TauE_SubStructure_BDTscoreAsP0 { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox + hist Tau_TauE_SubStructure_nShot { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } + + hist Tau_TauE_SubStructure_PSSFracEffCluster { + algorithm = tauHists_Chi2NDF + display = StatBox } - + + hist Tau_TauE_SubStructure_ptRatioApprox { + algorithm = tauHists_Chi2NDF + display = StatBox + } + hist Tau_TauE_SubStructure_PanMode { algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauE_SubStructure_PanPt { + hist Tau_TauE_SubStructure_PanEta { algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauE_SubStructure_PanEta { + hist Tau_TauE_SubStructure_PanPhi { algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauE_SubStructure_PanPhi { + hist Tau_TauE_SubStructure_PanPt { algorithm = tauHists_Chi2NDF display = StatBox } } } - dir Trigger { output = Tau/Trigger algorithm = tauHists_Chi2NDF_noEmpty @@ -1707,630 +1703,269 @@ dir Tau { display = StatBox } - hist TriggerChains { - algorithm = tauHists_Chi2NDF/noMatch - display = StatBox - } - - hist TriggerChains_LB { - algorithm = tauHists_Chi2NDF/noMatch - display = StatBox - } - - dir TauTrig { - output = Tau/Trigger/TauTrig - algorithm = tauHists_Chi2NDF_noEmpty + dir EleTrig { + output = Tau/Trigger/EleTrig + algorithm = tauHists_Chi2NDF hist all_in_dir { display = StatBox } - hist Tau_TauTrig_tauPhiVsEta { - algorithm = tauHists_Chi2Scatter + hist emTriggered_tauCharge { + algorithm = tauHists_Chi2NDF_noEmpty display = StatBox - } + } - hist Tau_TauTrig_tauEtaVsLB { - algorithm = tauHists_Chi2Scatter - display = StatBox + hist emTriggered_RNNJetScore { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY } - hist Tau_TauTrig_tauPhiVsLB { - algorithm = tauHists_Chi2Scatter - display = StatBox + hist emTriggered_RNNJetScoreSigTrans { + display = StatBox,LogY } - hist Tau_TauTrig_tauEtaVsLBet15BDTLoose { - algorithm = tauHists_Chi2Scatter/Loose + hist emTriggered_tauEt { + algorithm = tauHists_Chi2NDF + display = StatBox,LogX + } + + hist emTriggered_tauEta { + algorithm = tauHists_Chi2NDF display = StatBox } - hist Tau_TauTrig_tauPhiVsLBet15BDTLoose { + hist emTriggered_tauEtaVsLB { algorithm = tauHists_Chi2Scatter/Loose display = StatBox } - hist Tau_TauTrig_nTauCandidates { + hist emTriggered_tauPhi { algorithm = tauHists_Chi2NDF - display = StatBox,LogY + display = StatBox } - hist Tau_TauTrig_tauCharge { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY - } + hist emTriggered_tauPhiVsEta { + algorithm = tauHists_Chi2Scatter + display = StatBox + } - hist Tau_TauTrig_tauEt { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } + hist emTriggered_tauPhiVsLB { + algorithm = tauHists_Chi2Scatter + display = StatBox + } - hist Tau_TauTrig_tauEta { - algorithm = tauHists_Chi2NDF + hist emTriggered_nTauPerLB { + algorithm = tauHists_Chi2NDF display = StatBox - } + } - hist Tau_TauTrig_tauPhi { + hist emTriggered_tauNumTracks { algorithm = tauHists_Chi2NDF display = StatBox - } - - dir Calo { - output = Tau/Trigger/TauTrig/Calo - algorithm = tauHists_Chi2NDF_noEmpty - hist all_in_dir { - display = StatBox - } - - hist Tau_TauTrig_Calo_jetSeedPt { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - - hist Tau_TauTrig_Calo_jetSeedEta { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauTrig_Calo_jetSeedPhi { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauTrig_Calo_etEMAtEMScale { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY - } - - hist Tau_TauTrig_Calo_etHadAtEMScale { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY - } - - hist Tau_TauTrig_Calo_EMRadius { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY - } - - hist Tau_TauTrig_Calo_hadRadius { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY - } - - hist Tau_TauTrig_Calo_isolFrac { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox - } - - hist Tau_TauTrig_Calo_nStrip { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauTrig_Calo_stripWidth2 { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY - } - - hist Tau_TauTrig_Calo_CentFracVsLB { - algorithm = tauHists_Chi2Scatter_noEmpty - display = StatBox - } - - hist Tau_TauTrig_Calo_isolFracVsLB { - algorithm = tauHists_Chi2Scatter_noEmpty - display = StatBox - } } - dir Track { - output = Tau/Trigger/TauTrig/Track - algorithm = tauHists_Chi2NDF/noMatch - - hist all_in_dir { - display = StatBox - } - - hist Tau_TauTrig_Track_pT { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauTrig_Track_eta { - algorithm = tauHists_Chi2NDF/Loose - display = StatBox - } - - hist Tau_TauTrig_Track_phi { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauTrig_Track_leadTrkPt { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauTrig_Track_nHighPTtaus { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauTrig_Track_dRJetSeedAxis { - display = StatBox - } - - hist Tau_TauTrig_Track_d0 { - algorithm = tauHists_Chi2NDF_noEmpty/veryLoose - display = StatBox,<AxisRange(-5,5,"X")>,LogY - } - - hist Tau_TauTrig_Track_z0TJVA { - display = StatBox,<AxisRange(-35,35,"X")>,LogY - } - - hist Tau_TauTrig_Track_z0PriVtx { - display = StatBox,<AxisRange(-35,35,"X")>,LogY - } - - hist Tau_TauTrig_Track_trkWidth2 { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauTrig_Track_rConv { - display = StatBox,LogY - } - - hist Tau_TauTrig_Track_rConvII { - display = StatBox,LogY - } - - hist Tau_TauTrig_Track_ipZ0SinThetaSigLeadTrk { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox - } - - hist Tau_TauTrig_Track_leadTrackDeltaEta { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauTrig_Track_leadTrackDeltaPhi { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauTrig_Track_eProbabilityHT { - display = StatBox - } - - hist Tau_TauTrig_Track_numberOfPixelHits { - display = StatBox,LogY - } - - hist Tau_TauTrig_Track_numberOfPixelSharedHits { - display = StatBox,LogY - } - - hist Tau_TauTrig_Track_numberOfInnermostPixelLayerHits { - display = StatBox,LogY - } - - hist Tau_TauTrig_Track_numberOfSCTHits { - display = StatBox,LogY - } - - hist Tau_TauTrig_Track_numberOfSCTSharedHits { - display = StatBox,LogY - } - - hist Tau_TauTrig_Track_numberOfTRTHits { - display = StatBox,LogY - } - - hist Tau_TauTrig_Track_numberOfTRTHighThresholdHits { - display = StatBox,LogY - } - - hist Tau_TauTrig_Track_numberOfTRTHighThresholdOutliers { - display = StatBox,LogY - } - - hist Tau_TauTrig_Track_numberOfTRTOutliers { - display = StatBox,LogY - } - - hist Tau_TauTrig_Track_z0VsLB { - display = StatBox,<AxisRange(-35,35,"Y")> - } - + hist emTriggered_nCluster { + algorithm = tauHists_Chi2NDF/veryLoose + display = StatBox } - dir Identification { - output = Tau/Trigger/TauTrig/Identification - algorthm = tauHists_Chi2NDF_noEmpty - hist all_in_dir { - display = StatBox - } - - hist Tau_TauTrig_Identification_tauBDTLoose { - algorithm = tauHists_Chi2NDF/Loose - display = StatBox - } - - hist Tau_TauTrig_Identification_tauBDTMedium { - algorithm = tauHists_Chi2NDF/Loose - display = StatBox - } - - hist Tau_TauTrig_Identification_tauBDTTight { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauTrig_Identification_BDTEleScoreSigTrans { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox - } + hist emTriggered_tauEtVsEta { + algorithm = tauHists_Chi2Scatter + display = StatBox + } - hist Tau_TauTrig_Identification_BDTJetScore { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } + hist emTriggered_tauEtVsPhi { + algorithm = tauHists_Chi2Scatter + display = StatBox + } - hist Tau_TauTrig_Identification_BDTJetScoreSigTrans { - display = StatBox,LogY - } + hist emTriggered_nTauCandidates { + algorithm = tauHists_Chi2NDF + display = StatBox + } - hist Tau_TauTrig_Identification_muonVeto { - display = StatBox - } + hist emTriggered_nHighPtTauCandidates { + algorithm = tauHists_Chi2NDF + display = StatBox + } - hist Tau_TauTrig_Identification_eleBDTMedium { - algorithm = tauHists_Chi2NDF/veryLoose - display = StatBox - } + } - hist Tau_TauTrig_Identification_eleBDTTight { - algorithm = tauHists_Chi2NDF/Loose - display = StatBox - } + dir JetTrig { + output = Tau/Trigger/JetTrig + algorithm = tauHists_Chi2NDF + hist all_in_dir { + display = StatBox + } - dir tauJetBDTinputs { - output = Tau/Trigger/TauTrig/Identification/tauJetBDTinputs - algoithm = tauHists_Chi2NDF_noEmpty - - hist Tau_TauTrig_Identification_tauJetBDTinputs_CentFrac { -# algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauTrig_Identification_tauJetBDTinputs_dRmax { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauTrig_Identification_tauJetBDTinputs_trkAvgDist { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauTrig_Identification_tauJetBDTinputs_SumPtTrkFrac { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauTrig_Identification_tauJetBDTinputs_etOverPtLeadTrk { -# algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauTrig_Identification_tauJetBDTinputs_absipSigLeadTrk { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauTrig_Identification_tauJetBDTinputs_trFlightPathSig { -# algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauTrig_Identification_tauJetBDTinputs_massTrkSys { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauTrig_Identification_tauJetBDTinputs_EMPOverTrkSysP { -# algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauTrig_Identification_tauJetBDTinputs_mEflowApprox { -# algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauTrig_Identification_tauJetBDTinputs_ptRatioEflowApprox { -# algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauTrig_Identification_tauJetBDTinputs_ptIntermediateAxis { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - } + hist jetTriggered_tauCharge { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox + } - dir EleVetoBDTinputs { - output = Tau/Trigger/TauTrig/Identification/EleVetoBDTinputs - algoithm = tauHists_Chi2NDF_noEmpty - - hist Tau_TauTrig_Identification_EleVetoBDTinputs_etHotShotWinOverPtLeadTrk { -# algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauTrig_Identification_EleVetoBDTinputs_EMFracFixed { -# algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauTrig_Identification_EleVetoBDTinputs_hadLeakFracFixed { -# algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauTrig_Identification_EleVetoBDTinputs_PSSFrac { -# algorithm = tauHists_Chi2NDF - display = StatBox - } - } + hist jetTriggered_RNNJetScore { + algorithm = tauHists_Chi2NDF + display = StatBox,LogY + } - dir BDTLoose15GeV { - output = Tau/Trigger/TauTrig/Identification/BDTLoose15GeV - algoithm = tauHists_Chi2NDF - - hist Tau_TauTrig_Identification_BDTLoose15GeV_et { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauTrig_Identification_BDTLoose15GeV_eta { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauTrig_Identification_BDTLoose15GeV_phi { - algorithm = tauHists_Chi2NDF - display = StatBox - } - - hist Tau_TauTrig_Identification_BDTLoose15GeV_numTracks { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauTrig_Identification_BDTLoose15GeV_nCluster { - algorithm = tauHists_Chi2NDF/Loose - display = StatBox,LogY - } - - hist Tau_TauTrig_Identification_BDTLoose15GeV_PanMode { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - } + hist jetTriggered_RNNJetScoreSigTrans { + display = StatBox,LogY } - dir SubStructure { - output = Tau/Trigger/TauTrig/SubStructure + hist jetTriggered_tauEt { algorithm = tauHists_Chi2NDF - hist all_in_dir { - display = StatBox - } - - hist Tau_TauTrig_SubStructure_nShot { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } - - hist Tau_TauTrig_SubStructure_InvMassEffClusters { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox - } - - hist Tau_TauTrig_SubStructure_EfracL2EffCluster { - algorithm = tauHists_Chi2NDF/Loose - display = StatBox - } - - hist Tau_TauTrig_SubStructure_EisoEffCluster { - algorithm = tauHists_Chi2NDF_noEmpty/Loose - display = StatBox - } + display = StatBox,LogX + } - hist Tau_TauTrig_SubStructure_shots_pt3 { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox,LogY - } + hist jetTriggered_tauEta { + algorithm = tauHists_Chi2NDF + display = StatBox + } - hist Tau_TauTrig_SubStructure_EMFracTrk { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox - } + hist jetTriggered_tauEtaVsLB { + algorithm = tauHists_Chi2Scatter/Loose + display = StatBox + } - hist Tau_TauTrig_SubStructure_NumNeutPFO { - algorithm = tauHists_Chi2NDF - display = StatBox,LogY - } + hist jetTriggered_tauPhi { + algorithm = tauHists_Chi2NDF + display = StatBox + } - hist Tau_TauTrig_SubStructure_BDTscoreAsP0 { - algorithm = tauHists_Chi2NDF_noEmpty - display = StatBox - } - - hist Tau_TauTrig_SubStructure_PanMode { - algorithm = tauHists_Chi2NDF - display = StatBox - } + hist jetTriggered_tauPhiVsEta { + algorithm = tauHists_Chi2Scatter + display = StatBox + } - hist Tau_TauTrig_SubStructure_PanPt { - algorithm = tauHists_Chi2NDF - display = StatBox - } + hist jetTriggered_tauPhiVsLB { + algorithm = tauHists_Chi2Scatter + display = StatBox + } - hist Tau_TauTrig_SubStructure_PanEta { - algorithm = tauHists_Chi2NDF - display = StatBox - } + hist jetTriggered_nTauPerLB { + algorithm = tauHists_Chi2NDF + display = StatBox + } - hist Tau_TauTrig_SubStructure_PanPhi { - algorithm = tauHists_Chi2NDF - display = StatBox - } + hist jetTriggered_tauNumTracks { + algorithm = tauHists_Chi2NDF + display = StatBox } - } - dir JetTrig { - output = Tau/Trigger/JetTrig - algorithm = tauHists_Chi2NDF_noEmpty - hist all_in_dir { + hist jetTriggered_nCluster { + algorithm = tauHists_Chi2NDF/veryLoose display = StatBox } - + + hist jetTriggered_tauEtVsEta { + algorithm = tauHists_Chi2Scatter + display = StatBox + } + + hist jetTriggered_tauEtVsPhi { + algorithm = tauHists_Chi2Scatter + display = StatBox + } + hist jetTriggered_nTauCandidates { algorithm = tauHists_Chi2NDF display = StatBox } - hist jetTriggered_tauCharge { - algorithm = tauHists_Chi2NDF_noEmpty + hist jetTriggered_nHighPtTauCandidates { + algorithm = tauHists_Chi2NDF display = StatBox } - hist jetTriggered_tauEt { - algorithm = tauHists_Chi2NDF - display = StatBox,LogX - } + } - hist jetTriggered_tauEtVsEta { - algorithm = tauHists_Chi2Scatter + dir TauTrig1 { + output = Tau/Trigger/TauTrig1 + algorithm = tauHists_Chi2NDF + hist all_in_dir { display = StatBox } - hist jetTriggered_tauEtVsPhi { - algorithm = tauHists_Chi2Scatter - display = StatBox + hist tauTriggered1_tauTriggered1_tauCharge { + algorithm = tauHists_Chi2NDF_noEmpty + display = StatBox,LogY } - hist jetTriggered_PtTESMVA { + hist tauTriggered1_RNNJetScore { algorithm = tauHists_Chi2NDF display = StatBox,LogY - } - - hist jetTriggered_Ptcombined { - algorithm = tauHists_Chi2NDF + } + + hist tauTriggered1_RNNJetScoreSigTrans { display = StatBox,LogY - } - - hist jetTriggered_tauEta { + } + + hist tauTriggered1_tauEt { algorithm = tauHists_Chi2NDF - display = StatBox - } + display = StatBox,LogY + } - hist jetTriggered_tauPhi { + hist tauTriggered1_tauEta { algorithm = tauHists_Chi2NDF display = StatBox - } - - hist jetTriggered_tauPhiVsEta { - algorithm = tauHists_Chi2Scatter - display = StatBox } - } - dir EleTrig { - output = Tau/Trigger/EleTrig - algorithm = tauHists_Chi2NDF_noEmpty - hist all_in_dir { + hist tauTriggered1_tauEtaVsLB { + algorithm = tauHists_Chi2Scatter/Loose display = StatBox } - hist emTriggered_nTauCandidates { + hist tauTriggered1_tauPhi { algorithm = tauHists_Chi2NDF display = StatBox } - hist emTriggered_tauCharge { - algorithm = tauHists_Chi2NDF_noEmpty + hist tauTriggered1_tauPhiVsEta { + algorithm = tauHists_Chi2Scatter display = StatBox } - hist emTriggered_NumTracks { - algorithm = tauHists_Chi2NDF/Loose + + hist tauTriggered1_tauPhiVsLB { + algorithm = tauHists_Chi2Scatter/Loose display = StatBox } - - hist emTriggered_tauEt { + + hist tauTriggered1_nTauPerLB { + algorithm = tauHists_Chi2NDF + display = StatBox + } + + hist tauTriggered1_tauNumTracks { algorithm = tauHists_Chi2NDF - display = StatBox,LogX + display = StatBox } - hist emTriggered_tauEtVsEta { - algorithm = tauHists_Chi2Scatter + hist tauTriggered1_nCluster { + algorithm = tauHists_Chi2NDF/veryLoose display = StatBox } - hist emTriggered_tauEtVsPhi { + hist tauTriggered1_tauEtVsEta { algorithm = tauHists_Chi2Scatter display = StatBox } - hist emTriggered_tauEta { - algorithm = tauHists_Chi2NDF + hist tauTriggered1_tauEtVsPhi { + algorithm = tauHists_Chi2Scatter display = StatBox - } + } - hist emTriggered_tauPhi { - algorithm = tauHists_Chi2NDF - display = StatBox - } - hist emTriggered_PtTESMVA { + hist tauTriggered1_nTauCandidates { algorithm = tauHists_Chi2NDF display = StatBox,LogY - } - - hist emTriggered_Ptcombined { + } + + + hist tauTriggered1_nHighPtTauCandidates { algorithm = tauHists_Chi2NDF display = StatBox,LogY - } - - - hist emTriggered_tauPhiVsEta { - algorithm = tauHists_Chi2Scatter - display = StatBox } } } diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/TPCnvElt.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/TPCnvElt.cxx index 5bdf2bf5062212699007183133cf065f4f25c187..3902f42b2b6719afa94ea4baa2d955c02c781beb 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/TPCnvElt.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/TPCnvElt.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file AthenaPoolCnvSvc/src/TPCnvElt.cxx * @author scott snyder <snyder@bnl.gov> @@ -15,6 +13,10 @@ #include "AthenaPoolCnvSvc/exceptions.h" #include "StorageSvc/DbReflex.h" +#include "AthenaKernel/getMessageSvc.h" +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/System.h" + namespace AthenaPoolCnvSvc { @@ -28,7 +30,96 @@ namespace AthenaPoolCnvSvc { Guid guidFromTypeinfo (const std::type_info& ti) { pool::TypeH typ = pool::DbReflex::forTypeInfo (ti); - if (!typ) throwExcNoDictForClass (ti); + if (!typ) { + // Print additional diagnostic information here to try to get a better + // handle on why this is happening. + // See ATEAM-697. + std::string clname = System::typeinfoName (ti); + MsgStream msg (Athena::getMessageSvc(), "TPCnvElt"); + msg << MSG::ERROR << "Cannot find full dictionary information for class " << + clname << endmsg; + TClass* cls = static_cast<TClass*>(typ); + if (!cls) { + msg << MSG::ERROR << "No TClass; trying to retrieve again." << endmsg; + cls = TClass::GetClass (ti); + if (!cls) { + msg << MSG::ERROR << "Couldn't retrieve via type_info; try by name." << endmsg; + cls = TClass::GetClass (clname.c_str()); + } + } + if (cls) { + msg << MSG::ERROR << "Got TClass " << cls->GetName() << " " << + cls->HasInterpreterInfoInMemory() << " " << + cls->HasInterpreterInfo() << " " << + cls->GetState() << " " << + cls->HasDictionary() << " " << + cls->IsLoaded() << " " << + cls->IsForeign() << endmsg; + + TClass* cls2 = TClass::GetClass (ti); + if (cls2) { + msg << MSG::ERROR << "Got TClass by ti " << cls2->GetName() << " " << + (cls == cls2) << " " << + cls2->HasInterpreterInfoInMemory() << " " << + cls2->HasInterpreterInfo() << " " << + cls2->GetState() << " " << + cls2->HasDictionary() << " " << + cls2->IsLoaded() << " " << + cls2->IsForeign() << endmsg; + } + else { + msg << MSG::ERROR << "Could not re-get class by ti" << endmsg; + } + + cls2 = TClass::GetClass (clname.c_str()); + if (cls2) { + msg << MSG::ERROR << "Got TClass by name " << cls2->GetName() << " " << + (cls == cls2) << " " << + cls2->HasInterpreterInfoInMemory() << " " << + cls2->HasInterpreterInfo() << " " << + cls2->GetState() << " " << + cls2->HasDictionary() << " " << + cls2->IsLoaded() << " " << + cls2->IsForeign() << endmsg; + } + else { + msg << MSG::ERROR << "Could not re-get class by name" << endmsg; + } + + sleep (10); + + cls2 = TClass::GetClass (ti); + if (cls2) { + msg << MSG::ERROR << "Got TClass by ti " << cls2->GetName() << " " << + (cls == cls2) << " " << + cls2->HasInterpreterInfoInMemory() << " " << + cls2->HasInterpreterInfo() << " " << + cls2->GetState() << " " << + cls2->HasDictionary() << " " << + cls2->IsLoaded() << " " << + cls2->IsForeign() << endmsg; + } + else { + msg << MSG::ERROR << "Could not re-get class by ti" << endmsg; + } + + cls2 = TClass::GetClass (clname.c_str()); + if (cls2) { + msg << MSG::ERROR << "Got TClass by name " << cls2->GetName() << " " << + (cls == cls2) << " " << + cls2->HasInterpreterInfoInMemory() << " " << + cls2->HasInterpreterInfo() << " " << + cls2->GetState() << " " << + cls2->HasDictionary() << " " << + cls2->IsLoaded() << " " << + cls2->IsForeign() << endmsg; + } + else { + msg << MSG::ERROR << "Could not re-get class by name" << endmsg; + } + } + throwExcNoDictForClass (ti); + } return pool::DbReflex::guid (typ); } diff --git a/Database/AthenaPOOL/PoolSvc/PoolSvc/IPoolSvc.h b/Database/AthenaPOOL/PoolSvc/PoolSvc/IPoolSvc.h index 20262d49febf0226fae70eb1a202bc7c490d5419..037518d3a7e3ef1ddaa88bde47215e4fd309776d 100644 --- a/Database/AthenaPOOL/PoolSvc/PoolSvc/IPoolSvc.h +++ b/Database/AthenaPOOL/PoolSvc/PoolSvc/IPoolSvc.h @@ -104,12 +104,6 @@ public: // Non-static members const pool::ICollection::OpenMode& openMode = pool::ICollection::READ, unsigned int contextId = IPoolSvc::kInputStream) const = 0; - /// @return void - /// @param c [IN] collection to be registered - /// @param overwrite [IN] whether to overwrite - /// @param sharedCat [IN] whether to use same catalog as data - virtual void registerExistingCollection ATLAS_NOT_THREAD_SAFE (pool::ICollection* c, bool overwrite, bool sharedCat = true) = 0; - /// @return a token for a container entry. /// @param connection [IN] string containing the connection/file name. /// @param collection [IN] string containing the persistent name of the collection. diff --git a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx index 39072b98c9051728a3df08393b6595c93d0a0a9b..2bc26371bbd867e9ecf4f2dd370669b4b3d09909 100644 --- a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx +++ b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx @@ -543,16 +543,6 @@ pool::ICollection* PoolSvc::createCollection ATLAS_NOT_THREAD_SAFE return(collPtr); } //__________________________________________________________________________ -void PoolSvc::registerExistingCollection ATLAS_NOT_THREAD_SAFE - (pool::ICollection* coll, bool overwrite, bool sharedCat) -{ - std::lock_guard<CallMutex> lock(m_pool_mut); - m_catalog->commit(); - pool::CollectionFactory* collFac = pool::CollectionFactory::get(); - collFac->registerExisting(coll, overwrite, sharedCat ? m_catalog : nullptr); - m_catalog->start(); -} -//__________________________________________________________________________ Token* PoolSvc::getToken(const std::string& connection, const std::string& collection, const unsigned long ientry) const { diff --git a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.h b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.h index ec0e564864394c3190e877d4d957ef0bc289efd4..db883011c212c1c5df50103491df79a3500373f2 100644 --- a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.h +++ b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.h @@ -109,12 +109,6 @@ public: // Non-static members const pool::ICollection::OpenMode& openMode = pool::ICollection::READ, unsigned int contextId = IPoolSvc::kInputStream) const; - /// @return void - /// @param c [IN] collection to be registered - /// @param overwrite [IN] whether to overwrite - /// @param sharedCat [IN] whether to use same catalog as data - void registerExistingCollection ATLAS_NOT_THREAD_SAFE (pool::ICollection* c, bool overwrite, bool sharedCat = true); - /// @return a token for a container entry. /// @param connection [IN] string containing the connection/file name. /// @param collection [IN] string containing the persistent name of the collection. diff --git a/Event/xAOD/xAODCaloEvent/Root/CaloClusterAccessors_v1.cxx b/Event/xAOD/xAODCaloEvent/Root/CaloClusterAccessors_v1.cxx index 0a3353663d6450f8aaaaad3af0ac8700533add0c..3708e0bf83be9daa167123a988ec5204343afd8a 100644 --- a/Event/xAOD/xAODCaloEvent/Root/CaloClusterAccessors_v1.cxx +++ b/Event/xAOD/xAODCaloEvent/Root/CaloClusterAccessors_v1.cxx @@ -56,6 +56,7 @@ namespace xAOD { DEFINE_ACCESSOR( SIGNIFICANCE ); DEFINE_ACCESSOR( PTD ); DEFINE_ACCESSOR( MASS ); + DEFINE_ACCESSOR( SECOND_TIME ); DEFINE_ACCESSOR( CELL_SIGNIFICANCE ); DEFINE_ACCESSOR( CELL_SIG_SAMPLING ); DEFINE_ACCESSOR( AVG_LAR_Q ); diff --git a/Event/xAOD/xAODCaloEvent/Root/CaloCluster_v1.cxx b/Event/xAOD/xAODCaloEvent/Root/CaloCluster_v1.cxx index 6b5b48e5180d0cf0917fde1a4682401c5f2c22b2..52aa125df7910deeef525ff9c2b086f3b675a280 100644 --- a/Event/xAOD/xAODCaloEvent/Root/CaloCluster_v1.cxx +++ b/Event/xAOD/xAODCaloEvent/Root/CaloCluster_v1.cxx @@ -33,7 +33,8 @@ namespace xAOD { : IParticle(other), m_samplingPattern(other.samplingPattern()), m_cellLinks(nullptr), - m_recoStatus(other.m_recoStatus) { + m_recoStatus(other.m_recoStatus), + m_secondTime(other.m_secondTime) { setSignalState(other.signalState()); this->makePrivateStore(other); #if !(defined(SIMULATIONBASE) || defined(XAOD_ANALYSIS)) @@ -58,6 +59,7 @@ namespace xAOD { m_recoStatus=other.m_recoStatus; setSignalState(other.signalState()); m_samplingPattern=other.m_samplingPattern; + m_secondTime = other.m_secondTime; #if !(defined(SIMULATIONBASE) || defined(XAOD_ANALYSIS)) const CaloClusterCellLink* links=other.getCellLinks(); @@ -922,6 +924,15 @@ namespace xAOD { return true; } + void CaloCluster_v1::setSecondTime(CaloCluster_v1::flt_t stime) { m_secondTime = stime; } + + CaloCluster_v1::flt_t CaloCluster_v1::secondTime() const { + if ( m_secondTime < 0. ) { + double stime(0.); return this->retrieveMoment(SECOND_TIME,stime) ? stime : 0.; + } else { + return m_secondTime; + } + } #if !(defined(SIMULATIONBASE) || defined(XAOD_ANALYSIS)) size_t CaloCluster_v1::size() const { diff --git a/Event/xAOD/xAODCaloEvent/src/CaloClusterKineHelper.cxx b/Event/xAOD/xAODCaloEvent/src/CaloClusterKineHelper.cxx index 592ab047a04854fc9a8630a0d3fe4bbca2ec741d..320ba561fb14882a3ab4a62687e2f89756918154 100644 --- a/Event/xAOD/xAODCaloEvent/src/CaloClusterKineHelper.cxx +++ b/Event/xAOD/xAODCaloEvent/src/CaloClusterKineHelper.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef SIMULATIONBASE @@ -12,6 +12,8 @@ #include "CaloGeoHelpers/CaloPhiRange.h" #include "CaloEvent/CaloPrefetch.h" +#include <cmath> + namespace { @@ -37,6 +39,7 @@ struct CellAccum PresenceInSample(), theNewEnergy(0), theNewTime(0), + theNewSecondTime(0), theNewEta(0), theNewPhi(0), phi0(-999), @@ -55,6 +58,7 @@ struct CellAccum bool PresenceInSample[CaloSampling::Unknown]; double theNewEnergy; double theNewTime; + double theNewSecondTime; double theNewEta; double theNewPhi; double phi0; @@ -160,9 +164,10 @@ void accumCell (const CaloClusterCellLink::const_iterator& cellIt, CellAccum& ac // Is time defined? if ( cell.provenance() & pmask ) { // keep the sign of weight for the time norm in case a cell is removed - double theTimeNorm = fabsweight * theEnergy * theEnergyNoWeight; - accum.theNewTime += theTimeNorm * cell.time(); - accum.timeNorm += theTimeNorm; + double theTimeNorm = fabsweight * theEnergy * theEnergyNoWeight; + accum.theNewTime += theTimeNorm * cell.time(); + accum.theNewSecondTime += theTimeNorm * cell.time() * cell.time(); + accum.timeNorm += theTimeNorm; } } } @@ -251,10 +256,17 @@ void CaloClusterKineHelper::calculateKine(xAOD::CaloCluster* clu, const bool use clu->setE(accum.theNewEnergy); clu->setM(0.0); - if ( timeNorm != 0. ) + if ( timeNorm != 0. ) { clu->setTime(accum.theNewTime/timeNorm); - else - clu->setTime(0); + // note that standard deviation of cell time distribution is >= 0. + // (no particular accommodation for <x^2> < <x><x>!) + // clu->setSecondTime(std::sqrt(std::max(accum.theNewSecondTime/timeNorm-clu->time()*clu->time(),0.))); + // consistency with other second moments: store variance! + clu->setSecondTime(accum.theNewSecondTime/timeNorm-clu->time()*clu->time()); + } else { + clu->setTime(0.); + clu->setSecondTime(0.); + } //Set Sampling pattern: diff --git a/Event/xAOD/xAODCaloEvent/xAODCaloEvent/selection.xml b/Event/xAOD/xAODCaloEvent/xAODCaloEvent/selection.xml index ec86a1c2207f8269e37b1b8eab3219edf155d338..ece9052cf6997976cb9ddca8b2b81c7e77273fb9 100644 --- a/Event/xAOD/xAODCaloEvent/xAODCaloEvent/selection.xml +++ b/Event/xAOD/xAODCaloEvent/xAODCaloEvent/selection.xml @@ -6,6 +6,7 @@ <field name="m_signalState" transient="true" /> <field name="m_cellLinks" transient="true" /> <field name="m_recoStatus" transient="true" /> + <field name="m_secondTime" transient="true" /> </class> <read sourceClass="xAOD::CaloCluster_v1" version="[1-]" targetClass="xAOD::CaloCluster_v1" source="" target="m_signalState" > @@ -19,6 +20,11 @@ m_cellLinks = 0; ]]> </read> + <read sourceClass="xAOD::CaloCluster_v1" version="[1-]" + targetClass="xAOD::CaloCluster_v1" source="" target="m_secondTime" > + <![CDATA[ + m_secondTime = -999; + ]]> <class name="xAOD::CaloClusterContainer_v1" id="24997BCA-3F6A-4530-8826-822EE9FC3C08" /> <typedef name="xAOD::CaloCluster" /> diff --git a/Event/xAOD/xAODCaloEvent/xAODCaloEvent/versions/CaloCluster_v1.h b/Event/xAOD/xAODCaloEvent/xAODCaloEvent/versions/CaloCluster_v1.h index 2cd7b51a3c5bf5f932db305a59fee5ced4b095c2..aae9d913cfdc1b5c2ffa9441f464006bf5ff54a5 100644 --- a/Event/xAOD/xAODCaloEvent/xAODCaloEvent/versions/CaloCluster_v1.h +++ b/Event/xAOD/xAODCaloEvent/xAODCaloEvent/versions/CaloCluster_v1.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef XAODCALOEVENT_VERSIONS_CALOCLUSTER_V1_H #define XAODCALOEVENT_VERSIONS_CALOCLUSTER_V1_H @@ -14,7 +14,7 @@ extern "C" { // xAOD include(s): #include "xAODBase/IParticle.h" -//Defintion of CaloSamples (enum) +//Definition of CaloSamples (enum) #include "CaloGeoHelpers/CaloSampling.h" #include "xAODCaloEvent/CaloClusterBadChannelData.h" @@ -45,8 +45,11 @@ namespace xAOD { /// Description of a calorimeter cluster /// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> /// @author Walter Lampl <Walter.Lampl@cern.ch> + /// @author Peter Loch <Peter.Loch@cern.ch> /// - /// + /// @since 23-March-2021: added methods to set and retrieve second + /// moment of cell time distribution (persistified + /// as a cluster moment) class CaloCluster_v1 : public IParticle { friend class ::CaloClusterChangeSignalState; @@ -103,8 +106,8 @@ namespace xAOD { DELTA_PHI = 301, /// Angular shower axis deviation (\f$\theta\f$) from IP-to-Center DELTA_THETA = 302, - /// Angular shower axis deviation from IP-to-Center - DELTA_ALPHA = 303, + /// Angular shower axis deviation (\f$\Delta\alpha\f$) from IP-to-Center + DELTA_ALPHA = 303, CENTER_X = 401, ///< Cluster Centroid (\f$x\f$) CENTER_Y = 402, ///< Cluster Centroid (\f$y\f$) CENTER_Z = 403, ///< Cluster Centroid (\f$z\f$) @@ -153,6 +156,8 @@ namespace xAOD { DM_WEIGHT = 903, ///< Dead-material weight (E_dm/E_ooc) /// Confidence Level of a tile calorimeter cluster to be noise TILE_CONFIDENCE_LEVEL = 904, + /// Second moment of cell time distribution in cluster + SECOND_TIME = 910, VERTEX_FRACTION = 1000, /**< Vertex fraction of this cluster wrt. primary vertex of the event. Calculated in CaloRec/CaloClusterVertexFractionMaker.cxx */ NVERTEX_FRACTION = 1001, /**< slightly updated vertex fraction more pile up independent (similar to nJVF) */ @@ -442,6 +447,16 @@ namespace xAOD { void setTime(flt_t); /// Access cluster time flt_t time() const; + /// Set second moment of cell timing distribution + void setSecondTime(flt_t stime); + /// Access second moment of cell timing distribution + /// + /// For clusters read from persistent storage, this method returns the value + /// stored for the @c SECOND_TIME moment. + /// + /// @retval 0 if (1) moment is not available, (2) the cluster time could not be calculated, + /// or (3) the cluster has only one cell or all cells have exactly the same time. + flt_t secondTime() const; /// Access to sampling pattern (one bit per sampling) (Method may be removed later) unsigned samplingPattern() const; @@ -589,13 +604,16 @@ namespace xAOD { /// Current signal state State m_signalState; - ///Unique ptr to cell links. For cluster building + /// Unique ptr to cell links. For cluster building /// transient only , holds cells owned by the cluster if non-nullptr std::unique_ptr<CaloClusterCellLink> m_cellLinks; - ///Reco status (transient only) + /// Reco status (transient only) CaloRecoStatus m_recoStatus; + /// Second cell time moment (transient only) + double m_secondTime = { -1. }; + unsigned sampVarIdx(const CaloSample) const; float getSamplVarFromAcc(const Accessor<std::vector<float > >& acc, diff --git a/Event/xAOD/xAODCore/CMakeLists.txt b/Event/xAOD/xAODCore/CMakeLists.txt index df01b23be6f16156f386f7a7f70f59f8c4f558d3..659debc3d08f32637bbecaaf1d6a6e7b494d9765 100644 --- a/Event/xAOD/xAODCore/CMakeLists.txt +++ b/Event/xAOD/xAODCore/CMakeLists.txt @@ -32,9 +32,13 @@ atlas_add_dictionary( xAODCoreDict xAODCore/selection.xml LINK_LIBRARIES xAODCore ) +set( _stlDictXml "xAODCore/selectionSTL.xml" ) +if( APPLE ) + set( _stlDictXml "xAODCore/selectionSTLmacOS.xml" ) +endif() atlas_add_dictionary( xAODCoreSTLDict xAODCore/xAODCoreSTLDict.h - xAODCore/selectionSTL.xml ) + ${_stlDictXml} ) # Install the CMake code from the package: atlas_install_generic( cmake/xAODUtilitiesConfig.cmake diff --git a/Event/xAOD/xAODCore/xAODCore/selectionSTL.xml b/Event/xAOD/xAODCore/xAODCore/selectionSTL.xml index bb7b686365ed193834bc59ee486a442ea240bee5..f79951583a20b4bd3358abc89f5dfccf11027f86 100644 --- a/Event/xAOD/xAODCore/xAODCore/selectionSTL.xml +++ b/Event/xAOD/xAODCore/xAODCore/selectionSTL.xml @@ -44,11 +44,12 @@ <!-- Map type(s). --> <class name="std::map<std::string,std::vector<int> >" /> <class name="std::map<std::string,std::vector<float> >" /> - <class pattern="std::*pair*<*string*vector<float*"/> <class name="std::map<std::string,std::vector<std::vector<int> > >" /> - <class pattern="std::*pair*<*string*vector<*vector<int*"/> <class name="std::map<std::string,std::vector<std::vector<float> > >" /> - <class pattern="std::*pair*<*string*vector<*vector<float*"/> + + <!-- Pair type(s) belonging to that/those map type(s) --> + <class pattern="*pair*<*string*vector<int*" /> + <class pattern="*pair*<*string*vector<float*" /> <!-- "Other" type(s). --> <class name="std::bitset<3>" /> diff --git a/Event/xAOD/xAODCore/xAODCore/selectionSTLmacOS.xml b/Event/xAOD/xAODCore/xAODCore/selectionSTLmacOS.xml new file mode 100644 index 0000000000000000000000000000000000000000..735d9cf08c25fe2ded97d9a5ec81ef48308782ee --- /dev/null +++ b/Event/xAOD/xAODCore/xAODCore/selectionSTLmacOS.xml @@ -0,0 +1,61 @@ +<!-- Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration --> +<lcgdict> + + <!-- "Single" vector type(s). --> + <class name="std::vector<char>" /> + <class name="std::vector<signed char>" /> + <class name="std::vector<unsigned char>" /> + <class name="std::vector<uint32_t>" /> + + <!-- "Double" vector type(s). --> + <class name="std::vector<std::vector<bool> >" /> + <class name="std::vector<std::vector<char> >" /> + <class name="std::vector<std::vector<signed char> >" /> + <class name="std::vector<std::vector<unsigned char> >" /> + <class name="std::vector<std::vector<int> >" /> + <class name="std::vector<std::vector<size_t> >" /> + <class name="std::vector<std::vector<uint16_t> >" /> + <class name="std::vector<std::vector<uint32_t> >" /> + <class name="std::vector<std::vector<unsigned long> >" /> + <class name="std::vector<std::vector<unsigned long long> >" /> + <class name="std::vector<std::vector<std::string> >" /> + + <!-- "Triple" vector type(s). --> + <class name="std::vector<std::vector<std::vector<int> > >" /> + <class name="std::vector<std::vector<std::vector<unsigned char> > >" /> + <class name="std::vector<std::vector<std::vector<size_t> > >" /> + <class name="std::vector<std::vector<std::vector<uint16_t> > >" /> + <class name="std::vector<std::vector<std::vector<uint32_t> > >" /> + <class name="std::vector<std::vector<std::vector<unsigned long> > >" /> + <class name="std::vector<std::vector<std::vector<unsigned long long> > >" /> + <class name="std::vector<std::vector<std::vector<float> > >" /> + <class name="std::vector<std::vector<std::vector<std::string> > >" /> + + <!-- "Quadruple" vector type(s). --> + <class name="std::vector<std::vector<std::vector<std::vector<std::string> > > >" /> + + <!-- "Special" vector type(s). --> + <class name="std::vector<std::set<uint32_t> >" /> + <class name="std::vector<std::vector<std::set<uint32_t> > >" /> + <class name="std::vector<std::pair<std::string,std::string> >" /> + <class name="std::vector<std::vector<std::pair<std::string,std::string> > >" /> + <class name="std::vector<std::vector<std::pair<unsigned int,double> > >" /> + + <!-- Map type(s). --> + <class name="std::map<std::string,std::vector<int> >" /> + <class name="std::map<std::string,std::vector<float> >" /> + <class name="std::map<std::string,std::vector<std::vector<int> > >" /> + <class name="std::map<std::string,std::vector<std::vector<float> > >" /> + + <!-- Pair type(s) belonging to that/those map type(s) --> + <class name="std::pair<std::string,std::vector<int> >" /> + <class name="std::pair<std::string,std::vector<float> >" /> + <class name="std::pair<std::string,std::vector<std::vector<int> > >" /> + <class name="std::pair<std::string,std::vector<std::vector<float> > >" /> + + <!-- "Other" type(s). --> + <class name="std::bitset<3>" /> + <class name="std::bitset<11>" /> + <class name="std::set<uint32_t>" /> + +</lcgdict> diff --git a/Event/xAOD/xAODCore/xAODCore/xAODCoreSTLDict.h b/Event/xAOD/xAODCore/xAODCore/xAODCoreSTLDict.h index c11b58d76361203464fdda09c811b6bd4eba8297..f061f53c1e3431d61a7f3d1d50b4389e40e7dab4 100644 --- a/Event/xAOD/xAODCore/xAODCore/xAODCoreSTLDict.h +++ b/Event/xAOD/xAODCore/xAODCore/xAODCoreSTLDict.h @@ -63,6 +63,14 @@ namespace { std::map< std::string, std::vector< std::vector< int > > > stl_m3; std::map< std::string, std::vector< std::vector< float > > > stl_m4; + // Pair type(s) belonging to that/those map type(s). +#ifdef XAOD_ANALYSIS + std::pair< std::string, std::vector< int > > stl_p1; +#endif // XAOD_ANALYSIS + std::pair< std::string, std::vector< float > > stl_p2; + std::pair< std::string, std::vector< std::vector< int > > > stl_p3; + std::pair< std::string, std::vector< std::vector< float > > > stl_p4; + // "Other" type(s). std::bitset< 3 > stl_o1; // 3 == CaloCluster::NSTATES std::bitset< 11 > stl_o2; // 11 == xAOD::NumberOfTrackRecoInfo @@ -70,9 +78,4 @@ namespace { }; } -// specializations to be picked up by class patterns in the selection.xml -template struct std::pair<std::string, std::vector<float> >; -template struct std::pair<std::string, std::vector< std::vector<int> > >; -template struct std::pair<std::string, std::vector< std::vector<float> > >; - #endif // XAODCORE_XAODCORESTLDICT_H diff --git a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx index 6a8da47c9ca043c5f1bd54a33e6b2a4a7c4f608d..c978313cb5f28a33a72a6f5fce17c34ed69242fe 100644 --- a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx +++ b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx @@ -220,6 +220,8 @@ namespace xAODMaker { // Event weights vector<float> weights; for (const double& w : genEvt->weights()) weights.push_back((float)(w)); + //AV This to be decided. It is always a good idea to have a default weight 1.0. + //if (weights.empty()) weights.push_back(1.0); xTruthEvent->setWeights(weights); // Heavy ion info @@ -462,12 +464,6 @@ namespace xAODMaker { void xAODTruthCnvAlg::fillVertex(xAOD::TruthVertex* tv, HepMC::ConstGenVertexPtr gv) { tv->setId(gv->id()); tv->setBarcode(HepMC::barcode(gv)); - - // No vertex weights - // vector<float> weights; - // for (const double& w : gv->weights()) weights.push_back((float)w); - // tv->setWeights(weights); - tv->setX(gv->position().x()); tv->setY(gv->position().y()); tv->setZ(gv->position().z()); @@ -535,7 +531,12 @@ namespace xAODMaker { if (!genEvt.run_info()) { for (size_t i=0; i<genEvt.weights().size();i++) orderedWeightNameVec.push_back(std::to_string(i)); } else { - orderedWeightNameVec=genEvt.weight_names(); + if (!genEvt.run_info()->weight_names().empty()) { + orderedWeightNameVec = genEvt.weight_names(); + } else { + //AV This to be decided. It is always a good idea to have a default weight 1.0. + //orderedWeightNameVec.push_back("0"); + } } md->setWeightNames(orderedWeightNameVec); #else diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p1.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p1.h index 3639f774cf59341af1e6f2aa4687b9c8dbb281b5..32d1dd0321b7c57762c1056a24acecc299e0c75f 100755 --- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p1.h +++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p1.h @@ -40,13 +40,6 @@ class HepMcParticleLinkCnv_p1 : public T_AthenaPoolTPCnvBase< */ HepMcParticleLinkCnv_p1(); - /** Destructor: - */ - //virtual ~HepMcParticleLinkCnv_p1(); - - /////////////////////////////////////////////////////////////////// - // Const methods: - /////////////////////////////////////////////////////////////////// /** Method creating the transient representation of @c HepMcParticleLink * from its persistent representation @c HepMcParticleLink_p1 @@ -62,15 +55,6 @@ class HepMcParticleLinkCnv_p1 : public T_AthenaPoolTPCnvBase< HepMcParticleLink_p1* persObj, MsgStream &msg ); - /////////////////////////////////////////////////////////////////// - // Protected methods: - /////////////////////////////////////////////////////////////////// - protected: - - /////////////////////////////////////////////////////////////////// - // Protected data: - /////////////////////////////////////////////////////////////////// - protected: }; diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p2.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p2.h index dbdf608e2280be51413660a38d2624d4f74dc886..8a677b68820fe5916406ecd15288352ae76084d3 100755 --- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p2.h +++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p2.h @@ -36,13 +36,6 @@ public: */ HepMcParticleLinkCnv_p2(); - /** Destructor: - */ - //virtual ~HepMcParticleLinkCnv_p2(); - - /////////////////////////////////////////////////////////////////// - // Const methods: - /////////////////////////////////////////////////////////////////// /** Method creating the transient representation of @c HepMcParticleLink * from its persistent representation @c HepMcParticleLink_p2 @@ -57,17 +50,6 @@ public: virtual void transToPers( const HepMcParticleLink* transObj, HepMcParticleLink_p2* persObj, MsgStream &msg ); - - /////////////////////////////////////////////////////////////////// - // Protected methods: - /////////////////////////////////////////////////////////////////// -protected: - - /////////////////////////////////////////////////////////////////// - // Protected data: - /////////////////////////////////////////////////////////////////// -protected: - }; /////////////////////////////////////////////////////////////////// diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLink_p1.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLink_p1.h index 0957408e33600c118374890d4a52f0609482e30b..170ef09100a8b756cd2386bad1b46b55b8fb0f46 100755 --- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLink_p1.h +++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLink_p1.h @@ -36,14 +36,6 @@ class HepMcParticleLink_p1 const unsigned short genEvtIndex, const unsigned long barcode ); - /////////////////////////////////////////////////////////////////// - // Const methods: - /////////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////// - // Non-const methods: - /////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////// // Protected data: /////////////////////////////////////////////////////////////////// diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLink_p2.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLink_p2.h index c244be767dedd176e77bd20c88fc1b585d007f73..71c772ec93e879fd7d175e6f9de191bd4aea66e3 100755 --- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLink_p2.h +++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/HepMcParticleLink_p2.h @@ -33,14 +33,6 @@ public: const unsigned long barcode, char evtColl ); - /////////////////////////////////////////////////////////////////// - // Const methods: - /////////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////// - // Non-const methods: - /////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////// // Protected data: /////////////////////////////////////////////////////////////////// diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p1.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p1.h index 4a008270378034d553d8952b8908249883e2e200..a55f9ecd831f8042a0864c2de81639f73a95ccc9 100755 --- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p1.h +++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p1.h @@ -65,10 +65,6 @@ class McEventCollectionCnv_p1 : public T_AthenaPoolTPCnvBase< */ virtual ~McEventCollectionCnv_p1(); - /////////////////////////////////////////////////////////////////// - // Const methods: - /////////////////////////////////////////////////////////////////// - /** Method creating the transient representation of @c McEventCollection * from its persistent representation @c McEventCollection_p1 */ diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p2.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p2.h index 084c72730ba61d01cc485f19b275bd1c5e61ffaa..b85dd02a6386d6d8b97fc280e0039274f4579b7c 100755 --- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p2.h +++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p2.h @@ -71,10 +71,6 @@ class McEventCollectionCnv_p2 : public T_AthenaPoolTPCnvBase< */ virtual ~McEventCollectionCnv_p2(); - /////////////////////////////////////////////////////////////////// - // Const methods: - /////////////////////////////////////////////////////////////////// - /** Method creating the transient representation of @c McEventCollection * from its persistent representation @c McEventCollection_p2 */ diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p3.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p3.h index 78f89d6c687e0c410c17e448a0fcd08c2549ec77..1d606a400081bedb5d12de476cb3d91de77a93d7 100755 --- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p3.h +++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p3.h @@ -70,10 +70,6 @@ class McEventCollectionCnv_p3 : public T_AthenaPoolTPCnvBase< */ virtual ~McEventCollectionCnv_p3(); - /////////////////////////////////////////////////////////////////// - // Const methods: - /////////////////////////////////////////////////////////////////// - /** Method creating the transient representation of @c McEventCollection * from its persistent representation @c McEventCollection_p3 */ diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p4.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p4.h index 4828f682825d5fc150045e0aa801ec1326cc771b..d261187dc596a2989d83002f116224d3a509e5ea 100755 --- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p4.h +++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p4.h @@ -75,10 +75,6 @@ class McEventCollectionCnv_p4 : public T_AthenaPoolTPCnvBase< void setPileup(); - /////////////////////////////////////////////////////////////////// - // Const methods: - /////////////////////////////////////////////////////////////////// - /** Method creating the transient representation of @c McEventCollection * from its persistent representation @c McEventCollection_p4 */ diff --git a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p5.h b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p5.h index dfae1c8c7ab4b194917e125ac556f9f67ca1a901..f4d009a8a8532a502059bbf978b157dd454e1aa8 100755 --- a/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p5.h +++ b/Generators/GeneratorObjectsTPCnv/GeneratorObjectsTPCnv/McEventCollectionCnv_p5.h @@ -76,10 +76,6 @@ class McEventCollectionCnv_p5 : public T_AthenaPoolTPCnvBase< void setPileup(); - /////////////////////////////////////////////////////////////////// - // Const methods: - /////////////////////////////////////////////////////////////////// - /** Method creating the transient representation of @c McEventCollection * from its persistent representation @c McEventCollection_p5 */ diff --git a/Generators/GeneratorObjectsTPCnv/src/GenEventCnv_p1.cxx b/Generators/GeneratorObjectsTPCnv/src/GenEventCnv_p1.cxx index 350e9549da6da9f7b12bc91079b06bb2f20ca735..7c11814fc732273251234aafc29a0eabe1b83509 100755 --- a/Generators/GeneratorObjectsTPCnv/src/GenEventCnv_p1.cxx +++ b/Generators/GeneratorObjectsTPCnv/src/GenEventCnv_p1.cxx @@ -95,7 +95,7 @@ void GenEventCnv_p1::persToTrans( const GenEvent_p1* persObj, // create the vertices for ( unsigned int iVtx = 0; iVtx != nVertices; ++iVtx ) { const GenVertex_p1& persVtx = persObj->m_vertices[iVtx]; - transObj->add_vertex( createGenVertex( *persObj, persVtx, partToEndVtx, *m_pool ) ); + createGenVertex( *persObj, persVtx, partToEndVtx, *m_pool, transObj ); } //> end loop over vertices // set the signal process vertex diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx index b844798bbc51935173d5f7c79f8e2a7917db71c9..5f6ca99d72305f530b26243833083de67e45a06f 100755 --- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx +++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx @@ -257,7 +257,13 @@ void McEventCollectionCnv_p4::transToPers( const McEventCollection* transObj, const HepMC::GenEvent* genEvt = *itr; //save the weight names to metadata via the HepMCWeightSvc if (genEvt->run_info()) { - m_hepMCWeightSvc->setWeightNames( names_to_name_index_map(genEvt->weight_names()) ).ignore(); + if (!genEvt->run_info()->weight_names().empty()) { + m_hepMCWeightSvc->setWeightNames( names_to_name_index_map(genEvt->weight_names()) ).ignore(); + } else { + //AV : This to be decided if one would like to have default names. + //std::vector<std::string> names{"0"}; + //m_hepMCWeightSvc->setWeightNames( names_to_name_index_map(names) ); + } } auto A_signal_process_id=genEvt->attribute<HepMC3::IntAttribute>("signal_process_id"); auto A_event_scale=genEvt->attribute<HepMC3::DoubleAttribute>("event_scale"); diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p5.cxx b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p5.cxx index a713b1d88d8a958ad65995450cb9704d38e2a2b4..f9824cb1460b34ee51a70717f083262a244cd267 100755 --- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p5.cxx +++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p5.cxx @@ -354,7 +354,13 @@ void McEventCollectionCnv_p5::transToPers( const McEventCollection* transObj, #ifdef HEPMC3 //save the weight names to metadata via the HepMCWeightSvc if (genEvt->run_info()) { - m_hepMCWeightSvc->setWeightNames( names_to_name_index_map(genEvt->weight_names()) ).ignore(); + if (!genEvt->run_info()->weight_names().empty()) { + m_hepMCWeightSvc->setWeightNames( names_to_name_index_map(genEvt->weight_names()) ).ignore(); + } else { + //AV : This to be decided if one would like to have default names. + //std::vector<std::string> names{"0"}; + //m_hepMCWeightSvc->setWeightNames( names_to_name_index_map(names) ); + } } auto A_mpi=genEvt->attribute<HepMC3::IntAttribute>("mpi"); diff --git a/Generators/Pythia8_i/test/test_00_Zprime_1000_tt.sh b/Generators/Pythia8_i/test/test_00_Zprime_1000_tt.sh index 68dfb4a820ddaedca9542474650fe05532d00a3c..5f8b153a18b6b469c0bc163cb1916730c0d06226 100755 --- a/Generators/Pythia8_i/test/test_00_Zprime_1000_tt.sh +++ b/Generators/Pythia8_i/test/test_00_Zprime_1000_tt.sh @@ -13,6 +13,8 @@ Gen_tf.py --ecmEnergy=13000. --maxEvents=10000 --firstEvent=-1 --randomSeed=123456 --outputEVNTFile=EVNT.root --outputYODAFile=MyOutput.yoda.gz --postInclude=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Pythia8i/JO_MC/JO_MC_Zprime.py --jobConfig=950072 +asetup 22.6.1,AthGeneration +source setupRivet echo "art-result:$? Gen_tf" @@ -28,7 +30,8 @@ dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Pythia8i/test_00_Zpr bash /cvmfs/atlas.cern.ch/repo/sw/art/dcube/bin/art-dcube $dcubeName MyOutput.root $dcubeXml $dcubeRef #yodadiff -o yodadiff MyOutput.yoda.gz ~/Qualification_task_ART/Pythia_8/result/Pythia_8/test_00_Zprime_1000_tt/MyOutput.yoda.gz # use this for histogram comparison if one only care if they are exactly the same -echo "art-result: $? Dcube" +echo "art-result: $? Dcube" + diff --git a/Generators/Pythia8_i/test/test_01_Z_tautau.sh b/Generators/Pythia8_i/test/test_01_Z_tautau.sh index 7ed9d24573d709db3ccb412e0b43a57bbe9f3a52..0435ddc0dc8e2238934bcc2c5bd55848a797c6f1 100755 --- a/Generators/Pythia8_i/test/test_01_Z_tautau.sh +++ b/Generators/Pythia8_i/test/test_01_Z_tautau.sh @@ -16,6 +16,8 @@ Gen_tf.py --ecmEnergy=13000. --maxEvents=10000 --firstEvent=-1 --randomSeed=1234 echo "art-result:$? Gen_tf" +source `which setupRivet` + python rootconvert.py MyOutput.yoda.gz echo "art-result: $? convert" diff --git a/Generators/Pythia8_i/test/test_02_minbias.sh b/Generators/Pythia8_i/test/test_02_minbias.sh index d58ac25ea50566cc67abde380bcb133be13eda28..abd918b4e44e04f3f6469566d2a4692806b33f5e 100755 --- a/Generators/Pythia8_i/test/test_02_minbias.sh +++ b/Generators/Pythia8_i/test/test_02_minbias.sh @@ -13,6 +13,7 @@ Gen_tf.py --ecmEnergy=13000. --maxEvents=10000 --firstEvent=-1 --randomSeed=123456 --outputEVNTFile=EVNT.root --outputYODAFile=MyOutput.yoda.gz --postInclude=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Pythia8i/JO_MC/JO_MC_minbias.py --jobConfig=421113 +source setupRivet.sh echo "art-result:$? Gen_tf" diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx index bcaf9930f2e4a03f284fd23c370774e33189f790..cf163cd72ef086313cf3bd24b3eaeff40547f1d1 100755 --- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx +++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx @@ -105,7 +105,7 @@ InDetMaterialManager::getMaterial(const std::string& materialName) { bool InDetMaterialManager::hasMaterial(const std::string& materialName) const { - return m_store.find(materialName) != m_store.end(); + return m_weightMap.find(materialName) != m_weightMap.end(); } const GeoMaterial* diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py index f71ae46426c9aa193296bde2c43ecc942e7d8989..26f8d15e5ce9b28a4ef9f96fc8bf436e820fc861 100644 --- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py +++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py @@ -10,6 +10,7 @@ from InDetRecExample.InDetJobProperties import InDetFlags from DerivationFrameworkInDet.InDetCommon import * from InDetPrepRawDataToxAOD.InDetDxAODJobProperties import InDetDxAODFlags +from InDetRecExample import TrackingCommon # Select active sub-systems dumpPixInfo = InDetDxAODFlags.DumpPixelInfo() @@ -140,7 +141,8 @@ if makeSplitTracks: # Create xAOD::TrackParticles out of them from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool InDetxAODSplitParticleCreatorTool = Trk__TrackParticleCreatorTool(name = "InDetSplitxAODParticleCreatorTool", - TrackSummaryTool = InDetTrackSummaryToolSharedHits, + TrackToVertex = TrackingCommon.getInDetTrackToVertexTool(), + TrackSummaryTool = TrackingCommon.getInDetTrackSummaryToolSharedHits(), KeepParameters = True) ToolSvc += InDetxAODSplitParticleCreatorTool # The following adds truth information, but needs further testing @@ -148,6 +150,7 @@ if makeSplitTracks: #if isIdTrkDxAODSimulation: # InDetSplitTracksTruth = ConfiguredInDetTrackTruth("Tracks_splitID",'SplitTrackDetailedTruth','SplitTrackTruth') + from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg xAODSplitTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg('InDetSplitTrackParticles') xAODSplitTrackParticleCnvAlg.xAODContainerName = 'InDetSplitTrackParticles' xAODSplitTrackParticleCnvAlg.xAODTrackParticlesFromTracksContainerName = 'InDetSplitTrackParticles' diff --git a/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonResiduals.h b/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonResiduals.h index 36ce3bcf4313e93339628b62e14cdec13073c273..a86fa804dcece684a15beacd51fbd2022e03e0b8 100755 --- a/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonResiduals.h +++ b/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonResiduals.h @@ -191,7 +191,7 @@ class IDAlignMonResiduals : public ManagedMonitorToolBase bool m_extendedPlots{}; bool m_changedlumiblock{}; int m_oldlumiblock{}; - int m_FinerBinningFactor{}; + float m_FinerBinningFactor{}; float m_LBGranularity{}; std::vector<TString> m_siliconBarrelLayersLabels; std::vector<TString> m_siliconEndcapLayersLabels; diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZmumu.h b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZmumu.h index 7299628961b205b80d1c9d027d5d031f4258daf1..a61ccb9ede36ff51acbb259fd8b0261c0edb7899 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZmumu.h +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZmumu.h @@ -190,7 +190,7 @@ class IDPerfMonZmumu : public AthAlgorithm double m_positive_d0{}; double m_positive_z0_err{}; double m_positive_d0_err{}; - double m_positive_sigma_qOverP{}; + double m_positive_sigma_pt{}; double m_positive_z0_PV{}; double m_positive_d0_PV{}; double m_positive_z0_PVerr{}; @@ -218,7 +218,7 @@ class IDPerfMonZmumu : public AthAlgorithm double m_negative_d0{}; double m_negative_z0_err{}; double m_negative_d0_err{}; - double m_negative_sigma_qOverP{}; + double m_negative_sigma_pt{}; double m_negative_z0_PV{}; double m_negative_d0_PV{}; double m_negative_z0_PVerr{}; diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TrackMonitoring.py b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TrackMonitoring.py index f78edefa20aa6ccb9b6be60f279c757f14141048..d11abd230bd9cc03e02daf3aaa5e7c72469c8104 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TrackMonitoring.py +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TrackMonitoring.py @@ -129,6 +129,7 @@ for trackCollection in trackCollections: NBinsPtRange = 25, xHitErrorRange = 0.06, maxPtforECHistos = 100., # to be set to 10 or 5 GeV + FinerBinningFactor = 0.5, applyHistWeight = useWeightInMonitoring, hWeightHistName = "h_eventMuVsTrkEta", hWeightInFileName = fileWithWeights, diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx index 03a20e4b1f4ed63020d18c25e9ac7edc03259d43..95176f2c1cb186713d7b675e58aa04e605d49f04 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx @@ -285,6 +285,7 @@ StatusCode IDPerfMonZmumu::bookTrees() m_defaultTree->Branch("Negative_d0", &m_negative_d0, "Negative_d0/D"); m_defaultTree->Branch("Negative_z0_err", &m_negative_z0_err, "Negative_z0_err/D"); m_defaultTree->Branch("Negative_d0_err", &m_negative_d0_err, "Negative_d0_err/D"); + m_defaultTree->Branch("Negative_sigma_pt", &m_negative_sigma_pt, "Negative_sigma_pt/D"); m_defaultTree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D"); m_defaultTree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D"); @@ -293,6 +294,7 @@ StatusCode IDPerfMonZmumu::bookTrees() m_defaultTree->Branch("Positive_d0", &m_positive_d0, "Positive_d0/D"); m_defaultTree->Branch("Positive_z0_err", &m_positive_z0_err, "Positive_z0_err/D"); m_defaultTree->Branch("Positive_d0_err", &m_positive_d0_err, "Positive_d0_err/D"); + m_defaultTree->Branch("Positive_sigma_pt", &m_positive_sigma_pt, "Positive_sigma_pt/D"); if (m_doIP) { m_defaultTree->Branch("Negative_d0_PV", &m_negative_d0_PV , "Negative_d0_PV/D"); @@ -329,6 +331,8 @@ StatusCode IDPerfMonZmumu::bookTrees() m_IDTree->Branch("Negative_d0", &m_negative_d0, "Negative_d0/D"); m_IDTree->Branch("Negative_z0_err", &m_negative_z0_err, "Negative_z0_err/D"); m_IDTree->Branch("Negative_d0_err", &m_negative_d0_err, "Negative_d0_err/D"); + m_IDTree->Branch("Negative_sigma_pt", &m_negative_sigma_pt, "Negative_sigma_pt/D"); + m_IDTree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D"); m_IDTree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D"); m_IDTree->Branch("Positive_Pz", &m_positive_pz, "Positive_Pz/D"); @@ -336,6 +340,7 @@ StatusCode IDPerfMonZmumu::bookTrees() m_IDTree->Branch("Positive_d0", &m_positive_d0, "Positive_d0/D"); m_IDTree->Branch("Positive_z0_err", &m_positive_z0_err, "Positive_z0_err/D"); m_IDTree->Branch("Positive_d0_err", &m_positive_d0_err, "Positive_d0_err/D"); + m_IDTree->Branch("Positive_sigma_pt", &m_positive_sigma_pt, "Positive_sigma_pt/D"); if(m_doIP){ m_IDTree->Branch("Negative_d0_PV", &m_negative_d0_PV , "Negative_d0_PV/D"); @@ -372,7 +377,7 @@ StatusCode IDPerfMonZmumu::bookTrees() m_refit1Tree->Branch("Negative_d0", &m_negative_d0, "Negative_d0/D"); m_refit1Tree->Branch("Negative_z0_err", &m_negative_z0_err, "Negative_z0_err/D"); m_refit1Tree->Branch("Negative_d0_err", &m_negative_d0_err, "Negative_d0_err/D"); - m_refit1Tree->Branch("Negative_sigma_qoverp", &m_negative_sigma_qOverP, "Negative_sigma_qoverp/D"); + m_refit1Tree->Branch("Negative_sigma_pt", &m_negative_sigma_pt, "Negative_sigma_pt/D"); m_refit1Tree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D"); m_refit1Tree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D"); @@ -381,7 +386,7 @@ StatusCode IDPerfMonZmumu::bookTrees() m_refit1Tree->Branch("Positive_d0", &m_positive_d0, "Positive_d0/D"); m_refit1Tree->Branch("Positive_z0_err", &m_positive_z0_err, "Positive_z0_err/D"); m_refit1Tree->Branch("Positive_d0_err", &m_positive_d0_err, "Positive_d0_err/D"); - m_refit1Tree->Branch("Positive_sigma_qoverp", &m_positive_sigma_qOverP, "Positive_sigma_qoverp/D"); + m_refit1Tree->Branch("Positive_sigma_pt", &m_positive_sigma_pt, "Positive_sigma_pt/D"); if(m_doIP){ m_refit1Tree->Branch("Negative_d0_PV", &m_negative_d0_PV , "Negative_d0_PV/D"); @@ -418,8 +423,7 @@ StatusCode IDPerfMonZmumu::bookTrees() m_refit2Tree->Branch("Negative_d0", &m_negative_d0, "Negative_d0/D"); m_refit2Tree->Branch("Negative_z0_err", &m_negative_z0_err, "Negative_z0_err/D"); m_refit2Tree->Branch("Negative_d0_err", &m_negative_d0_err, "Negative_d0_err/D"); - - + m_refit2Tree->Branch("Negative_sigma_pt", &m_negative_sigma_pt, "Negative_sigma_pt/D"); m_refit2Tree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D"); m_refit2Tree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D"); @@ -428,6 +432,7 @@ StatusCode IDPerfMonZmumu::bookTrees() m_refit2Tree->Branch("Positive_d0", &m_positive_d0, "Positive_d0/D"); m_refit2Tree->Branch("Positive_z0_err", &m_positive_z0_err, "Positive_z0_err/D"); m_refit2Tree->Branch("Positive_d0_err", &m_positive_d0_err, "Positive_d0_err/D"); + m_refit2Tree->Branch("Positive_sigma_pt", &m_positive_sigma_pt, "Positive_sigma_pt/D"); if(m_doIP){ @@ -467,7 +472,7 @@ StatusCode IDPerfMonZmumu::bookTrees() m_combTree->Branch("Negative_d0", &m_negative_d0, "Negative_d0/D"); m_combTree->Branch("Negative_z0_err", &m_negative_z0_err, "Negative_z0_err/D"); m_combTree->Branch("Negative_d0_err", &m_negative_d0_err, "Negative_d0_err/D"); - + m_combTree->Branch("Negative_sigma_pt", &m_negative_sigma_pt, "Negative_sigma_pt/D"); m_combTree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D"); m_combTree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D"); @@ -476,6 +481,7 @@ StatusCode IDPerfMonZmumu::bookTrees() m_combTree->Branch("Positive_d0", &m_positive_d0, "Positive_d0/D"); m_combTree->Branch("Positive_z0_err", &m_positive_z0_err, "Positive_z0_err/D"); m_combTree->Branch("Positive_d0_err", &m_positive_d0_err, "Positive_d0_err/D"); + m_combTree->Branch("Positive_sigma_pt", &m_positive_sigma_pt, "Positive_sigma_pt/D"); if(m_doIP){ m_combTree->Branch("Negative_z0_PV", &m_negative_z0_PV, "Negative_z0_PV/D"); @@ -514,6 +520,7 @@ StatusCode IDPerfMonZmumu::bookTrees() m_MSTree->Branch("Negative_d0", &m_negative_d0, "Negative_d0/D"); m_MSTree->Branch("Negative_z0_err", &m_negative_z0_err, "Negative_z0_err/D"); m_MSTree->Branch("Negative_d0_err", &m_negative_d0_err, "Negative_d0_err/D"); + m_MSTree->Branch("Negative_sigma_pt", &m_negative_sigma_pt, "Negative_sigma_pt/D"); m_MSTree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D"); m_MSTree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D"); @@ -522,6 +529,7 @@ StatusCode IDPerfMonZmumu::bookTrees() m_MSTree->Branch("Positive_d0", &m_positive_d0, "Positive_d0/D"); m_MSTree->Branch("Positive_z0_err", &m_positive_z0_err, "Positive_z0_err/D"); m_MSTree->Branch("Positive_d0_err", &m_positive_d0_err, "Positive_d0_err/D"); + m_MSTree->Branch("Positive_sigma_pt", &m_positive_sigma_pt, "Positive_sigma_pt/D"); } if( m_isMC && m_truthTree == 0){ @@ -907,14 +915,16 @@ StatusCode IDPerfMonZmumu::execute() << " pt: " << muon_pos->trackParticle(xAOD::Muon::InnerDetectorTrackParticle)->pt() << " d0: " << m_positive_d0 << " z0: " << m_positive_z0 - << " d0unc: " << m_positive_d0_err); + << " d0unc: " << m_positive_d0_err + << " sigma_pt: " << m_positive_sigma_pt); ATH_MSG_DEBUG("mu- --> pxyz: " << m_negative_px << ", " << m_negative_py << ", " << m_negative_pz << " pt: " << muon_neg->trackParticle(xAOD::Muon::InnerDetectorTrackParticle)->pt() << " d0: " << m_negative_d0 << " z0: " << m_negative_z0 - << " d0unc: " << m_negative_d0_err); + << " d0unc: " << m_negative_d0_err + << " sigma_pt: " << m_negative_sigma_pt); // ntuple variables have been filled in FillRecParametersTP m_IDTree->Fill(); } @@ -958,14 +968,16 @@ StatusCode IDPerfMonZmumu::execute() << " pt: " << muon_pos->trackParticle(xAOD::Muon::CombinedTrackParticle)->pt() << " d0: " << m_positive_d0 << " z0: " << m_positive_z0 - << " d0unc: " << m_positive_d0_err); + << " d0unc: " << m_positive_d0_err + << " sigma_pt: " << m_positive_sigma_pt); ATH_MSG_DEBUG("mu- --> pxyz: " << m_negative_px << ", " << m_negative_py << ", " << m_negative_pz << " pt: " << muon_neg->trackParticle(xAOD::Muon::CombinedTrackParticle)->pt() << " d0: " << m_negative_d0 << " z0: " << m_negative_z0 - << " d0unc: " << m_negative_d0_err); + << " d0unc: " << m_negative_d0_err + << " sigma_pt: " << m_negative_sigma_pt); // ntuple variables have been filled in FillRecParameters m_combTree->Fill(); } @@ -998,14 +1010,16 @@ StatusCode IDPerfMonZmumu::execute() << " pt: " << m_xZmm.getMSTrack(m_xZmm.getPosMuon(ZmumuEvent::CB))->pt() << " d0: " << m_positive_d0 << " z0: " << m_positive_z0 - << " d0unc: " << m_positive_d0_err); + << " d0unc: " << m_positive_d0_err + << " sigma_pt: " << m_positive_sigma_pt); ATH_MSG_DEBUG("mu- --> pxyz: " << m_negative_px << ", " << m_negative_py << ", " << m_negative_pz << " pt: " << m_xZmm.getMSTrack(m_xZmm.getNegMuon(ZmumuEvent::CB))->pt() << " d0: " << m_negative_d0 << " z0: " << m_negative_z0 - << " d0unc: " << m_negative_d0_err); + << " d0unc: " << m_negative_d0_err + << " sigma_pt: " << m_negative_sigma_pt); // ntuple variables have been filled in FillRecParametersTP m_MSTree->Fill(); } @@ -1153,12 +1167,14 @@ StatusCode IDPerfMonZmumu::execute() << m_negative_py << ", " << m_negative_pz << ") " << " d0: " << m_negative_d0 - << " z0: " << m_negative_z0); + << " z0: " << m_negative_z0 + << " sigma_pt: " << m_positive_sigma_pt); ATH_MSG_DEBUG("Positive p: (" << m_positive_px << "," << m_positive_py << "," << m_positive_pz << ") " << " d0: " << m_positive_d0 - << " z0: " << m_positive_z0); + << " z0: " << m_positive_z0 + << " sigma_pt: " << m_negative_sigma_pt); m_refit1Tree->Fill(); } else { @@ -1190,12 +1206,14 @@ StatusCode IDPerfMonZmumu::execute() << m_negative_py << ", " << m_negative_pz << ") " << " d0: " << m_negative_d0 - << " z0: " << m_negative_z0); + << " z0: " << m_negative_z0 + << " sigma_pt: " << m_positive_sigma_pt); ATH_MSG_DEBUG("Positive p: (" << m_positive_px << "," << m_positive_py << "," << m_positive_pz << ") " << " d0: " << m_positive_d0 - << " z0: " << m_positive_z0); + << " z0: " << m_positive_z0 + << " sigma_pt: " << m_negative_sigma_pt); m_refit2Tree->Fill(); } else { @@ -1290,7 +1308,7 @@ StatusCode IDPerfMonZmumu::FillRecParametersTP(const xAOD::TrackParticle* trackp double PVz0res = 0; double PVd0 = 0; double PVz0 = 0; - double sigma_qOverP = 0; + double sigma_pt = 0; px = trackp->p4().Px(); py = trackp->p4().Py(); @@ -1300,7 +1318,11 @@ StatusCode IDPerfMonZmumu::FillRecParametersTP(const xAOD::TrackParticle* trackp d0res = std::sqrt(trackp->definingParametersCovMatrix()(Trk::d0,Trk::d0)); z0res = std::sqrt(trackp->definingParametersCovMatrix()(Trk::z0,Trk::z0)); - sigma_qOverP = std::sqrt(trackp->definingParametersCovMatrix()(Trk::qOverP,Trk::qOverP)); + // computing sigma_pt + // pt = sin(theta) / qOverP --> sigma(pt) = (sin(theta)/ qOverP^2) x sigma(qOverP) // neglecting sigma(sin(theta)) + const Trk::Perigee *thePerigee = &(trackp->perigeeParameters()); + double sigma_qOverP = std::sqrt(trackp->definingParametersCovMatrix()(Trk::qOverP,Trk::qOverP)); + sigma_pt = (sin(thePerigee->parameters()[Trk::theta]) / pow(thePerigee->parameters()[Trk::qOverP],2)) * sigma_qOverP; if (vertex == nullptr) { ATH_MSG_WARNING("in FillRecParametersTP. WARNING: Vertex is NULL"); @@ -1343,7 +1365,7 @@ StatusCode IDPerfMonZmumu::FillRecParametersTP(const xAOD::TrackParticle* trackp m_positive_z0_err = z0res; m_positive_d0 = d0; m_positive_d0_err = d0res; - m_positive_sigma_qOverP = sigma_qOverP; + m_positive_sigma_pt = sigma_pt; if(m_doIP){ m_positive_z0_PV = PVz0; m_positive_d0_PV = PVd0; @@ -1360,7 +1382,7 @@ StatusCode IDPerfMonZmumu::FillRecParametersTP(const xAOD::TrackParticle* trackp m_negative_z0_err = z0res; m_negative_d0 = d0; m_negative_d0_err = d0res; - m_negative_sigma_qOverP = sigma_qOverP; + m_negative_sigma_pt = sigma_pt; if(m_doIP){ m_negative_z0_PV = PVz0; m_negative_d0_PV = PVd0; @@ -1789,7 +1811,7 @@ void IDPerfMonZmumu::Clear4MuNtupleVariables() m_positive_z0 = 0.; m_positive_d0_err = 0.; m_positive_z0_err = 0.; - m_positive_sigma_qOverP = 0.; + m_positive_sigma_pt = 0.; m_positive_1_vtx = 0; m_positive_parent = 0; @@ -1800,7 +1822,7 @@ void IDPerfMonZmumu::Clear4MuNtupleVariables() m_negative_z0 = 0.; m_negative_d0_err = 0.; m_negative_z0_err = 0.; - m_negative_sigma_qOverP = 0.; + m_negative_sigma_pt = 0.; m_negative_1_vtx = 0; m_negative_parent = 0; diff --git a/InnerDetector/InDetRecAlgs/TRT_TrackSegmentsFinder/src/TRT_TrackSegmentsFinder.cxx b/InnerDetector/InDetRecAlgs/TRT_TrackSegmentsFinder/src/TRT_TrackSegmentsFinder.cxx index 4851b857cbd7148c5da215d56edc5c113aa37a1b..d56103c9a7b3e851cd6a33a0cf7c54e85239117d 100644 --- a/InnerDetector/InDetRecAlgs/TRT_TrackSegmentsFinder/src/TRT_TrackSegmentsFinder.cxx +++ b/InnerDetector/InDetRecAlgs/TRT_TrackSegmentsFinder/src/TRT_TrackSegmentsFinder.cxx @@ -61,49 +61,33 @@ StatusCode InDet::TRT_TrackSegmentsFinder::initialize() StatusCode InDet::TRT_TrackSegmentsFinder::execute(const EventContext &ctx) const { std::unique_ptr<Trk::SegmentCollection> found_segments(std::make_unique<Trk::SegmentCollection>()); - std::unique_ptr<InDet::ITRT_TrackSegmentsMaker::IEventData> event_data_p; if(!m_useCaloSeeds) { - event_data_p = m_segmentsMakerTool->newEvent(ctx); m_segmentsMakerTool->find (ctx, *event_data_p); - // Loop through all segments and reconsrtucted segments collection preparation // Trk::Segment* segment = nullptr; while((segment = m_segmentsMakerTool->next(*event_data_p))) { found_segments->push_back(segment); } - } - else { - + } else { Amg::Vector3D PSV(0.,0.,0.); Trk::PerigeeSurface PS(PSV); - std::vector<IdentifierHash> vTR; - SG::ReadHandle calo(m_caloKey,ctx); if(calo.isValid()) { - // CaloClusterROI_Collection::const_iterator c = m_calo->begin(), ce = m_calo->end(); - // for(; c!=ce; ++c) { - for (const Trk::CaloClusterROI *c: *calo) { - if ( c->energy()/cosh(c->globalPosition().eta()) < m_ClusterEt) { + if ( c->energy()/std::cosh(c->globalPosition().eta()) < m_ClusterEt) { continue; } - - std::vector<const InDetDD::TRT_BaseElement*> DE; - { Amg::Vector3D global_pos(c->globalPosition()); double x = global_pos.x(); double y = global_pos.y(); double z = global_pos.z(); - std::unique_ptr<Trk::TrackParameters> par = PS.createUniqueTrackParameters( - 0., 0., atan2(y, x), atan2(1., z / sqrt(x * x + y * y)), 0., nullptr); - + 0., 0., std::atan2(y, x), std::atan2(1., z / std::sqrt(x * x + y * y)), 0., nullptr); // Get AtlasFieldCache MagField::AtlasFieldCache fieldCache; - SG::ReadCondHandle<AtlasFieldCacheCondObj> readHandle{m_fieldCondObjInputKey, ctx}; const AtlasFieldCacheCondObj* fieldCondObj{*readHandle}; if (fieldCondObj == nullptr) { @@ -111,30 +95,24 @@ StatusCode InDet::TRT_TrackSegmentsFinder::execute(const EventContext &ctx) cons return StatusCode::FAILURE; } fieldCondObj->getInitializedCache (fieldCache); - - // TRT detector elements road builder - // - m_roadtool->detElementsRoad(ctx, fieldCache, *par, Trk::alongMomentum, DE); - } - if(int(DE.size()) < m_minNumberDCs) continue; - - vTR.clear(); + // TRT detector elements road builder + // + const auto & DE = m_roadtool->detElementsRoad(ctx, fieldCache, *par, Trk::alongMomentum); + if(int(DE.size()) < m_minNumberDCs) continue; + vTR.clear(); vTR.reserve(DE.size()); for (const InDetDD::TRT_BaseElement*d: DE) { vTR.push_back(d->identifyHash()); } - - event_data_p = m_segmentsMakerTool->newRegion(ctx, vTR); - m_segmentsMakerTool->find(ctx, *event_data_p); - - // Loop through all segments and reconsrtucted segments collection preparation - // + event_data_p = m_segmentsMakerTool->newRegion(ctx, vTR); + m_segmentsMakerTool->find(ctx, *event_data_p); + // Loop through all segments and reconsrtucted segments collection preparation Trk::Segment* segment = nullptr; - while((segment = m_segmentsMakerTool->next(*event_data_p))) { - found_segments->push_back(segment); - } - } - }else{ + while((segment = m_segmentsMakerTool->next(*event_data_p))) { + found_segments->push_back(segment); + } + }//end of loopover *calo + } else { ATH_MSG_WARNING("Could not find calo cluster seeds in container " << m_caloKey.key()); return StatusCode::SUCCESS; // @TODO correct ? } diff --git a/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/CMakeLists.txt b/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/CMakeLists.txt index 7fdad69e34a6fb8da1262c765c2edaf7bd6ff15c..cee93252b62f5d3b625d9acc37ae210d650824ba 100644 --- a/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/CMakeLists.txt +++ b/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/CMakeLists.txt @@ -12,4 +12,4 @@ atlas_add_component( InDetIncSecVxFinderTool src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthContainers CxxUtils xAODTracking GaudiKernel InDetRecToolInterfaces GeoPrimitives TrkTrack TrkParticleBase TrkParameters TrkEventPrimitives VxVertex TrkLinks TrkTrack TrkTrackLink TrkTrackSummary TrkSurfaces TrkVertexFitterInterfaces EventPrimitives InDetTrackSelectionToolLib TrkVertexSeedFinderUtilsLib InDetBeamSpotServiceLib ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthContainers CxxUtils xAODTracking GaudiKernel InDetRecToolInterfaces GeoPrimitives TrkTrack TrkParticleBase TrkParameters TrkEventPrimitives VxVertex TrkLinks TrkTrack TrkTrackLink TrkTrackSummary TrkSurfaces TrkVertexFitterInterfaces EventPrimitives InDetTrackSelectionToolLib TrkVertexSeedFinderUtilsLib BeamSpotConditionsData ) diff --git a/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/InDetIncSecVxFinderTool/InDetIterativeSecVtxFinderTool.h b/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/InDetIncSecVxFinderTool/InDetIterativeSecVtxFinderTool.h index 991b520f9a01e93a9ff67d79f8e85ca6a5499865..e833099bb26a04fc6be3ce48a6eb4c1b03f7af4e 100755 --- a/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/InDetIncSecVxFinderTool/InDetIterativeSecVtxFinderTool.h +++ b/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/InDetIncSecVxFinderTool/InDetIterativeSecVtxFinderTool.h @@ -31,11 +31,12 @@ #include "TrkParameters/TrackParameters.h" // we may save out some private stuff #include "TTree.h" -class IBeamCondSvc; #include "xAODTracking/VertexFwd.h" #include "xAODTracking/TrackParticleFwd.h" #include "xAODTracking/VertexContainerFwd.h" #include "xAODTracking/TrackParticleContainerFwd.h" +#include "BeamSpotConditionsData/BeamSpotData.h" + namespace Trk { @@ -152,7 +153,7 @@ public: ToolHandle< Trk::IImpactPoint3dEstimator > m_ImpactPoint3dEstimator; ToolHandle< Trk::IVertexLinearizedTrackFactory > m_LinearizedTrackFactory; - ServiceHandle<IBeamCondSvc> m_iBeamCondSvc; //!< pointer to the beam condition service + SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; bool m_useBeamConstraint; double m_significanceCutSeeding; diff --git a/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/src/InDetIterativeSecVtxFinderTool.cxx b/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/src/InDetIterativeSecVtxFinderTool.cxx index 1c277493b25cdcd88d0d0076830b054760220d9f..2bc6d01ebab62f794c8ab8dbbc415c78011472d7 100644 --- a/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/src/InDetIterativeSecVtxFinderTool.cxx +++ b/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/src/InDetIterativeSecVtxFinderTool.cxx @@ -33,7 +33,6 @@ //#include <TMath.h> #include "TrkVertexFitterInterfaces/IImpactPoint3dEstimator.h" -#include "InDetBeamSpotService/IBeamCondSvc.h" #include "InDetTrackSelectionTool/IInDetTrackSelectionTool.h" #include "TrkVertexFitterInterfaces/IVertexSeedFinder.h" @@ -77,7 +76,6 @@ InDetIterativeSecVtxFinderTool::InDetIterativeSecVtxFinderTool(const std::string m_SeedFinder("Trk::IndexedCrossDistancesSeedFinder", this ), m_ImpactPoint3dEstimator("Trk::ImpactPoint3dEstimator", this ), m_LinearizedTrackFactory("Trk::FullLinearizedTrackFactory", this ), - m_iBeamCondSvc("BeamCondSvc",n), m_useBeamConstraint(false), m_significanceCutSeeding(10), m_maximumChi2cutForSeeding(6.*6.), @@ -106,7 +104,6 @@ InDetIterativeSecVtxFinderTool::InDetIterativeSecVtxFinderTool(const std::string declareProperty("VertexFitterTool", m_iVertexFitter); declareProperty("BaseTrackSelector",m_trkFilter); declareProperty("SecVtxTrackSelector",m_SVtrkFilter); - declareProperty("BeamPositionSvc", m_iBeamCondSvc); declareProperty("SeedFinder" , m_SeedFinder); declareProperty("ImpactPoint3dEstimator",m_ImpactPoint3dEstimator); declareProperty("LinearizedTrackFactory",m_LinearizedTrackFactory); @@ -142,8 +139,9 @@ std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*> InDetIterativeSecVt xAOD::Vertex beamposition; beamposition.makePrivateStore(); - beamposition.setPosition(m_iBeamCondSvc->beamVtx().position()); - beamposition.setCovariancePosition(m_iBeamCondSvc->beamVtx().covariancePosition()); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + beamposition.setPosition(beamSpotHandle->beamVtx().position()); + beamposition.setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition()); typedef DataVector<xAOD::TrackParticle>::const_iterator TrackParticleDataVecIter; @@ -205,8 +203,9 @@ std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*> xAOD::Vertex beamposition; beamposition.makePrivateStore(); - beamposition.setPosition(m_iBeamCondSvc->beamVtx().position()); - beamposition.setCovariancePosition(m_iBeamCondSvc->beamVtx().covariancePosition()); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + beamposition.setPosition(beamSpotHandle->beamVtx().position()); + beamposition.setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition()); bool selectionPassed; m_trkdefiPars.clear() ; @@ -355,10 +354,11 @@ std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*> InDetIterativeSecVt xAOD::Vertex theconstraint; if (m_useBeamConstraint) { theconstraint = xAOD::Vertex(); // Default constructor creates a private store - theconstraint.setPosition( m_iBeamCondSvc->beamVtx().position() ); - theconstraint.setCovariancePosition( m_iBeamCondSvc->beamVtx().covariancePosition() ); - theconstraint.setFitQuality( m_iBeamCondSvc->beamVtx().fitQuality().chiSquared(), - m_iBeamCondSvc->beamVtx().fitQuality().doubleNumberDoF() ); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + theconstraint.setPosition( beamSpotHandle->beamVtx().position() ); + theconstraint.setCovariancePosition( beamSpotHandle->beamVtx().covariancePosition() ); + theconstraint.setFitQuality( beamSpotHandle->beamVtx().fitQuality().chiSquared(), + beamSpotHandle->beamVtx().fitQuality().doubleNumberDoF() ); seedVertex = m_SeedFinder->findSeed( m_privtx.x(), m_privtx.y(), perigeeList, &theconstraint ); @@ -1743,12 +1743,7 @@ StatusCode InDetIterativeSecVtxFinderTool::initialize() return StatusCode::FAILURE; } - sc = m_iBeamCondSvc.retrieve(); - if (sc.isFailure()) - { - ATH_MSG_ERROR( "Could not find BeamCondSvc." ); - return sc; - } + ATH_CHECK(m_beamSpotKey.initialize()); if(m_trkFilter.retrieve().isFailure()) { ATH_MSG_ERROR(" Unable to retrieve "<<m_trkFilter ); @@ -1837,8 +1832,8 @@ std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*> InDetIterativeSecVt beamposition.setPosition(m_iBeamCondSvc->beamVtx().position()); beamposition.setCovariancePosition(m_iBeamCondSvc->beamVtx().covariancePosition()); */ - - Trk::RecVertex beamposition(m_iBeamCondSvc->beamVtx()); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + Trk::RecVertex beamposition(beamSpotHandle->beamVtx()); std::vector<Trk::ITrackLink*> selectedTracks; @@ -1884,8 +1879,8 @@ std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*> InDetIterativeSecVt std::vector<Trk::ITrackLink*> selectedTracks; // TODO: change trkFilter to allow for this replacement - - Trk::RecVertex beamposition(m_iBeamCondSvc->beamVtx()); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + Trk::RecVertex beamposition(beamSpotHandle->beamVtx()); typedef DataVector<Trk::TrackParticleBase>::const_iterator TrackParticleDataVecIter; diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/CMakeLists.txt b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/CMakeLists.txt index cd32326b83e7fc6d912c0fef880dd5135c290055..7a878caeccc8f56438f4ccf9cecbd36a12fa8ca0 100644 --- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/CMakeLists.txt +++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/CMakeLists.txt @@ -7,4 +7,4 @@ atlas_subdir( InDetMultipleVertexSeedFinder ) atlas_add_component( InDetMultipleVertexSeedFinder src/*.cxx src/components/*.cxx - LINK_LIBRARIES AthenaBaseComps GaudiKernel InDetRecToolInterfaces EventPrimitives xAODTracking InDetMultipleVertexSeedFinderUtilsLib TrkParticleBase TrkTrack VxVertex TrkExInterfaces TrkToolInterfaces TrkVertexFitterInterfaces InDetBeamSpotServiceLib ) + LINK_LIBRARIES AthenaBaseComps GaudiKernel InDetRecToolInterfaces EventPrimitives xAODTracking InDetMultipleVertexSeedFinderUtilsLib TrkParticleBase TrkTrack VxVertex TrkExInterfaces TrkToolInterfaces TrkVertexFitterInterfaces BeamSpotConditionsData ) diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/DivisiveMultiSeedFinder.h b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/DivisiveMultiSeedFinder.h index b262ba99b6bd46beba3da14ed4f68eda1e25515d..121937d9cd04a11deac6a33e04193d27e057c8df 100644 --- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/DivisiveMultiSeedFinder.h +++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/DivisiveMultiSeedFinder.h @@ -8,8 +8,7 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ToolHandle.h" #include "InDetRecToolInterfaces/IMultiPVSeedFinder.h" - -class IBeamCondSvc; +#include "BeamSpotConditionsData/BeamSpotData.h" namespace Trk { @@ -71,7 +70,8 @@ namespace InDet ToolHandle<InDetTrackClusterCleaningTool> m_cleaningTool; //beam spot finder - ServiceHandle< IBeamCondSvc > m_beamService; + SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; + ToolHandle<Trk::IExtrapolator> m_extrapolator; //<! Extrapolator tool //vertex seed finder diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/HistogrammingMultiSeedFinder.h b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/HistogrammingMultiSeedFinder.h index 702d3d481c1c89482490bc9ea4b9f96aa7398577..f0be795e9174c2ebfbca13fa7f0990a01650e45a 100644 --- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/HistogrammingMultiSeedFinder.h +++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/HistogrammingMultiSeedFinder.h @@ -8,6 +8,7 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ToolHandle.h" #include "InDetRecToolInterfaces/IMultiPVSeedFinder.h" +#include "BeamSpotConditionsData/BeamSpotData.h" /** * A multi seed finder for primary vertexing. Uses a @@ -23,7 +24,6 @@ * Mai 2007 */ -class IBeamCondSvc; namespace Trk { @@ -83,7 +83,7 @@ namespace InDet ToolHandle<Trk::IVertexSeedFinder> m_vtxSeedFinder; //beam spot finder - ServiceHandle< IBeamCondSvc > m_beamService; + SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; ToolHandle<Trk::IExtrapolator> m_extrapolator; //<! Extrapolator tool }; }//end of namespace definitions diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/SlidingWindowMultiSeedFinder.h b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/SlidingWindowMultiSeedFinder.h index 4f6bef4829916b1bbbac5ea32c02210e490c68ff..62002d408ceef31c3be42fc78ff6da7a65cf8edf 100644 --- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/SlidingWindowMultiSeedFinder.h +++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/InDetMultipleVertexSeedFinder/SlidingWindowMultiSeedFinder.h @@ -9,8 +9,8 @@ #include "GaudiKernel/ToolHandle.h" //#include "TrkParameters/TrackParameters.h" #include "InDetRecToolInterfaces/IMultiPVSeedFinder.h" +#include "BeamSpotConditionsData/BeamSpotData.h" -class IBeamCondSvc; namespace Trk { @@ -63,7 +63,7 @@ namespace InDet ToolHandle<Trk::IVertexSeedFinder> m_vtxSeedFinder; //beam spot finder - ServiceHandle< IBeamCondSvc > m_beamService; + SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; ToolHandle<Trk::IExtrapolator> m_extrapolator; //<! Extrapolator tool };//end of class definitions diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/DivisiveMultiSeedFinder.cxx b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/DivisiveMultiSeedFinder.cxx index dbec9d17a39232f6136f555bf042caf3ad5f58bc..8d45a91dbda4ab36bb620899c8e192f37dcc3fd7 100644 --- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/DivisiveMultiSeedFinder.cxx +++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/DivisiveMultiSeedFinder.cxx @@ -9,7 +9,6 @@ #include "InDetMultipleVertexSeedFinderUtils/InDetTrackZ0SortingTool.h" #include "InDetMultipleVertexSeedFinderUtils/InDetTrackClusterCleaningTool.h" #include "TrkParticleBase/TrackParticleBase.h" -#include "InDetBeamSpotService/IBeamCondSvc.h" #include "InDetRecToolInterfaces/IMultiPVSeedFinder.h" #include "TrkExInterfaces/IExtrapolator.h" #include "TrkVertexFitterInterfaces/IVertexSeedFinder.h" @@ -46,11 +45,7 @@ namespace InDet return StatusCode::FAILURE; }else msg(MSG::INFO)<<"Track sorting tool retrieved"<<endmsg; - if(m_beamService.retrieve().isFailure()) - { - msg(MSG::ERROR)<<"Unable to retrieve "<<m_beamService<<endmsg; - return StatusCode::FAILURE; - }else msg(MSG::INFO)<<"BeamSpot service retrieved"<<endmsg; + ATH_CHECK(m_beamSpotKey.initialize()); if ( m_extrapolator.retrieve().isFailure() ) { @@ -67,7 +62,6 @@ namespace InDet m_sepDistance(0.5), m_nRemaining(1), m_ignoreBeamSpot(false), - m_beamService("BeamCondSvc",n), m_extrapolator("Trk::Extrapolator"), m_vtxSeedFinder("Trk::CrossDistancesSeedFinder") { @@ -88,8 +82,7 @@ namespace InDet //vertex finder tool (needed when no beam spot is available) declareProperty("VertexSeedFinder",m_vtxSeedFinder); -//beam spot service - declareProperty("BeamSpotSvc", m_beamService); + //extrapolator declareProperty("Extrapolator",m_extrapolator); @@ -106,8 +99,8 @@ namespace InDet std::vector<const Trk::Track*>::const_iterator tr = tracks.begin(); std::vector<const Trk::Track*>::const_iterator tre = tracks.end(); -//selecting with respect to the beam spot - Trk::RecVertex beamrecposition(m_beamService->beamVtx()); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + Trk::RecVertex beamrecposition(beamSpotHandle->beamVtx()); for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr,&beamrecposition)) preselectedTracks.push_back(*tr); if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()<<endmsg; Trk::Vertex* beamposition=&beamrecposition; @@ -264,8 +257,8 @@ namespace InDet std::vector<const Trk::TrackParticleBase*>::const_iterator tre = tracks.end(); //selecting with respect to the beam spot - - Trk::RecVertex beamrecposition(m_beamService->beamVtx()); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + Trk::RecVertex beamrecposition(beamSpotHandle->beamVtx()); for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr, &beamrecposition)) preselectedTracks.push_back(*tr); if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()<<endmsg; Trk::Vertex* beamposition=&beamrecposition; @@ -443,8 +436,9 @@ namespace InDet xAOD::Vertex * beamposition = new xAOD::Vertex(); - beamposition->setPosition(m_beamService->beamVtx().position()); - beamposition->setCovariancePosition(m_beamService->beamVtx().covariancePosition()); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + beamposition->setPosition(beamSpotHandle->beamVtx().position()); + beamposition->setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition()); // for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr, &beamrecposition)) preselectedTracks.push_back(*tr); // if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()<<endmsg; //Trk::Vertex* beamposition=&beamrecposition; diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/HistogrammingMultiSeedFinder.cxx b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/HistogrammingMultiSeedFinder.cxx index fc7c3bd7441b62cae33a76829bce221efefc0ffd..f2c3aaa9f200fbe472f9cc111bcc4830b791920d 100644 --- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/HistogrammingMultiSeedFinder.cxx +++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/HistogrammingMultiSeedFinder.cxx @@ -7,7 +7,6 @@ //#include "TrkParameters/TrackParameters.h" #include "TrkToolInterfaces/ITrackSelectorTool.h" #include "InDetMultipleVertexSeedFinderUtils/InDetTrackClusterCleaningTool.h" -#include "InDetBeamSpotService/IBeamCondSvc.h" #include "TrkParticleBase/TrackParticleBase.h" #include "TrkExInterfaces/IExtrapolator.h" #include "TrkVertexFitterInterfaces/IVertexSeedFinder.h" @@ -31,12 +30,7 @@ namespace InDet return StatusCode::FAILURE; }else msg(MSG::INFO)<<"Cluster cleaning tool retrieved"<<endmsg; - if(m_beamService.retrieve().isFailure()) - { - msg(MSG::ERROR)<<"Unable to retrieve "<<m_beamService<<endmsg; - return StatusCode::FAILURE; - }else msg(MSG::INFO)<<"BeamSpot service retrieved"<<endmsg; - + ATH_CHECK(m_beamSpotKey.initialize()); if(m_vtxSeedFinder.retrieve().isFailure()) { msg(MSG::ERROR) << "Unable to retrieve " << m_vtxSeedFinder <<endmsg; @@ -61,7 +55,6 @@ namespace InDet m_histoRange(200.), m_ignoreBeamSpot(false), m_vtxSeedFinder("Trk::CrossDistancesSeedFinder"), - m_beamService("BeamCondSvc",n), m_extrapolator("Trk::Extrapolator") { declareInterface<IMultiPVSeedFinder>(this); @@ -78,9 +71,6 @@ namespace InDet //cleaning tool declareProperty("CleaningTool", m_cleaningTool); -//beam spot service - declareProperty("BeamSpotSvc", m_beamService); - //vertex finder tool (needed when no beam spot is available) declareProperty("VertexSeedFinder",m_vtxSeedFinder); @@ -100,7 +90,9 @@ namespace InDet std::vector<const Trk::Track*>::const_iterator tre = tracks.end(); //beamposition - Trk::RecVertex beamrecposition(m_beamService->beamVtx()); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + + Trk::RecVertex beamrecposition(beamSpotHandle->beamVtx()); if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()<<endmsg; for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr,&beamrecposition)) preselectedTracks.push_back(*tr); Trk::Vertex* beamposition=&beamrecposition; @@ -260,7 +252,8 @@ namespace InDet std::vector<const Trk::TrackParticleBase*>::const_iterator tre = tracks.end(); //beamposition - Trk::RecVertex beamrecposition(m_beamService->beamVtx()); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + Trk::RecVertex beamrecposition(beamSpotHandle->beamVtx()); for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr, &beamrecposition)) preselectedTracks.push_back(*tr); if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()<<endmsg; Trk::Vertex* beamposition=&beamrecposition; @@ -424,8 +417,10 @@ namespace InDet xAOD::Vertex * beamposition = new xAOD::Vertex(); - beamposition->setPosition(m_beamService->beamVtx().position()); - beamposition->setCovariancePosition(m_beamService->beamVtx().covariancePosition()); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + + beamposition->setPosition(beamSpotHandle->beamVtx().position()); + beamposition->setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition()); // for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr, &beamrecposition)) preselectedTracks.push_back(*tr); // if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()<<endmsg; //Trk::Vertex* beamposition=&beamrecposition; diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/SlidingWindowMultiSeedFinder.cxx b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/SlidingWindowMultiSeedFinder.cxx index 20e5ecc6f9045d80abdeedfb2f31c96117e0a43d..d11cdddaeb113c35552566df62e934fcff8f0517 100644 --- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/SlidingWindowMultiSeedFinder.cxx +++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/SlidingWindowMultiSeedFinder.cxx @@ -9,7 +9,6 @@ #include "TrkToolInterfaces/ITrackSelectorTool.h" #include "InDetMultipleVertexSeedFinderUtils/InDetTrackZ0SortingTool.h" -#include "InDetBeamSpotService/IBeamCondSvc.h" #include "TrkParticleBase/TrackParticleBase.h" #include "TrkExInterfaces/IExtrapolator.h" #include "TrkVertexFitterInterfaces/IVertexSeedFinder.h" @@ -32,12 +31,7 @@ namespace InDet return StatusCode::FAILURE; }else msg(MSG::INFO)<<"Track sorting tool retrieved"<<endmsg; - if(m_beamService.retrieve().isFailure()) - { - msg(MSG::ERROR)<<"Unable to retieve "<<m_beamService<<endmsg; - return StatusCode::FAILURE; - }else msg(MSG::INFO)<< "BeamSpot service retrieved"<<endmsg; - + ATH_CHECK(m_beamSpotKey.initialize()); if(m_vtxSeedFinder.retrieve().isFailure()) { @@ -65,7 +59,6 @@ namespace InDet m_ignoreLevel(0), m_ignoreBeamSpot(false), m_vtxSeedFinder("Trk::CrossDistancesSeedFinder"), - m_beamService("BeamCondSvc" ,n), m_extrapolator("Trk::Extrapolator") { declareInterface<IMultiPVSeedFinder>(this); @@ -85,9 +78,6 @@ namespace InDet //vertex finder tool (needed when no beam spot is available) declareProperty("VertexSeedFinder",m_vtxSeedFinder); -//beam spot finding tool - declareProperty("BeamSpotSvc", m_beamService); - //extrapolator declareProperty("Extrapolator", m_extrapolator); @@ -102,8 +92,8 @@ namespace InDet std::vector<const Trk::Track*>::const_iterator tr = tracks.begin(); std::vector<const Trk::Track*>::const_iterator tre = tracks.end(); - - Trk::RecVertex beamRecVertex(m_beamService->beamVtx()); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + Trk::RecVertex beamRecVertex(beamSpotHandle->beamVtx()); for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr,&beamRecVertex)) preselectedTracks.push_back(*tr); if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamRecVertex.position()<<endmsg; @@ -205,8 +195,8 @@ namespace InDet std::vector<const Trk::TrackParticleBase*>::const_iterator tre = tracks.end(); //using the beam position for pre-selection - - Trk::RecVertex beamRecVertex(m_beamService->beamVtx()); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + Trk::RecVertex beamRecVertex(beamSpotHandle->beamVtx()); for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr,&beamRecVertex)) preselectedTracks.push_back(*tr); if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamRecVertex.position()<<endmsg; Trk::Vertex* beamVertex=&beamRecVertex; @@ -326,8 +316,9 @@ std::vector< std::vector<const Trk::TrackParameters *> > SlidingWindowMultiSeedF xAOD::Vertex * beamposition = new xAOD::Vertex(); - beamposition->setPosition(m_beamService->beamVtx().position()); - beamposition->setCovariancePosition(m_beamService->beamVtx().covariancePosition()); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + beamposition->setPosition(beamSpotHandle->beamVtx().position()); + beamposition->setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition()); // for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr, &beamrecposition)) preselectedTracks.push_back(*tr); // if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()<<endmsg; //Trk::Vertex* beamposition=&beamrecposition; diff --git a/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/ITRT_DetElementsRoadMaker.h b/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/ITRT_DetElementsRoadMaker.h index df3c74e18ff8e564ed141565f9d52591176daa98..ea2cb1db6b9fccc62ac9912921c7b0acd9e6d9d4 100755 --- a/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/ITRT_DetElementsRoadMaker.h +++ b/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/ITRT_DetElementsRoadMaker.h @@ -58,17 +58,10 @@ namespace InDet { // Main methods for road builder /////////////////////////////////////////////////////////////////// - virtual void detElementsRoad - (const EventContext& ctx, + virtual std::vector<const InDetDD::TRT_BaseElement*> + detElementsRoad(const EventContext& ctx, MagField::AtlasFieldCache& fieldCache, - const Trk::TrackParameters&,Trk::PropDirection, - std::vector<const InDetDD::TRT_BaseElement*>&) const = 0; - - virtual void detElementsRoad - (const EventContext& ctx, - MagField::AtlasFieldCache& fieldCache, - const Trk::TrackParameters&,Trk::PropDirection, - std::vector<std::pair<const InDetDD::TRT_BaseElement*,const Trk::TrackParameters*> >&) const =0; + const Trk::TrackParameters&,Trk::PropDirection) const = 0; /////////////////////////////////////////////////////////////////// // Print internal tool parameters and status diff --git a/InnerDetector/InDetRecTools/TRT_DetElementsRoadTool_xk/TRT_DetElementsRoadTool_xk/TRT_DetElementsRoadMaker_xk.h b/InnerDetector/InDetRecTools/TRT_DetElementsRoadTool_xk/TRT_DetElementsRoadTool_xk/TRT_DetElementsRoadMaker_xk.h index 6febd736fd52a9c4392b17ff6ca81bca78cd35ba..b1e6044e1ea1ab71ff7f6953afaf799e324fbf71 100755 --- a/InnerDetector/InDetRecTools/TRT_DetElementsRoadTool_xk/TRT_DetElementsRoadTool_xk/TRT_DetElementsRoadMaker_xk.h +++ b/InnerDetector/InDetRecTools/TRT_DetElementsRoadTool_xk/TRT_DetElementsRoadTool_xk/TRT_DetElementsRoadMaker_xk.h @@ -87,17 +87,11 @@ namespace InDet { // Main methods for road builder /////////////////////////////////////////////////////////////////// - virtual void detElementsRoad - (const EventContext& ctx, + + virtual std::vector<const InDetDD::TRT_BaseElement*> + detElementsRoad(const EventContext& ctx, MagField::AtlasFieldCache& fieldCache, - const Trk::TrackParameters&,Trk::PropDirection, - std::vector<const InDetDD::TRT_BaseElement*>&) const; - - virtual void detElementsRoad - (const EventContext& ctx, - MagField::AtlasFieldCache& fieldCache, - const Trk::TrackParameters&,Trk::PropDirection, - std::vector<std::pair<const InDetDD::TRT_BaseElement*,const Trk::TrackParameters*> >&) const; + const Trk::TrackParameters&,Trk::PropDirection) const; /////////////////////////////////////////////////////////////////// // Print internal tool parameters and status diff --git a/InnerDetector/InDetRecTools/TRT_DetElementsRoadTool_xk/src/TRT_DetElementsRoadMaker_xk.cxx b/InnerDetector/InDetRecTools/TRT_DetElementsRoadTool_xk/src/TRT_DetElementsRoadMaker_xk.cxx index ca71f7adf9edd780b91eae4e5b267d2e3a3531ce..75384af860e0f57a99f802b2f43a0881d62f4ebd 100755 --- a/InnerDetector/InDetRecTools/TRT_DetElementsRoadTool_xk/src/TRT_DetElementsRoadMaker_xk.cxx +++ b/InnerDetector/InDetRecTools/TRT_DetElementsRoadTool_xk/src/TRT_DetElementsRoadMaker_xk.cxx @@ -276,72 +276,33 @@ std::ostream& InDet::TRT_DetElementsRoadMaker_xk::dump( std::ostream& out ) cons // Main methods for road builder /////////////////////////////////////////////////////////////////// -void InDet::TRT_DetElementsRoadMaker_xk::detElementsRoad +std::vector<const InDetDD::TRT_BaseElement*> +InDet::TRT_DetElementsRoadMaker_xk::detElementsRoad (const EventContext& ctx, MagField::AtlasFieldCache& fieldCache, - const Trk::TrackParameters& Tp,Trk::PropDirection D, - std::vector<const InDetDD::TRT_BaseElement*>& R) const + const Trk::TrackParameters& Tp,Trk::PropDirection D) const { - double qp = std::abs(500.*Tp.parameters()[4]) ; if( qp < 1.e-10 ) qp = 1.e-10; double S = m_step/qp ; if( S > 200. ) S = 200. ; if(D<0) S=-S; - Trk::CylinderBounds CB = getBound(fieldCache, Tp); - double rminTRT = getTRTMinR(); - + std::vector<const InDetDD::TRT_BaseElement*> result; if( CB.r() > rminTRT) { Trk::MagneticFieldMode fieldModeEnum(m_fieldModeEnum); if(!fieldCache.solenoidOn()) fieldModeEnum = Trk::NoField; Trk::MagneticFieldProperties fieldprop(fieldModeEnum); - std::list<Amg::Vector3D> G; m_proptool->globalPositions(ctx, G,Tp,fieldprop,CB,S,Trk::pion); - if(G.size() > 1 ) { - detElementsRoadATL(G,R); + detElementsRoadATL(G,result); } } - - if (msgLvl(MSG::VERBOSE)) { - dumpEvent(msg(MSG::VERBOSE),R.size()); - dumpConditions(msg(MSG::VERBOSE)); - msg(MSG::VERBOSE) << endmsg; - } + return result; } -/////////////////////////////////////////////////////////////////// -// Main methods for road builder -/////////////////////////////////////////////////////////////////// - -void -InDet::TRT_DetElementsRoadMaker_xk::detElementsRoad -(const EventContext& ctx, - MagField::AtlasFieldCache& fieldCache, - const Trk::TrackParameters& trackParams, - Trk::PropDirection direction, std::vector<std::pair<const InDetDD::TRT_BaseElement*,const Trk::TrackParameters*> > & result) const -{ - std::vector<const InDetDD::TRT_BaseElement*> baseElementPointers; - detElementsRoad(ctx, fieldCache, trackParams,direction,baseElementPointers); - if (baseElementPointers.empty()) return; - // - Trk::MagneticFieldMode fieldModeEnum(m_fieldModeEnum); - if(!fieldCache.solenoidOn()) fieldModeEnum = Trk::NoField; - Trk::MagneticFieldProperties fieldprop(fieldModeEnum); - // - const Trk::TrackParameters* tp0 = &trackParams; - for(const auto pThisElement : baseElementPointers) { - const auto & thisSurface = pThisElement->surface(); - auto tp = m_proptool->propagate(ctx, (*tp0),thisSurface,direction,false,fieldprop,Trk::pion); - if(!tp) return; - tp0=tp.get(); - //ownership of tp given to the vector - result.emplace_back(pThisElement, tp.release()); - } -} /////////////////////////////////////////////////////////////////// // Main methods for road builder using input list global positions diff --git a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_DAF/src/TRT_TrackExtensionTool_DAF.cxx b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_DAF/src/TRT_TrackExtensionTool_DAF.cxx index 3b14950f1248cb615f5c355f5895ff869f4f8929..e33b0482070daed2cf2dc51f8bffe898af4cfc3d 100755 --- a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_DAF/src/TRT_TrackExtensionTool_DAF.cxx +++ b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_DAF/src/TRT_TrackExtensionTool_DAF.cxx @@ -225,8 +225,7 @@ InDet::TRT_TrackExtensionTool_DAF::extendTrack(const EventContext& ctx, fieldCondObj->getInitializedCache (fieldCache); // ---------------------------------- // start the TRT detector elements road maker to get a list of possibly interesting detector elements - std::vector<const InDetDD::TRT_BaseElement*> detElements; - m_roadtool->detElementsRoad(ctx, fieldCache, *event_data.m_siliconTrkParams, Trk::alongMomentum, detElements); + const std::vector<const InDetDD::TRT_BaseElement*> detElements = m_roadtool->detElementsRoad(ctx, fieldCache, *event_data.m_siliconTrkParams, Trk::alongMomentum); ATH_MSG_DEBUG("TRT detector elements road maker found "<< detElements.size()<< " detElements" ); if(detElements.empty()) { ATH_MSG_DEBUG("TRT_DetElementsRoadMaker found no road, stop!"); diff --git a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/TRT_TrackExtensionTool_xk/TRT_TrajectoryElement_xk.h b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/TRT_TrackExtensionTool_xk/TRT_TrajectoryElement_xk.h index 277f9e6be1d547d81410719df74b7d59bff9e0fb..13149cf4d1837ca8c1df20296ddf3320709743b4 100755 --- a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/TRT_TrackExtensionTool_xk/TRT_TrajectoryElement_xk.h +++ b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/TRT_TrackExtensionTool_xk/TRT_TrajectoryElement_xk.h @@ -72,12 +72,12 @@ namespace InDet{ void set (const Trk::MagneticFieldProperties&, const AtlasFieldCacheCondObj* ); - bool initiateForPrecisionSeed (bool,const InDetDD::TRT_BaseElement*&, + bool initiateForPrecisionSeed (bool,const InDetDD::TRT_BaseElement*, InDet::TRT_DriftCircleCollection::const_iterator&, InDet::TRT_DriftCircleCollection::const_iterator&, std::pair<Amg::Vector3D,double>&, const double*,double); - bool initiateForTRTSeed (bool,const InDetDD::TRT_BaseElement*&, + bool initiateForTRTSeed (bool,const InDetDD::TRT_BaseElement*, InDet::TRT_DriftCircleCollection::const_iterator&, InDet::TRT_DriftCircleCollection::const_iterator&, std::pair<Amg::Vector3D,double>&, const double*,double); diff --git a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/TRT_TrackExtensionTool_xk/TRT_Trajectory_xk.h b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/TRT_TrackExtensionTool_xk/TRT_Trajectory_xk.h index de198d294df5c2642112f1f6884b3b2d18edc2b9..92928bf80c1c7d89feb9b543146c8e57cbc40d96 100755 --- a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/TRT_TrackExtensionTool_xk/TRT_Trajectory_xk.h +++ b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/TRT_TrackExtensionTool_xk/TRT_Trajectory_xk.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ ///////////////////////////////////////////////////////////////////////////////// @@ -77,13 +77,13 @@ namespace InDet{ void initiateForPrecisionSeed (std::list< std::pair<Amg::Vector3D,double> >&, - std::vector<const InDetDD::TRT_BaseElement*>&, + const std::vector<const InDetDD::TRT_BaseElement*>&, const TRT_DriftCircleContainer*&, const Trk::PatternTrackParameters&); void initiateForTRTSeed (std::list< std::pair<Amg::Vector3D,double> >&, - std::vector<const InDetDD::TRT_BaseElement*>&, + const std::vector<const InDetDD::TRT_BaseElement*>&, const TRT_DriftCircleContainer*&, const Trk::PatternTrackParameters&); diff --git a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_TrackExtensionTool_xk.cxx b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_TrackExtensionTool_xk.cxx index 67f5de99ba8f0820b574c57c8ee0efb88d31dd52..f226806fd18b16afd2a42319751d331397feb879 100755 --- a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_TrackExtensionTool_xk.cxx +++ b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_TrackExtensionTool_xk.cxx @@ -28,7 +28,7 @@ namespace{ constexpr size_t MAX_ROAD_SIZE(399); std::list<const Trk::Surface*> - listOfSurfacesFromVectorOfElements(std::vector<const InDetDD::TRT_BaseElement*> & v){ + listOfSurfacesFromVectorOfElements(const std::vector<const InDetDD::TRT_BaseElement*> & v){ size_t roadsize{0}; std::list<const Trk::Surface*> surfaces; for(const auto &pThisElement: v) { @@ -385,8 +385,7 @@ InDet::TRT_TrackExtensionTool_xk::findSegment(const EventContext& ctx, // TRT detector elements road builder // - std::vector<const InDetDD::TRT_BaseElement*> detectorElements; - m_roadtool->detElementsRoad(ctx, fieldCache, *par, Trk::alongMomentum,detectorElements); + const std::vector<const InDetDD::TRT_BaseElement*> & detectorElements = m_roadtool->detElementsRoad(ctx, fieldCache, *par, Trk::alongMomentum); if(int(detectorElements.size())< nCut) return nullptr; @@ -475,8 +474,7 @@ InDet::TRT_TrackExtensionTool_xk::isGoodExtension(const EventContext& ctx, fieldCondObj->getInitializedCache (fieldCache); // TRT detector elements road builder // - std::vector<const InDetDD::TRT_BaseElement*> detectorElements; - m_roadtool->detElementsRoad(ctx, fieldCache, *par,Trk::alongMomentum,detectorElements); + const std::vector<const InDetDD::TRT_BaseElement*> & detectorElements = m_roadtool->detElementsRoad(ctx, fieldCache, *par,Trk::alongMomentum); if(int(detectorElements.size()) < m_minNumberDCs) return false; // Array pointers to surface preparation // diff --git a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_TrajectoryElement_xk.cxx b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_TrajectoryElement_xk.cxx index 67815fcfc2b2a085d7c2ebe1711a25ed44a4bc14..dac5a1cb34b31a71968779db187d181cff91bc7b 100755 --- a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_TrajectoryElement_xk.cxx +++ b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_TrajectoryElement_xk.cxx @@ -39,7 +39,7 @@ void InDet::TRT_TrajectoryElement_xk::set /////////////////////////////////////////////////////////////////// bool InDet::TRT_TrajectoryElement_xk::initiateForPrecisionSeed -(bool st,const InDetDD::TRT_BaseElement*& de, +(bool st,const InDetDD::TRT_BaseElement* de, InDet::TRT_DriftCircleCollection::const_iterator& sb, InDet::TRT_DriftCircleCollection::const_iterator& se, std::pair<Amg::Vector3D,double>& gp, @@ -63,7 +63,7 @@ bool InDet::TRT_TrajectoryElement_xk::initiateForPrecisionSeed /////////////////////////////////////////////////////////////////// bool InDet::TRT_TrajectoryElement_xk::initiateForTRTSeed -(bool st,const InDetDD::TRT_BaseElement*& de, +(bool st,const InDetDD::TRT_BaseElement* de, InDet::TRT_DriftCircleCollection::const_iterator& sb, InDet::TRT_DriftCircleCollection::const_iterator& se, std::pair<Amg::Vector3D,double>& gp, diff --git a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_Trajectory_xk.cxx b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_Trajectory_xk.cxx index a389a327ded1076cbcd9fb0ad8afc2866ba292f1..cea07716723ebdbea1fc7502a040d571d97bd45a 100755 --- a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_Trajectory_xk.cxx +++ b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_Trajectory_xk.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include <iostream> @@ -30,9 +30,9 @@ void InDet::TRT_Trajectory_xk::set m_proptool = pr ; m_updatortool = up ; m_roadwidth2 = roadwidth*roadwidth; - m_zVertexWidth = fabs(zvertexwidth) ; - m_impact = fabs(impact ) ; - m_scale_error = fabs(scale ) ; + m_zVertexWidth = std::abs(zvertexwidth) ; + m_impact = std::abs(impact ) ; + m_scale_error = std::abs(scale ) ; for(int i=0; i!=400; ++i) m_elements[i].set(m,pr,up,riod,rion,m_scale_error); m_minTRTSegmentpT = minTRTSegmentpT ; } @@ -51,7 +51,7 @@ void InDet::TRT_Trajectory_xk::set void InDet::TRT_Trajectory_xk::initiateForPrecisionSeed (std::list< std::pair<Amg::Vector3D,double> > & Gp , - std::vector<const InDetDD::TRT_BaseElement*> & De , + const std::vector<const InDetDD::TRT_BaseElement*> & De , const TRT_DriftCircleContainer* & TRTc, const Trk::PatternTrackParameters & Tp ) { @@ -69,39 +69,35 @@ void InDet::TRT_Trajectory_xk::initiateForPrecisionSeed InDet::TRT_DriftCircleCollection::const_iterator ti,te; - std::vector<const InDetDD::TRT_BaseElement*>::iterator d=De.begin(),de=De.end(); + std::vector<const InDetDD::TRT_BaseElement*>::const_iterator d=De.begin(),de=De.end(); std::list< std::pair<Amg::Vector3D,double> >::iterator i=Gp.begin(),i0=Gp.begin(),ie=Gp.end(); if(i0==ie) return; // Primary trajectory direction calculation - // - double A[4]; A[3]=Tp.parameters()[4]; - + // Tp.parameters()[4] is the (signed) q/p + double A[4]={0., 0., 0., Tp.parameters()[4]}; for(++i; i!=ie; ++i) { - if( (*i).second-(*i0).second > 1.) { - + if((*i).second-(*i0).second > 1.) { A[0] = (*i).first.x()-(*i0).first.x(); A[1] = (*i).first.y()-(*i0).first.y(); A[2] = (*i).first.z()-(*i0).first.z(); - double As = 1./sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]); - A[0]*=As; A[1]*=As; A[2]*=As; i0=i; break; + double As = 1./std::sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]); + A[0]*=As; A[1]*=As; A[2]*=As; + i0=i; + break; } } for(i=Gp.begin(); i!=ie; ++i) { - - IdentifierHash id = (*d)->identifyHash(); auto w=(*TRTc).indexFindPtr(id); + IdentifierHash id = (*d)->identifyHash(); + auto w=(*TRTc).indexFindPtr(id); bool q; if(w!=nullptr && w->begin()!=w->end()) { ti = w->begin(); te = w->end (); - q = m_elements[m_nElements].initiateForPrecisionSeed(true,(*d),ti,te,(*i),A,m_roadwidth2); if(q && m_elements[m_nElements].isCluster()) ++m_naElements; - - } - else { - + } else { q = m_elements[m_nElements].initiateForPrecisionSeed(false,(*d),ti,te,(*i),A,m_roadwidth2); } if(q && m_elements[m_nElements].nlinks()) ++m_nElements; @@ -110,11 +106,10 @@ void InDet::TRT_Trajectory_xk::initiateForPrecisionSeed // New trajectory direction calculation // if( (*i).second-(*i0).second > 50.) { - A[0] = (*i).first.x()-(*i0).first.x(); A[1] = (*i).first.y()-(*i0).first.y(); A[2] = (*i).first.z()-(*i0).first.z(); - double As = 1./sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]); + double As = 1./std::sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]); A[0]*=As; A[1]*=As; A[2]*=As; i0=i; } } @@ -130,7 +125,7 @@ void InDet::TRT_Trajectory_xk::initiateForPrecisionSeed void InDet::TRT_Trajectory_xk::initiateForTRTSeed (std::list< std::pair<Amg::Vector3D,double> > & Gp , - std::vector<const InDetDD::TRT_BaseElement*> & De , + const std::vector<const InDetDD::TRT_BaseElement*> & De , const TRT_DriftCircleContainer* & TRTc, const Trk::PatternTrackParameters & Tp ) { @@ -151,22 +146,20 @@ void InDet::TRT_Trajectory_xk::initiateForTRTSeed InDet::TRT_DriftCircleCollection::const_iterator ti,te; - std::vector<const InDetDD::TRT_BaseElement*>::iterator d=De.begin(),de=De.end(); + std::vector<const InDetDD::TRT_BaseElement*>::const_iterator d=De.begin(),de=De.end(); std::list< std::pair<Amg::Vector3D,double> >::iterator i=Gp.begin(),i0=Gp.begin(),ie=Gp.end(); if(i0==ie) return; // Primary trajectory direction calculation // - double A[4]; A[3]=Tp.parameters()[4]; - + double A[4]={0.,0.,0.,Tp.parameters()[4]}; for(++i; i!=ie; ++i) { if( (*i).second-(*i0).second > 1.) { - A[0] = (*i).first.x()-(*i0).first.x(); A[1] = (*i).first.y()-(*i0).first.y(); A[2] = (*i).first.z()-(*i0).first.z(); - double As = 1./sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]); + double As = 1./std::sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]); A[0]*=As; A[1]*=As; A[2]*=As; i0=i; break; } } @@ -203,7 +196,7 @@ void InDet::TRT_Trajectory_xk::initiateForTRTSeed A[0] = (*i).first.x()-(*i0).first.x(); A[1] = (*i).first.y()-(*i0).first.y(); A[2] = (*i).first.z()-(*i0).first.z(); - double As = 1./sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]); + double As = 1./std::sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]); A[0]*=As; A[1]*=As; A[2]*=As; i0=i; } } @@ -228,7 +221,7 @@ void InDet::TRT_Trajectory_xk::trackFindingWithDriftTime(double DA) double dmin = m_elements[i].dnegative()-.01; double dmax = m_elements[i].dpositive()+.01; - if(fabs(dmin) < rcut || fabs(dmax) < rcut) {dmin = -rcut; dmax = rcut;} + if(std::abs(dmin) < rcut || std::abs(dmax) < rcut) {dmin = -rcut; dmax = rcut;} for(int j=0; j!=nl; ++j) { @@ -281,7 +274,7 @@ void InDet::TRT_Trajectory_xk::trackFindingWithoutDriftTime(double DA) double dmin = m_elements[i].dnegative()-.01; double dmax = m_elements[i].dpositive()+.01; - if(fabs(dmin) < rcut || fabs(dmax) < rcut) {dmin = -rcut; dmax = rcut;} + if(std::abs(dmin) < rcut || std::abs(dmax) < rcut) {dmin = -rcut; dmax = rcut;} for(int j=0; j!=nl; ++j) { @@ -291,7 +284,7 @@ void InDet::TRT_Trajectory_xk::trackFindingWithoutDriftTime(double DA) double di= m_elements[i].link(j).distance(); if(di < dmin || di > dmax) continue; - double d = rs+fabs(m_elements[i].link(j).sdistance()*sr); + double d = rs+std::abs(m_elements[i].link(j).sdistance()*sr); double s = d *ui; double v = di*ui; m_U[n] = u; m_V[n++] = v-s; m_U[n] = u; m_V[n++] = v+s; @@ -358,7 +351,7 @@ void InDet::TRT_Trajectory_xk::trackFindingWithoutDriftTimeBL(double DA) if( l<0 || !m_elements[i].link(l).cluster()) continue; double u = m_elements[i].link(l).way(); if(u==0.) continue; double ui = 1./u; - double d = rs+fabs(m_elements[i].link(l).sdistance()*sr); + double d = rs+std::abs(m_elements[i].link(l).sdistance()*sr); double s = d*ui; double v = m_elements[i].link(l).distance()*ui; m_U[n] = u; m_V[n++] = v-s; m_U[n] = u; m_V[n++] = v+s; @@ -382,7 +375,7 @@ bool InDet::TRT_Trajectory_xk::searchStartStop() double D = m_elements[e].findCloseLink(m_A,m_B); int b = m_elements[e].bestlink(); w[e] = 0; - if( D < rs+fabs(m_elements[e].link(b).sdistance()*sr)) { + if( D < rs+std::abs(m_elements[e].link(b).sdistance()*sr)) { if (m_elements[e].link(b).cluster()) w[e] = 1; else if( D < rse ) w[e] =-1; @@ -484,7 +477,7 @@ void InDet::TRT_Trajectory_xk::radiusCorrection() double z0 = m_elements[e ].z (); double r1 = m_elements[el].radiusMax(); double z1 = m_elements[el].z (); - double dz = z1-z0; if(fabs(dz) < 1.) return; + double dz = z1-z0; if(std::abs(dz) < 1.) return; double rz = (r1-r0)/dz; double zv = z0 - r0/rz; @@ -520,7 +513,7 @@ Trk::TrackSegment* InDet::TRT_Trajectory_xk::convert() { // Test quality of propagation to perigee - if(fabs(m_parameters.pT()) < m_minTRTSegmentpT) return 0; + if(std::abs(m_parameters.pT()) < m_minTRTSegmentpT) return 0; const Trk::Surface* sur = &m_parameters.associatedSurface(); @@ -540,7 +533,7 @@ Trk::TrackSegment* InDet::TRT_Trajectory_xk::convert() const Trk::MeasurementBase* r = m_elements[e].rioOnTrack(); if(r) { - if (fabs(r->associatedSurface().transform()(2,2)) <.5) nendcap++; + if (std::abs(r->associatedSurface().transform()(2,2)) <.5) nendcap++; else { nbarrel++; //lastbarrelsurf=&r->associatedSurface(); @@ -556,7 +549,7 @@ Trk::TrackSegment* InDet::TRT_Trajectory_xk::convert() pms=pseudoMeasurements(&(**rio->begin()).associatedSurface(),&(**rio->rbegin()).associatedSurface(),bec); if(pms.first) rio->insert(rio->begin(),pms.first); if(pms.second) { - if (fabs((**rio->rbegin()).associatedSurface().center().z())<2650.) rio->push_back(pms.second); + if (std::abs((**rio->rbegin()).associatedSurface().center().z())<2650.) rio->push_back(pms.second); else rio->insert(rio->begin()+1,pms.second); } // Track segment production @@ -608,7 +601,7 @@ InDet::TRT_Trajectory_xk::pseudoMeasurements(const Trk::Surface *firstsurf, cons pseudopoint = Amg::Vector3D(lastsurf->center().x(),lastsurf->center().y(),tempz); pseudorot = lastsurf->transform().rotation(); } - else if (fabs(lastsurf->center().z())<2650.) { + else if (std::abs(lastsurf->center().z())<2650.) { //std::cout << "sur center: " << sur->center() << " halfz: " << halfz << " firstsur center: " << firstsur->center() << " halfzfirst: " << halfzfirst << std::endl; tempr= lastsurf->center().perp()+halfz; tempz=lastsurf->center().z(); @@ -623,7 +616,7 @@ InDet::TRT_Trajectory_xk::pseudoMeasurements(const Trk::Surface *firstsurf, cons pseudorot = firstsurf->transform().rotation(); } - pseudotheta=atan2(tempr,fabs(tempz)); + pseudotheta=atan2(tempr,std::abs(tempz)); //std::cout << "bec: " << bec << " pseudotheta: " << pseudotheta << std::endl; if (lastsurf->center().z()<0) pseudotheta=M_PI-pseudotheta; @@ -773,7 +766,7 @@ bool InDet::TRT_Trajectory_xk::fitter() void InDet::TRT_Trajectory_xk::stabline(int Np,double DA) { m_A=m_B=0; if(Np<2) return; - double Amax =fabs(DA); + double Amax =std::abs(DA); int i=0; @@ -802,26 +795,26 @@ void InDet::TRT_Trajectory_xk::stabline(int Np,double DA) { double U1=-1000., d=0.; int m=0; while(i<Np-1) { if (m_U[i]==U1) { - if(fabs(m_SS[m].m_F=(m_V[i ]-v0)*d)<Amax) m_SS[m++].m_NA=i; - if(fabs(m_SS[m].m_F=(m_V[i+1]-v0)*d)<Amax) m_SS[m++].m_NA=i+1; + if(std::abs(m_SS[m].m_F=(m_V[i ]-v0)*d)<Amax) m_SS[m++].m_NA=i; + if(std::abs(m_SS[m].m_F=(m_V[i+1]-v0)*d)<Amax) m_SS[m++].m_NA=i+1; } else { d=1./((U1=m_U[i])-u0); - if(fabs(m_SS[m].m_F=(m_V[i ]-v0)*d)<Amax) m_SS[m++].m_NA=i; - if(fabs(m_SS[m].m_F=(m_V[i+1]-v0)*d)<Amax) m_SS[m++].m_NA=i+1; + if(std::abs(m_SS[m].m_F=(m_V[i ]-v0)*d)<Amax) m_SS[m++].m_NA=i; + if(std::abs(m_SS[m].m_F=(m_V[i+1]-v0)*d)<Amax) m_SS[m++].m_NA=i+1; } i+=2; } (i=l); while(--i>0) {if(m_U[i]!=u0) {break;}} U1=-1000.; while(i>0) { if (m_U[i]==U1) { - if(fabs(m_SS[m].m_F=(m_V[i ]-v0)*d)<Amax) m_SS[m++].m_NA=i; - if(fabs(m_SS[m].m_F=(m_V[i-1]-v0)*d)<Amax) m_SS[m++].m_NA=i-1; + if(std::abs(m_SS[m].m_F=(m_V[i ]-v0)*d)<Amax) m_SS[m++].m_NA=i; + if(std::abs(m_SS[m].m_F=(m_V[i-1]-v0)*d)<Amax) m_SS[m++].m_NA=i-1; } else { d=1./((U1=m_U[i])-u0); - if(fabs(m_SS[m].m_F=(m_V[i ]-v0)*d)<Amax) m_SS[m++].m_NA=i; - if(fabs(m_SS[m].m_F=(m_V[i-1]-v0)*d)<Amax) m_SS[m++].m_NA=i-1; + if(std::abs(m_SS[m].m_F=(m_V[i ]-v0)*d)<Amax) m_SS[m++].m_NA=i; + if(std::abs(m_SS[m].m_F=(m_V[i-1]-v0)*d)<Amax) m_SS[m++].m_NA=i-1; } i-=2; } diff --git a/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVData.h b/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVData.h index 71f230f854fe63ea71970ca743c2549d211143ed..b46f3af09dfddebcf31f1ec85ad69e8332aafb7f 100755 --- a/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVData.h +++ b/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVData.h @@ -19,19 +19,15 @@ class LArHVData { friend class LArHVCondAlg; //The conditions alg filling this object public: - LArHVData() { } - ~LArHVData () { } + LArHVData() = default; + ~LArHVData () = default; - /** @brief struct for HV and weight pair + /** @brief struct for HV, current and weight */ struct HV_t { + HV_t(float ihv, float icurr, float iweight) : + hv(ihv),current(icurr),weight(iweight) {}; float hv; - float weight; - }; - - /** @brief struct for Current and weight pair - */ - struct CURRENT_t { float current; float weight; }; @@ -40,19 +36,16 @@ class LArHVData { /** brief Given a Offline Readout ID, return values of HV and Weight */ - StatusCode getHV(const Identifier& id, std::vector< HV_t > & v ) const ; - - /** Given a Offline Readout ID, return values of Current and Weight - */ - StatusCode getCurrent(const Identifier& id, std::vector< CURRENT_t > & v ) const ; + const std::vector<LArHVData::HV_t> & getHV(const Identifier& id) const; typedef std::map<Identifier, std::vector<HV_t> > hvMap; - typedef std::map<Identifier, std::vector<CURRENT_t> > currMap; private: hvMap m_voltage; - currMap m_current; std::set<Identifier> m_updatedCells; + + const std::vector<LArHVData::HV_t> m_empty; + }; inline diff --git a/LArCalorimeter/LArRecConditions/src/LArHVData.cxx b/LArCalorimeter/LArRecConditions/src/LArHVData.cxx index 7b7d2da243868e0b4ee01072a2e50d2602404aa6..a0e8aa3989fea547ad2a424fd184565fa29bfc1d 100644 --- a/LArCalorimeter/LArRecConditions/src/LArHVData.cxx +++ b/LArCalorimeter/LArRecConditions/src/LArHVData.cxx @@ -3,28 +3,15 @@ */ #include "LArRecConditions/LArHVData.h" -#include "GaudiKernel/StatusCode.h" #include "Identifier/Identifier.h" -#include "Identifier/HWIdentifier.h" -StatusCode LArHVData::getHV(const Identifier& id, std::vector< HV_t > & v ) const { - - v.clear(); - if(m_voltage.find(id) != m_voltage.end()) { // fill output - for(auto iptr : m_voltage.at(id)) v.push_back(iptr); - return StatusCode::SUCCESS; - } else { // do not have such data ? - return StatusCode::FAILURE; - } +const std::vector<LArHVData::HV_t> & LArHVData::getHV(const Identifier& id) const { + const auto& it=m_voltage.find(id); + if (it==m_voltage.end()) + return m_empty; //return empty vector + else { + return it->second; + } } + -StatusCode LArHVData::getCurrent(const Identifier& id, std::vector< CURRENT_t > & v ) const { - - v.clear(); - if(m_current.find(id) != m_current.end()) { // fill output - for(auto iptr : m_current.at(id)) v.push_back(iptr); - return StatusCode::SUCCESS; - } else { // do not have such data ? - return StatusCode::FAILURE; - } -} diff --git a/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.cxx b/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.cxx index a1248a5d944d159c0524d2f1657bdd84da6cc96e..f9364d83ef6dc4812d9c3ee4044f9a6b594ef89c 100755 --- a/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.cxx +++ b/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.cxx @@ -356,7 +356,6 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata , const float* rValues) const { LArHVData::hvMap &hvmap = hvdata->m_voltage; - LArHVData::currMap &currmap = hvdata->m_current; std::set<Identifier> &updatedCells = hvdata->m_updatedCells; const CaloDetDescrManager* calodetdescrmgr = nullptr; @@ -368,14 +367,11 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata updatedCells.clear(); hvmap.clear(); - currmap.clear(); std::vector<LArHVData::HV_t> v; - std::vector<LArHVData::CURRENT_t> ihv; // loop over all EM Identifiers for (auto id: m_larem_id->channel_ids()) { v.clear(); - ihv.clear(); if (abs(m_larem_id->barrel_ec(id))==1 && m_larem_id->sampling(id) > 0) { // LAr EMB unsigned int index = (unsigned int)(m_larem_id->channel_hash(id)); bool hasPathology=false; @@ -391,7 +387,7 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata unsigned int nelec = cell->getNumElectrodes(); unsigned int ngap = 2*nelec; double wt = 1./ngap; - v.clear(); ihv.clear(); + v.clear(); for (unsigned int i=0;i<nelec;i++) { const EMBHVElectrode& electrode = cell->getElectrode(i); // " " << electrode->getModule()->getEtaIndex() << " " << electrode->getModule()->getPhiIndex() << @@ -405,8 +401,7 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata // Do not bomb, but assume the HV=0 double hv=0; double curr=0; - addHV(v,hv,wt); - addCurr(ihv,curr,wt); + addHV(v,hv,curr,wt); } else { unsigned idx = itrLine - hvlineidx.begin(); double hv=voltage[idx]; @@ -441,13 +436,11 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata } msg(MSG::VERBOSE) << "set hv: "<<hv<<endmsg; } - addHV(v,hv,wt); - addCurr(ihv,curr,wt); + addHV(v,hv,curr,wt); } } } hvmap.insert(std::make_pair(id,v)); - currmap.insert(std::make_pair(id,ihv)); } else if (abs(m_larem_id->barrel_ec(id))==1 && m_larem_id->sampling(id) == 0) { // EMBPS const EMBDetectorElement* embElement = dynamic_cast<const EMBDetectorElement*>(calodetdescrmgr->get_element(id)); @@ -465,8 +458,7 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata //return StatusCode::FAILURE; double hv=0; double curr=0; - addHV(v,hv,wt); - addCurr(ihv,curr,wt); + addHV(v,hv,curr,wt); } else { unsigned idx = itrLine - hvlineidx.begin(); double hv=voltage[idx]; @@ -483,8 +475,7 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata if(curr > 0.) curr *= uAkOhm * rValues[ridx]; else curr = 0; ATH_MSG_VERBOSE("channel. "<<std::hex<<id.get_identifier32()<<std::dec <<" hvline: "<<idx<<" curr. " << curr << " R: "<<rValues[ridx]); } - addHV(v,hv,wt); - addCurr(ihv,curr,wt); + addHV(v,hv,curr,wt); } } @@ -514,8 +505,7 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata //return StatusCode::FAILURE; double hv=0; double curr=0; - addHV(v,hv,wt); - addCurr(ihv,curr,wt); + addHV(v,hv,curr,wt); } else { unsigned idx = itrLine - hvlineidx.begin(); double hv=voltage[idx]; @@ -548,8 +538,7 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata } } } - addHV(v,hv,wt); - addCurr(ihv,curr,wt); + addHV(v,hv,curr,wt); } } } @@ -571,26 +560,24 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata //return StatusCode::FAILURE; double hv=0; double curr=0; - addHV(v,hv,wt); - addCurr(ihv,curr,wt); + addHV(v,hv,curr,wt); } else { unsigned idx = itrLine - hvlineidx.begin(); double hv=voltage[idx]; double curr=current[idx]; - if(rValues) { // modify the current record - unsigned ridx = m_electrodeID->electrodeHash(m_electrodeID->ElectrodeId(3, - hvmodule.getSideIndex(), - hvCabling->getCellModule(id), - 0, // not used in EMECPS - 0, - igap, - 0 // not used in EMECPS - )); - if(curr >0.) curr *= uAkOhm * rValues[ridx]; else curr=0.; - ATH_MSG_VERBOSE("channel. "<<std::hex<<id.get_identifier32()<<std::dec <<" hvline: "<<idx<<" curr. " << curr << " R: "<<rValues[ridx]); - } - addHV(v,hv,wt); - addCurr(ihv,curr,wt); + if(rValues) { // modify the current record + unsigned ridx = m_electrodeID->electrodeHash(m_electrodeID->ElectrodeId(3, + hvmodule.getSideIndex(), + hvCabling->getCellModule(id), + 0, // not used in EMECPS + 0, + igap, + 0 // not used in EMECPS + )); + if(curr >0.) curr *= uAkOhm * rValues[ridx]; else curr=0.; + ATH_MSG_VERBOSE("channel. "<<std::hex<<id.get_identifier32()<<std::dec <<" hvline: "<<idx<<" curr. " << curr << " R: "<<rValues[ridx]); + } + addHV(v,hv,curr,wt); } } @@ -600,12 +587,11 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata } hvmap.emplace(id,v); - currmap.emplace(id,ihv); if(!hvdataOld) { // all cells are updated updatedCells.emplace(id); } else { // check if it was changed - std::vector< LArHVData::HV_t > oldv; - ATH_CHECK(hvdataOld->getHV(id, oldv)); + std::vector< LArHVData::HV_t > oldv=hvdataOld->getHV(id); + if (oldv.size()==0) return StatusCode::FAILURE; if(v.size() == oldv.size()) { unsigned int found=0; for(unsigned int i=0;i<v.size();++i) { @@ -626,7 +612,6 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata // LAr HEC for( auto id: m_larhec_id->channel_ids()) { v.clear(); - ihv.clear(); unsigned int index = (unsigned int)(m_larhec_id->channel_hash(id)); bool hasPathology=false; if (index<hasPathologyHEC.size()) { @@ -649,8 +634,7 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata //return StatusCode::FAILURE; double hv=0; double curr=0; - addHV(v,hv,wt); - addCurr(ihv,curr,wt); + addHV(v,hv,curr,wt); } else { unsigned idx = itrLine - hvlineidx.begin(); double hv=voltage[idx]; @@ -685,17 +669,15 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata } } - addHV(v,hv,wt); - addCurr(ihv,curr,wt); + addHV(v,hv,curr,wt); } } hvmap.emplace(id,v); - currmap.emplace(id,ihv); if(!hvdataOld) { // all cells are updated updatedCells.emplace(id); } else { // check if it was changed - std::vector< LArHVData::HV_t > oldv; - ATH_CHECK(hvdataOld->getHV(id, oldv)); + std::vector< LArHVData::HV_t > oldv=hvdataOld->getHV(id); + if (oldv.size()==0) return StatusCode::FAILURE; if(v.size() == oldv.size()) { unsigned int found=0; for(unsigned int i=0;i<v.size();++i) { @@ -715,7 +697,6 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata } // loop over FCAL for(auto id: m_larfcal_id->channel_ids()) { // LAr FCAL v.clear(); - ihv.clear(); unsigned int index = (unsigned int)(m_larfcal_id->channel_hash(id)); bool hasPathology=false; if (index<hasPathologyFCAL.size()) { @@ -745,8 +726,7 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata //return StatusCode::FAILURE; double hv=0; double curr=0; - addHV(v,hv,wt); - addCurr(ihv,curr,wt); + addHV(v,hv,curr,wt); } else { unsigned idx = itrLine - hvlineidx.begin(); double hv=voltage[idx]; @@ -780,18 +760,16 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata } } } - addHV(v,hv,wt); - addCurr(ihv,curr,wt); + addHV(v,hv,curr,wt); } } } hvmap.emplace(id,v); - currmap.emplace(id,ihv); if(!hvdataOld) { // all cells are updated updatedCells.emplace(id); } else { // check if it was changed - std::vector< LArHVData::HV_t > oldv; - ATH_CHECK(hvdataOld->getHV(id, oldv)); + std::vector< LArHVData::HV_t > oldv=hvdataOld->getHV(id); + if (oldv.size()==0) return StatusCode::FAILURE; if(v.size() == oldv.size()) { unsigned int found=0; for(unsigned int i=0;i<v.size();++i) { @@ -813,41 +791,21 @@ StatusCode LArHVCondAlg::fillPayload(LArHVData* hvdata return StatusCode::SUCCESS; } -void LArHVCondAlg::addHV(std::vector< LArHVData::HV_t > & v , double hv, double wt) const +void LArHVCondAlg::addHV(std::vector< LArHVData::HV_t > & v , double hv, double curr, double wt) const { bool found=false; for (unsigned int i=0;i<v.size();i++) { - if (std::fabs(hv-v[i].hv) < 0.1) { + if (std::fabs(hv-v[i].hv) < 0.1 && std::fabs (curr-v[i].current)<0.1) { found=true; v[i].weight += wt; break; } } if (!found) { - LArHVData::HV_t hh; - hh.hv = hv; - hh.weight = wt; - v.push_back(hh); + v.emplace_back(hv,curr,wt); } // not already in the list } -void LArHVCondAlg::addCurr(std::vector< LArHVData::CURRENT_t > & ihv , double current, double wt) const -{ - bool found=false; - for (unsigned int i=0;i<ihv.size();i++) { - if (std::fabs(current-ihv[i].current) < 0.1) { - found=true; - ihv[i].weight += wt; - break; - } - } - if (!found) { - LArHVData::CURRENT_t ii; - ii.current = current; - ii.weight = wt; - ihv.push_back(ii); - } // not already in the list -} std::vector<unsigned int> LArHVCondAlg::getElecList(const Identifier& id, const LArHVPathology& pathologyContainer) const { diff --git a/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.h b/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.h index f289427ddb5dec2d4aa37433cd8d2b07957a43c4..3a9f5b47462806ff902c4ae54c00c03f30968ec9 100755 --- a/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.h +++ b/LArCalorimeter/LArRecUtils/src/LArHVCondAlg.h @@ -110,8 +110,8 @@ class LArHVCondAlg: public AthReentrantAlgorithm , pathVec& hasPathologyFCAL , const float* rValues) const; - void addHV(std::vector< LArHVData::HV_t > & v, double hv, double wt) const; - void addCurr(std::vector< LArHVData::CURRENT_t > & ihv, double curr, double wt) const; + void addHV(std::vector< LArHVData::HV_t > & v, double hv, double curr, double wt) const; + std::vector<unsigned int> getElecList(const Identifier& id, const LArHVPathology& pathologies) const; StatusCode fillUpdatedHVChannelsVec(std::vector<float> &voltage, std::vector<float> ¤t, std::vector<unsigned int> &hvlineidx, std::vector<const CondAttrListCollection* > fldvec) const; diff --git a/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.cxx b/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.cxx index d3971fe10491b7289855ee405dda86727d739023..86c679a8991bd6d0a0967bc23dcf5a34d15602d8 100644 --- a/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.cxx +++ b/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.cxx @@ -312,10 +312,9 @@ StatusCode LArHVScaleCorrCondAlg::getScale(const HASHRANGEVEC& hashranges, T = T - m_T0; const double E_nominal = champ_e(nominal,d); - std::vector<LArHVData::HV_t> hvlist; - StatusCode sc = hvdata->getHV(offid,hvlist); + const std::vector<LArHVData::HV_t>& hvlist=hvdata->getHV(offid); - if (sc.isFailure() || hvlist.size()==0) { + if (hvlist.size() == 0) { mycorr=1.; mynorm=1.; ATH_MSG_WARNING( " HV value no found for cell " << m_larem_id->show_to_string(offid) ); @@ -333,15 +332,6 @@ StatusCode LArHVScaleCorrCondAlg::getScale(const HASHRANGEVEC& hashranges, if (notfound) { ATH_MSG_WARNING( " At least one HV value not found in database for cell " << m_larem_id->show_to_string(offid) ); } - std::vector<LArHVData::CURRENT_t> currlist; - if(m_useCurrentEMB || m_useCurrentFCAL1 || m_useCurrentOthers) { - sc = hvdata->getCurrent(offid,currlist); - if (sc.isFailure() || currlist.size() != hvlist.size()) { - ATH_MSG_WARNING( " Current values not the same size as hv for cell " << m_larem_id->show_to_string(offid) << " resetting to 0" ); - currlist.resize(hvlist.size(),LArHVData::CURRENT_t{0,0}); - } - - } mycorr=0.; mynorm=0.; @@ -350,20 +340,20 @@ StatusCode LArHVScaleCorrCondAlg::getScale(const HASHRANGEVEC& hashranges, if (isbarrelEM) { //const double corr = this->Scale_barrel(hvlist[i].hv)*hvlist[i].weight; //mycorr += corr; - if(m_useCurrentEMB) mycorr += this->Scale_barrel(hvlist[i].hv-currlist[i].current)*hvlist[i].weight; + if(m_useCurrentEMB) mycorr += this->Scale_barrel(hvlist[i].hv-hvlist[i].current)*hvlist[i].weight; else mycorr += this->Scale_barrel(hvlist[i].hv)*hvlist[i].weight; } //FCAL module 1 else if (isFCAL1) { //const double corr = this->Scale_FCAL1(hvlist[i].hv) * hvlist[i].weight; //mycorr+=corr; - if(m_useCurrentFCAL1) mycorr += this->Scale_FCAL1(hvlist[i].hv-currlist[i].current) * hvlist[i].weight; + if(m_useCurrentFCAL1) mycorr += this->Scale_FCAL1(hvlist[i].hv-hvlist[i].current) * hvlist[i].weight; else mycorr += this->Scale_FCAL1(hvlist[i].hv) * hvlist[i].weight; } // other subdetectors else { double E; - if(m_useCurrentOthers) E = champ_e(hvlist[i].hv-currlist[i].current,d); + if(m_useCurrentOthers) E = champ_e(hvlist[i].hv-hvlist[i].current,d); else E = champ_e(hvlist[i].hv,d); // dont correct if E is very close to E nominal to avoid small glitches diff --git a/MuonSpectrometer/MuonConfig/python/MuonRIO_OnTrackCreatorConfig.py b/MuonSpectrometer/MuonConfig/python/MuonRIO_OnTrackCreatorConfig.py index ba4b344dc0dcce083c9fe910250abe4c6ee4f580..207e3a17d2dd4db7d072c8e9438f4b44712c925c 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonRIO_OnTrackCreatorConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonRIO_OnTrackCreatorConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory @@ -98,9 +98,6 @@ def MdtDriftCircleOnTrackCreatorCfg(flags,name="MdtDriftCircleOnTrackCreator", * kwargs.setdefault("IsMC", flags.Input.isMC) - if flags.Muon.MuonTrigger: - kwargs.setdefault("doMDT", False) - result.addPublicTool(Muon__MdtDriftCircleOnTrackCreator(name, WasConfigured=True, **kwargs),primary=True) return result diff --git a/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py b/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py index b0d6d39e20114204ace6126a19ff27465556e10a..502aa271712060bf589b68b0e1d8c9dd6b622540 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory @@ -32,6 +32,8 @@ def MooTrackFitterCfg(flags, name = 'MooTrackFitter', **kwargs): kwargs.setdefault("Propagator", muon_prop) # kwargs.setdefault("SLFit" , ) # Was "not jobproperties.BField.allToroidOn()" but do not have access to Field here. + if flags.Muon.MuonTrigger: + kwargs.setdefault("SLFit", False) kwargs.setdefault("ReducedChi2Cut", flags.Muon.Chi2NDofCut) momentum_estimator="" @@ -510,7 +512,7 @@ def MuonTrackSelector(flags, name = "MuonTrackSelectorTool", **kwargs): return Muon__MuonTrackSelectorTool(name, **kwargs) -def MuonTrackBuildingCfg(flags, name = "MuPatTrackBuilder"): +def MuonTrackBuildingCfg(flags, name = "MuPatTrackBuilder", **kwargs): MuPatTrackBuilder=CompFactory.MuPatTrackBuilder # This is based on https://gitlab.cern.ch/atlas/athena/blob/release/22.0.3/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonStandalone.py#L162 result=ComponentAccumulator() @@ -531,7 +533,7 @@ def MuonTrackBuildingCfg(flags, name = "MuPatTrackBuilder"): from MuonConfig.MuonSegmentNameFixConfig import MuonSegmentNameFixCfg result.merge(MuonSegmentNameFixCfg(flags)) - track_builder = MuPatTrackBuilder(name=name, TrackSteering = track_steering, MuonSegmentCollection="TrackMuonSegments", SpectrometerTrackOutputLocation="MuonSpectrometerTracks" ) + track_builder = MuPatTrackBuilder(name=name, TrackSteering = track_steering, MuonSegmentCollection="TrackMuonSegments", SpectrometerTrackOutputLocation="MuonSpectrometerTracks", **kwargs) result.addEventAlgo( track_builder, primary=True ) return result diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/CMakeLists.txt b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/CMakeLists.txt index e3397bbd8d0704a3450f281e063f58a40411b25c..193e190afcfe69eec2c94ee1d422788700e0d5f0 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/CMakeLists.txt +++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/CMakeLists.txt @@ -13,7 +13,7 @@ atlas_add_library( MuonTGRecToolsLib MuonTGRecTools/*.h INTERFACE PUBLIC_HEADERS MuonTGRecTools - LINK_LIBRARIES GaudiKernel TrkGeometry EventPrimitives AthenaBaseComps TrkTrack TrkExInterfaces TrkToolInterfaces TrkFitterUtils TrackRecordLib TrkEventPrimitives TrkGeometry TrkPrepRawData MuonTrackMakerUtils MuonIdHelpersLib MuonPrepRawData AthContainers AthenaKernel TrkExInterfaces TrkSurfaces TrkSegment ) + LINK_LIBRARIES GaudiKernel TrkDetDescrInterfaces TrkGeometry EventPrimitives AthenaBaseComps TrkTrack TrkExInterfaces TrkToolInterfaces TrkFitterUtils TrackRecordLib TrkEventPrimitives TrkGeometry TrkPrepRawData MuonTrackMakerUtils MuonIdHelpersLib MuonPrepRawData AthContainers AthenaKernel TrkExInterfaces TrkSurfaces TrkSegment ) # Component(s) in the package: atlas_add_component( MuonTGRecTools diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/MuonTGRecTools/MuonTGMeasurementTool.h b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/MuonTGRecTools/MuonTGMeasurementTool.h index 6a7ab591ba23fe2ebc3cd1c8051cf8bdc5d7f7b1..33e3a3e2dd13fd565476c46a5f456e53506f9c32 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/MuonTGRecTools/MuonTGMeasurementTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/MuonTGRecTools/MuonTGMeasurementTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef MUONTGRECTOOLS_MUONTGMEASUREMENTTOOL_H @@ -27,7 +27,9 @@ #include "MuonPrepRawData/RpcPrepData.h" #include "GaudiKernel/ConcurrencyFlags.h" #include "EventPrimitives/EventPrimitives.h" - +#include "TrkGeometry/TrackingVolume.h" +#include "TrkGeometry/TrackingGeometry.h" +#include "TrkDetDescrInterfaces/ITrackingGeometrySvc.h" #include <fstream> #include <vector> #include <string> @@ -59,8 +61,7 @@ public: virtual ~MuonTGMeasurementTool()=default; virtual StatusCode initialize(); - virtual StatusCode finalize(); - + const std::vector<const Trk::PrepRawData*>* getMeasurementOnLayer(const Trk::Layer* lay) const; const std::vector<const Trk::PrepRawData*>* getEtaPhiMeasurementOnLayer(const Trk::Layer* lay, bool phi) const; const std::vector<const Trk::Segment*>* getSegments(const Trk::DetachedTrackingVolume* station) const; @@ -80,15 +81,17 @@ public: private: - // --- job options - Gaudi::Property<std::string> m_trackingGeometryName{this,"TrackingGeometryName","AtlasTrackingGeometry"}; - Gaudi::Property<std::string> m_ExtrapolatorName{this,"ExtrapolatorName"," "}; //!< Name of the Extrapolator Instance - + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey {this, "DetectorManagerKey", "MuonDetectorManager", "Key of input MuonDetectorManager condition data"}; + + ServiceHandle<Trk::ITrackingGeometrySvc> m_trackingGeometrySvc { this, "TrackingGeometrySvc", "TrackingGeometrySvc/AtlasTrackingGeometrySvc" }; + + SG::ReadCondHandleKey<Trk::TrackingGeometry> m_trackingGeometryReadKey { this, "TrackingGeometryReadKey", "", "Key of input TrackingGeometry" }; + const MuonGM::MuonDetectorManager* m_muonDetMgr; // nominal MuonDetectorManager from DetectorStore (used if UseDSManager=true) // -- algorithm members @@ -96,15 +99,29 @@ private: mutable MuonTGSegments* m_segments ATLAS_THREAD_SAFE; //Marked as thread-safe because it's disabled when running multi-threaded // projection matrices - AmgMatrix(5,5) *m_tgcProjEta; - AmgMatrix(5,5) *m_tgcProjPhi; - AmgMatrix(5,5) *m_rpcProjEta; - AmgMatrix(5,5) *m_rpcProjPhi; + std::unique_ptr<AmgMatrix(5,5)> m_tgcProjEta; + std::unique_ptr<AmgMatrix(5,5)> m_tgcProjPhi; + std::unique_ptr<AmgMatrix(5,5)> m_rpcProjEta; + std::unique_ptr<AmgMatrix(5,5)> m_rpcProjPhi; // steering Gaudi::Property<bool> m_alignedMode{this,"AlignedMode",true}; Gaudi::Property<bool> m_useDSManager{this,"UseDSManager",false}; + inline const Trk::TrackingGeometry* getGeometry() const { + /// Good old way of retrieving the volume via the geometry service + if (m_trackingGeometryReadKey.empty()) { + return m_trackingGeometrySvc->trackingGeometry(); + } + SG::ReadCondHandle < Trk::TrackingGeometry > handle(m_trackingGeometryReadKey, Gaudi::Hive::currentContext()); + if (!handle.isValid()) { + ATH_MSG_WARNING("Could not retrieve a valid tracking geometry"); + return nullptr; + } + return handle.cptr(); + } + + }; } diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/src/MuonTGMeasurementTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/src/MuonTGMeasurementTool.cxx index 21389582bf0900d54ab4280486b0ed5bba9d209f..c0e44bff14439e7f746b1f73ed056fb74b49c1bd 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/src/MuonTGMeasurementTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/src/MuonTGMeasurementTool.cxx @@ -11,8 +11,7 @@ #include "TrkMeasurementBase/MeasurementBase.h" #include "TrkSurfaces/DistanceSolution.h" #include "TrkGeometry/Layer.h" -#include "TrkGeometry/TrackingVolume.h" -#include "TrkGeometry/TrackingGeometry.h" + #include "TrkRIO_OnTrack/RIO_OnTrack.h" #include "TrackRecord/TrackRecord.h" #include "MuonPrepRawData/MuonPrepDataContainer.h" @@ -56,33 +55,25 @@ StatusCode Muon::MuonTGMeasurementTool::initialize() } // define projection matrices - m_tgcProjEta = new AmgMatrix(5,5); + m_tgcProjEta = std::make_unique<AmgMatrix(5,5)>(); m_tgcProjEta->setIdentity(); (*m_tgcProjEta)(0,0) = 0.; (*m_tgcProjEta)(1,1) = 0.; (*m_tgcProjEta)(0,1) = 1.; (*m_tgcProjEta)(1,0) =-1.; - m_tgcProjPhi = new AmgMatrix(5,5); + m_tgcProjPhi = std::make_unique<AmgMatrix(5,5)>(); m_tgcProjPhi->setIdentity(); - m_rpcProjEta = new AmgMatrix(5,5); + m_rpcProjEta = std::make_unique<AmgMatrix(5,5)>(); m_rpcProjEta->setIdentity(); (*m_rpcProjEta)(0,0) = 0.; (*m_rpcProjEta)(1,1) = 0.; (*m_rpcProjEta)(0,1) = 1.; (*m_rpcProjEta)(1,0) = 1.; - m_rpcProjPhi = new AmgMatrix(5,5); + m_rpcProjPhi = std::make_unique<AmgMatrix(5,5)>(); m_rpcProjPhi->setIdentity(); - return StatusCode::SUCCESS; -} - -// Finalize method: -StatusCode Muon::MuonTGMeasurementTool::finalize() -{ - // Get the messaging service, print where you are - ATH_MSG_INFO("MuonTGMeasurementTool::finalize()"); - //delete m_tpMinFinder; - delete m_tgcProjEta; - delete m_tgcProjPhi; - delete m_rpcProjEta; - delete m_rpcProjPhi; + if (!m_trackingGeometryReadKey.empty()) { + ATH_CHECK(m_trackingGeometryReadKey.initialize()); + } else { + ATH_CHECK(m_trackingGeometrySvc.retrieve()); + } return StatusCode::SUCCESS; } @@ -90,11 +81,8 @@ const std::vector<const Trk::PrepRawData*>* Muon::MuonTGMeasurementTool::getMeas { // Get the messaging service, print where you are ATH_MSG_DEBUG("Muon::MuonTGMeasurementTool::getMeasurementOnLayer"); - const std::vector<const Trk::PrepRawData*>* hitsOnLayer = 0; + const std::vector<const Trk::PrepRawData*>* hitsOnLayer = nullptr; // - const Trk::TrackingGeometry* trackingGeometry; - if ( detStore()->retrieve(trackingGeometry, m_trackingGeometryName).isFailure() )return hitsOnLayer; - if (m_hits && lay) { const Trk::DetachedTrackingVolume* station = lay->enclosingDetachedTrackingVolume(); if (!station) ATH_MSG_WARNING("no enclosing station found"); @@ -165,10 +153,7 @@ const std::vector<const Trk::Segment*>* Muon::MuonTGMeasurementTool::getSegments // Get the messaging service, print where you are ATH_MSG_DEBUG("Muon::MuonTGMeasurementTool::getSegments"); const std::vector<const Trk::Segment*>* segments = 0; - // - const Trk::TrackingGeometry* trackingGeometry; - if ( detStore()->retrieve(trackingGeometry, m_trackingGeometryName).isFailure() )return segments; - + if (m_segments && station) { unsigned int ist=0; while ( ist < m_segments->size() ) { @@ -205,9 +190,7 @@ const Trk::TrackParameters* Muon::MuonTGMeasurementTool::layerToDetEl(const Trk: if (!lay || !parm || !id.get_identifier32().get_compact() ) return projPar; // get tracking geometry - const Trk::TrackingGeometry* trackingGeometry; - if ( detStore()->retrieve(trackingGeometry, m_trackingGeometryName).isFailure() )return projPar; - + // check compatibility of layer info and required id ? this was already done when associating ! if (!lay->layerType()) return projPar; Identifier layId(lay->layerType()); @@ -307,8 +290,8 @@ const Trk::TrackParameters* Muon::MuonTGMeasurementTool::layerToDetEl(const Trk: Amg::VectorX locPar = parm->parameters(); // projection matrix AmgMatrix(5,5)* pMx = 0; - if (m_idHelperSvc->rpcIdHelper().measuresPhi(id)) pMx = m_rpcProjPhi; - else pMx = m_rpcProjEta; + if (m_idHelperSvc->rpcIdHelper().measuresPhi(id)) pMx = m_rpcProjPhi.get(); + else pMx = m_rpcProjEta.get(); // projected parameters double eta = 1.; double sign = (m_idHelperSvc->rpcIdHelper().measuresPhi(id) && m_idHelperSvc->rpcIdHelper().doubletPhi(id)==2 ) ? -1. : 1.; @@ -387,8 +370,8 @@ const Trk::TrackParameters* Muon::MuonTGMeasurementTool::layerToDetEl(const Trk: parProj[4]= parm->parameters()[Trk::qOverP]; // AmgMatrix(5,5)* pMx = 0; - if ( m_idHelperSvc->cscIdHelper().measuresPhi(id) ) pMx = m_tgcProjPhi; - else pMx = m_tgcProjEta; + if ( m_idHelperSvc->cscIdHelper().measuresPhi(id) ) pMx = m_tgcProjPhi.get(); + else pMx = m_tgcProjEta.get(); Amg::VectorX locPar = (*pMx)*parProj; ATH_MSG_DEBUG("projected parameters (layer->CSC):" << m_idHelperSvc->cscIdHelper().measuresPhi(id) <<"," << locPar ); @@ -418,8 +401,8 @@ const Trk::TrackParameters* Muon::MuonTGMeasurementTool::layerToDetEl(const Trk: if (!stripSurf) return projPar; // AmgMatrix(5,5)* pMx = 0; - if ( m_idHelperSvc->tgcIdHelper().isStrip(id) ) pMx = m_tgcProjPhi; - else pMx = m_tgcProjEta; + if ( m_idHelperSvc->tgcIdHelper().isStrip(id) ) pMx = m_tgcProjPhi.get(); + else pMx = m_tgcProjEta.get(); Amg::VectorX locPar = (*pMx)*parm->parameters(); ATH_MSG_DEBUG("projected parameters (layer->TGC):" << m_idHelperSvc->tgcIdHelper().isStrip(id) <<"," << locPar <<"," << stripSurf ); @@ -462,15 +445,11 @@ const Trk::TrackParameters* Muon::MuonTGMeasurementTool::detElToLayer(const Trk: { // Get the messaging service, print where you are ATH_MSG_DEBUG("MuonTGMeasurementTool::detElToLayer"); - const Trk::TrackParameters* projPar = 0; + const Trk::TrackParameters* projPar = nullptr; // check input if (!lay || !parm || !(id.get_identifier32().get_compact()>0) ) return projPar; - // get tracking geometry - const Trk::TrackingGeometry* trackingGeometry; - if ( detStore()->retrieve(trackingGeometry, m_trackingGeometryName).isFailure() )return projPar; - // check compatibility of layer info and required id ? this was already done when associating ! if (!lay->layerType()) return projPar; Identifier layId(lay->layerType()); @@ -561,8 +540,8 @@ const Trk::TrackParameters* Muon::MuonTGMeasurementTool::detElToLayer(const Trk: // Amg::VectorX locPar = parm->parameters(); AmgMatrix(5,5)* pMx = 0; - if (m_idHelperSvc->rpcIdHelper().measuresPhi(id)) pMx = m_rpcProjPhi; - else pMx = m_rpcProjEta; + if (m_idHelperSvc->rpcIdHelper().measuresPhi(id)) pMx = m_rpcProjPhi.get(); + else pMx = m_rpcProjEta.get(); double eta = 1.; double sign = (m_idHelperSvc->rpcIdHelper().measuresPhi(id) && m_idHelperSvc->rpcIdHelper().doubletPhi(id)==2 ) ? -1. : 1.; @@ -622,8 +601,8 @@ const Trk::TrackParameters* Muon::MuonTGMeasurementTool::detElToLayer(const Trk: const Amg::Vector2D csc_shift(0.,lay->getRef()); // projection : take into account possible misalignment ; AmgMatrix(5,5)* pMx = 0; - if ( m_idHelperSvc->cscIdHelper().measuresPhi(id) ) pMx = m_tgcProjPhi; - else pMx = m_tgcProjEta; + if ( m_idHelperSvc->cscIdHelper().measuresPhi(id) ) pMx = m_tgcProjPhi.get(); + else pMx = m_tgcProjEta.get(); AmgMatrix(5,5) pMxInv = pMx->inverse(); Amg::VectorX parProj = pMxInv*parm->parameters(); Amg::Vector3D corrLocPos = lay->surfaceRepresentation().center()-t*parm->momentum() + t*DN*layNormal; @@ -651,8 +630,8 @@ const Trk::TrackParameters* Muon::MuonTGMeasurementTool::detElToLayer(const Trk: } AmgMatrix(5,5)* pMx = 0; - if ( m_idHelperSvc->tgcIdHelper().isStrip(id) ) pMx = m_tgcProjPhi; - else pMx = m_tgcProjEta; + if ( m_idHelperSvc->tgcIdHelper().isStrip(id) ) pMx = m_tgcProjPhi.get(); + else pMx = m_tgcProjEta.get(); AmgMatrix(5,5) pMxInv = pMx->inverse(); Amg::VectorX locPar = pMxInv * parm->parameters(); ATH_MSG_DEBUG("back projected parameters(TGC->layer):" << m_idHelperSvc->tgcIdHelper().isStrip(id)<<"," << locPar ); @@ -697,14 +676,11 @@ const Trk::RIO_OnTrack* Muon::MuonTGMeasurementTool::measToLayer(const Trk::Laye } // Get the messaging service, print where you are ATH_MSG_DEBUG("MuonTGMeasurementTool::measToLayer"); - const Trk::RIO_OnTrack* projRIO = 0; + const Trk::RIO_OnTrack* projRIO = nullptr; // check input if (!lay || !parm || !rio ) return projRIO; - - // get tracking geometry - const Trk::TrackingGeometry* trackingGeometry; - if ( detStore()->retrieve(trackingGeometry, m_trackingGeometryName).isFailure() )return projRIO; + // check compatibility of layer info and required id ? this was already done when associating ! Identifier id = rio->identify(); @@ -879,10 +855,7 @@ const Identifier Muon::MuonTGMeasurementTool::nearestDetEl(const Trk::Layer* lay Identifier nid(0); // check input if (!lay || !parm || !lay->layerType() ) return nid; - - // get tracking geometry - const Trk::TrackingGeometry* trackingGeometry; - if ( detStore()->retrieve(trackingGeometry, m_trackingGeometryName).isFailure() )return nid; + // check compatibility of layer info and required id ? this was already done when associating ! Identifier layId(lay->layerType()); @@ -1204,21 +1177,13 @@ const Trk::Layer* Muon::MuonTGMeasurementTool::associatedLayer(Identifier id, Am { // Get the messaging service, print where you are ATH_MSG_DEBUG("MuonTGMeasurementTool::associatedLayer"); - const Trk::Layer* lay = 0; + const Trk::Layer* lay = nullptr; // check input if (!id.get_identifier32().get_compact() ) return lay; - // get tracking geometry - const Trk::TrackingGeometry* trackingGeometry; - StatusCode sc = detStore()->retrieve(trackingGeometry, m_trackingGeometryName); - if ( sc.isFailure() ){ - ATH_MSG_FATAL("Could not find tool "<< m_trackingGeometryName<<". Exiting."); - return lay; - }else ATH_MSG_DEBUG("tracking geometry Svc \""<<m_trackingGeometryName<<"\" booked "); - // rely on having misalignment uncertainty covered by span safety marge ( don't loose station from static volume // when misaligned - const Trk::TrackingVolume* staticVol = trackingGeometry->lowestStaticTrackingVolume(gp); + const Trk::TrackingVolume* staticVol = getGeometry()->lowestStaticTrackingVolume(gp); const Trk::DetachedTrackingVolume* station = 0; if (staticVol && staticVol->confinedDetachedVolumes()) { const std::vector<const Trk::DetachedTrackingVolume*>* detTV = staticVol->confinedDetachedVolumes(); diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkART/DerivationFrameworkPhysicsValidationART/test/test_mc16PHYSVAL_DAOD_NTUP_HIST.sh b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkART/DerivationFrameworkPhysicsValidationART/test/test_mc16PHYSVAL_DAOD_NTUP_HIST.sh index 60a95d3cabfda3fd872658beca086e4f6eb34eb1..c116437f40c2b102f4200aac39f6481172e2e027 100755 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkART/DerivationFrameworkPhysicsValidationART/test/test_mc16PHYSVAL_DAOD_NTUP_HIST.sh +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkART/DerivationFrameworkPhysicsValidationART/test/test_mc16PHYSVAL_DAOD_NTUP_HIST.sh @@ -2,14 +2,13 @@ # # art-description: AOD to DAOD to PHYSVAL # art-type: grid -# art-input: user.khoo.mc16_13TeV.410389.MadGraphPythia8EvtGen_A14NNPDF23_ttgamma_nonallhadronic.recon.AOD.e6155_s3126_r10201.DAOD_PHYSVAL_ART +# art-input: valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.recon.AOD.e4993_s3227_r12287 # art-include: master/Athena # art-input-nfiles: 10 # art-cores: 5 # art-output: art_core_* # art-output: PHYSVAL_WEB # art-output: DAOD_PHYSVAL.part1.* -# art-runon: Saturday echo "ArtProcess: $ArtProcess" diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGElectronLikelihoodToolWrapper.h b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGElectronLikelihoodToolWrapper.h index 62861f13d14a87b3837b89a43b88a8415aa9e55d..55f849d7b79345f92112de85c3b9beb1ab36e8a9 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGElectronLikelihoodToolWrapper.h +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGElectronLikelihoodToolWrapper.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -45,8 +45,14 @@ public: virtual StatusCode addBranches() const override final; private: - ToolHandle<IAsgElectronLikelihoodTool> m_tool; - ToolHandle<IElectronPhotonShowerShapeFudgeTool> m_fudgeMCTool; + ToolHandle<IAsgElectronLikelihoodTool> m_tool{ + this, + "EGammaElectronLikelihoodTool", + "", + "Electron Likelihood Selector" + }; + ToolHandle<IElectronPhotonShowerShapeFudgeTool> + m_fudgeMCTool{ this, "EGammaFudgeMCTool", "", "Fudging tool" }; SG::ReadHandleKey<xAOD::EgammaContainer> m_ContainerName{ this, "ContainerName", diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGSelectionToolWrapper.h b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGSelectionToolWrapper.h index d62e454e74b0807792940cc299775e5cb78d6433..2db317d6fbb2a00dd772c9b60c75ca9c5cc5ffc2 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGSelectionToolWrapper.h +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/DerivationFrameworkEGamma/EGSelectionToolWrapper.h @@ -9,35 +9,63 @@ #ifndef DERIVATIONFRAMEWORK_EGSELECTIONTOOLWRAPPER_H #define DERIVATIONFRAMEWORK_EGSELECTIONTOOLWRAPPER_H -#include <string> - -#include "AthenaBaseComps/AthAlgTool.h" #include "DerivationFrameworkInterfaces/IAugmentationTool.h" +// +#include "StoreGate/ReadHandle.h" +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteDecorHandle.h" +#include "StoreGate/WriteHandleKey.h" +// +#include "AsgTools/IAsgTool.h" +#include "AthenaBaseComps/AthAlgTool.h" #include "EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h" -//#include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h" #include "EgammaAnalysisInterfaces/IElectronPhotonShowerShapeFudgeTool.h" -#include "PATCore/IAsgSelectionTool.h" -#include "AsgTools/IAsgTool.h" #include "GaudiKernel/ToolHandle.h" +#include "xAODEgamma/EgammaContainer.h" +// +#include <string> namespace DerivationFramework { - class EGSelectionToolWrapper : public AthAlgTool, public IAugmentationTool { - public: - EGSelectionToolWrapper(const std::string& t, const std::string& n, const IInterface* p); - - StatusCode initialize(); - StatusCode finalize(); - virtual StatusCode addBranches() const; - - private: - //ToolHandle<IAsgSelectionTool> m_tool; // can't use isemValue, but can use TAccept and then getInvertedCutBitSet to retrieve isem-like value for both cut-based and LH selectors - ToolHandle<IAsgEGammaIsEMSelector> m_tool; // provides isemValue, but will not work with likelihood.. - ToolHandle<IElectronPhotonShowerShapeFudgeTool> m_fudgeMCTool; - std::string m_cut; - std::string m_sgName; - std::string m_containerName; - }; +class EGSelectionToolWrapper + : public AthAlgTool + , public IAugmentationTool +{ +public: + EGSelectionToolWrapper(const std::string& t, + const std::string& n, + const IInterface* p); + + virtual StatusCode initialize() override final; + virtual StatusCode addBranches() const override final; + +private: + ToolHandle<IAsgEGammaIsEMSelector> m_tool{ + this, + "EGammaSelectionTool", + "", + "Selector tool", + }; + ToolHandle<IElectronPhotonShowerShapeFudgeTool> + m_fudgeMCTool{ this, "EGammaFudgeMCTool", "", "Fudging tool" }; + + SG::ReadHandleKey<xAOD::EgammaContainer> m_ContainerName{ this, + "ContainerN" + "ame", + "", + "Input" }; + + // Write decoration handle keys + // these are not really configuarable + SG::WriteDecorHandleKey<xAOD::EgammaContainer> m_decoratorPass{}; + SG::WriteDecorHandleKey<xAOD::EgammaContainer> m_decoratorIsEM{}; + Gaudi::Property<std::string> m_cut{ this, "CutType", "", "cut type" }; + + Gaudi::Property<std::string> m_sgName{ this, + "StoreGateEntryName", + "", + "Store entry name" }; +}; } #endif // DERIVATIONFRAMEWORK_EGSELECTIONTOOLWRAPPER_H diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGElectronLikelihoodToolWrapper.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGElectronLikelihoodToolWrapper.cxx index 4562551d7b43b895f7a67ac7655a77d46c0b7d9c..0f8597c70b146223145eb505bc301d6d4d1ad2bf 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGElectronLikelihoodToolWrapper.cxx +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGElectronLikelihoodToolWrapper.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -29,9 +29,7 @@ EGElectronLikelihoodToolWrapper::EGElectronLikelihoodToolWrapper( , m_storeTResult(false) { declareInterface<DerivationFramework::IAugmentationTool>(this); - declareProperty("EGammaElectronLikelihoodTool", m_tool); - declareProperty("EGammaFudgeMCTool", m_fudgeMCTool); - declareProperty("CutType", m_cut); + declareProperty("CutType", m_cut); declareProperty("StoreGateEntryName", m_sgName); declareProperty("StoreTResult", m_storeTResult); } @@ -81,10 +79,12 @@ EGElectronLikelihoodToolWrapper::addBranches() const m_decoratorIsEM, ctx }; + SG::WriteDecorHandle<xAOD::EgammaContainer, double>* decoratorResult = nullptr; if (m_storeTResult) { - SG::WriteDecorHandle<xAOD::EgammaContainer, double> decoratorResult{ + SG::WriteDecorHandle<xAOD::EgammaContainer, double> concreteHandle{ m_decoratorResult, ctx }; + decoratorResult = &concreteHandle; } bool applyFF = (!m_fudgeMCTool.empty()); @@ -141,10 +141,8 @@ EGElectronLikelihoodToolWrapper::addBranches() const decoratorPass(*par) = 0; } decoratorIsEM(*par) = isEM; - if (m_storeTResult) { - static const SG::AuxElement::Decorator<double> decResult(m_sgName + - "Result"); - decResult(*par) = static_cast<double>(m_tool->calculate(ctx, pCopy)); + if (decoratorResult) { + (*decoratorResult)(*par) = static_cast<double>(m_tool->calculate(ctx, pCopy)); } } else { if (theAccept.getCutResult(m_cut)) { @@ -153,10 +151,10 @@ EGElectronLikelihoodToolWrapper::addBranches() const decoratorPass(*par) = 0; } decoratorIsEM(*par) = isEM; - if (m_storeTResult) { + if (decoratorResult) { static const SG::AuxElement::Decorator<double> decResult(m_sgName + "Result"); - decResult(*par) = static_cast<double>(m_tool->calculate(ctx, pCopy)); + (*decoratorResult)(*par) = static_cast<double>(m_tool->calculate(ctx, pCopy)); } } // delete the particle copy diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGSelectionToolWrapper.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGSelectionToolWrapper.cxx index 5b3715b1dc9ae42e3bd6b09eb13063c66d61f7c4..fc594a66e0816965960876ac3fff577f090d3992 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGSelectionToolWrapper.cxx +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGSelectionToolWrapper.cxx @@ -9,134 +9,129 @@ // #include "DerivationFrameworkEGamma/EGSelectionToolWrapper.h" -#include "xAODBase/IParticleContainer.h" #include "PATCore/AcceptData.h" +#include "xAODBase/IParticleContainer.h" #include "xAODEgamma/EgammaContainer.h" -#include "xAODEgamma/Photon.h" #include "xAODEgamma/Electron.h" +#include "xAODEgamma/Photon.h" namespace DerivationFramework { - EGSelectionToolWrapper::EGSelectionToolWrapper(const std::string& t, - const std::string& n, - const IInterface* p) : - AthAlgTool(t,n,p), - m_cut(""), - m_sgName(""), - m_containerName("") - { - declareInterface<DerivationFramework::IAugmentationTool>(this); - declareProperty("EGammaSelectionTool", m_tool); - declareProperty("EGammaFudgeMCTool", m_fudgeMCTool); - declareProperty("CutType", m_cut); - declareProperty("StoreGateEntryName", m_sgName); - declareProperty("ContainerName", m_containerName); - } +EGSelectionToolWrapper::EGSelectionToolWrapper(const std::string& t, + const std::string& n, + const IInterface* p) + : AthAlgTool(t, n, p) +{ + declareInterface<DerivationFramework::IAugmentationTool>(this); +} - StatusCode EGSelectionToolWrapper::initialize() - { - if (m_sgName=="") { - ATH_MSG_ERROR("No SG name provided for the output of EGSelectionToolWrapper!"); - return StatusCode::FAILURE; - } - if (m_containerName!="Photons" && m_containerName!="Electrons" && m_containerName!="ForwardElectrons") { - ATH_MSG_ERROR("Wrong container provided!"); - return StatusCode::FAILURE; - } - CHECK(m_tool.retrieve()); - if (m_fudgeMCTool.name()!="") CHECK(m_fudgeMCTool.retrieve()); - return StatusCode::SUCCESS; +StatusCode +EGSelectionToolWrapper::initialize() +{ + if (m_sgName.empty()) { + ATH_MSG_ERROR( + "No SG name provided for the output of EGElectronLikelihoodToolWrapper!"); + return StatusCode::FAILURE; } + ATH_CHECK(m_tool.retrieve()); - StatusCode EGSelectionToolWrapper::finalize() - { - return StatusCode::SUCCESS; + if (!(m_fudgeMCTool.name().empty())) { + ATH_CHECK(m_fudgeMCTool.retrieve()); + } else { + m_fudgeMCTool.disable(); } - StatusCode EGSelectionToolWrapper::addBranches() const - { - // retrieve container - const xAOD::IParticleContainer* particles = evtStore()->retrieve< const xAOD::IParticleContainer >( m_containerName ); - if( ! particles ) { - ATH_MSG_ERROR ("Couldn't retrieve IParticles with key: " << m_containerName ); - return StatusCode::FAILURE; - } + ATH_CHECK(m_ContainerName.initialize()); + // + m_decoratorPass = m_ContainerName.key() + "." + m_sgName; + m_decoratorIsEM = m_ContainerName.key() + "." + m_sgName + "IsEMValue"; + ATH_CHECK(m_decoratorPass.initialize()); + ATH_CHECK(m_decoratorIsEM.initialize()); - // Decorator - SG::AuxElement::Decorator< char > decoratorPass(m_sgName); - SG::AuxElement::Decorator< unsigned int > decoratorIsEM(m_sgName + "IsEMValue"); + return StatusCode::SUCCESS; +} - // Write mask for each element and record to SG for subsequent selection - for (xAOD::IParticleContainer::const_iterator pItr = particles->begin(); pItr!=particles->end(); ++pItr) { +StatusCode +EGSelectionToolWrapper::addBranches() const +{ + // retrieve container + const EventContext& ctx = Gaudi::Hive::currentContext(); + SG::ReadHandle<xAOD::EgammaContainer> particles{ m_ContainerName, ctx }; - xAOD::Type::ObjectType type = (*pItr)->type(); - if (type!=xAOD::Type::Electron && type!=xAOD::Type::Photon) { - ATH_MSG_ERROR ("addBranches(): Wrong particle type (not electron nor photon) being passed to EGSelectionToolWrapper"); - return StatusCode::FAILURE; - } - if (type==xAOD::Type::Electron && (m_containerName!="Electrons" && m_containerName!="ForwardElectrons")) { - ATH_MSG_ERROR ("addBranches(): Wrong particle type being passed to EGSelectionToolWrapper"); - return StatusCode::FAILURE; - } - if (type==xAOD::Type::Photon && m_containerName!="Photons") { - ATH_MSG_ERROR ("addBranches(): Wrong particle type being passed to EGSelectionToolWrapper"); - return StatusCode::FAILURE; - } - - const xAOD::IParticle* pCopy = *pItr; + // Decorators + SG::WriteDecorHandle<xAOD::EgammaContainer, char> decoratorPass{ + m_decoratorPass, ctx + }; + SG::WriteDecorHandle<xAOD::EgammaContainer, unsigned int> decoratorIsEM{ + m_decoratorIsEM, ctx + }; - // this should be computed based on some property of the tool or the existence of the ElectronPhotonShowerShapeFudgeTool - bool applyFF = (!m_fudgeMCTool.empty()); - if (applyFF) { - // apply the shower shape corrections - CP::CorrectionCode correctionCode = CP::CorrectionCode::Ok; - if (type==xAOD::Type::Electron) { - const xAOD::Electron* eg = static_cast<const xAOD::Electron*>(*pItr); - xAOD::Electron* el = 0; - correctionCode = m_fudgeMCTool->correctedCopy(*eg, el); - pCopy = el; - } - else { - const xAOD::Photon* eg = static_cast<const xAOD::Photon*>(*pItr); - xAOD::Photon* ph = 0; - correctionCode = m_fudgeMCTool->correctedCopy(*eg, ph); - pCopy = ph; - } - if (correctionCode==CP::CorrectionCode::Ok) - ; - else if (correctionCode==CP::CorrectionCode::Error) - Error("addBranches()","Error applying fudge factors to current photon"); - else if (correctionCode==CP::CorrectionCode::OutOfValidityRange) - Warning("addBranches()","Current photon has no valid fudge factors due to out-of-range"); - else - Warning("addBranches()","Unknown correction code %d from ElectronPhotonShowerShapeFudgeTool",(int) correctionCode); + bool applyFF = (!m_fudgeMCTool.empty()); + // Write mask for each element and record to SG for subsequent selection + for (const xAOD::Egamma* par : *particles) { + const xAOD::Egamma* pCopy = par; + if (applyFF) { + xAOD::Type::ObjectType type = par->type(); + CP::CorrectionCode correctionCode = CP::CorrectionCode::Ok; + if (type == xAOD::Type::Electron) { + const xAOD::Electron* eg = static_cast<const xAOD::Electron*>(par); + xAOD::Electron* el = nullptr; + correctionCode = m_fudgeMCTool->correctedCopy(*eg, el); + pCopy = el; + } else { + const xAOD::Photon* eg = static_cast<const xAOD::Photon*>(par); + xAOD::Photon* ph = nullptr; + correctionCode = m_fudgeMCTool->correctedCopy(*eg, ph); + pCopy = ph; + } + if (correctionCode == CP::CorrectionCode::Ok) { + // all OK + } else if (correctionCode == CP::CorrectionCode::Error) { + Error("addBranches()", + "Error applying fudge factors to current photon"); + } else if (correctionCode == CP::CorrectionCode::OutOfValidityRange) { + Warning( + "addBranches()", + "Current photon has no valid fudge factors due to out-of-range"); + } else { + Warning( + "addBranches()", + "Unknown correction code %d from ElectronPhotonShowerShapeFudgeTool", + (int)correctionCode); } + } + // compute the output of the selector + asg::AcceptData theAccept(m_tool->accept(pCopy)); + // unsigned int isEM = m_tool->IsemValue(); // this one should be done only + // for IsEM selectors.. + unsigned int isEM = (unsigned int)theAccept.getCutResultInvertedBitSet() + .to_ulong(); // this should work for both the + // cut-based and the LH selectors - // compute the output of the selector - asg::AcceptData theAccept(m_tool->accept(pCopy)); - //unsigned int isEM = m_tool->IsemValue(); // this one should be done only for IsEM selectors.. - unsigned int isEM = (unsigned int) theAccept.getCutResultInvertedBitSet().to_ulong(); // this should work for both the cut-based and the LH selectors - - // decorate the original object - if(m_cut==""){ - bool pass_selection = (bool) theAccept; - if(pass_selection) decoratorPass(**pItr) = 1; - else decoratorPass(**pItr) = 0; - decoratorIsEM(**pItr) = isEM; + // decorate the original object + if (m_cut == "") { + bool pass_selection = (bool)theAccept; + if (pass_selection) { + decoratorPass(*par) = 1; + } else { + decoratorPass(*par) = 0; } - else{ - if (theAccept.getCutResult(m_cut)) { - decoratorPass(**pItr) = 1; - } else { - decoratorPass(**pItr) = 0; - } - decoratorIsEM(**pItr) = isEM; + decoratorIsEM(*par) = isEM; + } else { + if (theAccept.getCutResult(m_cut)) { + decoratorPass(*par) = 1; + } else { + decoratorPass(*par) = 0; } + decoratorIsEM(*par) = isEM; + } - // delete the particle copy - if (applyFF) delete pCopy; + // delete the particle copy + if (applyFF) { + delete pCopy; } - - return StatusCode::SUCCESS; } + + return StatusCode::SUCCESS; +} } diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py index a64098794133cedd596e5d67e53b4a34db1119df..e061c6f8b5ce15405b9677b25f617302c4b8788c 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py @@ -19,6 +19,7 @@ from DerivationFrameworkJetEtMiss import METCommon from TriggerMenuMT.TriggerAPI.TriggerAPI import TriggerAPI from TriggerMenuMT.TriggerAPI.TriggerEnums import TriggerPeriod, TriggerType from DerivationFrameworkTrigger.TriggerMatchingHelper import TriggerMatchingHelper +import re #==================================================================== # SET UP STREAM @@ -101,15 +102,17 @@ from AthenaConfiguration.AutoConfigFlags import GetFileMD from AthenaConfiguration.AllConfigFlags import ConfigFlags if ConfigFlags.Trigger.EDMVersion == 3: - trigger_names_notau = [ - "HLT_mu26_ivarmedium_L1MU20", - "HLT_mu50_L1MU20", - "HLT_e26_etcut_L1EM22VHI", - "HLT_e26_lhmedium_L1EM22VHI", - "HLT_mu22_mu8noL1_L1MU20", - "HLT_e7_lhmedium_mu24_L1MU20", - ] - trigger_names_tau = ["HLT_tau25_mediumRNN_tracktwoMVA_L1TAU12IM",] + r_tau = re.compile("HLT_.*tau.*") + r_notau = re.compile("HLT_[1-9]*(e|mu|g).*") + r_veto = re.compile("HLT_.*(LRT).*") + for chain_name in GetFileMD(ConfigFlags.Input.Files)['TriggerMenu']['HLTChains']: + result_tau = r_tau.match(chain_name) + result_notau = r_notau.match(chain_name) + result_veto = r_veto.match(chain_name) + if result_tau is not None and result_veto is None: trigger_names_tau.append(chain_name) + if result_notau is not None and result_veto is None: trigger_names_notau.append(chain_name) + trigger_names_notau = set(trigger_names_notau) - set(trigger_names_tau) + trigger_names_notau = list(trigger_names_notau) else: for chain_name in GetFileMD(ConfigFlags.Input.Files)['TriggerMenu']['HLTChains']: if chain_name in trigger_names_full_notau: trigger_names_notau.append(chain_name) diff --git a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/ATLAS_CHECK_THREAD_SAFETY b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..72028a2909fb2f6fe1f78771e2c533d55d1ad909 --- /dev/null +++ b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers diff --git a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/EgammaAnalysisHelpers/AsgEGammaConfigHelper.h b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/EgammaAnalysisHelpers/AsgEGammaConfigHelper.h index b21125e1d9696cb8fb0b864cdcd06177de4127a9..c99faa4d49ac8669d3c1231de0f7914d6829bcb5 100644 --- a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/EgammaAnalysisHelpers/AsgEGammaConfigHelper.h +++ b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/EgammaAnalysisHelpers/AsgEGammaConfigHelper.h @@ -18,8 +18,8 @@ class TEnv; namespace AsgConfigHelper{ - std::string findConfigFile (std::string input, const std::map<std::string,std::string>& configmap); - unsigned int findMask (std::string input, const std::map<std::string,unsigned int>& maskmap); + std::string findConfigFile (const std::string& input, const std::map<std::string,std::string>& configmap); + unsigned int findMask (const std::string& input, const std::map<std::string,unsigned int>& maskmap); std::vector<double> HelperDouble(const std::string& input, TEnv& env); std::vector<float> HelperFloat(const std::string& input, TEnv& env); std::vector<int> HelperInt(const std::string& input, TEnv& env); diff --git a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/AsgEGammaConfigHelper.cxx b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/AsgEGammaConfigHelper.cxx index 09211e9ad376cc05a6bf782a28715cf8d44f7910..545b8e4b20bcc9d35e9c470dd700313e6db1220d 100644 --- a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/AsgEGammaConfigHelper.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/AsgEGammaConfigHelper.cxx @@ -10,7 +10,7 @@ namespace AsgConfigHelper{ - std::string findConfigFile (std::string input, const std::map<std::string,std::string>& configmap){ + std::string findConfigFile (const std::string& input, const std::map<std::string,std::string>& configmap){ auto confFile_itr=configmap.find(input); if(confFile_itr == configmap.end()){ static const asg::AsgMessaging msg("Egamma::AsgConfigHelper"); @@ -20,7 +20,7 @@ namespace AsgConfigHelper{ return confFile_itr->second; } - unsigned int findMask (std::string input, const std::map<std::string,unsigned int>& maskmap){ + unsigned int findMask (const std::string& input, const std::map<std::string,unsigned int>& maskmap){ auto mask_itr=maskmap.find(input); if(mask_itr==maskmap.end()){ static const asg::AsgMessaging msg("Egamma::AsgConfigHelper"); @@ -37,7 +37,7 @@ namespace AsgConfigHelper{ std::string tmp = input; std::string::size_type first(0); std::string::size_type last(0); - first = ( input.find("#") ) ; + first = ( input.find('#') ) ; //if we do not find a comment character "#" we are fine if (first == std::string::npos) { @@ -47,7 +47,7 @@ namespace AsgConfigHelper{ } else { //if we have found comment character check if it is inlined between two "#" - last = (input.find("#",first+1) ); + last = (input.find('#',first+1) ); //if nor error if (last == std::string::npos) { static const asg::AsgMessaging msg("Egamma::AsgConfigHelper"); @@ -67,10 +67,10 @@ namespace AsgConfigHelper{ std::vector<T> Helper (const std::string& input, TEnv& env){ std::vector<T> CutVector; std::string env_input(env.GetValue(input.c_str(), "")); - if (env_input.size() > 0) { + if (!env_input.empty()) { std::string::size_type end; do { - end = env_input.find(";"); + end = env_input.find(';'); T myValue(0); if(AsgConfigHelper::strtof(env_input.substr(0,end),myValue)){ CutVector.push_back(myValue); @@ -98,10 +98,10 @@ std::vector<int> AsgConfigHelper::HelperInt(const std::string& input, TEnv& env) std::vector<std::string> AsgConfigHelper::HelperString(const std::string& input, TEnv& env){ std::vector<std::string> CutVector; std::string env_input(env.GetValue(input.c_str(), "")); - if (env_input.size() > 0) { + if (!env_input.empty()) { std::string::size_type end; do { - end = env_input.find(";"); + end = env_input.find(';'); std::string myValue(""); if(AsgConfigHelper::strtof(env_input.substr(0,end),myValue)){ CutVector.push_back(myValue); diff --git a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/PhotonHelpers.cxx b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/PhotonHelpers.cxx index 099e380af8bac7f4b6b04d6dd7aa3bb58049e65f..59ce81007146658674278e3bf04fece2a86bc290 100644 --- a/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/PhotonHelpers.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/EgammaAnalysisHelpers/Root/PhotonHelpers.cxx @@ -17,15 +17,17 @@ bool PhotonHelpers::passOQquality(const xAOD::Photon *ph){ return 0; } - if( !( ( ph->OQ() & 1073741824 )!=0 || + return !( ( ph->OQ() & 1073741824 )!=0 || + ( ( ph->OQ() & 134217728 )!=0 && + ( ph->showerShapeValue(xAOD::EgammaParameters::Reta) > 0.98 + || ph->showerShapeValue(xAOD::EgammaParameters::f1) > 0.4 + || (ph->OQ() & 67108864) !=0) - ) ) ){ - return true; - } - return false; + + ) ); } // ================================================================== bool PhotonHelpers::passOQqualityDelayed(const xAOD::Photon *ph){ @@ -36,12 +38,13 @@ bool PhotonHelpers::passOQqualityDelayed(const xAOD::Photon *ph){ return 0; } - if( !( ( ph->OQ() & 1073741824)!=0 || + return !( ( ph->OQ() & 1073741824)!=0 || + ( ( ph->OQ() & 134217728)!=0 && + ( ph->showerShapeValue(xAOD::EgammaParameters::Reta) > 0.98 + || ph->showerShapeValue(xAOD::EgammaParameters::f1) > 0.4 - ) ) ) ) { - return true; - } - return false; + + ) ) ); } diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ATLAS_CHECK_THREAD_SAFETY b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..274b45e446739e2a710594569b6579daa9c13820 --- /dev/null +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/ElectronChargeEfficiencyCorrectionTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/ElectronChargeEfficiencyCorrectionTool.h index 522c3439f88453b5b41b5d1abce619561f4d5d43..995ee9db9669ea9fdbfdf5cac3e8afe9684411b3 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/ElectronChargeEfficiencyCorrectionTool.h +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/ElectronEfficiencyCorrection/ElectronChargeEfficiencyCorrectionTool.h @@ -141,7 +141,7 @@ namespace CP { /// Truth charge - mutable int m_truthCharge; + int m_truthCharge; //const xAOD::TruthParticle *m_truthparticle; diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ATLAS_CHECK_THREAD_SAFETY b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..0792ec7bbaf31109d44fed9b91ca9c5adda0d20b --- /dev/null +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool.h index 0692194f0e041194289bb62e49032d2900210b9a..eacb4da6421ab5319d5eb70ab30e5288cb6f1f6f 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool.h +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool/ElectronPhotonShowerShapeFudgeTool.h @@ -36,20 +36,23 @@ public: public: /** Gaudi Service Interface method implementations */ - virtual StatusCode initialize(); + virtual StatusCode initialize() override final; - /** Gaudi Service Interface method implementations */ - virtual StatusCode finalize(); public: + virtual const CP::CorrectionCode applyCorrection( + xAOD::Photon& ph) const override final; - virtual const CP::CorrectionCode applyCorrection(xAOD::Photon& ph ) const; - - virtual const CP::CorrectionCode applyCorrection(xAOD::Electron& el ) const; + virtual const CP::CorrectionCode applyCorrection( + xAOD::Electron& el) const override final; - virtual const CP::CorrectionCode correctedCopy( const xAOD::Photon& ph, xAOD::Photon*& output ) const ; + virtual const CP::CorrectionCode correctedCopy( + const xAOD::Photon& ph, + xAOD::Photon*& output) const override final; - virtual const CP::CorrectionCode correctedCopy( const xAOD::Electron& el, xAOD::Electron*& output) const; + virtual const CP::CorrectionCode correctedCopy( + const xAOD::Electron& el, + xAOD::Electron*& output) const override final; private: diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/Root/ElectronPhotonShowerShapeFudgeTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/Root/ElectronPhotonShowerShapeFudgeTool.cxx index 327f39e0bc269ad8c06014d158ffee587ee0450e..da8ee467dd3b2b62cfb2f5b599e4011351e6c6ab 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/Root/ElectronPhotonShowerShapeFudgeTool.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/Root/ElectronPhotonShowerShapeFudgeTool.cxx @@ -40,10 +40,6 @@ ElectronPhotonShowerShapeFudgeTool::ElectronPhotonShowerShapeFudgeTool(const std // Standard Destructor ElectronPhotonShowerShapeFudgeTool::~ElectronPhotonShowerShapeFudgeTool() { - if(finalize().isFailure()){ - ATH_MSG_ERROR ( "Failure in ElectronPhotonShowerShapeFudgeTool finalize()"); - } - if ( m_ph_rootTool ) delete m_ph_rootTool; if ( m_el_rootTool ) delete m_el_rootTool; } @@ -105,12 +101,6 @@ StatusCode ElectronPhotonShowerShapeFudgeTool::initialize() } -StatusCode ElectronPhotonShowerShapeFudgeTool::finalize() -{ - return StatusCode::SUCCESS; -} - - const CP::CorrectionCode ElectronPhotonShowerShapeFudgeTool::applyCorrection( xAOD::Photon& ph) const { //Input vars to the underlying root tool. @@ -364,8 +354,7 @@ bool ElectronPhotonShowerShapeFudgeTool::strtof(const std::string& input, float& else { last = (input.find('#',first+1) ); if (last == std::string::npos) { - static asg::AsgMessaging msg("Egamma::ElectronPhotonShowerShapeFudgeTool"); - msg.msg(MSG::WARNING)<<" Improper comment format , inline comment should be enclosed between two # "<<endmsg; + ATH_MSG_WARNING("Improper comment format , inline comment should be enclosed between two #"); return false; } diff = last - first ; diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/Root/TPhotonMCShifterTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/Root/TPhotonMCShifterTool.cxx index 71a915e2e875a076fb7ec8e055c7f61ecf99fbee..fad15d52f3cb65e7ea752d0bbe0e5b0080deff9a 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/Root/TPhotonMCShifterTool.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonShowerShapeFudgeTool/Root/TPhotonMCShifterTool.cxx @@ -151,10 +151,10 @@ void TPhotonMCShifterTool::LoadFFs(int preselection, const std::string& file) throw std::runtime_error( "Couldn't open file: " + m_corr_file ); } if (!f->FindKey(Form("TUNE%d",preselection))) { - std::cout << "Directory TUNE" << preselection << " does not exist in fudge factor file. Aborting" << std::endl; - exit(-1); + throw std::runtime_error("Directory TUNE " + std::to_string(preselection) + + " does not exist in fudge factor file."); } - + h_u_rhad1 = (TH2D*) f->Get(Form("TUNE%d/FF_RHAD1_UNCONV",preselection)); h_u_rhad1->SetDirectory(nullptr); diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt index b1a0b9bf3a210ef158bd7c33db2dbf00f75784ae..bd94845e43cbb765acea7f0fa673862a2a2be3b7 100644 --- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt +++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # The name of the package: atlas_subdir( EgammaAnalysisInterfaces ) @@ -8,7 +8,8 @@ atlas_add_library( EgammaAnalysisInterfacesLib EgammaAnalysisInterfaces/*.h INTERFACE PUBLIC_HEADERS EgammaAnalysisInterfaces - LINK_LIBRARIES AsgTools xAODCaloEvent xAODEgamma xAODTracking PATInterfaces PATCoreLib ) + LINK_LIBRARIES AsgTools AsgServicesLib xAODCaloEvent + xAODEgamma xAODTracking AsgMessagingLib PATInterfaces PATCoreLib ) atlas_add_dictionary( EgammaAnalysisInterfacesDict EgammaAnalysisInterfaces/EgammaAnalysisInterfacesDict.h diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfacesDict.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfacesDict.h index 7b91c9c6b9b1486306199e53b680f680d2f22bb0..e5a07762ede73f473f4fa028324b4359e678fdb0 100644 --- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfacesDict.h +++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfacesDict.h @@ -15,6 +15,8 @@ #include "EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h" +#include "EgammaAnalysisInterfaces/IegammaMVACalibTool.h" +#include "EgammaAnalysisInterfaces/IegammaMVASvc.h" #include "EgammaAnalysisInterfaces/IEgammaCalibrationAndSmearingTool.h" #include "EgammaAnalysisInterfaces/IAsgPhotonEfficiencyCorrectionTool.h" diff --git a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaMVACalibTool.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IegammaMVACalibTool.h similarity index 60% rename from Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaMVACalibTool.h rename to PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IegammaMVACalibTool.h index d6540b79374e1e914808a391db610cbc16ff2f73..8936f44499824d5d99e2b090f1e6e4d612bfdedb 100644 --- a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaMVACalibTool.h +++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IegammaMVACalibTool.h @@ -1,10 +1,10 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -#ifndef EGAMMAINTERFACES_iEGAMMAMVACALIBTOOL_H -#define EGAMMAINTERFACES_iEGAMMAMVACALIBTOOL_H +#ifndef EGAMMAANALYSISINTERFACES_IEGAMMAMVACALIBTOOL_H +#define EGAMMAANALYSISINTERFACES_IEGAMMAMVACALIBTOOL_H -#include "GaudiKernel/IAlgTool.h" +#include "AsgTools/IAsgTool.h" // EDM includes #include "xAODEgamma/EgammaFwd.h" @@ -14,16 +14,15 @@ * @class IegammaMVACalibTool * @brief A tool used by the egammaMVASvc to help manage the MVAs. **/ -class IegammaMVACalibTool : virtual public IAlgTool { +class IegammaMVACalibTool : virtual public asg::IAsgTool{ + ASG_TOOL_INTERFACE(IegammaMVACalibTool) public: - DeclareInterfaceID(IegammaMVACalibTool, 1, 0); - virtual ~IegammaMVACalibTool() override {}; ///Return MVA energy for the given cluster, an eg object is optional virtual float getEnergy(const xAOD::CaloCluster& clus, const xAOD::Egamma* eg) const = 0; -}; +}; #endif diff --git a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaMVASvc.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IegammaMVASvc.h similarity index 67% rename from Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaMVASvc.h rename to PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IegammaMVASvc.h index 97497f096a4b317d0e3d61091ba48ff875136ee8..a414a7190476d598862ba1439d986cd03827e1f4 100644 --- a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaMVASvc.h +++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IegammaMVASvc.h @@ -1,24 +1,24 @@ // Dear Emacs, this is -*- C++ -*- /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -#ifndef EGAMMAINTERFACES_IEGAMMAMVASVC_H -#define EGAMMAINTERFACES_IEGAMMAMVASVC_H - -#include "GaudiKernel/IService.h" +#ifndef EGAMMAANALYSISINTERFACES_IEGAMMAMVASVC_H +#define EGAMMAANALYSISINTERFACES_IEGAMMAMVASVC_H +#include "AsgServices/IAsgService.h" +#include "AsgMessaging/StatusCode.h" // EDM includes #include "xAODEgamma/EgammaFwd.h" #include "xAODEgamma/EgammaEnums.h" #include "xAODCaloEvent/CaloClusterFwd.h" -class IegammaMVASvc : virtual public IService { +class IegammaMVASvc : virtual public asg::IAsgService { + ASG_SERVICE_INTERFACE(IegammaMVASvc) public: - DeclareInterfaceID(IegammaMVASvc, 1, 0); virtual ~IegammaMVASvc() override {}; diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/selection.xml b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/selection.xml index 042c1d9ed007d15fb82972e70be0fa8b860c2bfb..4197162871d82982b220b1b0676a1b29b320eff2 100644 --- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/selection.xml +++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/selection.xml @@ -9,13 +9,15 @@ <class name="IAsgDeadHVCellRemovalTool" /> <class name="IAsgElectronEfficiencyCorrectionTool" /> + + <class name="IegammaMVACalibTool" /> + <class name="IegammaMVASvc" /> <class name="IEgammaCalibrationAndSmearingTool" /> <variable pattern="EgammaCalibPeriodRunNumbersExample::*"/> <class name="EgammaCalibPeriodRunNumbersExample::ROOT6_NamespaceAutoloadHook" /> <class name="IAsgPhotonEfficiencyCorrectionTool" /> - <class name="IElectronPhotonShowerShapeFudgeTool" /> <lcgdict> diff --git a/PhysicsAnalysis/TruthParticleID/McParticleTools/src/HepMcReaderTool.cxx b/PhysicsAnalysis/TruthParticleID/McParticleTools/src/HepMcReaderTool.cxx index 5d9f75f433afdd9c08ca684de67126bca4e32bea..03391fffc683600df216e31366c80c2b5ca923e2 100755 --- a/PhysicsAnalysis/TruthParticleID/McParticleTools/src/HepMcReaderTool.cxx +++ b/PhysicsAnalysis/TruthParticleID/McParticleTools/src/HepMcReaderTool.cxx @@ -124,11 +124,6 @@ StatusCode HepMcReaderTool::read( HepMC::GenEvent* evt ) return StatusCode::SUCCESS; } - -/////////////////////////////////////////////////////////////////// -/// Non-const methods: -/////////////////////////////////////////////////////////////////// - void HepMcReaderTool::setupFrontend( Gaudi::Details::PropertyBase& /*prop*/ ) { // defaults diff --git a/Projects/AthDataQuality/version.txt b/Projects/AthDataQuality/version.txt index 3513fa3975b574aae593eb37e7953d5b924301cc..4d15ca0406c60c5d409bc33ab5858a0090feb7d2 100644 --- a/Projects/AthDataQuality/version.txt +++ b/Projects/AthDataQuality/version.txt @@ -1 +1 @@ -22.0.28 +22.0.30 diff --git a/Projects/AthGeneration/version.txt b/Projects/AthGeneration/version.txt index 3e310491880ead81f048317add9dd7d1dab6da06..7d45883c79396603a1ef322b371e3f4ebe7bb1d0 100644 --- a/Projects/AthGeneration/version.txt +++ b/Projects/AthGeneration/version.txt @@ -1 +1 @@ -22.6.1 +22.6.2 diff --git a/Projects/AthSimulation/version.txt b/Projects/AthSimulation/version.txt index 3513fa3975b574aae593eb37e7953d5b924301cc..4d15ca0406c60c5d409bc33ab5858a0090feb7d2 100644 --- a/Projects/AthSimulation/version.txt +++ b/Projects/AthSimulation/version.txt @@ -1 +1 @@ -22.0.28 +22.0.30 diff --git a/Projects/Athena/version.txt b/Projects/Athena/version.txt index 4d15ca0406c60c5d409bc33ab5858a0090feb7d2..e5078b479cf7c53b9a657a8440d822748ade1826 100644 --- a/Projects/Athena/version.txt +++ b/Projects/Athena/version.txt @@ -1 +1 @@ -22.0.30 +22.0.31 diff --git a/Projects/VP1Light/version.txt b/Projects/VP1Light/version.txt index 3513fa3975b574aae593eb37e7953d5b924301cc..4d15ca0406c60c5d409bc33ab5858a0090feb7d2 100644 --- a/Projects/VP1Light/version.txt +++ b/Projects/VP1Light/version.txt @@ -1 +1 @@ -22.0.28 +22.0.30 diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/CaloMuonScoreTool.h b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/CaloMuonScoreTool.h index 9d1bb50fa290e4fe8632d38005818c60d2c7c1ef..582605ce68bfbfa2b9b7bc963ca058db92a96af2 100644 --- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/CaloMuonScoreTool.h +++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/CaloMuonScoreTool.h @@ -43,7 +43,7 @@ public: virtual StatusCode initialize(); // Compute the muon score given a track particle - float getMuonScore(const xAOD::TrackParticle* trk) const; + float getMuonScore(const xAOD::TrackParticle* trk, const CaloCellContainer* cells = nullptr, const CaloExtensionCollection* extensionCache = nullptr) const; // run the ONNX inference on the input tensor float runOnnxInference(std::vector<float> &tensor) const; diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h index 093f0c8cd9345cfdf8d6b306ea5e78621f6c2c26..143a65b6f171e49625252f5e86e88d6856141ca9 100755 --- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h +++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h @@ -66,7 +66,7 @@ class TrackDepositInCaloTool: public AthAlgTool, virtual public ITrackDepositInC */ std::vector<DepositInCalo> getDeposits(const Trk::TrackParameters* par, const CaloCellContainer* caloCellCont = nullptr) const; - std::vector<DepositInCalo> getDeposits(const xAOD::TrackParticle* tp) const; + std::vector<DepositInCalo> getDeposits(const xAOD::TrackParticle* tp, const CaloCellContainer* caloCellCont = nullptr, const CaloExtensionCollection* extensionCache = nullptr) const; std::vector<DepositInCalo> deposits(const Trk::TrackParameters *par, const double deltaR=0.3, const bool inCell= true) const; /** diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonScoreTool.cxx b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonScoreTool.cxx index 12bb65e6cc27b206570cf41777623ac34be61382..a5f96564446345e4c1f9c6c4b99dba31d7827877 100644 --- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonScoreTool.cxx +++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonScoreTool.cxx @@ -12,6 +12,7 @@ #include "TrkParameters/TrackParameters.h" #include "ParticleCaloExtension/ParticleCellAssociationCollection.h" +#include "TrkCaloExtension/CaloExtensionCollection.h" #include <string> #include <iostream> @@ -149,7 +150,7 @@ void CaloMuonScoreTool::fillInputVectors(std::unique_ptr<const Rec::ParticleCell /////////////////////////////////////////////////////////////////////////////// // CaloMuonScoreTool::getMuonScore /////////////////////////////////////////////////////////////////////////////// -float CaloMuonScoreTool::getMuonScore( const xAOD::TrackParticle* trk ) const { +float CaloMuonScoreTool::getMuonScore( const xAOD::TrackParticle* trk, const CaloCellContainer* cells, const CaloExtensionCollection* extensionCache ) const { ATH_MSG_DEBUG("in CaloMuonScoreTool::getMuonScore()"); double track_eta = trk->eta(); @@ -165,7 +166,7 @@ float CaloMuonScoreTool::getMuonScore( const xAOD::TrackParticle* trk ) const { ATH_MSG_DEBUG("Finding calo cell association for track particle within cone of delta R="<<m_CaloCellAssociationConeSize); // - associate calocells to trackparticle - std::unique_ptr<const Rec::ParticleCellAssociation> association = m_caloCellAssociationTool->particleCellAssociation(*trk,m_CaloCellAssociationConeSize,nullptr); + std::unique_ptr<const Rec::ParticleCellAssociation> association = m_caloCellAssociationTool->particleCellAssociation(*trk,m_CaloCellAssociationConeSize,cells, extensionCache); if(!association){ ATH_MSG_VERBOSE("Could not get particleCellAssociation"); return -1.; diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx index cad4b2bb14eb7bfa93c8f3f2d51d0b665bc2e92b..6b0e25a0d2669710f1314496a8bed83e942986fe 100755 --- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx +++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx @@ -28,6 +28,7 @@ #include "ParticleCaloExtension/ParticleCaloAssociation.h" #include "TrkCaloExtension/CaloExtension.h" #include "TrkCaloExtension/CaloExtensionHelpers.h" +#include "TrkCaloExtension/CaloExtensionCollection.h" #include "GaudiKernel/ITHistSvc.h" // --- ROOT --- #include "TH1F.h" @@ -199,7 +200,7 @@ std::vector<DepositInCalo> TrackDepositInCaloTool::getDeposits(const Trk::TrackP /////////////////////////////////////////////////////////////////////////////// // - New getDeposits /////////////////////////////////////////////////////////////////////////////// -std::vector<DepositInCalo> TrackDepositInCaloTool::getDeposits(const xAOD::TrackParticle* tp) const { +std::vector<DepositInCalo> TrackDepositInCaloTool::getDeposits(const xAOD::TrackParticle* tp, const CaloCellContainer* caloCellCont, const CaloExtensionCollection* extensionCache) const { ATH_MSG_DEBUG("In TrackDepositsInCaloTool::getDeposits() - new"); std::vector<DepositInCalo> result; @@ -208,7 +209,7 @@ std::vector<DepositInCalo> TrackDepositInCaloTool::getDeposits(const xAOD::Track // - associate calocells to trackparticle, cone size 0.2, use cache std::unique_ptr<const Rec::ParticleCellAssociation> association = - m_caloCellAssociationTool->particleCellAssociation(*tp,0.2,nullptr); + m_caloCellAssociationTool->particleCellAssociation(*tp,0.2,caloCellCont, extensionCache); if(!association) return result; ATH_MSG_VERBOSE(" particleCellAssociation done " << association.get() ); diff --git a/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/CMakeLists.txt b/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/CMakeLists.txt index 3e5abe061ba251a45a03f4394d77615ce468de51..ab82b2e7e654a8d0011ec9af252096ddd6ded2b2 100644 --- a/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/CMakeLists.txt +++ b/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/CMakeLists.txt @@ -8,4 +8,4 @@ atlas_subdir( ICaloTrkMuIdTools ) # Component(s) in the package: atlas_add_library( ICaloTrkMuIdTools PUBLIC_HEADERS ICaloTrkMuIdTools - LINK_LIBRARIES CaloEvent CaloIdentifier xAODCaloEvent xAODTracking GaudiKernel muonEvent TrkSurfaces TrkEventPrimitives TrkParameters TrkTrack CaloDetDescrLib ) + LINK_LIBRARIES CaloEvent CaloIdentifier xAODCaloEvent xAODTracking GaudiKernel muonEvent TrkSurfaces TrkEventPrimitives TrkParameters TrkTrack CaloDetDescrLib TrkCaloExtension ) diff --git a/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/ICaloTrkMuIdTools/ICaloMuonScoreTool.h b/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/ICaloTrkMuIdTools/ICaloMuonScoreTool.h index 6eabefed1fe3e21904765736f07321cf7667ddca..411af7b5703159147df992828c1c126f35059fb8 100644 --- a/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/ICaloTrkMuIdTools/ICaloMuonScoreTool.h +++ b/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/ICaloTrkMuIdTools/ICaloMuonScoreTool.h @@ -7,6 +7,9 @@ #include "GaudiKernel/IAlgTool.h" #include "xAODTracking/TrackParticle.h" +#include "TrkCaloExtension/CaloExtensionCollection.h" + +class CaloCellContainer; static const InterfaceID IID_ICaloMuonScoreTool("ICaloMuonScoreTool",1,0); @@ -18,7 +21,7 @@ class ICaloMuonScoreTool : virtual public IAlgTool static const InterfaceID& interfaceID(){return IID_ICaloMuonScoreTool;} - virtual float getMuonScore(const xAOD::TrackParticle* trk) const = 0; + virtual float getMuonScore(const xAOD::TrackParticle* trk, const CaloCellContainer* cells = nullptr, const CaloExtensionCollection* extensionCache = nullptr) const = 0; }; diff --git a/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/ICaloTrkMuIdTools/ITrackDepositInCaloTool.h b/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/ICaloTrkMuIdTools/ITrackDepositInCaloTool.h index 541990f68534086e12d97d0558890c8b4749022c..319aa115d96fe0d234e334b3ff24c732b3848024 100644 --- a/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/ICaloTrkMuIdTools/ITrackDepositInCaloTool.h +++ b/Reconstruction/MuonIdentification/ICaloTrkMuIdTools/ICaloTrkMuIdTools/ITrackDepositInCaloTool.h @@ -15,6 +15,7 @@ #include "CaloEvent/CaloCell.h" #include "CaloEvent/CaloCellContainer.h" #include "xAODTracking/TrackParticle.h" +#include "TrkCaloExtension/CaloExtensionCollection.h" static const InterfaceID IID_ITrackDepositInCaloTool("ITrackDepositInCaloTool", 1, 0); @@ -51,7 +52,7 @@ class ITrackDepositInCaloTool: virtual public IAlgTool */ virtual std::vector<DepositInCalo> getDeposits(const Trk::TrackParameters* par, const CaloCellContainer* caloCellCont = nullptr) const = 0; - virtual std::vector<DepositInCalo> getDeposits(const xAOD::TrackParticle* tp) const = 0; + virtual std::vector<DepositInCalo> getDeposits(const xAOD::TrackParticle* tp, const CaloCellContainer* caloCellCont = nullptr, const CaloExtensionCollection* extensionCache = nullptr) const = 0; virtual StatusCode getTraversedLayers(const Trk::TrackParameters* par, std::map<double, const CaloDetDescriptor*>& caloInfo, std::vector<Amg::Vector3D>& extrapolations) const = 0; /** diff --git a/Reconstruction/MuonIdentification/MuidTrackBuilder/src/CombinedMuonTrackBuilder.cxx b/Reconstruction/MuonIdentification/MuidTrackBuilder/src/CombinedMuonTrackBuilder.cxx index ec847f245f2a3aa1cdefb0dd5a59926103b6ea3c..57a21a2ad1285fd6487e18745b1057f3dc56b125 100755 --- a/Reconstruction/MuonIdentification/MuidTrackBuilder/src/CombinedMuonTrackBuilder.cxx +++ b/Reconstruction/MuonIdentification/MuidTrackBuilder/src/CombinedMuonTrackBuilder.cxx @@ -1482,8 +1482,8 @@ CombinedMuonTrackBuilder::standaloneFit(const Trk::Track& inputSpectrometerTrack if (checkTrack("refineFit", refinedTrack.get(), track.get())) { ATH_MSG_VERBOSE("refined track checks out"); + track.swap(refinedTrack); } - track.swap(refinedTrack); } else { ATH_MSG_VERBOSE("refined track fit failed"); ++improvementsFailed; @@ -1529,8 +1529,8 @@ CombinedMuonTrackBuilder::standaloneFit(const Trk::Track& inputSpectrometerTrack << " Chi2/DoF= " << fitChi2); ++m_countDegradedStandaloneFit; - if (improvementsFailed == 2) { - ATH_MSG_WARNING("reject track, quality degraded and improvements failed"); + if (improvementsFailed >= 2) { + ATH_MSG_DEBUG("reject track, quality degraded and improvements failed"); if (haveSpectrometerRefit) { delete spectrometerFit; } diff --git a/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py b/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py index a615b6b95d90dfd7e94b4347d738aa91f988a792..4514e9ae42e8fb2e036735e259253613388e3492 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py +++ b/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py @@ -15,60 +15,8 @@ mm = 1 def MuonCombinedTrackSummaryToolCfg(flags, name="", **kwargs): # Based on https://gitlab.cern.ch/atlas/athena/blob/release/22.0.8/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py - # FIXME - check all of this once the ID configuration is available, because probably we can simplify this a lot - result = AtlasExtrapolatorCfg(flags) - extrapolator = result.getPrimary() - result.addPublicTool(extrapolator) - - from InDetConfig. InDetRecToolConfig import InDetBoundaryCheckToolCfg - acc = InDetBoundaryCheckToolCfg(flags, name="CombinedMuonIDBoundaryCheckTool") - boundary_tool = result.popToolsAndMerge(acc) - - from InDetConfig.InDetRecToolConfig import InDetTrackHoleSearchToolCfg - acc = InDetTrackHoleSearchToolCfg(flags, - name = "CombinedMuonIDHoleSearch", - Extrapolator = extrapolator, - CountDeadModulesAfterLastHit = True, - BoundaryCheckTool = boundary_tool, - Cosmics = (flags.Beam.Type=="cosmics")) - indet_hole_search_tool = acc.getPrimary() - result.addPublicTool(indet_hole_search_tool) - result.merge(acc) - #FIXME - need InDet to provide configuration for PixelConditionsSummaryTool - # Also assuming we don't use DetailedPixelHoleSearch (since it seems to be off in standard workflows) - from InDetConfig.InDetRecToolConfig import InDetTrackSummaryHelperToolCfg - acc = InDetTrackSummaryHelperToolCfg(flags, - name="CombinedMuonIDSummaryHelper", - AssoTool = None, - PixelToTPIDTool = None, - TestBLayerTool = None, - DoSharedHits = False, - usePixel = True, - useSCT = True, - useTRT = True, - HoleSearch = indet_hole_search_tool) - indet_track_summary_helper_tool = acc.getPrimary() - result.addPublicTool(indet_track_summary_helper_tool) - result.merge(acc) - - - from MuonConfig.MuonRecToolsConfig import MuonTrackSummaryHelperToolCfg - acc = MuonTrackSummaryHelperToolCfg(flags) - muon_track_summary_helper_tool = acc.getPrimary() - track_summary_tool = CompFactory.Trk.TrackSummaryTool(name="CombinedMuonTrackSummary", - doSharedHits = False, - doHolesInDet = True, - doHolesMuon = False, - AddDetailedInDetSummary = True, - AddDetailedMuonSummary = True, - InDetSummaryHelperTool = indet_track_summary_helper_tool, - TRT_ElectronPidTool = None, - PixelToTPIDTool = None, - MuonSummaryHelperTool = muon_track_summary_helper_tool, - PixelExists = True ) - result.merge(acc) - result.addPublicTool(track_summary_tool) - result.setPrivateTools(track_summary_tool) + from TrkConfig.AtlasTrackSummaryToolConfig import AtlasTrackSummaryToolCfg + result = AtlasTrackSummaryToolCfg(flags, name = "CombinedMuonTrackSummary") return result def MuonTrackToVertexCfg(flags, name = 'MuonTrackToVertexTool', **kwargs ): diff --git a/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonStauRecoTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonStauRecoTool.cxx index 67bba1ae5aca9fca0aeaaae469d570deeabf86d7..48458e1a885797f57ebbc68525ee500a97b9c3b8 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonStauRecoTool.cxx +++ b/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonStauRecoTool.cxx @@ -610,7 +610,8 @@ namespace MuonCombined { TrkDriftCircleMath::Segment segment = result; segment.hitsOnTrack(dcs.size()); unsigned int ndofFit = segment.ndof(); - double chi2NdofSegmentFit = segment.chi2()/(double)(ndofFit); + if (ndofFit < 1) continue; + double chi2NdofSegmentFit = segment.chi2()/ndofFit; bool hasDropHit = false; unsigned int dropDepth = 0; if( !segmentFinder.dropHits(segment, hasDropHit, dropDepth) ){ @@ -698,8 +699,8 @@ namespace MuonCombined { if( !isSelected ) continue; - hits.push_back(Muon::TimePointBetaFitter::Hit(distance,time,er)); - candidate.stauHits.push_back(MuGirlNS::StauHit(MuGirlNS::MDTT_STAU_HIT, time+tof, ix, iy, iz, id, ie, er,sh, isEta, propTime)); + hits.emplace_back(distance,time,er); + candidate.stauHits.emplace_back(MuGirlNS::MDTT_STAU_HIT, time+tof, ix, iy, iz, id, ie, er,sh, isEta, propTime); } } // fit data diff --git a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/FlowElement_LinkerPlots.cxx b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/FlowElement_LinkerPlots.cxx index c356dcf8452ea87bfa4945af1c89fecf594f9846..a01b3bbe4c4d162274eee107f1e5e406ebbdfb56 100644 --- a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/FlowElement_LinkerPlots.cxx +++ b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/FlowElement_LinkerPlots.cxx @@ -129,6 +129,7 @@ namespace PFO { } for (ElementLink<xAOD::MuonContainer> MuonLink: MuonLinks){ + //get Muon from link by de-referencing it const xAOD::Muon* muon = *MuonLink; TLorentzVector muon_fourvec=muon->p4(); @@ -146,7 +147,7 @@ namespace PFO { m_CFE_muon_largeDR_debug_type->Fill(type,eventInfo.beamSpotWeight()); } }// end of CFE fill block for muon_dR code - } + } }// end of muon acc block // Electron block diff --git a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFO_FE_Comparison_PlotMaker.cxx b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFO_FE_Comparison_PlotMaker.cxx index eba5b090e1f56fd4561522040e480564cc53c6e4..9e40a0f9efab420753cffe5c4739abbebf6f2a19 100644 --- a/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFO_FE_Comparison_PlotMaker.cxx +++ b/Reconstruction/PFlow/PFlowValidation/PFOHistUtils/src/PFO_FE_Comparison_PlotMaker.cxx @@ -5,6 +5,9 @@ #include "PFOHistUtils/PFO_FE_Comparison_PlotMaker.h" #include <math.h> +// some debug libraries for cluster moment floating point checks +#include <bitset> +#include <climits> namespace PFO { PFO_FE_Comparison_PlotMaker::PFO_FE_Comparison_PlotMaker(PlotBase* pParent,std::string sDir, std::string sPFOContainerName, std::string sFEContainerName, bool isNeutral): PlotBase(pParent,sDir), asg::AsgMessaging("PFO_FE_Comparison_PlotMaker"), m_sPFOContainerName(sPFOContainerName), m_sFEContainerName(sFEContainerName), m_isNeutral(isNeutral) { // init all hists as nullptrs @@ -87,11 +90,11 @@ namespace PFO { void PFO_FE_Comparison_PlotMaker::Fill(const xAOD::PFO* pfo, const xAOD::FlowElement* fe){ TLorentzVector fe_tlv=fe->p4(); - TLorentzVector pfo_tlv=pfo->p4(); + TLorentzVector pfo_tlv=pfo->p4EM(); // default PFO is LC scale, switch to EM scale for comparison double pfo_pt=pfo_tlv.Pt(); double pfo_eta=pfo_tlv.Eta(); - double pfo_e=pfo_tlv.E(); + double pfo_e=pfo_tlv.E(); // get correct scale double fe_pt=fe_tlv.Pt(); double fe_eta=fe_tlv.Eta(); @@ -106,7 +109,26 @@ namespace PFO { double abs_dEta=std::abs(fe_eta-pfo_eta); double dphi=fe_tlv.DeltaPhi(pfo_tlv); double dE=fe_e-pfo_e; - + double ERatio=-9999999999; + if(pfo_e!=0) + ERatio=fe_e/pfo_e; + + if(m_isNeutral){ + // debug of scale + double pfo_e_LC=pfo->p4().E(); // pfo LC scale energy + double pfo_eEM=pfo->eEM(); // pfo EM scale energy + ATH_MSG_DEBUG("PFO E(): "<<pfo_e_LC<<"PFO eEM()"<<pfo_eEM<<" FE E(): "<<fe_e); + if(ERatio>-999999999) + ATH_MSG_INFO("Ratio (PFO_e/FE_e): "<<ERatio); + if(dE!=0) + ATH_MSG_INFO("FE_e - PFO_e : "<<dE); + // assume all edge cases/nullptr catches for clusters were already vetoed + double fe_clus_e=(fe->otherObjects()).at(0)->p4().E(); + double pfo_clus_e=pfo->cluster(0)->p4().E(); + + + ATH_MSG_INFO("PFO_clus E(): "<<pfo_clus_e<<" FE_clus E(): "<<fe_clus_e); + } // now fill the histos m_PFO_FE_dE->Fill(dE); @@ -166,9 +188,22 @@ namespace PFO { if(acc_FE_moment_N_BAD_CELLS.isAvailable(*fe)) FE_moment_N_BAD_CELLS=acc_FE_moment_N_BAD_CELLS(*fe); - if(acc_FE_moment_BADLARQ_FRAC.isAvailable(*fe)) + if(acc_FE_moment_BADLARQ_FRAC.isAvailable(*fe)){ FE_moment_BADLARQ_FRAC=acc_FE_moment_BADLARQ_FRAC(*fe); - + // this section is a debug of floating point compression + ATH_MSG_DEBUG("BADLARQ_FRAC "<<FE_moment_BADLARQ_FRAC); + + union{ //using union and bitset to read the binary + //representation of the floating point number (to check compression effects) + float input; // + int output; + } indata; + indata.input=FE_moment_BADLARQ_FRAC; + std::bitset<sizeof(float) * CHAR_BIT> bits(indata.output); + ATH_MSG_DEBUG("BADLARQ_FRAC bits (binary rep) "<<bits<<""); + + + } if(acc_FE_moment_ENG_POS.isAvailable(*fe)) FE_moment_ENG_POS=acc_FE_moment_ENG_POS(*fe); diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_btagging_fromesd_compareSerialThreadings.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_btagging_fromesd_compareSerialThreadings.sh index cde95554d1640c81b6656dd6418b951a00e9e23e..11504982622573c6eb697d0acf69a40e506c55d7 100755 --- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_btagging_fromesd_compareSerialThreadings.sh +++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_btagging_fromesd_compareSerialThreadings.sh @@ -6,8 +6,7 @@ # art-athena-mt: 8 # art-output: serial # art-output: threadOne -# art-output: threadTwo -# art-output: threadFive +# art-output: threadEight export ATHENA_CORE_NUMBER=8 diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_calotopoclustering_fromesd_compareSerialThreadings.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_calotopoclustering_fromesd_compareSerialThreadings.sh index f27b93e9a44eb36fa9aa40146e071967c7c6044d..ea26f650ffaba912e31a2e9767c6f1ffc1f6c446 100755 --- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_calotopoclustering_fromesd_compareSerialThreadings.sh +++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_calotopoclustering_fromesd_compareSerialThreadings.sh @@ -6,8 +6,7 @@ # art-athena-mt: 8 # art-output: serial # art-output: threadOne -# art-output: threadTwo -# art-output: threadFive +# art-output: threadEight export ATHENA_CORE_NUMBER=8 diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_calotopoclustering_pflow_and_jets_fromesd_compareSerialThreadings.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_calotopoclustering_pflow_and_jets_fromesd_compareSerialThreadings.sh index b1cafcf1a1a0cecad6d7ad9b79c3b49fa748af01..3e8674e321b120498eeef83b697823981a4018d1 100755 --- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_calotopoclustering_pflow_and_jets_fromesd_compareSerialThreadings.sh +++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_calotopoclustering_pflow_and_jets_fromesd_compareSerialThreadings.sh @@ -6,8 +6,7 @@ # art-athena-mt: 8 # art-output: serial # art-output: threadOne -# art-output: threadTwo -# art-output: threadFive +# art-output: threadEight export ATHENA_CORE_NUMBER=8 diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_egamma_fromesd_compareSerialThreadings.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_egamma_fromesd_compareSerialThreadings.sh index 38c807ff7001aa89ad5404faefa132b1c1bb5c7a..d28f788b016c051b9f103b68c88ce3221837c13e 100755 --- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_egamma_fromesd_compareSerialThreadings.sh +++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_egamma_fromesd_compareSerialThreadings.sh @@ -6,8 +6,7 @@ # art-athena-mt: 8 # art-output: serial # art-output: threadOne -# art-output: threadTwo -# art-output: threadFive +# art-output: threadEight export ATHENA_CORE_NUMBER=8 diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_jets_fromesd_compareSerialThreadings.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_jets_fromesd_compareSerialThreadings.sh index 978d48ba216b5949ef02259e6590a00e989b0283..9d5edd4d775fdbfca8d8c3969a4a32d8ea12e349 100755 --- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_jets_fromesd_compareSerialThreadings.sh +++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_jets_fromesd_compareSerialThreadings.sh @@ -6,8 +6,7 @@ # art-athena-mt: 8 # art-output: serial # art-output: threadOne -# art-output: threadTwo -# art-output: threadFive +# art-output: threadEight export ATHENA_CORE_NUMBER=8 diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_met_fromesd_compareSerialThreadings.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_met_fromesd_compareSerialThreadings.sh index e1ef67e74d7330b97b6dc80f586d4408e25ad16b..8844d92922e153b27e4e2f80b0d6cb8b43f03e5c 100755 --- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_met_fromesd_compareSerialThreadings.sh +++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_met_fromesd_compareSerialThreadings.sh @@ -6,8 +6,7 @@ # art-athena-mt: 8 # art-output: serial # art-output: threadOne -# art-output: threadTwo -# art-output: threadFive +# art-output: threadEight export ATHENA_CORE_NUMBER=8 diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd_compareSerialThreadings.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd_compareSerialThreadings.sh index a8fb1797f54a068815243d0dba73fe8f4034843c..8f4907fd2449a9c165ddb22753b164dff22783b5 100755 --- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd_compareSerialThreadings.sh +++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd_compareSerialThreadings.sh @@ -6,8 +6,7 @@ # art-athena-mt: 8 # art-output: serial # art-output: threadOne -# art-output: threadTwo -# art-output: threadFive +# art-output: threadEight export ATHENA_CORE_NUMBER=8 diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_noalgs_fromesd_compareSerialThreadings.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_noalgs_fromesd_compareSerialThreadings.sh index 7dc3af98b10b5f291fe022de7c0a3e353451e69d..f87c228b4092526b20e9b973f053c9ad2cd1c919 100755 --- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_noalgs_fromesd_compareSerialThreadings.sh +++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_noalgs_fromesd_compareSerialThreadings.sh @@ -6,8 +6,7 @@ # art-athena-mt: 8 # art-output: serial # art-output: threadOne -# art-output: threadTwo -# art-output: threadFive +# art-output: threadEight export ATHENA_CORE_NUMBER=8 diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_q221_compareSerialThreadings.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_q221_compareSerialThreadings.sh index 92beed31f2d58339eed6ebed49112b3ced34bcd0..4e05ccec71d43ba2baf0299cc7851816deca1c12 100755 --- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_q221_compareSerialThreadings.sh +++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_q221_compareSerialThreadings.sh @@ -6,8 +6,7 @@ # art-athena-mt: 8 # art-output: serial # art-output: threadOne -# art-output: threadTwo -# art-output: threadFive +# art-output: threadEight export ATHENA_CORE_NUMBER=8 diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_q431_compareSerialThreadings.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_q431_compareSerialThreadings.sh index b5cd128854ab9888bc44ef5899d55706c9282c32..7f86e8743f41a43145218429858ff07b76038109 100755 --- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_q431_compareSerialThreadings.sh +++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_q431_compareSerialThreadings.sh @@ -6,8 +6,7 @@ # art-athena-mt: 8 # art-output: serial # art-output: threadOne -# art-output: threadTwo -# art-output: threadFive +# art-output: threadEight export ATHENA_CORE_NUMBER=8 diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_refit_fromesd_compareSerialThreadings.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_refit_fromesd_compareSerialThreadings.sh index eb54fa2dafa3cd9e096a168e80d42c11b7f1b0f3..b92bd591db2d11845fea3a6ddbcbe88dd84653a8 100755 --- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_refit_fromesd_compareSerialThreadings.sh +++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_refit_fromesd_compareSerialThreadings.sh @@ -6,8 +6,7 @@ # art-athena-mt: 8 # art-output: serial # art-output: threadOne -# art-output: threadTwo -# art-output: threadFive +# art-output: threadEight export ATHENA_CORE_NUMBER=8 diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd_compareSerialThreadings.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd_compareSerialThreadings.sh index 26fc9a25146e04aa2aeba5c7b78c2668644f7253..e03668f0476ff18465dfb914e29636227a86b58d 100755 --- a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd_compareSerialThreadings.sh +++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd_compareSerialThreadings.sh @@ -6,8 +6,7 @@ # art-athena-mt: 8 # art-output: serial # art-output: threadOne -# art-output: threadTwo -# art-output: threadFive +# art-output: threadEight export ATHENA_CORE_NUMBER=8 diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_data20_IDCosmic.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_data20_IDCosmic.sh index d1a90cb42acc0df9b515f5a5194e4ccb61b29686..f33269de49b112fba129cb7fcd6caf9a203a94e6 100755 --- a/Reconstruction/RecExample/RecJobTransformTests/test/test_data20_IDCosmic.sh +++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_data20_IDCosmic.sh @@ -4,5 +4,5 @@ # art-athena-mt: 4 # art-type: grid # art-include: master/Athena -Reco_tf.py --athenaopts="--threads=1" --inputBSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/data20_idcomm/data20_idcomm.00375727.physics_IDCosmic.merge.RAW._lb0876._SFO-ALL._0001.1 --maxEvents=10 --preExec="rec.doTrigger=False;rec.doBTagging=False;" --outputESDFile=myESD.pool.root --outputAODFile=myAOD.pool.root --conditionsTag=CONDBR2-BLKPA-RUN2-01 --geometryVersion=ATLAS-R2-2016-01-00-01 +Reco_tf.py --athenaopts="--threads=1" --inputBSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/data20_idcomm/data20_idcomm.00375727.physics_IDCosmic.merge.RAW._lb0876._SFO-ALL._0001.1 --maxEvents=300 --preExec="rec.doTrigger=False;rec.doBTagging=False;" --outputESDFile=myESD.pool.root --outputAODFile=myAOD.pool.root --conditionsTag=CONDBR2-BLKPA-RUN2-01 --geometryVersion=ATLAS-R2-2016-01-00-01 diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_data20_IDCosmic_MultipleThreads.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_data20_IDCosmic_MultipleThreads.sh index 20f15eb83185efa45475c13bf27339aa7abead86..e5ce6fe15c7e5209adeda18c3d518a572b6d2de6 100755 --- a/Reconstruction/RecExample/RecJobTransformTests/test/test_data20_IDCosmic_MultipleThreads.sh +++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_data20_IDCosmic_MultipleThreads.sh @@ -4,5 +4,5 @@ # art-athena-mt: 4 # art-type: grid # art-include: master/Athena -Reco_tf.py --athenaopts="--threads=8" --inputBSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/data20_idcomm/data20_idcomm.00375727.physics_IDCosmic.merge.RAW._lb0876._SFO-ALL._0001.1 --maxEvents=10 --preExec="rec.doTrigger=False;rec.doBTagging=False;" --outputESDFile=myESD.pool.root --outputAODFile=myAOD.pool.root --conditionsTag=CONDBR2-BLKPA-RUN2-01 --geometryVersion=ATLAS-R2-2016-01-00-01 +Reco_tf.py --athenaopts="--threads=8" --inputBSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/data20_idcomm/data20_idcomm.00375727.physics_IDCosmic.merge.RAW._lb0876._SFO-ALL._0001.1 --maxEvents=300 --preExec="rec.doTrigger=False;rec.doBTagging=False;" --outputESDFile=myESD.pool.root --outputAODFile=myAOD.pool.root --conditionsTag=CONDBR2-BLKPA-RUN2-01 --geometryVersion=ATLAS-R2-2016-01-00-01 diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_13TeV_FiveThreads.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_13TeV_MultipleThreads.sh similarity index 93% rename from Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_13TeV_FiveThreads.sh rename to Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_13TeV_MultipleThreads.sh index 4b690798843a512d6f209946c8bb7fcab5a490f7..a7b25c8a59351007c2be3728dfd3681002afd7e2 100755 --- a/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_13TeV_FiveThreads.sh +++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mcLatest_nopileup_13TeV_MultipleThreads.sh @@ -6,7 +6,7 @@ # art-include: master/Athena export TRF_ECHO=True; -Reco_tf.py --AMI=r11976 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1 --maxEvents=500 --jobNumber=1 --imf False --athenaopts "RDOtoRDOTrigger:--imf --threads=5 --concurrent-events=1" +Reco_tf.py --AMI=r11976 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1 --maxEvents=500 --jobNumber=1 --imf False --athenaopts "RDOtoRDOTrigger:--imf --threads=8 --concurrent-events=1" RES=$? echo "art-result: $RES Reco" if [ $RES -ne 0 ];then diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_splash_events_FiveThreads.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_splash_events_MultipleThreads.sh similarity index 93% rename from Reconstruction/RecExample/RecJobTransformTests/test/test_splash_events_FiveThreads.sh rename to Reconstruction/RecExample/RecJobTransformTests/test/test_splash_events_MultipleThreads.sh index 3dd241e4d284bf40d2e6072ee7f1e3233b91d531..c60c9d29c1e49dd843be25094bc6ce06d5b54319 100755 --- a/Reconstruction/RecExample/RecJobTransformTests/test/test_splash_events_FiveThreads.sh +++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_splash_events_MultipleThreads.sh @@ -10,7 +10,7 @@ # art-include: 21.9/Athena #Monitoring is disabled because it tries to use the trigger information, which is disabled. -export TRF_ECHO=True; Reco_tf.py --athenaopts="--threads=1" --inputBSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/data15_1beam/data15_1beam.00260466.physics_L1Calo.merge.RAW._lb1380._SFO-ALL._0001.1 --autoConfiguration everything --conditionsTag="CONDBR2-BLKPA-2015-04" --geometryVersion="ATLAS-R2-2015-03-01-00" --outputESDFile myESD.pool.root --maxEvents 300 --preExec 'rec.doTrigger=False;from AthenaMonitoring.DQMonFlags import jobproperties;jobproperties.DQMonFlagsCont.doMonitoring.set_Value_and_Lock(False)' +export TRF_ECHO=True; Reco_tf.py --athenaopts="--threads=8" --inputBSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/data15_1beam/data15_1beam.00260466.physics_L1Calo.merge.RAW._lb1380._SFO-ALL._0001.1 --autoConfiguration everything --conditionsTag="CONDBR2-BLKPA-2015-04" --geometryVersion="ATLAS-R2-2015-03-01-00" --outputESDFile myESD.pool.root --maxEvents 300 --preExec 'rec.doTrigger=False;from AthenaMonitoring.DQMonFlags import jobproperties;jobproperties.DQMonFlagsCont.doMonitoring.set_Value_and_Lock(False)' RES=$? echo "art-result: $RES Reco" diff --git a/Reconstruction/RecoTools/IsolationTool/IsolationTool/CaloIsolationTool.h b/Reconstruction/RecoTools/IsolationTool/IsolationTool/CaloIsolationTool.h index 2efc26cae8eac6e9fbfabef7dc905ae4364c6673..0607053e3cb73e99ed78177c5740bd93e50d2b68 100644 --- a/Reconstruction/RecoTools/IsolationTool/IsolationTool/CaloIsolationTool.h +++ b/Reconstruction/RecoTools/IsolationTool/IsolationTool/CaloIsolationTool.h @@ -18,6 +18,7 @@ #include "RecoToolInterfaces/IParticleCaloExtensionTool.h" #include "TrkParametersIdentificationHelpers/TrackParametersIdHelper.h" #include "CaloRec/CaloClusterProcessor.h" +#include "TrkCaloExtension/CaloExtensionCollection.h" #endif // XAOD_ANALYSIS #include "IsolationCorrections/IIsolationCorrectionTool.h" @@ -289,6 +290,10 @@ namespace xAOD { Gaudi::Property<bool> m_useCaloExtensionCaching {this, "UseCaloExtensionCaching", true, "Use cached caloExtension if avaliable."}; + + /** The input calorimeter extensions */ + SG::ReadHandleKey<CaloExtensionCollection> m_caloExtensionKey{ + this, "InputCaloExtension", "", "The calorimeter extensions of the tracks"}; #endif // XAOD_ANALYSIS /** @brief Tool for pt-corrected isolation calculation (new)*/ diff --git a/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx b/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx index 1ce9a2dc9f8a13a77c15ddfc01ebb411f34d16e2..06b3e77247eb6a57bdb9d69e979f251d4ed6b74e 100644 --- a/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx +++ b/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx @@ -104,6 +104,9 @@ namespace xAOD { } else ATH_MSG_DEBUG("Select calorimeter " << m_HadCaloNums[index]); } + + if (!m_caloExtensionKey.empty()) + ATH_CHECK(m_caloExtensionKey.initialize()); #endif // XAOD_ANALYSIS if (!m_IsoLeakCorrectionTool.empty()) @@ -537,7 +540,25 @@ namespace xAOD { #ifndef XAOD_ANALYSIS /// try the extention in athena if it's not obtained from muon yet. ATH_MSG_DEBUG("Geting calo extension caloExtension tool."); - std::unique_ptr<Trk::CaloExtension> caloExtension = m_caloExtTool->caloExtension(*tp); + // If we have an extension cache then it owns the extension, otherwise we own it + // Therefore we have to prepare both an owning and a non-owning pointer + std::unique_ptr<Trk::CaloExtension> caloExtensionUPtr; + const Trk::CaloExtension* caloExtension = nullptr; + if (m_caloExtensionKey.empty()) + { + caloExtensionUPtr = m_caloExtTool->caloExtension(*tp); + caloExtension = caloExtensionUPtr.get(); + } + else + { + auto cache = SG::makeHandle(m_caloExtensionKey); + if (!cache.isValid()) + { + ATH_MSG_WARNING("Failed to retrieve calo extension cache " << m_caloExtensionKey); + return false; + } + caloExtension = m_caloExtTool->caloExtension(*tp, *cache); + } if(!caloExtension){ ATH_MSG_WARNING("Can not get caloExtension."); return false; diff --git a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/IParticleCaloCellAssociationTool.h b/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/IParticleCaloCellAssociationTool.h index 23739342ec6860d27f03386e258855987d9f2c14..770bf19cf7add0886b5c23904889860db6280553 100644 --- a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/IParticleCaloCellAssociationTool.h +++ b/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/IParticleCaloCellAssociationTool.h @@ -11,10 +11,10 @@ #include "GaudiKernel/IAlgTool.h" #include "xAODBase/IParticle.h" #include "ParticleCaloExtension/ParticleCellAssociation.h" +#include "TrkCaloExtension/CaloExtensionCollection.h" #include <memory> class CaloCellContainer; - namespace Rec { @@ -28,16 +28,19 @@ public: * @param particle input particle * @param dr cone size used for the association * @param container cell container to be used if provided + * @param extensionCache A calo extension cache to be used if provided * @return std::unique_ptr<ParticleCellAssociation> */ virtual std::unique_ptr< ParticleCellAssociation > particleCellAssociation( const xAOD::IParticle& particle, float dr, - const CaloCellContainer* container = nullptr) const = 0; + const CaloCellContainer* container = nullptr, + const CaloExtensionCollection* extensionCache = nullptr) const = 0; /** Method to get the ParticleCellAssociation for a given Particle * @param particle input particle * @param dr cone size used for the association * @ param cache cache for keeping previous results * @param container cell container to be used if provided + * @param extensionCache A calo extension cache to be used if provided * @return ParticleCellAssociation* (plain ptr cache has ownership) * * An alg looping over a single collection of IParticles @@ -52,7 +55,8 @@ public: typedef std::unordered_map<size_t,std::unique_ptr< ParticleCellAssociation >> Cache; virtual ParticleCellAssociation* particleCellAssociation( const xAOD::IParticle& particle, float dr, Cache& cache, - const CaloCellContainer* container = nullptr) const = 0; + const CaloCellContainer* container = nullptr, + const CaloExtensionCollection* extensionCache = nullptr) const = 0; static const InterfaceID& interfaceID( ) ; diff --git a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.cxx b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.cxx index 9826352647464ced20e3e01ed7d12cdc3870cc52..ec78cfcdf1e45564412cd8d1dd9e9fd4fc75068d 100644 --- a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.cxx +++ b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.cxx @@ -14,6 +14,7 @@ #include "CaloEvent/CaloCellContainer.h" #include "TrkCaloExtension/CaloExtension.h" #include "TrkCaloExtension/CaloExtensionHelpers.h" +#include "TrkCaloExtension/CaloExtensionCollection.h" #include "xAODTracking/TrackingPrimitives.h" #include <cmath> @@ -49,11 +50,19 @@ StatusCode ParticleCaloCellAssociationTool::finalize() { std::unique_ptr<ParticleCellAssociation> ParticleCaloCellAssociationTool::particleCellAssociation( const xAOD::IParticle& particle, float dr, - const CaloCellContainer* container ) const{ + const CaloCellContainer* container, + const CaloExtensionCollection* extensionCache ) const{ ATH_MSG_DEBUG(" particleCellAssociation: ptr " << &particle << " dr " << dr ); // get the extrapolation into the calo - std::unique_ptr<Trk::CaloExtension> caloExtension = m_caloExtensionTool->caloExtension(particle); + std::unique_ptr<const Trk::CaloExtension> caloExtensionUPtr; + const Trk::CaloExtension* caloExtension = nullptr; + if (extensionCache) + caloExtension = m_caloExtensionTool->caloExtension(particle, *extensionCache); + else { + caloExtensionUPtr = m_caloExtensionTool->caloExtension(particle); + caloExtension = caloExtensionUPtr.get(); + } if( !caloExtension ) { ATH_MSG_DEBUG("Failed to get calo extension"); return nullptr; @@ -81,21 +90,27 @@ ParticleCaloCellAssociationTool::particleCellAssociation( const xAOD::IParticle& // get cell intersections ParticleCellAssociation::CellIntersections cellIntersections; getCellIntersections(*caloExtension,cells,cellIntersections); - - return std::make_unique<ParticleCellAssociation> ( caloExtension.release(), std::move(cells), dr, - std::move(cellIntersections), container ); - + if (!caloExtensionUPtr) + // Have to manually copy the calo extension object. Clearly the class wants + // to be shared through a shared_ptr but this clearly is not an option + caloExtensionUPtr = std::make_unique<Trk::CaloExtension>( + caloExtension->caloEntryLayerIntersection() ? caloExtension->caloEntryLayerIntersection()->clone() : nullptr, + caloExtension->muonEntryLayerIntersection() ? caloExtension->muonEntryLayerIntersection()->clone() : nullptr, + std::vector<Trk::CurvilinearParameters>(caloExtension->caloLayerIntersections())); + return std::make_unique<ParticleCellAssociation> ( caloExtensionUPtr.release(), std::move(cells), dr, + std::move(cellIntersections), container ); } ParticleCellAssociation* ParticleCaloCellAssociationTool::particleCellAssociation( const xAOD::IParticle& particle, float dr, IParticleCaloCellAssociationTool::Cache& cache, - const CaloCellContainer* container) const { + const CaloCellContainer* container, + const CaloExtensionCollection* extensionCache) const { /*if not there , default ctor for unique_ptr (nullptr)*/ std::unique_ptr<ParticleCellAssociation>& association= cache[particle.index()]; if (association==nullptr){ - association=particleCellAssociation(particle,dr,container); + association=particleCellAssociation(particle,dr,container, extensionCache); } return association.get(); } diff --git a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.h b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.h index caf0e41b72169ee772bd97ae8611143fba0193e0..53c7af05f12382a19269286a0effea19c3618231 100644 --- a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.h +++ b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloCellAssociationTool.h @@ -46,7 +46,8 @@ public: * @return std::unique_ptr<ParticleCellAssociation> */ virtual std::unique_ptr< ParticleCellAssociation > particleCellAssociation( const xAOD::IParticle& particle, float dr, - const CaloCellContainer* container = nullptr) const override final; + const CaloCellContainer* container = nullptr, + const CaloExtensionCollection* extensionCache = nullptr) const override final; /** Method to get the ParticleCellAssociation for a given Particle @@ -68,7 +69,8 @@ public: virtual ParticleCellAssociation* particleCellAssociation( const xAOD::IParticle& particle, float dr, IParticleCaloCellAssociationTool::Cache& cache, - const CaloCellContainer* container = nullptr) const override final; + const CaloCellContainer* container = nullptr, + const CaloExtensionCollection* extensionCache = nullptr) const override final; private: diff --git a/Reconstruction/RecoTools/TrackToCalo/src/PreselCaloExtensionBuilderAlg.cxx b/Reconstruction/RecoTools/TrackToCalo/src/PreselCaloExtensionBuilderAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..36642822b6263526cbe13db7b3fbef769ee7ecc5 --- /dev/null +++ b/Reconstruction/RecoTools/TrackToCalo/src/PreselCaloExtensionBuilderAlg.cxx @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + */ + +#include "PreselCaloExtensionBuilderAlg.h" +#include "StoreGate/ReadHandle.h" +#include "StoreGate/WriteHandle.h" +#include <memory> + +namespace Trk { + PreselCaloExtensionBuilderAlg::PreselCaloExtensionBuilderAlg(const std::string& name, ISvcLocator* pSvcLocator) + : AthReentrantAlgorithm(name, pSvcLocator) + {} + + PreselCaloExtensionBuilderAlg::~PreselCaloExtensionBuilderAlg() {} + + StatusCode PreselCaloExtensionBuilderAlg::initialize() + { + ATH_CHECK(m_particleCaloExtensionTool.retrieve()); + ATH_CHECK(m_inputTracksKey.initialize()); + ATH_CHECK(m_outputCacheKey.initialize()); + return StatusCode::SUCCESS; + } + + StatusCode PreselCaloExtensionBuilderAlg::execute(const EventContext &ctx) const + { + auto tracks = SG::makeHandle(m_inputTracksKey, ctx); + if (!tracks.isValid()) + { + ATH_MSG_ERROR("Failed to retrieve " << m_inputTracksKey); + return StatusCode::FAILURE; + } + auto cache = std::make_unique<CaloExtensionCollection>(); + if (tracks->size() > 0) + // Use the index of the last track as a good guess of the largest index + // present in the container. This will be the right value if the view + // has not been sorted differently from the original container + cache->resize(tracks->back()->index() + 1); + for (const xAOD::TrackParticle* itrk : *tracks) + { + if (itrk->index() >= cache->size()) + // Handle the case where the above assumption does not hold + cache->resize(itrk->index() + 1); + cache->at(itrk->index()) = std::move(m_particleCaloExtensionTool->caloExtension(ctx, *itrk)); + } + auto outputHandle = SG::makeHandle(m_outputCacheKey, ctx); + ATH_CHECK(outputHandle.record(std::move(cache))); + return StatusCode::SUCCESS; + } +} //> end namespace Trk diff --git a/Reconstruction/RecoTools/TrackToCalo/src/PreselCaloExtensionBuilderAlg.h b/Reconstruction/RecoTools/TrackToCalo/src/PreselCaloExtensionBuilderAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..5bfad7dc63c03b77f9024cd4ee7f74782fba6068 --- /dev/null +++ b/Reconstruction/RecoTools/TrackToCalo/src/PreselCaloExtensionBuilderAlg.h @@ -0,0 +1,49 @@ +/* + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + */ + +#ifndef TRACKTOCALO_PRESELCALOEXTENSIONBUILDERALG_H +#define TRACKTOCALO_PRESELCALOEXTENSIONBUILDERALG_H + +#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" +#include "GaudiKernel/ToolHandle.h" +#include "xAODTracking/TrackParticleContainer.h" +#include "TrkCaloExtension/CaloExtensionCollection.h" +#include "RecoToolInterfaces/IParticleCaloExtensionTool.h" + +namespace Trk { + /** + * @brief Build the calo extensions for a preselected collection of tracks + * @author Jon Burr + * + * This algorithm is designed to work correctly with a view container. The + * indices used in the CaloExtensionCollection use the track's index function + * to key the correct extension (this is consistent with its use in the tool) + * so the produced extension collection can also safely be used with the + * original track collection from which the view was created. + * + * Note that this is not guaranteed to work if a view container is provided + * that was produced from more than one container, as the indices of the + * tracks are not guaranteed to be unique. + */ + class PreselCaloExtensionBuilderAlg : public AthReentrantAlgorithm + { + public: + PreselCaloExtensionBuilderAlg(const std::string& name, ISvcLocator* pSvcLocator); + ~PreselCaloExtensionBuilderAlg(); + + virtual StatusCode initialize() override; + virtual StatusCode execute(const EventContext &ctx) const override; + private: + ToolHandle<Trk::IParticleCaloExtensionTool> m_particleCaloExtensionTool{ + this, "ParticleCaloExtensionTool", "ParticleCaloExtensionTool"}; + SG::ReadHandleKey<xAOD::TrackParticleContainer> m_inputTracksKey{ + this, "InputTracks", "", "Input track container"}; + SG::WriteHandleKey<CaloExtensionCollection> m_outputCacheKey{ + this, "OutputCache", "", "Output extension cache"}; + }; //> end class PreselCaloExtensionBuilderAlg +} //> end namespace Trk + +#endif //> !TRACKTOCALO_PRESELCALOEXTENSIONBUILDERALG_H diff --git a/Reconstruction/RecoTools/TrackToCalo/src/components/TrackToCalo_entries.cxx b/Reconstruction/RecoTools/TrackToCalo/src/components/TrackToCalo_entries.cxx index 2795b9bb967093f64021f2341c584e10e6a5a7bc..23d7655c77109606c2a357743caa6eef29a6749f 100644 --- a/Reconstruction/RecoTools/TrackToCalo/src/components/TrackToCalo_entries.cxx +++ b/Reconstruction/RecoTools/TrackToCalo/src/components/TrackToCalo_entries.cxx @@ -2,6 +2,7 @@ #include "../ParticleCaloCellAssociationTool.h" #include "../MuonCaloEnergyTool.h" #include "../CaloExtensionBuilderAlg.h" +#include "../PreselCaloExtensionBuilderAlg.h" using namespace Trk; using namespace Rec; @@ -9,3 +10,4 @@ DECLARE_COMPONENT( ParticleCaloExtensionTool ) DECLARE_COMPONENT( ParticleCaloCellAssociationTool ) DECLARE_COMPONENT( MuonCaloEnergyTool ) DECLARE_COMPONENT( CaloExtensionBuilderAlg ) +DECLARE_COMPONENT( PreselCaloExtensionBuilderAlg ) diff --git a/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/CMakeLists.txt b/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/CMakeLists.txt index 9e9b771c11ce38d95d778556e8883de81b65ddf6..0513d9e1da330439917884eb0d06614d890062b6 100644 --- a/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/CMakeLists.txt +++ b/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/CMakeLists.txt @@ -11,7 +11,7 @@ find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread TMVA ) atlas_add_component( NewVrtSecInclusiveTool src/*.cxx src/components/*.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AnalysisUtilsLib AthenaBaseComps GaudiKernel GeoPrimitives InDetBeamSpotServiceLib MVAUtils PathResolver TrkExInterfaces TrkGeometry TrkNeutralParameters TrkTrackSummary TrkVKalVrtFitterLib VxSecVertex xAODTracking xAODTruth ) + LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AnalysisUtilsLib AthenaBaseComps GaudiKernel GeoPrimitives BeamSpotConditionsData MVAUtils PathResolver TrkExInterfaces TrkGeometry TrkNeutralParameters TrkTrackSummary TrkVKalVrtFitterLib VxSecVertex xAODTracking xAODTruth ) # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/NewVrtSecInclusiveTool/NewVrtSecInclusiveTool.h b/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/NewVrtSecInclusiveTool/NewVrtSecInclusiveTool.h index 4b9c1dca06e19eb721b5bf0cd220ee250699220b..b0eb0ddce9a93d7873e1742abb72ed34aab55d36 100755 --- a/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/NewVrtSecInclusiveTool/NewVrtSecInclusiveTool.h +++ b/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/NewVrtSecInclusiveTool/NewVrtSecInclusiveTool.h @@ -35,7 +35,7 @@ // #include "xAODTruth/TruthEventContainer.h" #include "TrkExInterfaces/IExtrapolator.h" -// +#include "BeamSpotConditionsData/BeamSpotData.h" #include "VxSecVertex/VxSecVertexInfo.h" #include "NewVrtSecInclusiveTool/IVrtInclusive.h" @@ -44,7 +44,6 @@ class TH2D; class TH1F; class TProfile; class TTree; -class IBeamCondSvc; namespace Trk{ class TrkVKalVrtFitter; @@ -165,8 +164,8 @@ namespace Rec { std::unique_ptr<MVAUtils::BDT> m_SV2T_BDT; - ServiceHandle< IBeamCondSvc > m_beamService; - //ToolHandle<Trk::IVertexFitter> m_fitterSvc; + SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; + ToolHandle<Trk::IExtrapolator> m_extrapolator{this,"ExtrapolatorName","Trk::Extrapolator/Extrapolator"}; ToolHandle<Trk::TrkVKalVrtFitter> m_fitSvc; //Trk::TrkVKalVrtFitter* m_fitSvc{}; diff --git a/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/NewVrtSecInclusiveTool.cxx b/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/NewVrtSecInclusiveTool.cxx index 1edd8d47d6a38ca7f13850fa22c82f250dba756d..d5a24b552e8b3d7be27ae9548eaa8514c81590b2 100644 --- a/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/NewVrtSecInclusiveTool.cxx +++ b/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/NewVrtSecInclusiveTool.cxx @@ -10,7 +10,6 @@ #include "NewVrtSecInclusiveTool/NewVrtSecInclusiveTool.h" #include "VxSecVertex/VxSecVertexInfo.h" #include "TrkVKalVrtFitter/TrkVKalVrtFitter.h" -#include "InDetBeamSpotService/IBeamCondSvc.h" #include "PathResolver/PathResolver.h" #include "GaudiKernel/ITHistSvc.h" @@ -64,7 +63,6 @@ NewVrtSecInclusiveTool::NewVrtSecInclusiveTool(const std::string& type, m_multiWithOneTrkVrt(true), m_calibFileName("Fake2TrVertexReject.MVA.v01.root"), m_SV2T_BDT(nullptr), - m_beamService("BeamCondSvc",name), m_fitSvc("Trk::TrkVKalVrtFitter/VertexFitterTool",this) { // @@ -117,7 +115,6 @@ NewVrtSecInclusiveTool::NewVrtSecInclusiveTool(const std::string& type, declareProperty("calibFileName", m_calibFileName, " MVA calibration file for 2-track fake vertices removal" ); - declareProperty("BeamSpotSvc", m_beamService, "Name of the BeamSpot service"); declareProperty("VertexFitterTool", m_fitSvc, "Name of the Vertex Fitter tool"); // m_massPi = Trk::ParticleMasses().mass[Trk::pion]; @@ -139,10 +136,8 @@ NewVrtSecInclusiveTool::NewVrtSecInclusiveTool(const std::string& type, StatusCode NewVrtSecInclusiveTool::initialize(){ ATH_MSG_DEBUG( "Initialising NewVrtSecInclusiveTool- Package version: " << PACKAGE_VERSION ); m_compatibilityGraph = new boost::adjacency_list<boost::listS, boost::vecS, boost::undirectedS>(); - - ATH_CHECK( m_beamService.retrieve() ); ATH_CHECK( m_extrapolator.retrieve() ); - + ATH_CHECK(m_beamSpotKey.initialize()); ATH_CHECK( m_fitSvc.retrieve() ); ATH_MSG_DEBUG("NewVrtSecInclusiveTool TrkVKalVrtFitter found"); @@ -324,11 +319,12 @@ NewVrtSecInclusiveTool::NewVrtSecInclusiveTool(const std::string& type, workVectorArrxAOD * tmpVectxAOD=new workVectorArrxAOD(); tmpVectxAOD->inpTrk.resize(inpTrk.size()); std::copy(inpTrk.begin(),inpTrk.end(), tmpVectxAOD->inpTrk.begin()); - tmpVectxAOD->beamX=m_beamService->beamPos().x(); - tmpVectxAOD->beamY=m_beamService->beamPos().y(); - tmpVectxAOD->beamZ=m_beamService->beamPos().z(); - tmpVectxAOD->tanBeamTiltX=tan(m_beamService->beamTilt(0)); - tmpVectxAOD->tanBeamTiltY=tan(m_beamService->beamTilt(1)); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + tmpVectxAOD->beamX=beamSpotHandle->beamPos().x(); + tmpVectxAOD->beamY=beamSpotHandle->beamPos().y(); + tmpVectxAOD->beamZ=beamSpotHandle->beamPos().z(); + tmpVectxAOD->tanBeamTiltX=tan(beamSpotHandle->beamTilt(0)); + tmpVectxAOD->tanBeamTiltY=tan(beamSpotHandle->beamTilt(1)); listVrtSec = getVrtSecMulti(tmpVectxAOD,primVrt); diff --git a/Reconstruction/VKalVrt/TrkToLeptonPVTool/CMakeLists.txt b/Reconstruction/VKalVrt/TrkToLeptonPVTool/CMakeLists.txt index d0607d657fdf16cb7f601e739d6835e06fa47ba0..91a6764f18d5a75dfed9a90e9a048cd01f6dc4ae 100644 --- a/Reconstruction/VKalVrt/TrkToLeptonPVTool/CMakeLists.txt +++ b/Reconstruction/VKalVrt/TrkToLeptonPVTool/CMakeLists.txt @@ -15,7 +15,7 @@ atlas_add_library ( TrkToLeptonPVToolLib PUBLIC_HEADERS TrkToLeptonPVTool INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps xAODTracking xAODEventInfo GaudiKernel - TrkVKalVrtFitterLib TrkVertexFitterInterfaces InDetBeamSpotServiceLib) + TrkVKalVrtFitterLib TrkVertexFitterInterfaces BeamSpotConditionsData) atlas_add_component ( TrkToLeptonPVTool src/components/*.cxx diff --git a/Reconstruction/VKalVrt/TrkToLeptonPVTool/TrkToLeptonPVTool/TrkToLeptonPVTool.h b/Reconstruction/VKalVrt/TrkToLeptonPVTool/TrkToLeptonPVTool/TrkToLeptonPVTool.h index 08808cccb980cf205be0ec5bdef104e6b33ce0e2..bcd2054c4f7d284917282cb5d5435e09c81be4f8 100644 --- a/Reconstruction/VKalVrt/TrkToLeptonPVTool/TrkToLeptonPVTool/TrkToLeptonPVTool.h +++ b/Reconstruction/VKalVrt/TrkToLeptonPVTool/TrkToLeptonPVTool/TrkToLeptonPVTool.h @@ -23,7 +23,7 @@ #include "GaudiKernel/ServiceHandle.h" #include "TrkToLeptonPVTool/ITrkToLeptonPV.h" #include "TrkVertexFitterInterfaces/IVertexFitter.h" -#include "InDetBeamSpotService/IBeamCondSvc.h" +#include "BeamSpotConditionsData/BeamSpotData.h" // @@ -47,7 +47,7 @@ private: - ServiceHandle< IBeamCondSvc > m_beamService{this,"BeamCondSvc","BeamCondSvc"}; + SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; ToolHandle< Trk::IVertexFitter > m_fitterSvc{this,"VertexFitter","Trk::TrkVKalVrtFitter/VertexFitterTool","Vertex Fitter tool instance"}; }; diff --git a/Reconstruction/VKalVrt/TrkToLeptonPVTool/src/TrkToLeptonPVTool.cxx b/Reconstruction/VKalVrt/TrkToLeptonPVTool/src/TrkToLeptonPVTool.cxx index a9d03c94b68a49c4d6ae54b5a4f70ea054e71159..2580b0b366b980e5a32d7c6472564dae87e73729 100644 --- a/Reconstruction/VKalVrt/TrkToLeptonPVTool/src/TrkToLeptonPVTool.cxx +++ b/Reconstruction/VKalVrt/TrkToLeptonPVTool/src/TrkToLeptonPVTool.cxx @@ -37,10 +37,7 @@ TrkToLeptonPVTool::TrkToLeptonPVTool(const std::string& type, ATH_MSG_DEBUG("TrkToLeptonPVTool TrkVKalVrtFitter found"); } //----- - if(m_beamService.retrieve().isFailure()) { - ATH_MSG_DEBUG("Can't retrieve BeamService"); - return StatusCode::FAILURE; - } + ATH_CHECK(m_beamSpotKey.initialize()); //----- return StatusCode::SUCCESS; } @@ -116,15 +113,17 @@ TrkToLeptonPVTool::TrkToLeptonPVTool(const std::string& type, BEAM.setCovariancePosition(beamcov); beamtiltX= eventINFO->beamTiltXZ(); beamtiltY= eventINFO->beamTiltYZ(); - } - if(m_beamService && fullxAOD ){ + } + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + + if(beamSpotHandle.isValid() && fullxAOD ){ ATH_MSG_DEBUG("Beam service is present"); - BEAM.setPosition(m_beamService->beamVtx().position()); - beamcov = m_beamService->beamVtx().covariancePosition(); + BEAM.setPosition(beamSpotHandle->beamVtx().position()); + beamcov = beamSpotHandle->beamVtx().covariancePosition(); beamcov(2,2) *= 1.e6; //Remove any constraint in Z direction BEAM.setCovariancePosition(beamcov); - beamtiltX= m_beamService->beamTilt(0); - beamtiltY= m_beamService->beamTilt(1); + beamtiltX= beamSpotHandle->beamTilt(0); + beamtiltY= beamSpotHandle->beamTilt(1); } if(fullxAOD){ ATH_MSG_DEBUG("xAOD data"); } else { ATH_MSG_DEBUG("DxAOD data");} diff --git a/Reconstruction/eflowRec/CMakeLists.txt b/Reconstruction/eflowRec/CMakeLists.txt index 2e71c364370e14b541e47ec45c5a7a26004fa8ca..5e8c3e5ecc451804d8623b21ebbbe919d31af161 100644 --- a/Reconstruction/eflowRec/CMakeLists.txt +++ b/Reconstruction/eflowRec/CMakeLists.txt @@ -11,7 +11,7 @@ atlas_add_component( eflowRec src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} CaloEvent CaloIdentifier CaloRecLib AthContainers AthLinks AthenaBaseComps CxxUtils AthenaKernel GeoPrimitives Identifier xAODBase xAODCaloEvent xAODCore xAODEgamma xAODMuon xAODPFlow xAODTau xAODTracking GaudiKernel InDetReadoutGeometry TRT_ReadoutGeometry Particle RecoToolInterfaces TrkParameters CaloDetDescrLib CaloUtilsLib StoreGateLib FourMomUtils PathResolver TrkCaloExtension TrkParametersIdentificationHelpers InDetTrackSelectionToolLib AthenaMonitoringKernelLib) + LINK_LIBRARIES ${ROOT_LIBRARIES} CaloEvent CaloIdentifier CaloRecLib AthContainers AthLinks AthenaBaseComps CxxUtils AthenaKernel GeoPrimitives Identifier xAODBase xAODCaloEvent xAODCore xAODEgamma xAODMuon xAODPFlow xAODTau xAODTracking GaudiKernel InDetReadoutGeometry TRT_ReadoutGeometry Particle RecoToolInterfaces TrkParameters CaloDetDescrLib CaloUtilsLib StoreGateLib FourMomUtils PathResolver TrkCaloExtension TrkParametersIdentificationHelpers InDetTrackSelectionToolLib AthenaMonitoringKernelLib ICaloTrkMuIdTools) # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/Reconstruction/eflowRec/python/PFHLTSequence.py b/Reconstruction/eflowRec/python/PFHLTSequence.py index 956190f2b3404fae37d4d5e37ccaf57baf5c1849..1ea85c969e261fc0d090be46a62312541e600fc6 100644 --- a/Reconstruction/eflowRec/python/PFHLTSequence.py +++ b/Reconstruction/eflowRec/python/PFHLTSequence.py @@ -2,45 +2,137 @@ from eflowRec import eflowRecConf from InDetTrackSelectionTool import InDetTrackSelectionToolConf +from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigExtrapolator from AthenaCommon.Logging import logging -log = logging.getLogger('PFHLTSequence') + +log = logging.getLogger("PFHLTSequence") # Use the appropriate containers based on what config is desired trackvtxcontainers = { - "offline": ("InDetTrackParticles","PrimaryVertices"), - "ftf": ("HLT_IDTrack_FS_FTF","HLT_IDVertex_FS"), - } + "offline": ("InDetTrackParticles", "PrimaryVertices"), + "ftf": ("HLT_IDTrack_FS_FTF", "HLT_IDVertex_FS"), +} +# Configure the extrapolator +def getExtrapolator(): + # Set up with trigger extrapolator instance + # FIXME: reconfigure for lower tolerance to speed up + # from TrkExTools.AtlasExtrapolator import AtlasExtrapolator + from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool + + return Trk__ParticleCaloExtensionTool( + "HLTPF_ParticleCaloExtension", Extrapolator=InDetTrigExtrapolator + ) + +def PFTrackExtension(tracktype): + """ Get the track extension after a preselection + + Returns the preselected track selection, the extension cache and the list of algorithms + """ + tracksin, _ = trackvtxcontainers[tracktype] + from eflowRec.eflowRecConf import PFTrackPreselAlg + from TrackToCalo.TrackToCaloConf import Trk__PreselCaloExtensionBuilderAlg + + presel_alg = PFTrackPreselAlg( + f"HLTPFTrackPresel_{tracktype}", + InputTracks=tracksin, + OutputTracks=f"HLTPFPreselTracks_{tracktype}", + TrackSelTool=InDetTrackSelectionToolConf.InDet__InDetTrackSelectionTool( + CutLevel="TightPrimary", minPt=500.0 + ), + ) + + extension_alg = Trk__PreselCaloExtensionBuilderAlg( + f"HLTPFTrackExtension_{tracktype}", + ParticleCaloExtensionTool=getExtrapolator(), + InputTracks=presel_alg.OutputTracks, + OutputCache=f"HLTPFTrackExtensionCache_{tracktype}", + ) + + return ( + presel_alg.OutputTracks, + extension_alg.OutputCache, + [presel_alg, extension_alg] + ) + +def muonCaloTagSeq(flags, tracktype, tracksin, extcache, cellsin): + from eflowRec.eflowRecConf import PFTrackMuonCaloTaggingAlg + from TrackToCalo.TrackToCaloConf import Rec__ParticleCaloCellAssociationTool + from CaloTrkMuIdTools.CaloTrkMuIdToolsConf import ( + CaloMuonScoreTool, + CaloMuonTag, + TrackDepositInCaloTool, + ) + tag_alg = PFTrackMuonCaloTaggingAlg( + f"PFTrackMuonCaloTaggingAlg_{tracktype}", + InputTracks = tracksin, + InputCaloExtension = extcache, + InputCells = cellsin, + OutputTracks=f"PFMuonCaloTagTracks_{tracktype}", + MinPt = flags.Trigger.FSHad.PFOMuonRemovalMinPt, + MuonScoreTool=CaloMuonScoreTool( + CaloMuonEtaCut=3, + ParticleCaloCellAssociationTool=Rec__ParticleCaloCellAssociationTool( + ParticleCaloExtensionTool=getExtrapolator(), + CaloCellContainer="" + ), + ), + LooseTagTool=CaloMuonTag("LooseCaloMuonTag", TagMode="Loose"), + TightTagTool=CaloMuonTag("TightCaloMuonTag", TagMode="Tight"), + DepositInCaloTool=TrackDepositInCaloTool( + ExtrapolatorHandle=InDetTrigExtrapolator, + ParticleCaloCellAssociationTool=Rec__ParticleCaloCellAssociationTool( + ParticleCaloExtensionTool=getExtrapolator(), + CaloCellContainer="" + ), + ParticleCaloExtensionTool=getExtrapolator(), + ), + ) + return tag_alg.OutputTracks, tag_alg + +def muonIsoTagSeq(flags, tracktype, tracksin, extcache, clustersin): + from eflowRec.eflowRecConf import PFTrackMuonIsoTaggingAlg + from IsolationTool.IsolationToolConf import xAOD__CaloIsolationTool, xAOD__TrackIsolationTool + + tag_alg = PFTrackMuonIsoTaggingAlg( + f"PFTrackMuonIsoTaggingAlg_{tracktype}", + InputTracks = tracksin, + InputClusters = clustersin, + InputVertices = trackvtxcontainers[tracktype][1], + OutputTracks = f"PFMuonIsoTagTracks_{tracktype}", + MinPt = flags.Trigger.FSHad.PFOMuonRemovalMinPt, + TrackIsoTool = xAOD__TrackIsolationTool(TrackParticleLocation=tracksin), + CaloIsoTool = xAOD__CaloIsolationTool( + ParticleCaloExtensionTool=getExtrapolator(), + InputCaloExtension=extcache, + ParticleCaloCellAssociationTool="", + saveOnlyRequestedCorrections=True, + ), + ) + return tag_alg.OutputTracks, tag_alg # PFTrackSelector # This handles the track selection (including lepton veto) # and extrapolation into the calorimeter. # Parameters: track & vertex container names (offline, HLT, FTK) -def getPFTrackSel(tracktype): - tracksin,verticesin = trackvtxcontainers[tracktype] - - # Configure the extrapolator - def getExtrapolator(): - # Set up with trigger extrapolator instance - # FIXME: reconfigure for lower tolerance to speed up - # from TrkExTools.AtlasExtrapolator import AtlasExtrapolator - from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool - from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigExtrapolator - return Trk__ParticleCaloExtensionTool("HLTPF_ParticleCaloExtension",Extrapolator = InDetTrigExtrapolator) - - TrackCaloExtensionTool = eflowRecConf.eflowTrackCaloExtensionTool("HLTPF_eflowTrkCaloExt",TrackCaloExtensionTool=getExtrapolator()) - # Don't assume the existence of a pre-built cache - # We expect to run PF at most once per event, and not overlap with - # other use cases like taus - TrackCaloExtensionTool.PFParticleCache = "" +def getPFTrackSel(tracktype, extensionCache="", trackname=None): + tracksin, verticesin = trackvtxcontainers[tracktype] + if trackname is not None: + tracksin = trackname + + TrackCaloExtensionTool = eflowRecConf.eflowTrackCaloExtensionTool( + "HLTPF_eflowTrkCaloExt", TrackCaloExtensionTool=getExtrapolator() + ) + # Set the extension cache - if this is "" then the tool will run the extension + TrackCaloExtensionTool.PFParticleCache = extensionCache # Configure the track selector - PFTrackSelector = eflowRecConf.PFTrackSelector("PFTrackSelector_"+tracktype) + PFTrackSelector = eflowRecConf.PFTrackSelector("PFTrackSelector_" + tracktype) PFTrackSelector.trackExtrapolatorTool = TrackCaloExtensionTool TrackSelectionTool = InDetTrackSelectionToolConf.InDet__InDetTrackSelectionTool( - CutLevel = "TightPrimary", - minPt = 500.0) + CutLevel="TightPrimary", minPt=500.0 + ) PFTrackSelector.trackSelectionTool = TrackSelectionTool # Disable lepton veto as not reconstructed for hadronic triggers @@ -51,11 +143,13 @@ def getPFTrackSel(tracktype): PFTrackSelector.VertexContainer = verticesin from eflowRec import PFOnlineMon + monTool = PFOnlineMon.getMonTool_PFTrackSelector() PFTrackSelector.MonTool = monTool return PFTrackSelector + # PFAlgorithm # This runs the cell-level subtraction: # 1. Match clusters to tracks @@ -64,96 +158,135 @@ def getPFTrackSel(tracktype): # For HLT purposes, no LC calibration is applied and only # one essential moment (CENTER_MAG) is computed. This is # needed for origin corrections. -def getPFAlg(clustersin,tracktype): +def getPFAlg(clustersin, tracktype): # The tool to handle cell-level subtraction, default parameters CellEOverPTool = eflowRecConf.eflowCellEOverPTool_mc12_JetETMiss() # Need a few instances of PFTrackClusterMatchingTool with different distance cuts - def getPFMatchingTool(name,matchcut): + def getPFMatchingTool(name, matchcut): matchingtool = eflowRecConf.PFTrackClusterMatchingTool(name) - matchingtool.TrackPositionType = 'EM2EtaPhi' # str - matchingtool.ClusterPositionType = 'PlainEtaPhi' # str - matchingtool.DistanceType = 'EtaPhiSquareDistance' # str - matchingtool.MatchCut = matchcut*matchcut + matchingtool.TrackPositionType = "EM2EtaPhi" # str + matchingtool.ClusterPositionType = "PlainEtaPhi" # str + matchingtool.DistanceType = "EtaPhiSquareDistance" # str + matchingtool.MatchCut = matchcut * matchcut return matchingtool # Default energy subtraction where a single cluster satisfies the expected # track calo energy - PFCellLevelSubtractionTool = eflowRecConf.PFCellLevelSubtractionTool("PFCellLevelSubtractionTool", - eflowCellEOverPTool = CellEOverPTool, + PFCellLevelSubtractionTool = eflowRecConf.PFCellLevelSubtractionTool( + "PFCellLevelSubtractionTool", + eflowCellEOverPTool=CellEOverPTool, # Uses a deltaR' cut (deltaR corrected for cluster width in eta/phi) to # match clusters to tracks - PFTrackClusterMatchingTool = eflowRecConf.PFTrackClusterMatchingTool("CalObjBldMatchingTool"), + PFTrackClusterMatchingTool=eflowRecConf.PFTrackClusterMatchingTool( + "CalObjBldMatchingTool" + ), # Additional matching tools used to determine cluster weights # These deal with dense environments in which subtraction is difficult. - PFTrackClusterMatchingTool_015 = getPFMatchingTool(name="MatchingTool_Pull_015",matchcut=0.15), - PFTrackClusterMatchingTool_02 = getPFMatchingTool(name="MatchingTool_Pull_02", matchcut=0.2) - ) + PFTrackClusterMatchingTool_015=getPFMatchingTool( + name="MatchingTool_Pull_015", matchcut=0.15 + ), + PFTrackClusterMatchingTool_02=getPFMatchingTool( + name="MatchingTool_Pull_02", matchcut=0.2 + ), + ) # A second cell-level subtraction tool that handles cases where more than one # cluster is needed to recover the full track expected energy # Reuse the default E/P subtraction tool - PFRecoverSplitShowersTool = eflowRecConf.PFRecoverSplitShowersTool("PFRecoverSplitShowersTool", - eflowCellEOverPTool = CellEOverPTool - ) + PFRecoverSplitShowersTool = eflowRecConf.PFRecoverSplitShowersTool( + "PFRecoverSplitShowersTool", eflowCellEOverPTool=CellEOverPTool + ) # Configure moment calculation using topocluster moment calculator - PFMomentCalculatorTool = eflowRecConf.PFMomentCalculatorTool("PFMomentCalculatorTool") + PFMomentCalculatorTool = eflowRecConf.PFMomentCalculatorTool( + "PFMomentCalculatorTool" + ) # Only need CENTER_MAG (depth in calo) for origin corrections from CaloRec import CaloRecConf - PFMomentCalculatorTool.CaloClusterMomentsMaker = CaloRecConf.CaloClusterMomentsMaker("PFClusterMomentsMaker", + + PFMomentCalculatorTool.CaloClusterMomentsMaker = CaloRecConf.CaloClusterMomentsMaker( + "PFClusterMomentsMaker", # Originally from CaloTopoClusterFlags - TwoGaussianNoise = True, + TwoGaussianNoise=True, # Needed for origin correction - MomentsNames = ["CENTER_MAG"] - ) + MomentsNames=["CENTER_MAG"], + ) # Makes a temporary cluster collection for moment calculation - PFMomentCalculatorTool.PFClusterCollectionTool = eflowRecConf.PFClusterCollectionTool() + PFMomentCalculatorTool.PFClusterCollectionTool = ( + eflowRecConf.PFClusterCollectionTool() + ) - pfClusterSel = eflowRecConf.PFClusterSelectorTool("PFClusterSelectorTool", - clustersName=clustersin, - calClustersName="") - PFAlgorithm = eflowRecConf.PFAlgorithm("PFAlgorithm_"+tracktype, - PFClusterSelectorTool = pfClusterSel, - SubtractionToolList = [PFCellLevelSubtractionTool,PFRecoverSplitShowersTool], - BaseToolList = [PFMomentCalculatorTool] - ) + pfClusterSel = eflowRecConf.PFClusterSelectorTool( + "PFClusterSelectorTool", clustersName=clustersin, calClustersName="" + ) + PFAlgorithm = eflowRecConf.PFAlgorithm( + "PFAlgorithm_" + tracktype, + PFClusterSelectorTool=pfClusterSel, + SubtractionToolList=[PFCellLevelSubtractionTool, PFRecoverSplitShowersTool], + BaseToolList=[PFMomentCalculatorTool], + ) from eflowRec import PFOnlineMon + monTool = PFOnlineMon.getMonTool_PFAlgorithm() PFAlgorithm.MonTool = monTool - + return PFAlgorithm + # Convert internal eflowRec track/cluster objects into xAOD neutral/charged # particle flow objects def getPFOCreators(tracktype): PFOChargedCreatorAlgorithm = eflowRecConf.PFOChargedCreatorAlgorithm( - "PFOChargedCreatorAlgorithm_"+tracktype, - PFOOutputName="HLT_{}ChargedParticleFlowObjects".format(tracktype) - ) + "PFOChargedCreatorAlgorithm_" + tracktype, + PFOOutputName="HLT_{}ChargedParticleFlowObjects".format(tracktype), + ) - PFONeutralCreatorAlgorithm = eflowRecConf.PFONeutralCreatorAlgorithm( - "PFONeutralCreatorAlgorithm_"+tracktype, + PFONeutralCreatorAlgorithm = eflowRecConf.PFONeutralCreatorAlgorithm( + "PFONeutralCreatorAlgorithm_" + tracktype, PFOOutputName="HLT_{}NeutralParticleFlowObjects".format(tracktype), - DoClusterMoments=False # Only CENTER_MAG - ) + DoClusterMoments=False, # Only CENTER_MAG + ) return PFOChargedCreatorAlgorithm, PFONeutralCreatorAlgorithm + # Generate the full PF reco sequence, assuming tracks, vertices, clusters # will be created upstream -def PFHLTSequence(dummyflags,clustersin,tracktype): +def PFHLTSequence(flags, clustersin, tracktype, cellsin=None): + if flags is None: + from AthenaConfiguration.AllConfigFlags import ConfigFlags as flags - PFTrkSel = getPFTrackSel(tracktype) - PFAlg = getPFAlg(clustersin,tracktype) + muon_mode = flags.Trigger.FSHad.PFOMuonRemoval + if muon_mode == "None": + tracks = trackvtxcontainers[tracktype][0] + algs = [] + extension = "" + else: + pretracks, extension, algs = PFTrackExtension(tracktype) + if muon_mode == "Calo": + if cellsin is None: + raise ValueError("Cells must be provided for the 'Calo' muon mode!") + tracks, tag_alg = muonCaloTagSeq(flags, tracktype, pretracks, extension, cellsin) + elif muon_mode == "Iso": + tracks, tag_alg = muonIsoTagSeq(flags, tracktype, pretracks, extension, clustersin) + else: + raise ValueError(f"Invalid muon removal mode '{muon_mode}'") + algs.append(tag_alg) + + PFTrkSel = getPFTrackSel(tracktype, extension, tracks) + PFAlg = getPFAlg(clustersin, tracktype) PFCCreator, PFNCreator = getPFOCreators(tracktype) # Create HLT "parallel OR" sequence holding the PF algs # Can be inserted into the jet building sequence from AthenaCommon.CFElements import parOR - pfSequence = parOR("HLTPFlow_"+tracktype, [PFTrkSel,PFAlg,PFCCreator,PFNCreator]) - pfoPrefix = "HLT_"+tracktype + + pfSequence = parOR( + "HLTPFlow_" + tracktype, algs + [PFTrkSel, PFAlg, PFCCreator, PFNCreator] + ) + pfoPrefix = "HLT_" + tracktype log.debug("Created sequence:\n%s", pfSequence) diff --git a/Reconstruction/eflowRec/src/PFTrackMuonCaloTaggingAlg.cxx b/Reconstruction/eflowRec/src/PFTrackMuonCaloTaggingAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..0c6ae655e2f0bf2e412333efd47d1162529a9bcb --- /dev/null +++ b/Reconstruction/eflowRec/src/PFTrackMuonCaloTaggingAlg.cxx @@ -0,0 +1,65 @@ +#include "PFTrackMuonCaloTaggingAlg.h" +#include "StoreGate/ReadHandle.h" +#include "StoreGate/WriteHandle.h" +#include "AthContainers/ConstDataVector.h" + +PFTrackMuonCaloTaggingAlg::PFTrackMuonCaloTaggingAlg(const std::string &name, ISvcLocator *pSvcLocator) + : AthReentrantAlgorithm(name, pSvcLocator) +{ +} + +PFTrackMuonCaloTaggingAlg::~PFTrackMuonCaloTaggingAlg() {} + +StatusCode PFTrackMuonCaloTaggingAlg::initialize() +{ + ATH_CHECK(m_inputTracksKey.initialize()); + ATH_CHECK(m_caloExtensionKey.initialize()); + ATH_CHECK(m_inputCellsKey.initialize()); + ATH_CHECK(m_outputTracksKey.initialize()); + ATH_CHECK(m_looseMuonTagTool.retrieve()); + ATH_CHECK(m_tightMuonTagTool.retrieve()); + ATH_CHECK(m_muonScoreTool.retrieve()); + ATH_CHECK(m_depositInCaloTool.retrieve()); + return StatusCode::SUCCESS; +} + +StatusCode PFTrackMuonCaloTaggingAlg::execute(const EventContext &ctx) const +{ + auto inputTracks = SG::makeHandle(m_inputTracksKey, ctx); + if (!inputTracks.isValid()) + { + ATH_MSG_ERROR("Failed to retrieve " << m_inputTracksKey); + return StatusCode::FAILURE; + } + auto inputCells = SG::makeHandle(m_inputCellsKey, ctx); + if (!inputCells.isValid()) + { + ATH_MSG_ERROR("Failed to retrieve " << m_inputCellsKey); + return StatusCode::FAILURE; + } + auto inputCaloExtensions = SG::makeHandle(m_caloExtensionKey, ctx); + if (!inputCaloExtensions.isValid()) + { + ATH_MSG_ERROR("Failed to retrieve " << m_caloExtensionKey); + return StatusCode::FAILURE; + } + auto outputHandle = SG::makeHandle(m_outputTracksKey, ctx); + + auto outputTracks = std::make_unique<ConstDataVector<xAOD::TrackParticleContainer>>(SG::VIEW_ELEMENTS); + for (const xAOD::TrackParticle *itrk : *inputTracks) + { + if (itrk->pt() > m_minPt) + { + std::vector<DepositInCalo> deposits = m_depositInCaloTool->getDeposits(itrk, inputCells.ptr(), inputCaloExtensions.ptr()); + int looseTag = m_looseMuonTagTool->caloMuonTag(deposits, itrk->eta(), itrk->pt()); + int tightTag = m_tightMuonTagTool->caloMuonTag(deposits, itrk->eta(), itrk->pt()); + float score = m_muonScoreTool->getMuonScore(itrk, inputCells.ptr(), inputCaloExtensions.ptr()); + if (tightTag || (score > m_caloMuonScoreCut && looseTag)) + // This means that the track is tagged as a muon, so don't output it + continue; + } + outputTracks->push_back(itrk); + } + ATH_CHECK(outputHandle.put(ctx, std::move(outputTracks)) != nullptr); + return StatusCode::SUCCESS; +} \ No newline at end of file diff --git a/Reconstruction/eflowRec/src/PFTrackMuonCaloTaggingAlg.h b/Reconstruction/eflowRec/src/PFTrackMuonCaloTaggingAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..088205eef07dce46d3f921f0f0bad69c34d63d9c --- /dev/null +++ b/Reconstruction/eflowRec/src/PFTrackMuonCaloTaggingAlg.h @@ -0,0 +1,62 @@ +/* + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef EFLOWREC_PFTRACKMUONCALOTAGGINGALG_H +#define EFLOWREC_PFTRACKMUONCALOTAGGINGALG_H + +#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" +#include "xAODTracking/TrackParticleContainer.h" +#include "CaloEvent/CaloCellContainer.h" +#include "GaudiKernel/ToolHandle.h" +#include "ICaloTrkMuIdTools/ICaloMuonScoreTool.h" +#include "ICaloTrkMuIdTools/ICaloMuonTag.h" +#include "ICaloTrkMuIdTools/ITrackDepositInCaloTool.h" +#include "TrkCaloExtension/CaloExtensionCollection.h" +#include "GaudiKernel/SystemOfUnits.h" + +/** + * @brief Algorithm to use calorimeter information to remove potential muons + * + * Outputs a reduced set of tracks, containing only those not tagged as muons + */ +class PFTrackMuonCaloTaggingAlg : public AthReentrantAlgorithm +{ +public: + PFTrackMuonCaloTaggingAlg(const std::string &name, ISvcLocator *pSvcLocator); + virtual ~PFTrackMuonCaloTaggingAlg() override; + + virtual StatusCode initialize() override; + virtual StatusCode execute(const EventContext &ctx) const override; + +private: + /// The input track collection + SG::ReadHandleKey<xAOD::TrackParticleContainer> m_inputTracksKey{ + this, "InputTracks", "", "Input track collection"}; + /// The input calorimeter extension + SG::ReadHandleKey<CaloExtensionCollection> m_caloExtensionKey{ + this, "InputCaloExtension", "", "The calorimeter extensions of the tracks"}; + /// Input cells. It's generally more efficient to pass these in this way + SG::ReadHandleKey<CaloCellContainer> m_inputCellsKey{ + this, "InputCells", "", "Cell container to pass to the other tools"}; + /// The output tracks, excluding those identified as muons + SG::WriteHandleKey<xAOD::TrackParticleContainer> m_outputTracksKey{ + this, "OutputTracks", "", "Output tracks, excluding those tagged as muons"}; + ToolHandle<ICaloMuonTag> m_looseMuonTagTool{ + this, "LooseTagTool", "", "Loose muon tag tool"}; + ToolHandle<ICaloMuonTag> m_tightMuonTagTool{ + this, "TightTagTool", "", "Tight muon tag tool"}; + ToolHandle<ICaloMuonScoreTool> m_muonScoreTool{ + this, "MuonScoreTool", "", "Calo muon score tool"}; + ToolHandle<ITrackDepositInCaloTool> m_depositInCaloTool{ + this, "DepositInCaloTool", "", "Deposit in calo tool"}; + Gaudi::Property<float> m_minPt{ + this, "MinPt", 10 * Gaudi::Units::GeV, "Only consider tracks above this value for muon selection (all below go into the output)"}; + Gaudi::Property<float> m_caloMuonScoreCut{ + this, "MuonScoreCut", 0.4, "Below this value, require a tight calo tag"}; + +}; //> end class PFTrackMuonCaloTaggingAlg + +#endif //> !EFLOWREC_PFTRACKMUONCALOTAGGINGALG_H \ No newline at end of file diff --git a/Reconstruction/eflowRec/src/PFTrackMuonIsoTaggingAlg.cxx b/Reconstruction/eflowRec/src/PFTrackMuonIsoTaggingAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..ae827293650e914dbccb15d1d5467e1bda67d68a --- /dev/null +++ b/Reconstruction/eflowRec/src/PFTrackMuonIsoTaggingAlg.cxx @@ -0,0 +1,107 @@ +/* + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ + +#include "PFTrackMuonIsoTaggingAlg.h" +#include "StoreGate/ReadHandle.h" +#include "StoreGate/WriteHandle.h" +#include "AthContainers/ConstDataVector.h" +#include <memory> +#include "EventPrimitives/EventPrimitivesHelpers.h" + +PFTrackMuonIsoTaggingAlg::PFTrackMuonIsoTaggingAlg(const std::string &name, ISvcLocator *pSvcLocator) + : AthReentrantAlgorithm(name, pSvcLocator) +{ +} + +PFTrackMuonIsoTaggingAlg::~PFTrackMuonIsoTaggingAlg() {} + +StatusCode PFTrackMuonIsoTaggingAlg::initialize() +{ + ATH_CHECK(m_inputTracksKey.initialize()); + ATH_CHECK(m_inputClustersKey.initialize()); + ATH_CHECK(m_inputVerticesKey.initialize()); + ATH_CHECK(m_outputTracksKey.initialize()); + ATH_CHECK(m_trkIsoTool.retrieve()); + ATH_CHECK(m_caloIsoTool.retrieve()); + return StatusCode::SUCCESS; +} + +StatusCode PFTrackMuonIsoTaggingAlg::execute(const EventContext &ctx) const +{ + auto inputTracks = SG::makeHandle(m_inputTracksKey, ctx); + if (!inputTracks.isValid()) + { + ATH_MSG_ERROR("Failed to retrieve " << m_inputTracksKey); + return StatusCode::FAILURE; + } + auto inputClusters = SG::makeHandle(m_inputClustersKey, ctx); + if (!inputClusters.isValid()) + { + ATH_MSG_ERROR("Failed to retrieve " << m_inputClustersKey); + return StatusCode::FAILURE; + } + auto inputVertices = SG::makeHandle(m_inputVerticesKey, ctx); + if (!inputVertices.isValid()) + { + ATH_MSG_ERROR("Failed to retrieve " << m_inputVerticesKey); + return StatusCode::FAILURE; + } + auto outputHandle = SG::makeHandle(m_outputTracksKey, ctx); + const xAOD::Vertex *primaryVtx = nullptr; + for (const xAOD::Vertex *ivtx : *inputVertices) + { + if (ivtx->vertexType() == xAOD::VxType::PriVtx) + { + primaryVtx = ivtx; + break; + } + } + + auto outputTracks = std::make_unique<ConstDataVector<xAOD::TrackParticleContainer>>(SG::VIEW_ELEMENTS); + for (const xAOD::TrackParticle *itrk : *inputTracks) + { + if (itrk->pt() > m_minPt) + { + xAOD::TrackIsolation trackIsoResult; + std::vector<xAOD::Iso::IsolationType> trackIsoTypes{xAOD::Iso::ptcone20}; + xAOD::TrackCorrection trackIsoCorr; + trackIsoCorr.trackbitset.set(xAOD::Iso::IsolationTrackCorrection::coreTrackPtr); + m_trkIsoTool->trackIsolation(trackIsoResult, *itrk, trackIsoTypes, trackIsoCorr, primaryVtx, nullptr, inputTracks.ptr()); + float ptCone20 = trackIsoResult.ptcones[0]; + xAOD::CaloIsolation caloIsoResult; + xAOD::CaloCorrection caloIsoCorr; + caloIsoCorr.calobitset.set(xAOD::Iso::IsolationCaloCorrection::coreCone); + m_caloIsoTool->caloTopoClusterIsolation(caloIsoResult, *itrk, {xAOD::Iso::IsolationType::etcone20}, caloIsoCorr, inputClusters.ptr()); + float etConeCore = caloIsoResult.coreCorrections[xAOD::Iso::IsolationCaloCorrection::coreCone][xAOD::Iso::IsolationCorrectionParameter::coreEnergy]; + float rerr = Amg::error(itrk->definingParametersCovMatrix(), 4) / fabs(itrk->qOverP()); + float eOverP = etConeCore / itrk->pt(); + float trackIso = ptCone20 / itrk->pt(); + float ptsum = itrk->pt() + ptCone20; + float caloIso = etConeCore / ptsum; + float trkPtFraction = itrk->pt() / ptsum; + + bool fakeTrack = false; + bool muonTrack = false; + if (trackIso < m_hltTrkIsoThresh) + { + if (rerr > m_hltFakeTrkRErr) + fakeTrack = true; + else if (eOverP < m_hltIsoMuonEOverP) + muonTrack = true; + else if (rerr > 0.1 || (eOverP > 0.1 && rerr > 0.05)) + fakeTrack = true; + } + else + { + muonTrack = caloIso < m_hltNonIsoMuonEOverP && trkPtFraction > m_hltNonIsoMuonTrkPtFraction; + } + if (muonTrack || fakeTrack) + continue; + } + outputTracks->push_back(itrk); + } + ATH_CHECK(outputHandle.put(ctx, std::move(outputTracks)) != nullptr); + + return StatusCode::SUCCESS; +} \ No newline at end of file diff --git a/Reconstruction/eflowRec/src/PFTrackMuonIsoTaggingAlg.h b/Reconstruction/eflowRec/src/PFTrackMuonIsoTaggingAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..52089587966c45fcbc72b1ab3d240bca75df74d1 --- /dev/null +++ b/Reconstruction/eflowRec/src/PFTrackMuonIsoTaggingAlg.h @@ -0,0 +1,68 @@ +/* + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef EFLOWREC_PFTRACKMUONISOTAGGINGALG_H +#define EFLOWREC_PFTRACKMUONISOTAGGINGALG_H + +#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" +#include "xAODTracking/TrackParticleContainer.h" +#include "xAODTracking/VertexContainer.h" +#include "xAODCaloEvent/CaloClusterContainer.h" +#include "GaudiKernel/ToolHandle.h" +#include "RecoToolInterfaces/ITrackIsolationTool.h" +#include "RecoToolInterfaces/ICaloTopoClusterIsolationTool.h" + +class PFTrackMuonIsoTaggingAlg : public AthReentrantAlgorithm +{ +public: + PFTrackMuonIsoTaggingAlg(const std::string &name, ISvcLocator *pSvcLocator); + virtual ~PFTrackMuonIsoTaggingAlg() override; + + virtual StatusCode initialize() override; + virtual StatusCode execute(const EventContext &ctx) const override; + +private: + /// The input track collection + SG::ReadHandleKey<xAOD::TrackParticleContainer> m_inputTracksKey{ + this, "InputTracks", "", "Input track collection"}; + /// Input cluster collection + SG::ReadHandleKey<xAOD::CaloClusterContainer> m_inputClustersKey{ + this, "InputClusters", "", "Input cluster collection"}; + /// Input vertex collection + SG::ReadHandleKey<xAOD::VertexContainer> m_inputVerticesKey{ + this, "InputVertices", "", "Input vertex collection"}; + /// The output tracks, excluding those identified as muons + SG::WriteHandleKey<xAOD::TrackParticleContainer> m_outputTracksKey{ + this, "OutputTracks", "", "Output tracks, excluding those tagged as muons"}; + + ToolHandle<xAOD::ITrackIsolationTool> m_trkIsoTool{ + this, "TrackIsoTool", "", "The track isolation tool"}; + + ToolHandle<xAOD::ICaloTopoClusterIsolationTool> m_caloIsoTool{ + this, "CaloIsoTool", "", "The calorimeter isolation tool"}; + /** HLT track isolation threshold **/ + Gaudi::Property<float> m_hltTrkIsoThresh{this, "HLTTrackIsoThreshold", 0.1, "The HLT threshold to consider tracks as isolated"}; + + /** HLT fake track relative error threshold **/ + Gaudi::Property<float> m_hltFakeTrkRErr{this, "HLTFakeTrackRErr", 0.4, "The relative error threshold for rejecting fake tracks"}; + + /** HLT E over P selection for isolated muon tracks **/ + Gaudi::Property<float> m_hltIsoMuonEOverP{this, "HLTIsoMuonEOverP", 0.65, "The upper limit on E over P for identifying isolated HLT muon tracks"}; + + /** HLT E over P selection for non-isolated muon tracks **/ + Gaudi::Property<float> m_hltNonIsoMuonEOverP{ + this, "HLTNonIsoMuonEOverP", 0.6, "The upper limit on E over P for identifying non-isolated HLT muon tracks"}; + + /** HLT track pt fraction for non-isolated muon tracks **/ + Gaudi::Property<float> m_hltNonIsoMuonTrkPtFraction{ + this, "HLTNonIsoMuonTrkPtFraction", 0.6, "The lower limit on the track pt fraction in the central track for HLT muons"}; + + Gaudi::Property<float> m_minPt{ + this, "MinPt", 10 * Gaudi::Units::GeV, "Only consider tracks above this value for muon selection (all below go into the output)"}; + +}; //> end class PFTrackMuonIsoTaggingAlg + +#endif //> !EFLOWREC_PFTRACKMUONISOTAGGINGALG_H \ No newline at end of file diff --git a/Reconstruction/eflowRec/src/PFTrackPreselAlg.cxx b/Reconstruction/eflowRec/src/PFTrackPreselAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..a26e64f7e1caa00b0a5a02be47b23df46e04db20 --- /dev/null +++ b/Reconstruction/eflowRec/src/PFTrackPreselAlg.cxx @@ -0,0 +1,52 @@ +/* + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ + +#include "PFTrackPreselAlg.h" +#include "StoreGate/ReadHandle.h" +#include "StoreGate/WriteHandle.h" +#include "AthContainers/ConstDataVector.h" +#include <memory> + +namespace { + const static SG::AuxElement::Decorator<char> decPass("passPFTrackPresel"); +} + +PFTrackPreselAlg::PFTrackPreselAlg(const std::string& name, ISvcLocator* pSvcLocator) + : AthReentrantAlgorithm(name, pSvcLocator) +{ +} + +PFTrackPreselAlg::~PFTrackPreselAlg() {} + +StatusCode PFTrackPreselAlg::initialize() +{ + ATH_CHECK( m_inputTracksKey.initialize() ); + ATH_CHECK( m_outputTracksKey.initialize() ); + ATH_CHECK( m_trackSelTool.retrieve() ); + return StatusCode::SUCCESS; +} + +StatusCode PFTrackPreselAlg::execute(const EventContext &ctx) const +{ + auto input = SG::makeHandle(m_inputTracksKey, ctx); + if (!input.isValid()) + { + ATH_MSG_ERROR("Failed to retrieve " << m_inputTracksKey); + return StatusCode::FAILURE; + } + auto output = std::make_unique<ConstDataVector<xAOD::TrackParticleContainer>>(SG::VIEW_ELEMENTS); + for (const xAOD::TrackParticle* itrk : *input) + { + if (itrk->pt() > m_upperPtCut || !m_trackSelTool->accept(*itrk)) + { + decPass(*itrk) = false; + continue; + } + decPass(*itrk) = true; + output->push_back(itrk); + } + auto outputHandle = SG::makeHandle(m_outputTracksKey, ctx); + ATH_CHECK(outputHandle.put(std::move(output)) != nullptr); + return StatusCode::SUCCESS; +} diff --git a/Reconstruction/eflowRec/src/PFTrackPreselAlg.h b/Reconstruction/eflowRec/src/PFTrackPreselAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..732ae2f0fb62973901a7f3915ebc2366d1fcd665 --- /dev/null +++ b/Reconstruction/eflowRec/src/PFTrackPreselAlg.h @@ -0,0 +1,42 @@ +/* + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ +#ifndef EFLOWREC_PFTRACKPRESELALG_H +#define EFLOWREC_PFTRACKPRESELALG_H + +#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" +#include "xAODTracking/TrackParticleContainer.h" +#include "GaudiKernel/ToolHandle.h" +#include "InDetTrackSelectionTool/IInDetTrackSelectionTool.h" +#include "GaudiKernel/SystemOfUnits.h" + +/** + * @brief Algorithm producing a preselected set of tracks + * + * The tracks output by this algorithm are the only ones that will be extended + * through the calorimeter and used in later steps of the PFO creation. + * Selections which do not depend on the extrapolation belong here + */ +class PFTrackPreselAlg : public AthReentrantAlgorithm { + public: + PFTrackPreselAlg(const std::string& name, ISvcLocator* pSvcLocator); + ~PFTrackPreselAlg(); + + virtual StatusCode initialize() override; + virtual StatusCode execute(const EventContext& ctx) const override; + private: + SG::ReadHandleKey<xAOD::TrackParticleContainer> m_inputTracksKey{ + this, "InputTracks", "", "The input track selection"}; + SG::WriteHandleKey<xAOD::TrackParticleContainer> m_outputTracksKey{ + this, "OutputTracks", "", "The output preselected track collection"}; + ToolHandle<InDet::IInDetTrackSelectionTool> m_trackSelTool{ + this, "TrackSelTool", "", "The track selection tool"}; + Gaudi::Property<float> m_upperPtCut{ + this, "UpperPtCut", 100 * Gaudi::Units::GeV, "Upper limit on track pT"}; + +}; //> end PFTrackPreselAlg + + +#endif //> !EFLOWREC_PFTRACKPRESELALG_H diff --git a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx index a399ea6da1f2b4bb42dac6ad40ea474bc1a31415..6932211306b67e7182da663b58ff0b087efcde01 100644 --- a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx +++ b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx @@ -27,6 +27,9 @@ #include "eflowRec/PFMuonFlowElementAssoc.h" #include "eflowRec/PFEGamFlowElementAssoc.h" #include "eflowRec/PFTauFlowElementAssoc.h" +#include "../PFTrackPreselAlg.h" +#include "../PFTrackMuonCaloTaggingAlg.h" +#include "../PFTrackMuonIsoTaggingAlg.h" DECLARE_COMPONENT( eflowOverlapRemoval ) DECLARE_COMPONENT( PFLeptonSelector ) @@ -53,3 +56,6 @@ DECLARE_COMPONENT( eflowCellEOverPTool_mc12_LC) DECLARE_COMPONENT( PFMuonFlowElementAssoc ) DECLARE_COMPONENT( PFEGamFlowElementAssoc ) DECLARE_COMPONENT( PFTauFlowElementAssoc ) +DECLARE_COMPONENT( PFTrackPreselAlg ) +DECLARE_COMPONENT( PFTrackMuonCaloTaggingAlg ) +DECLARE_COMPONENT( PFTrackMuonIsoTaggingAlg ) diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h index 2d463c313b769f550ffbdec6745d785ce7ceb8e5..c99e8801281c336800b2fc9d7108c45faecde9a7 100644 --- a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h +++ b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h @@ -15,7 +15,7 @@ #include "CaloDetDescr/CaloDetDescrManager.h" #include "CaloUtils/CaloCellDetPos.h" #include "egammaInterfaces/IegammaCheckEnergyDepositTool.h" -#include "egammaInterfaces/IegammaMVASvc.h" +#include "EgammaAnalysisInterfaces/IegammaMVASvc.h" #include "egammaInterfaces/IegammaSwTool.h" #include "egammaRecEvent/egammaRecContainer.h" #include "xAODCaloEvent/CaloClusterFwd.h" diff --git a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/egammaInterfacesDict.h b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/egammaInterfacesDict.h index 5edb3297dbc582b82ea737bdd10a7715b6d27e29..e3897bbfd04fa84298dc2a63c9bfa82697a01635 100644 --- a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/egammaInterfacesDict.h +++ b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/egammaInterfacesDict.h @@ -29,7 +29,6 @@ #include "egammaInterfaces/IegammaShowerShape.h" #include "egammaInterfaces/IegammaStripsShape.h" #include "egammaInterfaces/IegammaSwTool.h" -#include "egammaInterfaces/IegammaMVASvc.h" #include "egammaInterfaces/IegammaOQFlagsBuilder.h" #ifndef XAOD_ANALYSIS # include "egammaInterfaces/IEMExtrapolationTools.h" diff --git a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/selection.xml b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/selection.xml index 1969394b3f9918c86191b6bd27d781c177b9c00b..e52f5e1ad698ee21e214aa04fb2cab9d8deafcdc 100644 --- a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/selection.xml +++ b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/selection.xml @@ -16,7 +16,6 @@ <class name="IegammaStripsShape" /> <class name="IegammaSwTool" /> <class name="IegammaTrkRefitterTool" /> - <class name="IegammaMVASvc" /> <class name="IegammaOQFlagsBuilder" /> </lcgdict> diff --git a/Reconstruction/egamma/egammaMVACalib/CMakeLists.txt b/Reconstruction/egamma/egammaMVACalib/CMakeLists.txt index 4897240610632899c0dce3e77319f8e229c6f2a4..8155feb9d49601602f4915bfe112f86690cba922 100644 --- a/Reconstruction/egamma/egammaMVACalib/CMakeLists.txt +++ b/Reconstruction/egamma/egammaMVACalib/CMakeLists.txt @@ -17,14 +17,20 @@ atlas_add_library( egammaMVACalibLib egammaMVACalib/*.h Root/*.cxx PUBLIC_HEADERS egammaMVACalib INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AsgMessagingLib xAODCaloEvent xAODEgamma + LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools AsgServicesLib AsgMessagingLib + xAODCaloEvent xAODEgamma xAODTracking MVAUtils PathResolver EgammaAnalysisInterfacesLib ${extra_libs} ) +atlas_add_dictionary( egammaMVACalibDict + egammaMVACalib/egammaMVACalibDict.h + egammaMVACalib/selection.xml + LINK_LIBRARIES egammaMVACalibLib ) + if( NOT XAOD_STANDALONE ) atlas_add_component( egammaMVACalib src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps GaudiKernel MVAUtils PathResolver egammaInterfacesLib egammaMVACalibLib xAODCaloEvent xAODEgamma xAODTracking ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps GaudiKernel egammaMVACalibLib) endif() # Install files from the package: diff --git a/Reconstruction/egamma/egammaMVACalib/src/egammaMVACalibTool.cxx b/Reconstruction/egamma/egammaMVACalib/Root/egammaMVACalibTool.cxx similarity index 97% rename from Reconstruction/egamma/egammaMVACalib/src/egammaMVACalibTool.cxx rename to Reconstruction/egamma/egammaMVACalib/Root/egammaMVACalibTool.cxx index 0de9e373dec21feff4a2a78125e36a6f05050e7a..d9d09f4f9908983bcca982daafaab4b6093c985c 100644 --- a/Reconstruction/egamma/egammaMVACalib/src/egammaMVACalibTool.cxx +++ b/Reconstruction/egamma/egammaMVACalib/Root/egammaMVACalibTool.cxx @@ -2,7 +2,7 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -#include "egammaMVACalibTool.h" +#include "egammaMVACalib/egammaMVACalibTool.h" #include "xAODEgamma/Egamma.h" #include "xAODCaloEvent/CaloCluster.h" @@ -23,8 +23,8 @@ using Gaudi::Units::GeV; #define GeV 1000 #endif -egammaMVACalibTool::egammaMVACalibTool(const std::string& type, const std::string& name, const IInterface* parent) : - base_class(type, name, parent) +egammaMVACalibTool::egammaMVACalibTool(const std::string& name) : + asg::AsgTool(name) { } @@ -81,11 +81,6 @@ StatusCode egammaMVACalibTool::initialize() return StatusCode::SUCCESS; } -StatusCode egammaMVACalibTool::finalize() -{ - return StatusCode::SUCCESS; -} - StatusCode egammaMVACalibTool::setupBDT(const egammaMVAFunctions::funcMap_t& funcLibrary, const std::string& fileName) { diff --git a/Reconstruction/egamma/egammaMVACalib/src/egammaMVASvc.cxx b/Reconstruction/egamma/egammaMVACalib/Root/egammaMVASvc.cxx similarity index 88% rename from Reconstruction/egamma/egammaMVACalib/src/egammaMVASvc.cxx rename to Reconstruction/egamma/egammaMVACalib/Root/egammaMVASvc.cxx index af640151cf0651cb6ec88b8ce23723ecb8e22499..136ee2d1220a50e57f2c5cac7e586822188c04b8 100644 --- a/Reconstruction/egamma/egammaMVACalib/src/egammaMVASvc.cxx +++ b/Reconstruction/egamma/egammaMVACalib/Root/egammaMVASvc.cxx @@ -2,7 +2,7 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -#include "egammaMVASvc.h" +#include "egammaMVACalib/egammaMVASvc.h" #include "xAODEgamma/Egamma.h" #include "xAODCaloEvent/CaloCluster.h" #include "xAODEgamma/EgammaDefs.h" @@ -12,7 +12,7 @@ egammaMVASvc::egammaMVASvc(const std::string& name, ISvcLocator* svc) : - base_class( name, svc ) + asg::AsgService( name, svc ) { } @@ -20,7 +20,7 @@ StatusCode egammaMVASvc::initialize() { ATH_MSG_DEBUG("In initialize of " << name() << "..." ); - if (m_mvaElectron.isEnabled()) { + if (!m_mvaElectron.empty()) { ATH_MSG_DEBUG("Retrieving mvaElectron"); ATH_CHECK(m_mvaElectron.retrieve()); } else { @@ -28,7 +28,7 @@ StatusCode egammaMVASvc::initialize() m_mvaElectron.disable(); } - if (m_mvaUnconvertedPhoton.isEnabled()) { + if (!m_mvaUnconvertedPhoton.empty()) { ATH_MSG_DEBUG("Retrieving mvaUnconvertedPhoton"); ATH_CHECK(m_mvaUnconvertedPhoton.retrieve()); } else { @@ -36,7 +36,7 @@ StatusCode egammaMVASvc::initialize() m_mvaUnconvertedPhoton.disable(); } - if (m_mvaConvertedPhoton.isEnabled()) { + if (!m_mvaConvertedPhoton.empty()) { ATH_MSG_DEBUG("Retrieving mvaConvertedPhoton"); ATH_CHECK(m_mvaConvertedPhoton.retrieve()); } else { @@ -47,12 +47,6 @@ StatusCode egammaMVASvc::initialize() return StatusCode::SUCCESS; } - -StatusCode egammaMVASvc::finalize(){ - ATH_MSG_DEBUG( "in finalize" ); - return StatusCode::SUCCESS; -} - StatusCode egammaMVASvc::execute(xAOD::CaloCluster& cluster, const xAOD::Egamma& eg) const { @@ -62,7 +56,7 @@ StatusCode egammaMVASvc::execute(xAOD::CaloCluster& cluster, float mvaE = 0.0; if (xAOD::EgammaHelpers::isElectron(&eg)) { - if (m_mvaElectron.isEnabled()) { + if (!m_mvaElectron.empty()) { mvaE = m_mvaElectron->getEnergy(cluster, &eg); } else { ATH_MSG_FATAL("Trying to calibrate an electron, but disabled"); @@ -70,14 +64,14 @@ StatusCode egammaMVASvc::execute(xAOD::CaloCluster& cluster, } } else if (xAOD::EgammaHelpers::isConvertedPhoton(&eg) && xAOD::EgammaHelpers::conversionRadius(static_cast<const xAOD::Photon*>(&eg)) < m_maxConvR) { - if (m_mvaConvertedPhoton.isEnabled()) { + if (!m_mvaConvertedPhoton.empty()) { mvaE = m_mvaConvertedPhoton->getEnergy(cluster, &eg); } else { ATH_MSG_FATAL("Trying to calibrate a converted photon, but disabled"); return StatusCode::FAILURE; } } else if (xAOD::EgammaHelpers::isPhoton(&eg)) { - if (m_mvaUnconvertedPhoton.isEnabled()) { + if (!m_mvaUnconvertedPhoton.empty()) { mvaE = m_mvaUnconvertedPhoton->getEnergy(cluster, &eg); } else { ATH_MSG_FATAL("Trying to calibrate an unconverted photon, but disabled"); @@ -109,7 +103,7 @@ StatusCode egammaMVASvc::execute(xAOD::CaloCluster& cluster, float mvaE = 0.0; switch (egType) { case xAOD::EgammaParameters::electron: - if (m_mvaElectron.isEnabled()) { + if (!m_mvaElectron.empty()) { mvaE = m_mvaElectron->getEnergy(cluster,nullptr); } else { ATH_MSG_FATAL("Trying to calibrate an electron, but disabled"); @@ -119,7 +113,7 @@ StatusCode egammaMVASvc::execute(xAOD::CaloCluster& cluster, case xAOD::EgammaParameters::convertedPhoton: case xAOD::EgammaParameters::unconvertedPhoton: // treat converted photons like unconverted photons since don't have access to vertex - if (m_mvaUnconvertedPhoton.isEnabled()) { + if (!m_mvaUnconvertedPhoton.empty()) { mvaE = m_mvaUnconvertedPhoton->getEnergy(cluster,nullptr); } else { ATH_MSG_FATAL("Trying to calibrate an unconverted photon, but disabled"); diff --git a/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVACalibDict.h b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVACalibDict.h new file mode 100644 index 0000000000000000000000000000000000000000..53ac086d84630dba236af0b753c02b38fd8a57a1 --- /dev/null +++ b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVACalibDict.h @@ -0,0 +1,10 @@ +/* + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + */ + + #ifndef EGAMMAMVACALIB_EGAMMAMVACALIBDICT_H + #define EGAMMAMVACALIB_EGAMMAMVACALIBDICT_H + #include "egammaMVACalib/egammaMVACalibTool.h" + #include "egammaMVACalib/egammaMVASvc.h" + + #endif // EGAMMAMVACALIB_EGAMMAMVACALIBDICT_H diff --git a/Reconstruction/egamma/egammaMVACalib/src/egammaMVACalibTool.h b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVACalibTool.h similarity index 93% rename from Reconstruction/egamma/egammaMVACalib/src/egammaMVACalibTool.h rename to Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVACalibTool.h index d1bd04a1ad67c49a22acf87b60573a03402cd321..89d5ced20c62126478924859e31611029a94d1d8 100644 --- a/Reconstruction/egamma/egammaMVACalib/src/egammaMVACalibTool.h +++ b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVACalibTool.h @@ -6,13 +6,16 @@ #define EGAMMAMVACALIB_EGAMMAMVACALIBTOOL_H // Package includes -#include "egammaInterfaces/IegammaMVACalibTool.h" +#include "EgammaAnalysisInterfaces/IegammaMVACalibTool.h" #include "xAODEgamma/EgammaEnums.h" #include "MVAUtils/BDT.h" #include "egammaMVACalib/egammaMVAFunctions.h" // Framework includes -#include "AthenaBaseComps/AthAlgTool.h" +#include "AsgTools/AsgTool.h" +#include "AsgTools/PropertyWrapper.h" + +//Root includes #include "TH2Poly.h" #include "TObject.h" #include "TString.h" @@ -52,21 +55,21 @@ * Each TObjString is a string which represent the formula to compute the shift * (used to construct a TFormula). The variables is the Et in GeV after the calibration. * The value of the shift is divided by the energy calibrated by the BDT. - * - * + * + * * On data the property use_layer_corrected should be set to true. In reconstruction * this flag is always false. In PhysicsAnalysis it should be set appropriately. * When set to true when using the layer energies as input the data-driver-corrected * version are used. **/ -class egammaMVACalibTool : public extends<AthAlgTool, IegammaMVACalibTool> { +class egammaMVACalibTool : public asg::AsgTool, virtual public IegammaMVACalibTool{ + ASG_TOOL_CLASS(egammaMVACalibTool, IegammaMVACalibTool) public: - egammaMVACalibTool(const std::string& type, const std::string& name, const IInterface* parent); + egammaMVACalibTool(const std::string& type); virtual ~egammaMVACalibTool() override; virtual StatusCode initialize() override; - virtual StatusCode finalize() override; /** how the output of the BDT is used * correctEaccordion: energy = raw energy * BDT diff --git a/Reconstruction/egamma/egammaMVACalib/src/egammaMVASvc.h b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVASvc.h similarity index 82% rename from Reconstruction/egamma/egammaMVACalib/src/egammaMVASvc.h rename to Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVASvc.h index e7d8941f8ac31524430a1676737e56bb7b2918ab..b9e6f2b13fb5b2d0ccac72f0d161f3b46ff94b2a 100644 --- a/Reconstruction/egamma/egammaMVACalib/src/egammaMVASvc.h +++ b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/egammaMVASvc.h @@ -8,29 +8,27 @@ #define EGAMMAMVACALIB_EGAMMAMVASVC_H #include "xAODEgamma/EgammaEnums.h" -#include "egammaInterfaces/IegammaMVASvc.h" -#include "egammaInterfaces/IegammaMVACalibTool.h" -#include "AthenaBaseComps/AthService.h" +#include "EgammaAnalysisInterfaces/IegammaMVASvc.h" +#include "EgammaAnalysisInterfaces/IegammaMVACalibTool.h" +// Framework includes +#include "AsgServices/AsgService.h" +#include "AsgTools/PropertyWrapper.h" #include <string> -class egammaMVASvc : public extends1<AthService, IegammaMVASvc> +class egammaMVASvc : public asg::AsgService, virtual public IegammaMVASvc { public: egammaMVASvc( const std::string& name, ISvcLocator* svc ); - + ASG_SERVICE_CLASS1(egammaMVASvc, IegammaMVASvc) virtual ~egammaMVASvc() override {}; - virtual StatusCode initialize() override; - virtual StatusCode finalize() override; - /** Main execute. We need to calibrate the cluster. Use full egamma object instead of Type As we employ further variables than the ones present in the cluster This method needs to be valid also for reconstruction */ - StatusCode execute(xAOD::CaloCluster& cluster, const xAOD::Egamma& eg) const override final; diff --git a/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/selection.xml b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/selection.xml new file mode 100644 index 0000000000000000000000000000000000000000..4947f6e051f02ba42057219942957dd3049dbb88 --- /dev/null +++ b/Reconstruction/egamma/egammaMVACalib/egammaMVACalib/selection.xml @@ -0,0 +1,4 @@ + <lcgdict> + <class name="egammaMVACalibTool" /> + <class name="egammaMVASvc" /> + </lcgdict> diff --git a/Reconstruction/egamma/egammaMVACalib/src/components/egammaMVACalib_entries.cxx b/Reconstruction/egamma/egammaMVACalib/src/components/egammaMVACalib_entries.cxx index f0c0dad2190c3a4ebe4b950611290c01ddb164b4..2d5bd19872d02c1f7a9bcd98b962516e207790ed 100644 --- a/Reconstruction/egamma/egammaMVACalib/src/components/egammaMVACalib_entries.cxx +++ b/Reconstruction/egamma/egammaMVACalib/src/components/egammaMVACalib_entries.cxx @@ -1,5 +1,5 @@ -#include "../egammaMVASvc.h" -#include "../egammaMVACalibTool.h" +#include "egammaMVACalib/egammaMVASvc.h" +#include "egammaMVACalib/egammaMVACalibTool.h" DECLARE_COMPONENT( egammaMVASvc ) DECLARE_COMPONENT( egammaMVACalibTool ) diff --git a/Reconstruction/egamma/egammaTools/src/EMClusterTool.h b/Reconstruction/egamma/egammaTools/src/EMClusterTool.h index 0e67e6dc1941c4ac42fc81946372bc86b7d95d1b..787aad9030dc831a2f13ee3a83c24493bf6bcdc7 100644 --- a/Reconstruction/egamma/egammaTools/src/EMClusterTool.h +++ b/Reconstruction/egamma/egammaTools/src/EMClusterTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef EGAMMATOOLS_EMCLUSTERTOOL_H @@ -11,7 +11,7 @@ #include "egammaBaseTool.h" #include "egammaInterfaces/IEMClusterTool.h" -#include "egammaInterfaces/IegammaMVASvc.h" +#include "EgammaAnalysisInterfaces/IegammaMVASvc.h" #include "egammaInterfaces/IegammaSwTool.h" #include "StoreGate/WriteHandleKey.h" diff --git a/Reconstruction/egamma/egammaTools/src/egammaOQFlagsBuilder.cxx b/Reconstruction/egamma/egammaTools/src/egammaOQFlagsBuilder.cxx index 450e26ebef79eb0b6353ffc80d7f42a2cb802c6f..984b20cbe6414b47479857c08b2f7c88253407d1 100644 --- a/Reconstruction/egamma/egammaTools/src/egammaOQFlagsBuilder.cxx +++ b/Reconstruction/egamma/egammaTools/src/egammaOQFlagsBuilder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ // INCLUDE HEADER FILES: @@ -185,10 +185,6 @@ egammaOQFlagsBuilder::execute(const EventContext& ctx, unsigned int iflag = 0; - // Find the central cell in the middle layer - Identifier cellCentrId; - bool foundCentralCell = findCentralCell(cluster, cellCentrId); - // Set timing bit const double absEnergyGeV = fabs(cluster->e() * (1. / Gaudi::Units::GeV)); if (absEnergyGeV != 0 && @@ -200,11 +196,12 @@ egammaOQFlagsBuilder::execute(const EventContext& ctx, double totE = 0; double badE = 0; double energyCellMax = 0; - + // Find the central cell in the middle layer + Identifier cellCentrId; + bool foundCentralCell = findCentralCell(cluster, cellCentrId); if (foundCentralCell) { // Find the list of neighbours cells, to define the 3x3 cluster core std::vector<IdentifierHash> neighbourList = findNeighbours(cellCentrId); - // Get Bad-channel info for this event SG::ReadCondHandle<LArBadChannelCont> larBadChanHdl{ m_bcContKey, ctx }; const LArBadChannelCont* larBadChanCont = *larBadChanHdl; @@ -222,21 +219,34 @@ egammaOQFlagsBuilder::execute(const EventContext& ctx, continue; } // Find cell parameters and properties - float eta = cell->eta(); + const float eta = cell->eta(); // float phi = cell->phi(); // no longer used - float qual = cell->quality(); - CaloSampling::CaloSample layer = cell->caloDDE()->getSampling(); + const float qual = cell->quality(); + const bool isHighQ = qual >= 4000; + const CaloSampling::CaloSample layer = cell->caloDDE()->getSampling(); + + const bool isMissing = ((cell->provenance() & 0x0A00) == 0x0A00); + const bool isMasked = ((cell->provenance() & 0x0A00) == 0x0800); + const bool isPresampler = (layer == CaloSampling::PreSamplerB || + layer == CaloSampling::PreSamplerE); + const bool isL1 = + (layer == CaloSampling::EMB1 || layer == CaloSampling::EME1); + const bool isL2 = + (layer == CaloSampling::EMB2 || layer == CaloSampling::EME2); + const bool isL3 = + (layer == CaloSampling::EMB3 || layer == CaloSampling::EME3); // Calculate badE et totE if ((cell->provenance() & 0x2000) && !(cell->provenance() & 0x0800)) { totE += cell->e(); - if (cell->e() > energyCellMax) + if (cell->e() > energyCellMax) { energyCellMax = cell->e(); - if (cell->quality() > m_QCellCut) + } + if (qual > m_QCellCut) { badE += cell->e(); + } } - bool isACoreCell = false; - isACoreCell = isCore(cell->ID(), neighbourList); + const bool isACoreCell = isCore(cell->ID(), neighbourList); bool isStripCoreCell = false; if ((layer == CaloSampling::EMB1 || layer == CaloSampling::EME1) && @@ -252,90 +262,74 @@ egammaOQFlagsBuilder::execute(const EventContext& ctx, // Set LAr bits const LArBadChannel bc = larBadChanCont->offlineStatus(cell->ID()); - // + const bool isAffected = + (bc.deadCalib() || bc.lowNoiseHG() || bc.lowNoiseMG() || + bc.lowNoiseLG() || bc.distorted() || bc.unstable() || + bc.unstableNoiseHG() || bc.unstableNoiseMG() || bc.unstableNoiseLG() || + bc.peculiarCalibrationLine() || bc.almostDead() || bc.shortProblem()); + if (isACoreCell) { - if ((cell->provenance() & 0x0A00) == 0x0A00) { + if (isMissing) { iflag |= (0x1 << xAOD::EgammaParameters::MissingFEBCellCore); } - if ((cell->provenance() & 0x0A00) == 0x0800) { + if (isMasked) { iflag |= (0x1 << xAOD::EgammaParameters::MaskedCellCore); } if (bc.sporadicBurstNoise() && qual < m_QCellSporCut) { iflag |= (0x1 << xAOD::EgammaParameters::SporadicNoiseLowQCore); } - if (bc.deadCalib() || bc.lowNoiseHG() || bc.lowNoiseMG() || - bc.lowNoiseLG() || bc.distorted() || bc.unstable() || - bc.unstableNoiseHG() || bc.unstableNoiseMG() || - bc.unstableNoiseLG() || bc.peculiarCalibrationLine() || - bc.almostDead() || bc.shortProblem()) { + if (isAffected) { iflag |= (0x1 << xAOD::EgammaParameters::AffectedCellCore); } - if (qual >= 4000) { + if (isHighQ) { iflag |= (0x1 << xAOD::EgammaParameters::HighQCore); } - } else { - if ((cell->provenance() & 0x0A00) == 0x0A00) { - - if (layer == CaloSampling::PreSamplerB || - layer == CaloSampling::PreSamplerE) { + } // end if isACoreCell + else { + if (isMissing) { + if (isPresampler) { iflag |= (0x1 << xAOD::EgammaParameters::MissingFEBCellEdgePS); - } else if (layer == CaloSampling::EMB1 || - layer == CaloSampling::EME1) { + } else if (isL1) { iflag |= (0x1 << xAOD::EgammaParameters::MissingFEBCellEdgeS1); - if (isStripCoreCell) + if (isStripCoreCell){ iflag |= (0x1 << xAOD::EgammaParameters::BadS1Core); - } else if (layer == CaloSampling::EMB2 || - layer == CaloSampling::EME2) { + } + } else if (isL2) { iflag |= (0x1 << xAOD::EgammaParameters::MissingFEBCellEdgeS2); - } else if (layer == CaloSampling::EMB3 || - layer == CaloSampling::EME3) { + } else if (isL3) { iflag |= (0x1 << xAOD::EgammaParameters::MissingFEBCellEdgeS3); } - } - if ((cell->provenance() & 0x0A00) == 0x0800) { - - if (layer == CaloSampling::PreSamplerB || - layer == CaloSampling::PreSamplerE) { + } // isMissing + if (isMasked) { + if (isPresampler) { iflag |= (0x1 << xAOD::EgammaParameters::MaskedCellEdgePS); - } else if (layer == CaloSampling::EMB1 || - layer == CaloSampling::EME1) { + } else if (isL1) { iflag |= (0x1 << xAOD::EgammaParameters::MaskedCellEdgeS1); if (isStripCoreCell) { iflag |= (0x1 << xAOD::EgammaParameters::BadS1Core); } - } else if (layer == CaloSampling::EMB2 || - layer == CaloSampling::EME2) { + } else if (isL2) { iflag |= (0x1 << xAOD::EgammaParameters::MaskedCellEdgeS2); - } else if (layer == CaloSampling::EMB3 || - layer == CaloSampling::EME3) { + } else if (isL3) { iflag |= (0x1 << xAOD::EgammaParameters::MaskedCellEdgeS3); } - } + } // isMasked if (bc.sporadicBurstNoise() && qual < m_QCellSporCut) { iflag |= (0x1 << xAOD::EgammaParameters::SporadicNoiseLowQEdge); } - if (bc.deadCalib() || bc.lowNoiseHG() || bc.lowNoiseMG() || - bc.lowNoiseLG() || bc.distorted() || bc.unstable() || - bc.unstableNoiseHG() || bc.unstableNoiseMG() || - bc.unstableNoiseLG() || bc.peculiarCalibrationLine() || - bc.almostDead() || bc.shortProblem()) { - - if (layer == CaloSampling::PreSamplerB || - layer == CaloSampling::PreSamplerE) { + if (isAffected) { + if (isPresampler) { iflag |= (0x1 << xAOD::EgammaParameters::AffectedCellEdgePS); - } else if (layer == CaloSampling::EMB1 || - layer == CaloSampling::EME1) { + } else if (isL1) { iflag |= (0x1 << xAOD::EgammaParameters::AffectedCellEdgeS1); - } else if (layer == CaloSampling::EMB2 || - layer == CaloSampling::EME2) { + } else if (isL2) { iflag |= (0x1 << xAOD::EgammaParameters::AffectedCellEdgeS2); - } else if (layer == CaloSampling::EMB3 || - layer == CaloSampling::EME3) { + } else if (isL3) { iflag |= (0x1 << xAOD::EgammaParameters::AffectedCellEdgeS3); } - } - if (qual >= 4000) { + } // is affected + if (isHighQ) { iflag |= (0x1 << xAOD::EgammaParameters::HighQEdge); } } @@ -343,15 +337,17 @@ egammaOQFlagsBuilder::execute(const EventContext& ctx, // Set LArQCleaning bit double egammaLArQCleaning = 0; - if (totE != 0) + if (totE != 0) { egammaLArQCleaning = badE / totE; + } if (egammaLArQCleaning > m_LArQCut) { iflag |= (0x1 << xAOD::EgammaParameters::LArQCleaning); } // Set HighRcell bit// double ratioCell = 0; - if (totE != 0) + if (totE != 0) { ratioCell = energyCellMax / totE; + } if (ratioCell > m_RcellCut) { iflag |= (0x1 << xAOD::EgammaParameters::HighRcell); } @@ -411,116 +407,118 @@ egammaOQFlagsBuilder::execute(const EventContext& ctx, //---------------> SAMPLING 2 : CLUSTER CORE deta = 0.5 * 0.025 * 3.; dphi = 0.5 * 0.025 * 3.; - bool isDeadHVS2Core = (m_affectedTool->isAffected(cluster, - affCont, - deta, - dphi, - CaloSampling::EMB2, - CaloSampling::EMB2, - 2) || - m_affectedTool->isAffected(cluster, - affCont, - deta, - dphi, - CaloSampling::EME2, - CaloSampling::EME2, - 2)); - - if (isDeadHVS2Core) { - iflag |= (0x1 << xAOD::EgammaParameters::DeadHVS1S2S3Core); - } - //----------------> SAMPLINGS 1,2,3 : CLUSTER EDGE - deta = 0.5 * 0.025 * etaSize; - dphi = 0.5 * 0.025 * phiSize; - - bool isNonNominalHVS1S2S3 = (m_affectedTool->isAffected(cluster, - affCont, - deta, - dphi, - CaloSampling::EMB1, - CaloSampling::EMB1, - 1) || - m_affectedTool->isAffected(cluster, + const bool isDeadHVS2Core = (m_affectedTool->isAffected(cluster, affCont, deta, dphi, CaloSampling::EMB2, CaloSampling::EMB2, - 1) || - m_affectedTool->isAffected(cluster, - affCont, - deta, - dphi, - CaloSampling::EMB3, - CaloSampling::EMB3, - 1) || - m_affectedTool->isAffected(cluster, - affCont, - deta, - dphi, - CaloSampling::EME1, - CaloSampling::EME1, - 1) || + 2) || m_affectedTool->isAffected(cluster, affCont, deta, dphi, CaloSampling::EME2, CaloSampling::EME2, - 1) || - m_affectedTool->isAffected(cluster, - affCont, - deta, - dphi, - CaloSampling::EME3, - CaloSampling::EME3, - 1)); + 2)); + + if (isDeadHVS2Core) { + iflag |= (0x1 << xAOD::EgammaParameters::DeadHVS1S2S3Core); + } + //----------------> SAMPLINGS 1,2,3 : CLUSTER EDGE + deta = 0.5 * 0.025 * etaSize; + dphi = 0.5 * 0.025 * phiSize; + + const bool isNonNominalHVS1S2S3 = + (m_affectedTool->isAffected(cluster, + affCont, + deta, + dphi, + CaloSampling::EMB1, + CaloSampling::EMB1, + 1) || + m_affectedTool->isAffected(cluster, + affCont, + deta, + dphi, + CaloSampling::EMB2, + CaloSampling::EMB2, + 1) || + m_affectedTool->isAffected(cluster, + affCont, + deta, + dphi, + CaloSampling::EMB3, + CaloSampling::EMB3, + 1) || + m_affectedTool->isAffected(cluster, + affCont, + deta, + dphi, + CaloSampling::EME1, + CaloSampling::EME1, + 1) || + m_affectedTool->isAffected(cluster, + affCont, + deta, + dphi, + CaloSampling::EME2, + CaloSampling::EME2, + 1) || + m_affectedTool->isAffected(cluster, + affCont, + deta, + dphi, + CaloSampling::EME3, + CaloSampling::EME3, + 1)); if (isNonNominalHVS1S2S3) { iflag |= (0x1 << xAOD::EgammaParameters::NonNominalHVS1S2S3); } - bool isDeadHVS1S2S3Edge = (m_affectedTool->isAffected(cluster, - affCont, - deta, - dphi, - CaloSampling::EMB1, - CaloSampling::EMB1, - 2) || - m_affectedTool->isAffected(cluster, - affCont, - deta, - dphi, - CaloSampling::EMB2, - CaloSampling::EMB2, - 2) || - m_affectedTool->isAffected(cluster, - affCont, - deta, - dphi, - CaloSampling::EMB3, - CaloSampling::EMB3, - 2) || - m_affectedTool->isAffected(cluster, - affCont, - deta, - dphi, - CaloSampling::EME1, - CaloSampling::EME1, - 2) || - m_affectedTool->isAffected(cluster, - affCont, - deta, - dphi, - CaloSampling::EME2, - CaloSampling::EME2, - 2) || - m_affectedTool->isAffected(cluster, - affCont, - deta, - dphi, - CaloSampling::EME3, - CaloSampling::EME3, - 2)); + const bool isDeadHVS1S2S3Edge = + (m_affectedTool->isAffected(cluster, + affCont, + deta, + dphi, + CaloSampling::EMB1, + CaloSampling::EMB1, + 2) || + m_affectedTool->isAffected(cluster, + affCont, + deta, + dphi, + CaloSampling::EMB2, + CaloSampling::EMB2, + 2) || + m_affectedTool->isAffected(cluster, + affCont, + deta, + dphi, + CaloSampling::EMB3, + CaloSampling::EMB3, + 2) || + m_affectedTool->isAffected(cluster, + affCont, + deta, + dphi, + CaloSampling::EME1, + CaloSampling::EME1, + 2) || + m_affectedTool->isAffected(cluster, + affCont, + deta, + dphi, + CaloSampling::EME2, + CaloSampling::EME2, + 2) || + m_affectedTool->isAffected(cluster, + affCont, + deta, + dphi, + CaloSampling::EME3, + CaloSampling::EME3, + 2)); if (isDeadHVS1S2S3Edge) { iflag |= (0x1 << xAOD::EgammaParameters::DeadHVS1S2S3Edge); diff --git a/Reconstruction/tauRec/share/tauRec_RTT_topOptions.py b/Reconstruction/tauRec/share/tauRec_RTT_topOptions.py deleted file mode 100644 index e0bd3f1054e781e91b4cf532a223b44d093a5721..0000000000000000000000000000000000000000 --- a/Reconstruction/tauRec/share/tauRec_RTT_topOptions.py +++ /dev/null @@ -1,62 +0,0 @@ - -DetDescrVersion="ATLAS-CSC-01-02-00" - - -doESD = True # if false, all algorithms are switched off by defaults -########################### -donewTracking=True -doxKalman=True -doiPatRec=True -doEmCluster=True -doCaloCluster=True -doCaloTopoCluster=True - -doMoore=False -doMuonboy=False -doConversion=False -doBtagging=False -doEgamma=True -doJetRec=True -doTauRec=True -doMuonIDStandAlone=False -doMuonIDCombined=False -doMuidLowPt=False -doMuGirl=False -doStaco=False -doMuTag=False -doTileMuID=False -doMissingET=False -doObjMissingET=False -doEFlow=False -doEFlowJet= False -doTrigger=False -doAtlfast=False -############################ -doWriteESD = False -doWriteTAG = False -doWriteAOD = True -doTrigger = False -doHist = False -doAOD = True -doCBNT=True - -# number of event to process -#EvtMax= 5 -EvtMax=-1 - -if not 'BTaggingFlags' in dir(): - from BTagging.BTaggingFlags import BTaggingFlags - BTaggingFlags.JetFitterTag=False - #BTaggingFlags.OutputLevel=INFO - -#disable atlfast -from ParticleBuilderOptions.AODFlags import AODFlags -AODFlags.FastSimulation=False - -include ("RecExCommon/RecExCommon_flags.py") -#DetFlags.Calo_setOff() -DetFlags.Muon_setOff() - -include ("RecExCommon/RecExCommon_topOptions.py") -#CBNT_TruthParticle.NMaxTruthParticles = 3000 - diff --git a/Tools/PROCTools/python/RunTier0TestsTools.py b/Tools/PROCTools/python/RunTier0TestsTools.py index 796037059eedde17ee248c85593df21a70e1e43d..45d7900b2ecb8df05a9a7faafbe401a7f9fa0a56 100644 --- a/Tools/PROCTools/python/RunTier0TestsTools.py +++ b/Tools/PROCTools/python/RunTier0TestsTools.py @@ -27,7 +27,7 @@ ciRefFileMap = { 's3505-21.0' : 'v2', 's3505-21.3' : 'v1', 's3505-21.9' : 'v1', - 's3505-22.0' : 'v8', + 's3505-22.0' : 'v9', # OverlayTier0Test_required-test 'overlay-d1498-21.0' : 'v2', 'overlay-d1498-22.0' : 'v38', diff --git a/Tools/TrfTestsART/test/test_trf_data18_11k_mt.sh b/Tools/TrfTestsART/test/test_trf_data18_11k_mt.sh index d5bf1b1630da8120df56026004fb69f71a8e1755..28f6fddedd09e7470475d3280f1f822a9c28564e 100755 --- a/Tools/TrfTestsART/test/test_trf_data18_11k_mt.sh +++ b/Tools/TrfTestsART/test/test_trf_data18_11k_mt.sh @@ -7,7 +7,10 @@ timeout 64800 Reco_tf.py \ --inputBSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data18_13TeV.00357750.physics_Main.daq.RAW/data18_13TeV.00357750.physics_Main.daq.RAW._lb0083._SFO-1._0001.data,/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data18_13TeV.00357750.physics_Main.daq.RAW/data18_13TeV.00357750.physics_Main.daq.RAW._lb0083._SFO-1._0002.data,/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data18_13TeV.00357750.physics_Main.daq.RAW/data18_13TeV.00357750.physics_Main.daq.RAW._lb0083._SFO-1._0003.data,/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data18_13TeV.00357750.physics_Main.daq.RAW/data18_13TeV.00357750.physics_Main.daq.RAW._lb0083._SFO-1._0004.data,/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data18_13TeV.00357750.physics_Main.daq.RAW/data18_13TeV.00357750.physics_Main.daq.RAW._lb0083._SFO-1._0005.data,/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data18_13TeV.00357750.physics_Main.daq.RAW/data18_13TeV.00357750.physics_Main.daq.RAW._lb0083._SFO-1._0006.data \ - --outputAODFile=aod.pool.root --outputHISTFile=hist.root \ + --outputAODFile=myAOD.pool.root \ + --outputHISTFile=myHIST.root \ + --outputDESDM_MCPFile=myDESDM_MCP.pool.root \ + --outputDRAW_ZMUMUFile=myDRAW_ZMUMU.data \ --multithreaded='True' \ --preExec 'all:from AthenaMonitoring.DQMonFlags import DQMonFlags; DQMonFlags.doMonitoring=True; DQMonFlags.doNewMonitoring=True' \ --postExec 'FPEAuditor.NStacktracesOnFPE=10' \ diff --git a/Tools/TrfTestsART/test/test_trf_data18_mp.sh b/Tools/TrfTestsART/test/test_trf_data18_mp.sh new file mode 100755 index 0000000000000000000000000000000000000000..8b030dd2d4b41ae8478668d8f10ab639d5fd8801 --- /dev/null +++ b/Tools/TrfTestsART/test/test_trf_data18_mp.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# +# art-description: Reco_tf.py q431 RAWtoALL in MP mode +# art-type: grid +# art-include: master/Athena +# art-athena-mt: 8 + +timeout 43200 Reco_tf.py \ + --inputBSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data18_13TeV.00357750.physics_Main.daq.RAW/data18_13TeV.00357750.physics_Main.daq.RAW._lb0114._SFO-5._0003.data \ + --outputAODFile=myAOD.pool.root \ + --outputHISTFile=myHIST.root \ + --outputDESDM_MCPFile=myDESDM_MCP.pool.root \ + --outputDRAW_ZMUMUFile=myDRAW_ZMUMU.data \ + --multiprocess='True' \ + --preExec 'all:from AthenaMonitoring.DQMonFlags import DQMonFlags; DQMonFlags.doMonitoring=True; DQMonFlags.doNewMonitoring=True' \ + --postExec 'FPEAuditor.NStacktracesOnFPE=10' \ + --autoConfiguration='everything' \ + --conditionsTag 'all:CONDBR2-BLKPA-RUN2-03' --geometryVersion='default:ATLAS-R2-2016-01-00-01' \ + --runNumber='357750' --steering='doRAWtoALL' --maxEvents='-1' + +echo "art-result: $? Reco_tf_data18_mp" diff --git a/Tools/TrfTestsART/test/test_trf_data18_mt.sh b/Tools/TrfTestsART/test/test_trf_data18_mt.sh index b2cd9096b398a6c9e5d9f7d7e965e682cfe0636e..83a15977c69ccf48ce8a38b5626f2a492b43bde1 100755 --- a/Tools/TrfTestsART/test/test_trf_data18_mt.sh +++ b/Tools/TrfTestsART/test/test_trf_data18_mt.sh @@ -7,7 +7,10 @@ timeout 43200 Reco_tf.py \ --inputBSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data18_13TeV.00357750.physics_Main.daq.RAW/data18_13TeV.00357750.physics_Main.daq.RAW._lb0114._SFO-5._0003.data \ - --outputAODFile=aod.pool.root --outputHISTFile=hist.root \ + --outputAODFile=myAOD.pool.root \ + --outputHISTFile=myHIST.root \ + --outputDESDM_MCPFile=myDESDM_MCP.pool.root \ + --outputDRAW_ZMUMUFile=myDRAW_ZMUMU.data \ --multithreaded='True' \ --preExec 'all:from AthenaMonitoring.DQMonFlags import DQMonFlags; DQMonFlags.doMonitoring=True; DQMonFlags.doNewMonitoring=True' \ --postExec 'FPEAuditor.NStacktracesOnFPE=10' \ diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h index e0f8a4735f15cd18885cbac3b81eefb8b6e4a8d3..1f3d35a14c51a5caa7fb4860f8a843e75041c060 100644 --- a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef ACTSGEOMETRY_ACTSEXTRAPOLATIONTOOL_H @@ -11,6 +11,8 @@ #include "GaudiKernel/ServiceHandle.h" #include "Gaudi/Property.h" #include "GaudiKernel/EventContext.h" +#include "TrkEventPrimitives/ParticleHypothesis.h" +#include "TrkEventPrimitives/PdgToParticleHypothesis.h" // Need to include this early; otherwise, we run into errors with // ReferenceWrapperAnyCompat in clang builds due the is_constructable @@ -70,14 +72,16 @@ public: propagationSteps(const EventContext& ctx, const Acts::BoundTrackParameters& startParameters, Acts::NavigationDirection navDir = Acts::forward, - double pathLimit = std::numeric_limits<double>::max()) const override; + double pathLimit = std::numeric_limits<double>::max(), + Trk::ParticleHypothesis particleHypo = Trk::pion) const override; virtual std::unique_ptr<const Acts::CurvilinearTrackParameters> propagate(const EventContext& ctx, const Acts::BoundTrackParameters& startParameters, Acts::NavigationDirection navDir = Acts::forward, - double pathLimit = std::numeric_limits<double>::max()) const override; + double pathLimit = std::numeric_limits<double>::max(), + Trk::ParticleHypothesis particleHypo = Trk::pion) const override; virtual ActsPropagationOutput @@ -85,7 +89,8 @@ public: const Acts::BoundTrackParameters& startParameters, const Acts::Surface& target, Acts::NavigationDirection navDir = Acts::forward, - double pathLimit = std::numeric_limits<double>::max()) const override; + double pathLimit = std::numeric_limits<double>::max(), + Trk::ParticleHypothesis particleHypo = Trk::pion) const override; virtual std::unique_ptr<const Acts::BoundTrackParameters> @@ -93,7 +98,8 @@ public: const Acts::BoundTrackParameters& startParameters, const Acts::Surface& target, Acts::NavigationDirection navDir = Acts::forward, - double pathLimit = std::numeric_limits<double>::max()) const override; + double pathLimit = std::numeric_limits<double>::max(), + Trk::ParticleHypothesis particleHypo = Trk::pion) const override; virtual const IActsTrackingGeometryTool* @@ -127,8 +133,10 @@ private: Gaudi::Property<bool> m_interactionMultiScatering{this, "InteractionMultiScatering", false, "Whether to consider multiple scattering in the interactor"}; Gaudi::Property<bool> m_interactionEloss{this, "InteractionEloss", false, "Whether to consider energy loss in the interactor"}; Gaudi::Property<bool> m_interactionRecord{this, "InteractionRecord", false, "Whether to record all material interactions"}; + // Particle masses + Trk::ParticleMasses m_particlemasses; + // Hypothesis to pdg converter + Trk::PdgToParticleHypothesis m_pdgToParticleHypothesis; }; - - #endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsGeantFollowerHelper.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsGeantFollowerHelper.h index f5f8ecad1bc29a8f2d37bf0d748220f16e47232e..756d9333ddbed202598e57f2a328739c383dc6d5 100755 --- a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsGeantFollowerHelper.h +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsGeantFollowerHelper.h @@ -10,6 +10,8 @@ #include "TrkParameters/TrackParameters.h" //typedef, can't fwd declare #include "ActsGeometry/IActsGeantFollowerHelper.h" #include "G4ThreeVector.hh" //typedef, can't fwd declare +#include "TrkEventPrimitives/ParticleHypothesis.h" +#include "TrkEventPrimitives/PdgToParticleHypothesis.h" #include "Acts/Surfaces/Surface.hpp" #include "Acts/EventData/TrackParameters.hpp" @@ -60,7 +62,8 @@ class ActsGeantFollowerHelper : public extends<AthAlgTool, IActsGeantFollowerHel mutable std::unique_ptr<const Acts::BoundTrackParameters> m_actsParameterCache; mutable std::unique_ptr<std::vector<Acts::SurfaceHit>> m_actsSurfaceCache; mutable std::vector<Acts::SurfaceHit>::iterator m_actsSurfaceIterator; - + // Hypothesis to pdg converter + Trk::PdgToParticleHypothesis m_pdgToParticleHypothesis; mutable float m_tX0Cache; mutable float m_tX0CacheActs; @@ -86,7 +89,7 @@ class ActsGeantFollowerHelper : public extends<AthAlgTool, IActsGeantFollowerHel mutable int m_t_pdg {0}; /** Ntuple variables : g4 step parameters */ mutable int m_g4_steps {0}; - mutable float m_g4_p[MAXPROBES] {0}; + mutable float m_g4_pt[MAXPROBES] {0}; mutable float m_g4_eta[MAXPROBES] {0}; mutable float m_g4_theta[MAXPROBES] {0}; mutable float m_g4_phi[MAXPROBES] {0}; @@ -99,7 +102,7 @@ class ActsGeantFollowerHelper : public extends<AthAlgTool, IActsGeantFollowerHel mutable float m_g4_X0[MAXPROBES] {0}; /** Ntuple variables : trk follow up parameters */ mutable int m_trk_status[MAXPROBES] {0}; - mutable float m_trk_p[MAXPROBES] {0}; + mutable float m_trk_pt[MAXPROBES] {0}; mutable float m_trk_eta[MAXPROBES] {0}; mutable float m_trk_theta[MAXPROBES] {0}; mutable float m_trk_phi[MAXPROBES] {0}; @@ -111,7 +114,7 @@ class ActsGeantFollowerHelper : public extends<AthAlgTool, IActsGeantFollowerHel /** Ntuple variables : acts follow up parameters */ mutable int m_acts_status[MAXPROBES] {0}; mutable int m_acts_volumeID[MAXPROBES] {0}; - mutable float m_acts_p[MAXPROBES] {0}; + mutable float m_acts_pt[MAXPROBES] {0}; mutable float m_acts_eta[MAXPROBES] {0}; mutable float m_acts_theta[MAXPROBES] {0}; mutable float m_acts_phi[MAXPROBES] {0}; diff --git a/Tracking/Acts/ActsGeometry/share/ActsGeantFollowing_jobOptions.py b/Tracking/Acts/ActsGeometry/share/ActsGeantFollowing_jobOptions.py index 3e317979bbbd03d78ef430bf3e5125a08e795f50..58dfcf968c0642c667df12e6363fe1a7f8c89b9e 100644 --- a/Tracking/Acts/ActsGeometry/share/ActsGeantFollowing_jobOptions.py +++ b/Tracking/Acts/ActsGeometry/share/ActsGeantFollowing_jobOptions.py @@ -30,12 +30,10 @@ from AthenaCommon.GlobalFlags import globalflags ### pass arguments with athena -c "..." ...jobOptions.py: if 'myMomentum' not in dir() : -# myMomentum = 25000 -# myMomentum = 50000 +# myMomentum = 30000 + myMomentum = 50000 # myMomentum = 100000 # myMomentum = 500000 - myMomentum = 10000 -# myMomentum = 5000 if 'myRandomOffset' not in dir() : myRandomOffset = 0 @@ -47,10 +45,10 @@ if 'myRandomSeed1' not in dir() : if 'myRandomSeed2' not in dir() : myRandomSeed2 = 820189 -if 'myMaxEvent' not in dir() : - myMaxEvent = 1000 +if 'myMaxEvent' not in dir(): + myMaxEvent = 100 + # myMaxEvent = 1000 # myMaxEvent = 5000 - # myMaxEvent = 100 if 'myPt' not in dir() : myPt = 'pt' # values are 'p' or 'pt' @@ -286,8 +284,8 @@ from ActsGeometry.ActsGeometryConf import ActsGeantFollowerHelper ActsGeantFollowerHelper = ActsGeantFollowerHelper(name="ActsGeantFollowerHelper") ActsGeantFollowerHelper.Extrapolator = TestExtrapolator ActsGeantFollowerHelper.ActsExtrapolator = ActsExtrapolator -ActsGeantFollowerHelper.ExtrapolateDirectly = True -ActsGeantFollowerHelper.ExtrapolateIncrementally = True +ActsGeantFollowerHelper.ExtrapolateDirectly = False +ActsGeantFollowerHelper.ExtrapolateIncrementally = False ActsGeantFollowerHelper.OutputLevel = INFO ToolSvc += ActsGeantFollowerHelper diff --git a/Tracking/Acts/ActsGeometry/src/ActsExtrapolationTool.cxx b/Tracking/Acts/ActsGeometry/src/ActsExtrapolationTool.cxx index 4ef45c475c9002b7c9451af4be7cad26b7b7720b..d59bc8f197983c64eda474271425b47c76941958 100644 --- a/Tracking/Acts/ActsGeometry/src/ActsExtrapolationTool.cxx +++ b/Tracking/Acts/ActsGeometry/src/ActsExtrapolationTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "ActsGeometry/ActsExtrapolationTool.h" @@ -134,7 +134,8 @@ ActsPropagationOutput ActsExtrapolationTool::propagationSteps(const EventContext& ctx, const Acts::BoundTrackParameters& startParameters, Acts::NavigationDirection navDir /*= Acts::forward*/, - double pathLimit /*= std::numeric_limits<double>::max()*/) const + double pathLimit /*= std::numeric_limits<double>::max()*/, + Trk::ParticleHypothesis particleHypo /*= Trk::pion*/) const { using namespace Acts::UnitLiterals; ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__ << " begin"); @@ -161,8 +162,12 @@ ActsExtrapolationTool::propagationSteps(const EventContext& ctx, options.maxStepSize = m_maxStepSize * 1_m; options.maxSteps = m_maxStep; options.direction = navDir; + if(particleHypo != Trk::noHypothesis){ + options.absPdgCode = m_pdgToParticleHypothesis.convert(particleHypo, startParameters.charge()); + options.mass = m_particlemasses.mass[particleHypo] * 1_MeV; + } - auto& mInteractor = options.actionList.get<Acts::MaterialInteractor>(); + auto &mInteractor = options.actionList.get<Acts::MaterialInteractor>(); mInteractor.multipleScattering = m_interactionMultiScatering; mInteractor.energyLoss = m_interactionEloss; mInteractor.recordInteractions = m_interactionRecord; @@ -208,7 +213,8 @@ std::unique_ptr<const Acts::CurvilinearTrackParameters> ActsExtrapolationTool::propagate(const EventContext& ctx, const Acts::BoundTrackParameters& startParameters, Acts::NavigationDirection navDir /*= Acts::forward*/, - double pathLimit /*= std::numeric_limits<double>::max()*/) const + double pathLimit /*= std::numeric_limits<double>::max()*/, + Trk::ParticleHypothesis particleHypo /*= Trk::pion*/) const { using namespace Acts::UnitLiterals; ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__ << " begin"); @@ -234,6 +240,10 @@ ActsExtrapolationTool::propagate(const EventContext& ctx, options.maxStepSize = m_maxStepSize * 1_m; options.maxSteps = m_maxStep; options.direction = navDir; + if(particleHypo != Trk::noHypothesis){ + options.absPdgCode = m_pdgToParticleHypothesis.convert(particleHypo, startParameters.charge()); + options.mass = m_particlemasses.mass[particleHypo] * 1_MeV; + } auto& mInteractor = options.actionList.get<Acts::MaterialInteractor>(); mInteractor.multipleScattering = m_interactionMultiScatering; @@ -258,7 +268,8 @@ ActsExtrapolationTool::propagationSteps(const EventContext& ctx, const Acts::BoundTrackParameters& startParameters, const Acts::Surface& target, Acts::NavigationDirection navDir /*= Acts::forward*/, - double pathLimit /*= std::numeric_limits<double>::max()*/) const + double pathLimit /*= std::numeric_limits<double>::max()*/, + Trk::ParticleHypothesis particleHypo /*= Trk::pion*/) const { using namespace Acts::UnitLiterals; ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__ << " begin"); @@ -284,6 +295,10 @@ ActsExtrapolationTool::propagationSteps(const EventContext& ctx, options.maxStepSize = m_maxStepSize * 1_m; options.maxSteps = m_maxStep; options.direction = navDir; + if(particleHypo != Trk::noHypothesis){ + options.absPdgCode = m_pdgToParticleHypothesis.convert(particleHypo, startParameters.charge()); + options.mass = m_particlemasses.mass[particleHypo] * 1_MeV; + } auto& mInteractor = options.actionList.get<Acts::MaterialInteractor>(); mInteractor.multipleScattering = m_interactionMultiScatering; @@ -324,7 +339,8 @@ ActsExtrapolationTool::propagate(const EventContext& ctx, const Acts::BoundTrackParameters& startParameters, const Acts::Surface& target, Acts::NavigationDirection navDir /*= Acts::forward*/, - double pathLimit /*= std::numeric_limits<double>::max()*/) const + double pathLimit /*= std::numeric_limits<double>::max()*/, + Trk::ParticleHypothesis particleHypo /*= Trk::pion*/) const { using namespace Acts::UnitLiterals; ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__ << " begin"); @@ -350,6 +366,10 @@ ActsExtrapolationTool::propagate(const EventContext& ctx, options.maxStepSize = m_maxStepSize * 1_m; options.maxSteps = m_maxStep; options.direction = navDir; + if(particleHypo != Trk::noHypothesis){ + options.absPdgCode = m_pdgToParticleHypothesis.convert(particleHypo, startParameters.charge()); + options.mass = m_particlemasses.mass[particleHypo] * 1_MeV; + } auto& mInteractor = options.actionList.get<Acts::MaterialInteractor>(); mInteractor.multipleScattering = m_interactionMultiScatering; diff --git a/Tracking/Acts/ActsGeometry/src/ActsGeantFollowerHelper.cxx b/Tracking/Acts/ActsGeometry/src/ActsGeantFollowerHelper.cxx index 761e04288600f589b70428b7e50ecdd22e1afc46..01f5ff14ca5a1cdc7882e42502f4478ee31ff714 100755 --- a/Tracking/Acts/ActsGeometry/src/ActsGeantFollowerHelper.cxx +++ b/Tracking/Acts/ActsGeometry/src/ActsGeantFollowerHelper.cxx @@ -88,7 +88,7 @@ StatusCode ActsGeantFollowerHelper::initialize() m_validationTree->Branch("InitCharge", &m_treeData->m_t_charge, "initQ/F"); m_validationTree->Branch("G4Steps", &m_treeData->m_g4_steps, "g4steps/I"); - m_validationTree->Branch("G4StepP", m_treeData->m_g4_p, "g4stepP[g4steps]/F"); + m_validationTree->Branch("G4StepPt", m_treeData->m_g4_pt, "g4stepPt[g4steps]/F"); m_validationTree->Branch("G4StepEta", m_treeData->m_g4_eta, "g4stepEta[g4steps]/F"); m_validationTree->Branch("G4StepTheta", m_treeData->m_g4_theta, "g4stepTheta[g4steps]/F"); m_validationTree->Branch("G4StepPhi", m_treeData->m_g4_phi, "g4stepPhi[g4steps]/F"); @@ -101,7 +101,7 @@ StatusCode ActsGeantFollowerHelper::initialize() m_validationTree->Branch("G4StepX0", m_treeData->m_g4_X0, "g4stepX0[g4steps]/F"); m_validationTree->Branch("TrkStepStatus",m_treeData->m_trk_status, "trkstepStatus[g4steps]/I"); - m_validationTree->Branch("TrkStepP", m_treeData->m_trk_p, "trkstepP[g4steps]/F"); + m_validationTree->Branch("TrkStepPt", m_treeData->m_trk_pt, "trkstepPt[g4steps]/F"); m_validationTree->Branch("TrkStepEta", m_treeData->m_trk_eta, "trkstepEta[g4steps]/F"); m_validationTree->Branch("TrkStepTheta", m_treeData->m_trk_theta, "trkstepTheta[g4steps]/F"); m_validationTree->Branch("TrkStepPhi", m_treeData->m_trk_phi, "trkstepPhi[g4steps]/F"); @@ -113,7 +113,7 @@ StatusCode ActsGeantFollowerHelper::initialize() m_validationTree->Branch("ActsStepStatus",m_treeData->m_acts_status, "actsstepStatus[g4steps]/I"); m_validationTree->Branch("ActsVolumeId", m_treeData->m_acts_volumeID,"actsvolumeid[g4steps]/I"); - m_validationTree->Branch("ActsStepP", m_treeData->m_acts_p, "actsstepP[g4steps]/F"); + m_validationTree->Branch("ActsStepPt", m_treeData->m_acts_pt, "actsstepPt[g4steps]/F"); m_validationTree->Branch("ActsStepEta", m_treeData->m_acts_eta, "actsstepEta[g4steps]/F"); m_validationTree->Branch("ActsStepTheta", m_treeData->m_acts_theta, "actsstepTheta[g4steps]/F"); m_validationTree->Branch("ActsStepPhi", m_treeData->m_acts_phi, "actsstepPhi[g4steps]/F"); @@ -208,24 +208,36 @@ void ActsGeantFollowerHelper::trackParticle(const G4ThreeVector& pos, ATH_MSG_WARNING("Maximum number of " << MAXPROBES << " reached, step is ignored."); return; } - + + // Use the G4 pdgId as the particle hypothesis + Trk::ParticleHypothesis particleHypo = m_pdgToParticleHypothesis.convert(m_treeData->m_t_pdg, m_treeData->m_t_charge); // parameters of the G4 step point Trk::CurvilinearParameters* g4Parameters = new Trk::CurvilinearParameters(npos, nmom, m_treeData->m_t_charge); // destination surface const Trk::PlaneSurface& destinationSurface = g4Parameters->associatedSurface(); // extrapolate to the destination surface const Trk::TrackParameters* trkParameters = m_extrapolateDirectly ? - m_extrapolator->extrapolateDirectly(*m_parameterCache,destinationSurface,Trk::alongMomentum,false) : - m_extrapolator->extrapolate(*m_parameterCache,destinationSurface,Trk::alongMomentum,false); + m_extrapolator->extrapolateDirectly(*m_parameterCache,destinationSurface,Trk::alongMomentum,false, particleHypo) : + m_extrapolator->extrapolate(*m_parameterCache,destinationSurface,Trk::alongMomentum,false, particleHypo); // create a Acts::Surface that correspond to the Trk::Surface auto destinationSurfaceActs = Acts::Surface::makeShared<Acts::PlaneSurface>(destinationSurface.center(), destinationSurface.normal()); - std::unique_ptr<const Acts::BoundTrackParameters> actsParameters = m_actsExtrapolator->propagate(ctx, *m_actsParameterCache, *destinationSurfaceActs); - double X0Acts = m_actsExtrapolator->propagationSteps(ctx, *m_actsParameterCache, *destinationSurfaceActs).second.materialInX0; + std::unique_ptr<const Acts::BoundTrackParameters> actsParameters = m_actsExtrapolator->propagate(ctx, + *m_actsParameterCache, + *destinationSurfaceActs, + Acts::forward, + std::numeric_limits<double>::max(), + particleHypo); + double X0Acts = m_actsExtrapolator->propagationSteps(ctx, + *m_actsParameterCache, + *destinationSurfaceActs, + Acts::forward, + std::numeric_limits<double>::max(), + particleHypo).second.materialInX0; int volID = trackingGeometry->lowestTrackingVolume(gctx.context(), actsParameters->position(gctx.context()))->geometryId().volume(); // fill the geant information and the trk information - m_treeData->m_g4_p[m_treeData->m_g4_steps] = mom.mag(); + m_treeData->m_g4_pt[m_treeData->m_g4_steps] = mom.mag()/std::cosh(mom.eta()); m_treeData->m_g4_eta[m_treeData->m_g4_steps] = mom.eta(); m_treeData->m_g4_theta[m_treeData->m_g4_steps] = mom.theta(); m_treeData->m_g4_phi[m_treeData->m_g4_steps] = mom.phi(); @@ -240,7 +252,7 @@ void ActsGeantFollowerHelper::trackParticle(const G4ThreeVector& pos, m_treeData->m_g4_X0[m_treeData->m_g4_steps] = X0; m_treeData->m_trk_status[m_treeData->m_g4_steps] = trkParameters ? 1 : 0; - m_treeData->m_trk_p[m_treeData->m_g4_steps] = trkParameters ? trkParameters->pT() : 0.; + m_treeData->m_trk_pt[m_treeData->m_g4_steps] = trkParameters ? trkParameters->pT() : 0.; m_treeData->m_trk_eta[m_treeData->m_g4_steps] = trkParameters ? trkParameters->momentum().eta() : 0.; m_treeData->m_trk_theta[m_treeData->m_g4_steps] = trkParameters ? trkParameters->momentum().theta() : 0.; m_treeData->m_trk_phi[m_treeData->m_g4_steps] = trkParameters ? trkParameters->momentum().phi() : 0.; @@ -252,19 +264,33 @@ void ActsGeantFollowerHelper::trackParticle(const G4ThreeVector& pos, m_treeData->m_acts_status[m_treeData->m_g4_steps] = actsParameters ? 1 : 0; m_treeData->m_acts_volumeID[m_treeData->m_g4_steps] = actsParameters ? volID : 0; - m_treeData->m_acts_p[m_treeData->m_g4_steps] = actsParameters ? actsParameters->transverseMomentum()*1000 : 0.; + m_treeData->m_acts_pt[m_treeData->m_g4_steps] = actsParameters ? actsParameters->transverseMomentum()*1000 : 0.; m_treeData->m_acts_eta[m_treeData->m_g4_steps] = actsParameters ? actsParameters->momentum().eta() : 0.; m_treeData->m_acts_theta[m_treeData->m_g4_steps] = actsParameters ? actsParameters->momentum().theta() : 0.; m_treeData->m_acts_phi[m_treeData->m_g4_steps] = actsParameters ? actsParameters->momentum().phi() : 0.; m_treeData->m_acts_x[m_treeData->m_g4_steps] = actsParameters ? actsParameters->position(gctx.context()).x() : 0.; m_treeData->m_acts_y[m_treeData->m_g4_steps] = actsParameters ? actsParameters->position(gctx.context()).y() : 0.; m_treeData->m_acts_z[m_treeData->m_g4_steps] = actsParameters ? actsParameters->position(gctx.context()).z() : 0.; - float tActs = (actsParameters->position(gctx.context()) - m_actsParameterCache->position(gctx.context())).norm(); - m_tX0CacheActs += X0Acts; - m_treeData->m_acts_tX0[m_treeData->m_g4_steps] = X0Acts; - m_treeData->m_acts_accX0[m_treeData->m_g4_steps] = m_tX0CacheActs; - m_treeData->m_acts_t[m_treeData->m_g4_steps] = tActs; - m_treeData->m_acts_X0[m_treeData->m_g4_steps] = tActs/X0Acts; + // Incremental extrapolation, the extrapolation correspond to one step + if(m_extrapolateIncrementally || m_treeData->m_g4_steps == 0){ + float tActs = (actsParameters->position(gctx.context()) - m_actsParameterCache->position(gctx.context())).norm(); + m_tX0CacheActs += X0Acts; + m_treeData->m_acts_tX0[m_treeData->m_g4_steps] = X0Acts; + m_treeData->m_acts_accX0[m_treeData->m_g4_steps] = m_tX0CacheActs; + m_treeData->m_acts_t[m_treeData->m_g4_steps] = tActs; + m_treeData->m_acts_X0[m_treeData->m_g4_steps] = tActs/X0Acts; + } + // Extrapolation perform from the start, step varaible need to be computed by comparing to the last extrapolation. + else{ + Acts::Vector3 previousPos(m_treeData->m_trk_x[m_treeData->m_g4_steps-1], + m_treeData->m_trk_y[m_treeData->m_g4_steps-1], + m_treeData->m_trk_z[m_treeData->m_g4_steps-1]); + float tActs = (actsParameters->position(gctx.context()) - previousPos).norm(); + m_treeData->m_acts_tX0[m_treeData->m_g4_steps] = X0Acts - m_treeData->m_acts_accX0[m_treeData->m_g4_steps-1] ; + m_treeData->m_acts_accX0[m_treeData->m_g4_steps] = X0Acts; + m_treeData->m_acts_t[m_treeData->m_g4_steps] = tActs; + m_treeData->m_acts_X0[m_treeData->m_g4_steps] = tActs/m_treeData->m_acts_tX0[m_treeData->m_g4_steps]; + } // update the parameters if needed/configured if (m_extrapolateIncrementally && trkParameters && actsParameters) { diff --git a/Tracking/Acts/ActsGeometry/src/ActsMaterialStepConverterTool.cxx b/Tracking/Acts/ActsGeometry/src/ActsMaterialStepConverterTool.cxx index 450b48e044ae0397a14aa824a7949e28c9de6c1b..9cc31f13117b65f7c6e8c58908d504078a1e02b8 100644 --- a/Tracking/Acts/ActsGeometry/src/ActsMaterialStepConverterTool.cxx +++ b/Tracking/Acts/ActsGeometry/src/ActsMaterialStepConverterTool.cxx @@ -63,7 +63,7 @@ ActsMaterialStepConverterTool::convertToMaterialTrack(const Trk::MaterialStepCol Acts::MaterialInteraction interaction; Acts::Vector3 pos{step->hitX(), step->hitY(), step->hitZ()}; - Acts::MaterialSlab matProp(Acts::Material::fromMassDensity(step->x0(), step->l0(), step->A(), step->Z(), step->rho()),step->steplength()); + Acts::MaterialSlab matProp(Acts::Material::fromMassDensity(step->x0(), step->l0(), step->A(), step->Z(), (step->rho() * Acts::UnitConstants::g) ),step->steplength()); interaction.position = pos; double x_dir = pos.x() - prev_pos.x(); diff --git a/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsExtrapolationTool.h b/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsExtrapolationTool.h index e456f739f97ebe85ab564fe141d5712e1647e5cb..050eaee47e0b798eaeeb3428ad65d8f59219f395 100644 --- a/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsExtrapolationTool.h +++ b/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsExtrapolationTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef ACTSGEOMETRYINTERFACES_IACTSEXTRAPOLATIONTOOL_H @@ -9,6 +9,8 @@ #include "GaudiKernel/IInterface.h" #include "GaudiKernel/IAlgTool.h" #include "GaudiKernel/EventContext.h" +#include "TrkEventPrimitives/ParticleHypothesis.h" + #include "ActsGeometry/ActsGeometryContext.h" #include "Acts/MagneticField/MagneticFieldContext.hpp" @@ -36,14 +38,16 @@ class IActsExtrapolationTool : virtual public IAlgTool { propagationSteps(const EventContext& ctx, const Acts::BoundTrackParameters& startParameters, Acts::NavigationDirection navDir = Acts::forward, - double pathLimit = std::numeric_limits<double>::max()) const = 0; + double pathLimit = std::numeric_limits<double>::max(), + Trk::ParticleHypothesis particleHypo = Trk::pion) const = 0; virtual std::unique_ptr<const Acts::CurvilinearTrackParameters> propagate(const EventContext& ctx, const Acts::BoundTrackParameters& startParameters, Acts::NavigationDirection navDir = Acts::forward, - double pathLimit = std::numeric_limits<double>::max()) const = 0; + double pathLimit = std::numeric_limits<double>::max(), + Trk::ParticleHypothesis particleHypo = Trk::pion) const = 0; virtual ActsPropagationOutput @@ -51,7 +55,8 @@ class IActsExtrapolationTool : virtual public IAlgTool { const Acts::BoundTrackParameters& startParameters, const Acts::Surface& target, Acts::NavigationDirection navDir = Acts::forward, - double pathLimit = std::numeric_limits<double>::max()) const = 0; + double pathLimit = std::numeric_limits<double>::max(), + Trk::ParticleHypothesis particleHypo = Trk::pion) const = 0; virtual std::unique_ptr<const Acts::BoundTrackParameters> @@ -59,7 +64,8 @@ class IActsExtrapolationTool : virtual public IAlgTool { const Acts::BoundTrackParameters& startParameters, const Acts::Surface& target, Acts::NavigationDirection navDir = Acts::forward, - double pathLimit = std::numeric_limits<double>::max()) const = 0; + double pathLimit = std::numeric_limits<double>::max(), + Trk::ParticleHypothesis particleHypo = Trk::pion) const = 0; virtual const IActsTrackingGeometryTool* diff --git a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx index 442784abce9bf32a56d8f126ed8e00682555f800..9e8bd09870f5092da45abf1a1804fbf027264d30 100644 --- a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx +++ b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx @@ -488,7 +488,7 @@ void Trk::TrkMaterialProviderTool::getCaloMEOT(const Trk::Track& idTrack, const if (!caloTSOS || caloTSOS->size() != 3) { - double idqOverP = fabs(idTrack.perigeeParameters()->parameters()[Trk::qOverP]); + double idqOverP = std::abs(idTrack.perigeeParameters()->parameters()[Trk::qOverP]); double msqOverP = msTrack.perigeeParameters() ? msTrack.perigeeParameters()->parameters()[Trk::qOverP] : (*firstMS)->trackParameters()->parameters()[Trk::qOverP] ; if ((!fieldCache.toroidOn() && idqOverP * 4000. < 1) || (fieldCache.toroidOn() && msqOverP != 1 / 100000. && msqOverP != 0)) @@ -526,7 +526,7 @@ void Trk::TrkMaterialProviderTool::getCaloMEOT(const Trk::Track& idTrack, const if (eloss) neweloss = new CaloEnergy(*eloss); else{ Trk::MaterialProperties matprop(meot->thicknessInX0(),1.,0.,0.,0.,0.); - double sigmascat = fabs(qoverp)>0.0 ? std::sqrt(m_scattool->sigmaSquare(matprop,std::abs(1./qoverp),1.,Trk::muon)) : 0.0; + double sigmascat = std::abs(qoverp)>0.0 ? std::sqrt(m_scattool->sigmaSquare(matprop,std::abs(1./qoverp),1.,Trk::muon)) : 0.0; newsa=new Trk::ScatteringAngles(0,0,sigmascat/sintheta,sigmascat); } Trk::MaterialEffectsOnTrack newmeot(meot->thicknessInX0(),newsa,neweloss,(*caloTSOS)[i]->trackParameters()->associatedSurface()); @@ -750,10 +750,10 @@ Trk::TrkMaterialProviderTool::getCaloTSOS (const Trk::TrackParameters& parm, } else { ATH_MSG_DEBUG(" volume " << this->getVolumeByGeo(m) << " Eloss from extrapolateM TG " << energyLoss->deltaE()); } - Eloss += fabs(energyLoss->deltaE()); - if(this->getVolumeByGeo(m)==1) ElossID += fabs(energyLoss->deltaE()); - if(this->getVolumeByGeo(m)==2) ElossCalo += fabs(energyLoss->deltaE()); - if(this->getVolumeByGeo(m)==3) ElossMS += fabs(energyLoss->deltaE()); + Eloss += std::abs(energyLoss->deltaE()); + if(this->getVolumeByGeo(m)==1) ElossID += std::abs(energyLoss->deltaE()); + if(this->getVolumeByGeo(m)==2) ElossCalo += std::abs(energyLoss->deltaE()); + if(this->getVolumeByGeo(m)==3) ElossMS += std::abs(energyLoss->deltaE()); } } } @@ -820,7 +820,7 @@ Trk::TrkMaterialProviderTool::getCaloTSOS (const Trk::TrackParameters& parm, // Note that for SA fit i'm taking the pAtCaloEntry from the perigee parameters double pAtCaloEntry = 0; if(dir == Trk::alongMomentum) { - double OneOverP = fabs(parm.parameters()[Trk::qOverP]); + double OneOverP = std::abs(parm.parameters()[Trk::qOverP]); if (OneOverP > 0.0) pAtCaloEntry = 1./OneOverP; else @@ -830,7 +830,7 @@ Trk::TrkMaterialProviderTool::getCaloTSOS (const Trk::TrackParameters& parm, if(!tsosAtCaloEntry) { ATH_MSG_WARNING( name() << " Unable to find Calorimeter Entry TSOS with TrackParameters! Momentum at Calo Entry not available!" ); }else{ - double OneOverP = fabs(tsosAtCaloEntry->trackParameters()->parameters()[Trk::qOverP]); + double OneOverP = std::abs(tsosAtCaloEntry->trackParameters()->parameters()[Trk::qOverP]); if (OneOverP > 0.0) pAtCaloEntry = 1./OneOverP; else @@ -853,9 +853,9 @@ Trk::TrkMaterialProviderTool::getCaloTSOS (const Trk::TrackParameters& parm, // Get momentum error in muon spectrometer double pAtMuonEntryError = 0.0; if(parms) { - if( fabs(parms->parameters()[Trk::qOverP]) > 0.0 ) { - double pAtMuonEntry = fabs(1./parms->parameters()[Trk::qOverP]); - if(!parms->covariance()) { + if( std::abs(parms->parameters()[Trk::qOverP]) > 0.0 ) { + double pAtMuonEntry = std::abs(1./parms->parameters()[Trk::qOverP]); + if(!parms->covariance() || !Amg::valid_cov(*parms->covariance())) { ATH_MSG_DEBUG("MS track parameters without covariance, using 10% relative error!" ); pAtMuonEntryError = pAtMuonEntry*0.1; }else{ @@ -1463,20 +1463,20 @@ Trk::TrkMaterialProviderTool::modifyTSOSvector(const std::vector<const Trk::Trac ATH_MSG_VERBOSE(" "); ATH_MSG_VERBOSE(" original TSOS type " << m->dumpType() << " TSOS surface " << m->trackParameters()->associatedSurface() << " position x " << m->trackParameters()->position().x() << " y " << m->trackParameters()->position().y() << " z " << m->trackParameters()->position().z() << " direction x " << m->trackParameters()->momentum().unit().x() << " y " << m->trackParameters()->momentum().unit().y() << " z " << m->trackParameters()->momentum().unit().z() << " p " << m->trackParameters()->momentum().mag() << " X0 " << X0 << " deltaE " << energyLoss->deltaE() << " meanIoni " << energyLoss->meanIoni() << " sigmaIoni " << energyLoss->sigmaIoni() << " sigma deltaTheta " << scat->sigmaDeltaTheta() << " depth " << depth << " dotprod " << dotprod ); - X0_tot += fabs(scaleX0*X0); + X0_tot += std::abs(scaleX0*X0); sigmaDeltaTheta2_tot += scaleX0*scat->sigmaDeltaTheta()*scat->sigmaDeltaTheta(); sigmaDeltaPhi2_tot += scaleX0*scat->sigmaDeltaPhi()*scat->sigmaDeltaPhi(); // Eloss sigma values add up linearly for Landau and exponential distributions - deltaE_tot += fabs(scaleEloss*energyLoss->deltaE()); - sigmaDeltaE_tot += fabs(scaleEloss*energyLoss->sigmaDeltaE()); - sigmaPlusDeltaE_tot += fabs(scaleEloss*energyLoss->sigmaPlusDeltaE()); - sigmaMinusDeltaE_tot += fabs(scaleEloss*energyLoss->sigmaMinusDeltaE()); - deltaE_ioni_tot += fabs(scaleEloss*energyLoss->meanIoni()); - sigmaDeltaE_ioni_tot += fabs(scaleEloss*energyLoss->sigmaIoni()); - deltaE_rad_tot += fabs(scaleEloss*energyLoss->meanRad()); - sigmaDeltaE_rad_tot += fabs(scaleEloss*energyLoss->sigmaRad()); + deltaE_tot += std::abs(scaleEloss*energyLoss->deltaE()); + sigmaDeltaE_tot += std::abs(scaleEloss*energyLoss->sigmaDeltaE()); + sigmaPlusDeltaE_tot += std::abs(scaleEloss*energyLoss->sigmaPlusDeltaE()); + sigmaMinusDeltaE_tot += std::abs(scaleEloss*energyLoss->sigmaMinusDeltaE()); + deltaE_ioni_tot += std::abs(scaleEloss*energyLoss->meanIoni()); + sigmaDeltaE_ioni_tot += std::abs(scaleEloss*energyLoss->sigmaIoni()); + deltaE_rad_tot += std::abs(scaleEloss*energyLoss->meanRad()); + sigmaDeltaE_rad_tot += std::abs(scaleEloss*energyLoss->sigmaRad()); depth_tot += depth; n_tot++; @@ -1505,7 +1505,7 @@ Trk::TrkMaterialProviderTool::modifyTSOSvector(const std::vector<const Trk::Trac //bool use_eweight = false; double w = scat->sigmaDeltaTheta()*scat->sigmaDeltaTheta(); // use_eweight s false, so the following never executes - //if(use_eweight) w = fabs(scaleEloss*energyLoss->deltaE()); + //if(use_eweight) w = std::abs(scaleEloss*energyLoss->deltaE()); w_tot += w; wpos += w*pos0/2.; wpos += w*posNew/2.; @@ -1548,7 +1548,7 @@ Trk::TrkMaterialProviderTool::modifyTSOSvector(const std::vector<const Trk::Trac } else if(!aggregate&&reposition) { - if(fabs(depth)<10.) { + if(std::abs(depth)<10.) { // Thin scatterer: make only one TSOS @@ -1606,7 +1606,7 @@ Trk::TrkMaterialProviderTool::modifyTSOSvector(const std::vector<const Trk::Trac const Trk::MaterialEffectsOnTrack* meotLast = new Trk::MaterialEffectsOnTrack(X0_tot/2., scatNew, caloEnergyNew, *surfLast, meotPattern); // calculate TrackParameters at first surface - double qOverP0 = m->trackParameters()->charge()/ (m->trackParameters()->momentum().mag()-fabs(energyLoss->deltaE())); + double qOverP0 = m->trackParameters()->charge()/ (m->trackParameters()->momentum().mag()-std::abs(energyLoss->deltaE())); if(mprevious) qOverP0 = mprevious->trackParameters()->charge()/mprevious->trackParameters()->momentum().mag(); std::unique_ptr<Trk::TrackParameters> parsFirst = @@ -1691,8 +1691,8 @@ Trk::TrkMaterialProviderTool::modifyTSOSvector(const std::vector<const Trk::Trac // Amg::Vector3D pos = wpos/w_tot; bool threePlanes = false; - //if(fabs(X0_tot)>50 && fabs(pos.z())<6700 && pos.perp()<4200) threePlanes = true; - if(fabs(pos.z())<6700 && pos.perp()<4200) threePlanes = true; // always 3 planes in calo + //if(std::abs(X0_tot)>50 && std::abs(pos.z())<6700 && pos.perp()<4200) threePlanes = true; + if(std::abs(pos.z())<6700 && pos.perp()<4200) threePlanes = true; // always 3 planes in calo // const Trk::ScatteringAngles* scatFirst = new ScatteringAngles(deltaPhi,deltaTheta,sqrt(sigmaDeltaPhi2_tot/2.),sqrt(sigmaDeltaTheta2_tot/2.)); const Trk::ScatteringAngles* scatNew = new ScatteringAngles(deltaPhi,deltaTheta,sqrt(sigmaDeltaPhi2_tot/2.),sqrt(sigmaDeltaTheta2_tot/2.)); @@ -1753,13 +1753,13 @@ Trk::TrkMaterialProviderTool::modifyTSOSvector(const std::vector<const Trk::Trac // force the planes to be inside the Calorimeter // double scaleCalo = 1.; - double scaleCaloNew = fabs(pos0.z())/6700; + double scaleCaloNew = std::abs(pos0.z())/6700; if(scaleCaloNew>scaleCalo) scaleCalo = scaleCaloNew; - scaleCaloNew = fabs(posNew.z())/6700; + scaleCaloNew = std::abs(posNew.z())/6700; if(scaleCaloNew>scaleCalo) scaleCalo = scaleCaloNew; - scaleCaloNew = fabs(pos0.perp())/4200; + scaleCaloNew = std::abs(pos0.perp())/4200; if(scaleCaloNew>scaleCalo) scaleCalo = scaleCaloNew; - scaleCaloNew = fabs(posNew.perp())/4200; + scaleCaloNew = std::abs(posNew.perp())/4200; if(scaleCaloNew>scaleCalo) scaleCalo = scaleCaloNew; if(scaleCalo>1.) { @@ -1779,7 +1779,7 @@ Trk::TrkMaterialProviderTool::modifyTSOSvector(const std::vector<const Trk::Trac Trk::PlaneSurface* surfFirst = new Trk::PlaneSurface( surfaceTransformFirst ); Trk::PlaneSurface* surfLast = new Trk::PlaneSurface( surfaceTransformLast ); // calculate TrackParameters at first surface - double qOverP0 = mfirst->trackParameters()->charge()/(mfirst->trackParameters()->momentum().mag()+fabs(deltaEFirst)); + double qOverP0 = mfirst->trackParameters()->charge()/(mfirst->trackParameters()->momentum().mag()+std::abs(deltaEFirst)); // calculate TrackParameters at last surface double qOverPNew = mlast->trackParameters()->charge()/mlast->trackParameters()->momentum().mag(); std::unique_ptr<Trk::TrackParameters> parsFirst = @@ -1964,14 +1964,14 @@ void Trk::TrkMaterialProviderTool::getMopAndIoniEnergyLoss(const std::vector<con ATH_MSG_WARNING("No materialEffectsOnTrack on TrackStateOnSurface "); continue; } - deltaE_tot += fabs(scaleEloss*energyLoss->deltaE()); - sigmaDeltaE_tot += fabs(scaleEloss*energyLoss->sigmaDeltaE()); - sigmaPlusDeltaE_tot += fabs(scaleEloss*energyLoss->sigmaPlusDeltaE()); - sigmaMinusDeltaE_tot += fabs(scaleEloss*energyLoss->sigmaMinusDeltaE()); - deltaE_ioni_tot += fabs(scaleEloss*energyLoss->meanIoni()); - sigmaDeltaE_ioni_tot += fabs(scaleEloss*energyLoss->sigmaIoni()); - deltaE_rad_tot += fabs(scaleEloss*energyLoss->meanRad()); - sigmaDeltaE_rad_tot += fabs(scaleEloss*energyLoss->sigmaRad()); + deltaE_tot += std::abs(scaleEloss*energyLoss->deltaE()); + sigmaDeltaE_tot += std::abs(scaleEloss*energyLoss->sigmaDeltaE()); + sigmaPlusDeltaE_tot += std::abs(scaleEloss*energyLoss->sigmaPlusDeltaE()); + sigmaMinusDeltaE_tot += std::abs(scaleEloss*energyLoss->sigmaMinusDeltaE()); + deltaE_ioni_tot += std::abs(scaleEloss*energyLoss->meanIoni()); + sigmaDeltaE_ioni_tot += std::abs(scaleEloss*energyLoss->sigmaIoni()); + deltaE_rad_tot += std::abs(scaleEloss*energyLoss->meanRad()); + sigmaDeltaE_rad_tot += std::abs(scaleEloss*energyLoss->sigmaRad()); ATH_MSG_DEBUG(" position x " << m->trackParameters()->position().x() << " y " << m->trackParameters()->position().y() << " perp " << m->trackParameters()->position().perp() << " z " << m->trackParameters()->position().z() ); ATH_MSG_DEBUG(" deltaE " << (scaleEloss*energyLoss->deltaE()) << " deltaE_ioni " << (scaleEloss*energyLoss->meanIoni()) << " sigmaDeltaE_ioni " << (scaleEloss*energyLoss->sigmaIoni())); @@ -2068,7 +2068,7 @@ double Trk::TrkMaterialProviderTool::getFinalMeasuredEnergy(Rec::CaloMeas* caloM // Correction for forward calorimetry double ForwardHECCorrection = 0.; - if (fabs(eta)>2. && caloMeas->LArHEC_EnergyMeasured()>100.) + if (std::abs(eta)>2. && caloMeas->LArHEC_EnergyMeasured()>100.) ForwardHECCorrection = (1. - LArHECMeasurementMaterial) * HECMaterial * MopLossCorrected; const double LArHECEnergy = caloMeas->LArHEC_EnergyMeasured() + ForwardHECCorrection; // Measured energy deposition in LArHEC @@ -2085,10 +2085,10 @@ double Trk::TrkMaterialProviderTool::getFinalMeasuredEnergy(Rec::CaloMeas* caloM bool bEM = false; // performed Em measurement? // If muon isolated, and no significant measurement is made then use the mop parameterization, else the mean - if (fabs(eta)<1.4) { + if (std::abs(eta)<1.4) { if (LArHECEnergy + TileEnergy > 0.1 * MopLoss * HECMaterial) bHEC= true; } - else if (fabs(eta)>1.8) { + else if (std::abs(eta)>1.8) { if (LArHECEnergy + TileEnergy > 0.2 * MopLoss * HECMaterial) bHEC= true; }else{ if (LArHECEnergy + TileEnergy > 0.25 * MopLoss * HECMaterial) bHEC= true; @@ -2135,7 +2135,7 @@ double Trk::TrkMaterialProviderTool::getFinalMeasuredEnergy(Rec::CaloMeas* caloM // -0.317111 , -0.428393 , -0.524839 , -0.599547 , -0.464013 , // -0.159663 , -0.140879 , -0.0975618, 0.0225352, 0.0701925, // -0.24778 }; - // int ieta = static_cast<int> (fabs(eta)/0.10); + // int ieta = static_cast<int> (std::abs(eta)/0.10); // if (ieta > 25) ieta = 25; double FinalMeasuredEnergy = MeasCorrected + eOverMipCorrection;// + (fix1FromPeter[ieta] + fix2FromPeter[ieta])*CLHEP::GeV; diff --git a/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py b/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py index 575869128c56ba790050687f85473ce68c945a01..c7619266e06fa2426052aed624a50d1f6ea12dfe 100644 --- a/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py +++ b/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauAlgorithmsHolder.py @@ -891,44 +891,6 @@ def getTauCellCorrection(): cached_instances[_name] = TauCellCorrectionTool return TauCellCorrectionTool -######################################################################### -# CaloNoiseTool -def getCaloNoiseTool(): - _name = 'CaloNoiseTool' - - if _name in cached_instances: - return cached_instances[_name] - - from CaloTools.CaloNoiseToolDefault import CaloNoiseToolDefault - theCaloNoiseTool = CaloNoiseToolDefault() - - from AthenaCommon.AppMgr import ToolSvc - ToolSvc += theCaloNoiseTool - - cached_instances[_name] = theCaloNoiseTool - return theCaloNoiseTool - -######################################################################### -# tau1p3p track match cells -def getTauEflowTrackMatchCells(): - _name = sPrefix + 'EflowTrackMatchCells' - - if _name in cached_instances: - return cached_instances[_name] - - from tauRec.tauRecConf import TauEflowTrackMatchCells - TauEflowTrackMatchCells = TauEflowTrackMatchCells(name = _name, - detRIsolCaloCut = 0.4, - useNoiseSigma = 1, - AbsNoiseSigma_cut = 2, - CaloNoiseTool = getCaloNoiseTool(), - selectConeSize = 0.45, #not used anymore - CellCorrection = True, - OriginCorrectionTool = getTauCellCorrection()) - - cached_instances[_name] = TauEflowTrackMatchCells - return TauEflowTrackMatchCells - ######################################################################### # tau1p3p AddCaloInfo def getTauEflowAddCaloInfo(): @@ -1003,35 +965,6 @@ def getPi0CreatorChooser(): cached_instances[_name] = TauPi0CreatorChooser return TauPi0CreatorChooser -######################################################################### -# Crakow Pi0/eflow algorithm -# Cluster/Cellfinder for Pi0/Eflow algos -def getPi0EflowCreateROI(): - _name = sPrefix + 'TauPi0EflowCreateROI' - - if _name in cached_instances: - return cached_instances[_name] - - from tauRec.tauRecConf import TauPi0EflowCreateROI - TauPi0EflowCreateROI = TauPi0EflowCreateROI( name = _name, - detRIsolCaloCut = 0.4, - detRCoreCaloCut = 0.2, - useNoiseSigma = 0, - AbsNoiseSigma_cut = 2, - removeChrgEM01 = 1, - removeChrgEM2 = 1, - detRChrgEMCut = 0.0375, - # Added by SL - fillCellContainer = TRUE, - CellsOutputContainerName = "TauCells", - CaloNoiseTool = getCaloNoiseTool(), - CaloCellMakerToolNames = ["CaloCellContainerFinalizerTool/cellfinalizerForTaus","CaloCellContainerCheckerTool/cellcheckForTaus"], - CellCorrection = True, - OriginCorrectionTool = getTauCellCorrection()) - - cached_instances[_name] = TauPi0EflowCreateROI - return TauPi0EflowCreateROI - ################ # Pi0 Clustering def getCrakowPi0ClusterCreator(): diff --git a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigSPTRKMonitoringMT.py b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigSPTRKMonitoringMT.py index 0132da1640ec8f8afd242002ffcbc2b3196429a2..56229d6fda9724486ac4a03c0b5152265442350a 100644 --- a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigSPTRKMonitoringMT.py +++ b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigSPTRKMonitoringMT.py @@ -11,11 +11,11 @@ def TrigSPTRK(configFlags): from AthenaMonitoring import AthMonitorCfgHelper - monConfig = AthMonitorCfgHelper(configFlags, "HLTMinBiasTrkMonAlg") + monConfig = AthMonitorCfgHelper(configFlags, "HLTMBSPTRKMonAlg") from AthenaConfiguration.ComponentFactory import CompFactory - alg = monConfig.addAlgorithm(CompFactory.HLTMinBiasTrkMonAlg, "HLTMinBiasTrkMonAlg") + alg = monConfig.addAlgorithm(CompFactory.HLTMinBiasTrkMonAlg, "HLTMBSPTRKMonAlg") trkSel = CompFactory.InDet.InDetTrackSelectionTool( "InDetTrackSelectionTool_TightPrimary", CutLevel="TightPrimary" ) @@ -26,191 +26,46 @@ def TrigSPTRK(configFlags): mbEffAllGroup = monConfig.addGroup(alg, "EffAll", topPath="HLT/MinBiasMon/") length = len(alg.triggerList) - mbEffAllGroup.defineHistogram( - "PurityPassed,whichTrigger", - type="TH2D", - title=";Purity;trigger passed", - xbins=2, - xmin=0, - xmax=2, - xlabels=["0 track", ">0 tracks"], - ybins=length, - ymin=0, - ymax=length, - ylabels=list(alg.triggerList), - ) - mbEffAllGroup.defineHistogram( - "whichTrigger", - title="count of triggers;HLT", - xbins=length, - xmin=0, - xmax=length, - xlabels=list(alg.triggerList), - ) + mbEffAllGroup.defineHistogram( "PurityPassed,whichTrigger", type="TH2D", title=";Purity;trigger passed", xbins=2, xmin=0, xmax=2, xlabels=["0 track", ">0 tracks"], + ybins=length, ymin=0, ymax=length, ylabels=list(alg.triggerList) ) + mbEffAllGroup.defineHistogram( "whichTrigger", title="count of triggers;HLT", xbins=length, xmin=0, xmax=length, xlabels=list(alg.triggerList) ) for chain in alg.triggerList: mbEffGroup = monConfig.addGroup( alg, chain + "_Tracking", topPath="HLT/MinBiasMon/Tracking/" + chain + "/" ) - mbEffGroup.defineHistogram( - "decision,nTrkOffline", - type="TEfficiency", - title="Efficiency;Offline Good nTrk", - xbins=100, - xmin=0, - xmax=1000, - ) - mbEffGroup.defineHistogram( - "decision,nTrkOffline;efficiency_low_mult", - type="TEfficiency", - title="Efficiency;Offline Good nTrk", - xbins=50, - xmin=0, - xmax=50, - ) - mbEffGroup.defineHistogram( - "nTrkRatio", - title="Number of tracks reconstructed online/offline;track counts online/offline", - xbins=100, - xmin=-1, - xmax=4, - ) - mbEffGroup.defineHistogram( - "decision,nTrk", - type="TEfficiency", - title="Efficiency (step curve);Online nTrk", - xbins=1000, - xmin=0, - xmax=1000, - ) - # expert plots - mbEffGroup.defineHistogram( - "trkSelOfflineRatio", - path="Expert", - title="Number of tracks reconstructed offline(selected)/offline; N sel/all", - xbins=100, - xmin=-1, - xmax=4, - ) - mbEffGroup.defineHistogram( - "nTrkOnline,nTrkOffline", - type="TH2F", - path="Expert", - title=";N online tracks;N oflfine tracks", - xbins=20, - xmin=0, - xmax=2000, - ybins=20, - ymin=0, - ymax=2000, - ) + + mbEffGroup.defineHistogram( "decision,nTrkOffline;efficiencyAnyMult", type="TEfficiency", title="Efficiency;Offline Good nTrk", xbins=100, xmin=0, xmax=400 ) + mbEffGroup.defineHistogram( "decision,nTrkOffline;efficiencyLowMult", type="TEfficiency", title="Efficiency;Offline Good nTrk", xbins=50, xmin=0, xmax=50 ) + mbEffGroup.defineHistogram( "nTrkOffline;nTrkOfflineLowMult", title="Number of tracks reconstructed offline;track counts", xbins=50, xmin=-1, xmax=50 ) + + mbEffGroup.defineHistogram( "nTrkOffline", title="Number of tracks reconstructed offline;track counts", xbins=100, xmin=-1, xmax=400 ) + mbEffGroup.defineHistogram( "nTrkOnline;nTrkOnlineLowMult", title="Number of tracks reconstructed online;track counts", xbins=50, xmin=-1, xmax=50 ) + mbEffGroup.defineHistogram( "nTrkOnline", title="Number of tracks reconstructed online;track counts", xbins=100, xmin=-1, xmax=400 ) + mbEffGroup.defineHistogram( "nTrkRatio", title="Number of tracks reconstructed online/offline;track counts online/offline", xbins=100, xmin=-1, xmax=4 ) + mbEffGroup.defineHistogram( "decision,nTrkOnline", type="TEfficiency", title="Efficiency (step curve);Online nTrk", xbins=1000, xmin=0, xmax=1000 ) # expert plots + mbEffGroup.defineHistogram( "trkSelOfflineRatio", path="Expert", title="Number of tracks reconstructed offline(selected)/offline; N sel/all", xbins=100, xmin=0.1, xmax=1.9 ) + mbEffGroup.defineHistogram( "nTrkOnline,nTrkOffline", type="TH2F", path="Expert", title=";N online tracks;N offline tracks", xbins=20, xmin=0, xmax=400, ybins=20, ymin=0, ymax=400 ) mbSpGroup = monConfig.addGroup( alg, chain + "_SpacePoints", - topPath="HLT/MinBiasMon/SPacePoints/" + chain + "/", - ) - mbSpGroup.defineHistogram( - "PixelCL;PixelCLNarrowRange", - title="Number of SP in whole Pixels detector for all events", - xbins=100, - xmin=0, - xmax=100, - ) - mbSpGroup.defineHistogram( - "PixelCL;PixelCLWideRange", - title="Number of SP in whole Pixels detector for all events", - xbins=100, - xmin=0, - xmax=30000, - ) - mbSpGroup.defineHistogram( - "PixBarr_SP", - title="Number of SP for all events in Barrel", - xbins=100, - xmin=0, - xmax=30000, - ) - mbSpGroup.defineHistogram( - "PixECA_SP", - title="Number of SP for all events in ECA", - xbins=100, - xmin=0, - xmax=30000, - ) - mbSpGroup.defineHistogram( - "PixECC_SP", - title="Number of SP for all events in ECC", - xbins=100, - xmin=0, - xmax=30000, - ) - mbSpGroup.defineHistogram( - "SctTot", - title="Number of SP in whole SCT detector for all events", - xbins=100, - xmin=0, - xmax=120000, - ) - mbSpGroup.defineHistogram( - "SctBarr_SP", - title="Number of SCT_SP for all events in Barrel", - xbins=100, - xmin=0, - xmax=50000, - ) - mbSpGroup.defineHistogram( - "SctECA_SP", - title="Number of SCT_SP for all events in ECA", - xbins=100, - xmin=0, - xmax=50000, - ) - mbSpGroup.defineHistogram( - "SctECC_SP", - title="Number of SCT_SP for all events in ECC", - xbins=100, - xmin=0, - xmax=50000, - ) + topPath="HLT/MinBiasMon/SpacePoints/" + chain + "/", + ) + mbSpGroup.defineHistogram( "PixelCL;PixelCLNarrowRange", title="Number of SP in whole Pixels detector for all events", xbins=100, xmin=0, xmax=100 ) + mbSpGroup.defineHistogram( "PixelCL;PixelCLWideRange", title="Number of SP in whole Pixels detector for all events", xbins=100, xmin=0, xmax=30000 ) + mbSpGroup.defineHistogram( "PixBarr_SP", title="Number of SP for all events in Barrel", xbins=100, xmin=0, xmax=30000 ) + mbSpGroup.defineHistogram( "PixECA_SP", title="Number of SP for all events in ECA", xbins=100, xmin=0, xmax=30000 ) + mbSpGroup.defineHistogram( "PixECC_SP", title="Number of SP for all events in ECC", xbins=100, xmin=0, xmax=30000 ) + mbSpGroup.defineHistogram( "SctTot", title="Number of SP in whole SCT detector for all events", xbins=100, xmin=0, xmax=120000 ) + mbSpGroup.defineHistogram( "SctBarr_SP", title="Number of SCT_SP for all events in Barrel", xbins=100, xmin=0, xmax=50000 ) + mbSpGroup.defineHistogram( "SctECA_SP", title="Number of SCT_SP for all events in ECA", xbins=100, xmin=0, xmax=50000 ) + mbSpGroup.defineHistogram( "SctECC_SP", title="Number of SCT_SP for all events in ECC", xbins=100, xmin=0, xmax=50000 ) # expert plots - mbSpGroup.defineHistogram( - "SctECA_SP,SctECC_SP", - type="TH2F", - path="Expert", - title="SctECA_SP;SctECC_SP", - xbins=100, - xmin=0, - xmax=100, - ybins=100, - ymin=0, - ymax=100, - ) - mbSpGroup.defineHistogram( - "PixECA_SP,PixECC_SP", - type="TH2F", - path="Expert", - title="PixECA_SP;PixECC_SP", - xbins=100, - xmin=0, - xmax=100, - ybins=100, - ymin=0, - ymax=100, - ) - mbSpGroup.defineHistogram( - "SctBarr_SP,PixBarr_SP", - type="TH2F", - path="Expert", - title="SctBarr_SP;PixBarr_SP", - xbins=100, - xmin=0, - xmax=100, - ybins=100, - ymin=0, - ymax=100, - ) + mbSpGroup.defineHistogram( "SctECA_SP,SctECC_SP", type="TH2F", title="SctECA_SP;SctECC_SP", xbins=100, xmin=0, xmax=100, ybins=100, ymin=0, ymax=100 ) + mbSpGroup.defineHistogram( "PixECA_SP,PixECC_SP", type="TH2F", title="PixECA_SP;PixECC_SP", xbins=100, xmin=0, xmax=100, ybins=100, ymin=0, ymax=100 ) + mbSpGroup.defineHistogram( "SctBarr_SP,PixBarr_SP", type="TH2F", title="SctBarr_SP;PixBarr_SP", xbins=100, xmin=0, xmax=100, ybins=100, ymin=0, ymax=100 ) return monConfig.result() @@ -221,8 +76,6 @@ if __name__ == "__main__": Configurable.configurableRun3Behavior = 1 - # Setup logs - from AthenaCommon.Constants import DEBUG # Set the Athena configuration flags from AthenaConfiguration.AllConfigFlags import ConfigFlags @@ -232,9 +85,7 @@ if __name__ == "__main__": # ConfigFlags.Input.Files = ['/afs/cern.ch/user/s/somadutt/public/testUPC2.AOD.pool.root'] #Local HI-UPC file # data AOD file - - # ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/data-art/build-output/master/Athena/x86_64-centos7-gcc8-opt/2020-05-22T2142/TrigAnalysisTest/test_trigAna_RDOtoT0Mon_mt1_build/AOD.pool.root'] - ConfigFlags.Input.Files = ["myAOD.pool.root"] +# ConfigFlags.Input.Files = ["myAOD.pool.root"] # ConfigFlags.Input.isMC = True #un-Comment this line for MC AOD files, comment for data-AOD files ConfigFlags.Output.HISTFileName = "TestMonitorOutput.root" @@ -250,8 +101,8 @@ if __name__ == "__main__": cfg.merge(TrigSPTRK(ConfigFlags)) # If you want to turn on more detailed messages ... - # cfg.getEventAlgo('HLTMinBiasTrkMonAlg').OutputLevel = 2 # DEBUG #either this line or the next works!! - cfg.getEventAlgo("HLTMinBiasTrkMonAlg").OutputLevel = DEBUG # DEBUG + from AthenaCommon.Constants import DEBUG + cfg.getEventAlgo("HLTMBSPTRKMonAlg").OutputLevel = DEBUG cfg.printConfig(withDetails=True) # set True for exhaustive info with open("cfg.pkl", "wb") as f: cfg.store(f) diff --git a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasTrkMonAlg.cxx b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasTrkMonAlg.cxx index d378bda3d199e716e03df265aa5fea51adb24c47..5c0d26ebbea5a102179a491aa292a50fdb6f34e2 100644 --- a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasTrkMonAlg.cxx +++ b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasTrkMonAlg.cxx @@ -131,12 +131,12 @@ StatusCode HLTMinBiasTrkMonAlg::monitorTrkCounts(const EventContext &context) co if ( ! (passBits & TrigDefs::EF_prescaled) ) { auto decision = Scalar<int>("decision", trigDecTool->isPassed(trig, TrigDefs::requireDecision) ? 1 : 0); - auto nTrk = Scalar("nTrkOnline", trkCountsHandle->at(0)->getDetail<int>("ntrks")); + auto nTrkOnline = Scalar("nTrkOnline", trkCountsHandle->at(0)->getDetail<int>("ntrks")); auto whichtrigger = Scalar<std::string>("whichTrigger", trig); double nTrkRatio = offlineTrkHandle->size() > 0 ? static_cast<double>(offlineTrkHandle->size()) / static_cast<double>(trkCountsHandle->at(0)->getDetail<int>("ntrks")) : -1.0; auto trkRatio = Scalar("nTrkRatio", nTrkRatio); - fill(trig + "_Tracking", nTrkOffline, nAllTrkOffline, decision, whichtrigger, trkRatio, nMBTrkTrkOfflineRatio); + fill(trig + "_Tracking", nTrkOffline, nAllTrkOffline, nTrkOnline, decision, whichtrigger, trkRatio, nMBTrkTrkOfflineRatio); fill("EffAll", decision, whichtrigger); } diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitCategory.py b/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitCategory.py index 607538445c4935ec5aed9ec833041e67a240fa97..1db745a39111dd6cbdc7d698f0335ec184fed513 100644 --- a/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitCategory.py +++ b/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitCategory.py @@ -5,8 +5,8 @@ monitoring_singleTau = [ ] monitoring_tau = [ - 'tau0_perf_ptonly_L1TAU12', - 'tau0_perf_ptonly_L1TAU60', + 'tau0_ptonly_L1TAU8', + 'tau0_ptonly_L1TAU60', 'tau25_idperf_track', 'tau25_idperf_tracktwo', 'tau25_perf_tracktwo', diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfig.py b/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfig.py index 261714ee6722bef36950cd3f904a392cbeb14920..3173ee194ca4785349a038d5f0b5f263e26e3431 100644 --- a/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfig.py +++ b/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfig.py @@ -52,8 +52,6 @@ def TrigTauMonitoringTool(): 'tau25_mediumRNN_tracktwoMVABDT_L1TAU12IM', 'tau25_tightRNN_tracktwoMVA_L1TAU12IM', 'tau25_tightRNN_tracktwoMVABDT_L1TAU12IM', - 'tau25_medium1_tracktwoMVA_L1TAU12IM', - 'tau25_medium1_tracktwoMVABDT_L1TAU12IM', 'tau35_idperf_tracktwoMVA_L1TAU12IM', 'tau35_idperf_tracktwoMVABDT_L1TAU12IM', 'tau35_perf_tracktwoMVA_L1TAU12IM', @@ -70,8 +68,6 @@ def TrigTauMonitoringTool(): 'tau160_perf_tracktwoMVABDT_L1TAU100', 'tau160_mediumRNN_tracktwoMVA_L1TAU100', 'tau160_mediumRNN_tracktwoMVABDT_L1TAU100', - 'tau160_medium1_tracktwoMVA_L1TAU100', - 'tau160_medium1_tracktwoMVABDT_L1TAU100', ] RNN_chains = [ @@ -94,8 +90,8 @@ def TrigTauMonitoringTool(): BDTRNN_chains = [ 'tau0_idperf_tracktwoMVA_L1eTAU12', 'tau0_idperf_tracktwoMVA_L1eTAU5', - 'tau0_perf_ptonly_L1TAU12', - 'tau0_perf_ptonly_L1TAU60', + 'tau0_ptonly_L1TAU8', + 'tau0_ptonly_L1TAU60', 'tau25_ptonly_L1TAU12IM', 'tau25_idperf_track_L1TAU12IM', 'tau25_idperf_tracktwo_L1TAU12IM', diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool.cxx b/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool.cxx index 86d609a8e073911d1c7d27d937ddce9661532147..0e68f3a2cc096507a2ce54eb888527c679f46523 100644 --- a/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool.cxx +++ b/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool.cxx @@ -1003,8 +1003,25 @@ StatusCode HLTTauMonTool::fillHistogramsForItem(const std::string & trigItem, co ATH_CHECK(fillPreselTau(*tauJetEL)); setCurrentMonGroup("HLT/TauMon/Expert/"+trigItemShort+"/PrecisionVsOffline"); ATH_CHECK(fillPreselTauVsOffline(*tauJetEL,goodTauRefType)); + + if(*tauJetEL) sc = fillEFTau(*tauJetEL, trigItem, "basicVars", monRNN, monBDT); + if (monBDT) { + if(*tauJetEL) sc = fillEFTau(*tauJetEL, trigItem, "1p_NonCorr", monRNN, monBDT); + if(*tauJetEL) sc = fillEFTau(*tauJetEL, trigItem, "mp_NonCorr", monRNN, monBDT); + } + if(!sc.isSuccess()){ ATH_MSG_WARNING("Failed to Fill BDT input histograms for fillEFTau(). Exiting!"); return sc;} + + if(m_truth) if(*tauJetEL) sc = fillEFTauVsTruth(*tauJetEL, trigItem); + if(*tauJetEL) sc = fillEFTauVsOffline(*tauJetEL, trigItem, "basicVars", goodTauRefType); + if (monBDT) { + if(*tauJetEL) sc = fillEFTauVsOffline(*tauJetEL, trigItem, "1p_NonCorr", goodTauRefType); + if(*tauJetEL) sc = fillEFTauVsOffline(*tauJetEL, trigItem, "mp_NonCorr", goodTauRefType); + } + if(!sc.isSuccess()){ ATH_MSG_WARNING("Failed to Fill histograms for fillEFTauVsOffline(). Exiting!"); return sc;} + } // end comb loop + const std::vector< TrigCompositeUtils::LinkInfo<xAOD::TauJetContainer> > featuresMerged = getTDT()->features<xAOD::TauJetContainer>( trig_item_EF, m_HLTTriggerCondition, "HLT_TrigTauRecMerged_MVA"); @@ -1020,12 +1037,13 @@ StatusCode HLTTauMonTool::fillHistogramsForItem(const std::string & trigItem, co } const ElementLink<xAOD::TauJetContainer> tauJetEL = tauJetLinkInfo.link; if(!Selection(*tauJetEL)) continue; + + setCurrentMonGroup("HLT/TauMon/Expert/"+trigItemShort+"/PrecisionTau"); + ATH_CHECK(fillPreselTau(*tauJetEL)); + setCurrentMonGroup("HLT/TauMon/Expert/"+trigItemShort+"/PrecisionVsOffline"); + ATH_CHECK(fillPreselTauVsOffline(*tauJetEL,goodTauRefType)); + if(*tauJetEL) sc = fillEFTau(*tauJetEL, trigItem, "basicVars", monRNN, monBDT); - if (monBDT) { - if(*tauJetEL) sc = fillEFTau(*tauJetEL, trigItem, "1p_NonCorr", monRNN, monBDT); - if(*tauJetEL) sc = fillEFTau(*tauJetEL, trigItem, "mp_NonCorr", monRNN, monBDT); - } - if(!sc.isSuccess()){ ATH_MSG_WARNING("Failed to Fill BDT input histograms for fillEFTau(). Exiting!"); return sc;} if(monRNN) { if(*tauJetEL) sc = fillEFTau(*tauJetEL, trigItem, "RNN_inScalar_1P", monRNN, monBDT); if(*tauJetEL) sc = fillEFTau(*tauJetEL, trigItem, "RNN_inScalar_3P", monRNN, monBDT); @@ -1036,10 +1054,6 @@ StatusCode HLTTauMonTool::fillHistogramsForItem(const std::string & trigItem, co } if(m_truth) if(*tauJetEL) sc = fillEFTauVsTruth(*tauJetEL, trigItem); if(*tauJetEL) sc = fillEFTauVsOffline(*tauJetEL, trigItem, "basicVars", goodTauRefType); - if (monBDT) { - if(*tauJetEL) sc = fillEFTauVsOffline(*tauJetEL, trigItem, "1p_NonCorr", goodTauRefType); - if(*tauJetEL) sc = fillEFTauVsOffline(*tauJetEL, trigItem, "mp_NonCorr", goodTauRefType); - } if(!sc.isSuccess()){ ATH_MSG_WARNING("Failed to Fill histograms for fillEFTauVsOffline(). Exiting!"); return sc;} } // end comb loop diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool_bookHistograms.cxx b/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool_bookHistograms.cxx index c909317ce337771642728399318579cfbebb30de..b4ce756e433d6bf4582437eb1f075c0e313092ca 100644 --- a/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool_bookHistograms.cxx +++ b/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool_bookHistograms.cxx @@ -105,23 +105,21 @@ void HLTTauMonTool::bookHistogramsForItem(const std::string & trigItem){ // Precision Tau //-------------------- - if(trigItem.find("tracktwoMVA")==string::npos && trigItem.find("tracktwoEF")==string::npos) { - addMonGroup(new MonGroup(this,"HLT/TauMon/Expert/"+trigItemShort+"/PrecisionTau",run)); - setCurrentMonGroup("HLT/TauMon/Expert/"+trigItemShort+"/PrecisionTau"); - addHistogram(new TH1F("hEFEt","EF Et;E_{T}[GeV];Nevents",40,0.0,100.0)); - addHistogram(new TH1F("hEFEt2","EF Et;E_{T}[GeV];Nevents",100,0.0,1000.0)); - addHistogram(new TH1F("hFTFnTrack","EF number of tracks;number of tracks;Nevents",10,0,10)); - addHistogram(new TH1F("hEta","EF TrigCaloCluster Eta; #eta ; Nevents",26,-2.6,2.6)); - addHistogram(new TH1F("hPhi","EF TrigCaloCluster Phi; #phi ; Nevents",32,-3.2,3.2)); - addHistogram(new TH2F("hEFEtaVsPhi","EF TrigCaloCluster Eta vs Phi; #eta ; #phi ; Nevents", + addMonGroup(new MonGroup(this,"HLT/TauMon/Expert/"+trigItemShort+"/PrecisionTau",run)); + setCurrentMonGroup("HLT/TauMon/Expert/"+trigItemShort+"/PrecisionTau"); + addHistogram(new TH1F("hEFEt","EF Et;E_{T}[GeV];Nevents",40,0.0,100.0)); + addHistogram(new TH1F("hEFEt2","EF Et;E_{T}[GeV];Nevents",100,0.0,1000.0)); + addHistogram(new TH1F("hFTFnTrack","EF number of tracks;number of tracks;Nevents",10,0,10)); + addHistogram(new TH1F("hEta","EF TrigCaloCluster Eta; #eta ; Nevents",26,-2.6,2.6)); + addHistogram(new TH1F("hPhi","EF TrigCaloCluster Phi; #phi ; Nevents",32,-3.2,3.2)); + addHistogram(new TH2F("hEFEtaVsPhi","EF TrigCaloCluster Eta vs Phi; #eta ; #phi ; Nevents", 26,-2.6,2.6,32,-3.2,3.2)); - addHistogram(new TH2F("hEtVsEta","Et from tau Jet vs #eta; #eta^{EF}; Raw E_{T}[GeV]", + addHistogram(new TH2F("hEtVsEta","Et from tau Jet vs #eta; #eta^{EF}; Raw E_{T}[GeV]", 26,-2.6,2.6,40,0.0,100.0)); - addHistogram(new TH2F("hEtVsPhi","Et from tau Jet vs #phi; #phi^{EF}; Raw E_{T} [GeV]", + addHistogram(new TH2F("hEtVsPhi","Et from tau Jet vs #phi; #phi^{EF}; Raw E_{T} [GeV]", 32,-3.2,3.2,40,0.0,100.0)); - addHistogram(new TH1F("hFTFnWideTrack","EF number of wide tracks;number of tracks;Nevents",10,0,10)); - } - + addHistogram(new TH1F("hFTFnWideTrack","EF number of wide tracks;number of tracks;Nevents",10,0,10)); + //-------------------- // EF //-------------------- @@ -330,15 +328,13 @@ void HLTTauMonTool::bookHistogramsForItem(const std::string & trigItem){ //-------------------- // Precision vs Offline //-------------------- - if(trigItem.find("tracktwoMVA")==string::npos && trigItem.find("tracktwoEF")==string::npos) { - addMonGroup(new MonGroup(this,"HLT/TauMon/Expert/"+trigItemShort+"/PrecisionVsOffline",run)); - setCurrentMonGroup("HLT/TauMon/Expert/"+trigItemShort+"/PrecisionVsOffline"); - addHistogram(new TH2F("hPreselvsOffnTrks","nTrks at FTF vs Off; nTrks off; nTrks FTF",10,0,10,10,0,10)); - addHistogram(new TH2F("hPreselvsOffnWideTrks","nWideTrks at FTF vs Off; nWideTrks off; nWideTrks FTF",10,0,10,10,0,10)); - addHistogram(new TH1F("hEFEtRatio","FTF-Offline Et Relative difference; Et relative diff; Et relative diff",50,-0.3,0.3)); - addHistogram(new TH1F("hEtaRatio","FTF-Offline Eta Relative difference; Eta relative diff; Eta relative diff",50,-0.3,0.3)); - addHistogram(new TH1F("hPhiRatio","FTF-Offline Phi Relative difference; Phi relative diff; Phi relative diff",50,-0.05,0.05)); - } + addMonGroup(new MonGroup(this,"HLT/TauMon/Expert/"+trigItemShort+"/PrecisionVsOffline",run)); + setCurrentMonGroup("HLT/TauMon/Expert/"+trigItemShort+"/PrecisionVsOffline"); + addHistogram(new TH2F("hPreselvsOffnTrks","nTrks at FTF vs Off; nTrks off; nTrks FTF",10,0,10,10,0,10)); + addHistogram(new TH2F("hPreselvsOffnWideTrks","nWideTrks at FTF vs Off; nWideTrks off; nWideTrks FTF",10,0,10,10,0,10)); + addHistogram(new TH1F("hEFEtRatio","FTF-Offline Et Relative difference; Et relative diff; Et relative diff",50,-0.3,0.3)); + addHistogram(new TH1F("hEtaRatio","FTF-Offline Eta Relative difference; Eta relative diff; Eta relative diff",50,-0.3,0.3)); + addHistogram(new TH1F("hPhiRatio","FTF-Offline Phi Relative difference; Phi relative diff; Phi relative diff",50,-0.05,0.05)); if(m_truth){ //---------------- diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/ExclusiveJets.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/ExclusiveJets.cxx index f58d5d7486e51948e8117bbdb9c882b231bdf71b..d9f40ed0e019653a9f93c2c9ed5b900cfee47dad 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/ExclusiveJets.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/ExclusiveJets.cxx @@ -20,6 +20,7 @@ #include "L1TopoAlgorithms/ExclusiveJets.h" #include "L1TopoCommon/Exception.h" #include "L1TopoInterfaces/Decision.h" +#include "L1TopoSimulationUtils/Kinematics.h" REGISTER_ALG_TCS(ExclusiveJets) @@ -113,8 +114,8 @@ TCS::ExclusiveJets::processBitCorrect( const std::vector<TCS::TOBArray const *> //In the ticket ATR-17320, pT_offline were defined as A*pT_L1+B, where A=1.4 and B=20 for run2 //A and B definition might change according to run3 configuration. - double xi_1 = (1.4*parType_t((*tob1)->Et())+20.)*exp((*tob1)->etaDouble())+(1.4*parType_t((*tob2)->Et())+20.)*exp((*tob2)->etaDouble()); - double xi_2 = (1.4*parType_t((*tob1)->Et())+20.)*exp(-1.*(*tob1)->etaDouble())+(1.4*parType_t((*tob2)->Et())+20.)*exp(-1.*(*tob2)->etaDouble()); + unsigned int xi_1 = TSU::Kinematics::calcXi1(*tob1,*tob2); + unsigned int xi_2 = TSU::Kinematics::calcXi2(*tob1,*tob2); const int eta1 = (*tob1)->eta(); const int eta2 = (*tob2)->eta(); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/KalmanMETCorrection.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/KalmanMETCorrection.cxx index 8e45d09f06f0922ab49e4bfd05d9a55f17e92511..300ab4ea8ad870245a5e6547f2cfce2e531869b9 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/KalmanMETCorrection.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/KalmanMETCorrection.cxx @@ -16,6 +16,7 @@ #include "L1TopoCommon/Exception.h" #include "L1TopoInterfaces/Decision.h" #include "L1TopoSimulationUtils/KFLUT.h" +#include "L1TopoSimulationUtils/Kinematics.h" // Bitwise implementation utils #include "L1TopoSimulationUtils/L1TopoDataTypes.h" #include "L1TopoSimulationUtils/Trigo.h" @@ -24,8 +25,6 @@ REGISTER_ALG_TCS(KalmanMETCorrection) -using namespace std; - TCS::KalmanMETCorrection::KalmanMETCorrection(const std::string & name) : DecisionAlg(name) { defineParameter("InputWidth", 9); @@ -107,11 +106,19 @@ TCS::KalmanMETCorrection::processBitCorrect( const std::vector<TCS::TOBArray con corrfactor = LUTobj.getcorrKF(ipt,jeta); // This part of the code has to be reviewed again for phase1 BW simulation - auto cosphi = TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Cos.at(/*abs*/(parType_t((*tob)->phi())))); - auto sinphi = TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Sin.at(/*abs*/(parType_t((*tob)->phi())))); - - summetx += (-1.)*(*tob)->Et()*float(cosphi)*corrfactor ; - summety += (-1.)*(*tob)->Et()*float(sinphi)*corrfactor ; + float cosphi; + float sinphi; + if (isLegacyTopo()){ + cosphi = TSU::Kinematics::calcCosLegacy((*tob)->phi()); + sinphi = TSU::Kinematics::calcSinLegacy((*tob)->phi()); + } + else { + cosphi = TSU::Kinematics::calcCos((*tob)->phi()); + sinphi = TSU::Kinematics::calcSin((*tob)->phi()); + } + + summetx += (-1.)*(*tob)->Et()*cosphi*corrfactor ; + summety += (-1.)*(*tob)->Et()*sinphi*corrfactor ; TRG_MSG_DEBUG("corr " << corrfactor); @@ -123,7 +130,7 @@ TCS::KalmanMETCorrection::processBitCorrect( const std::vector<TCS::TOBArray con KFmet = sqrt(summetx*summetx + summety*summety); - if (KFmet > 0 ) KFmetphi= TSU::Trigo::atan2(summetx,summety); + if (KFmet > 0 ) KFmetphi=isLegacyTopo()?TSU::Trigo::atan2leg(summetx,summety):TSU::Trigo::atan2(summetx,summety); for(unsigned int i=0; i<numberOutputBits(); ++i) { diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MetSort.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MetSort.cxx index b1cf1c6774eed18ccd30569860815e17360f0079..27e18aacd2e1b8c99c22060036eefce8664ba311 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MetSort.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MetSort.cxx @@ -49,7 +49,7 @@ TCS::MetSort::sortBitCorrect(const InputTOBArray & input, TOBArray & output) { const MetTOBArray & mets = dynamic_cast<const MetTOBArray&>(input); int missingET = quadraticSumBW(mets[0].Ex(), mets[0].Ey()); - int metphi = TSU::Trigo::atan2(mets[0].Ex(),mets[0].Ey()); + int metphi = isLegacyTopo()?TSU::Trigo::atan2leg(mets[0].Ex(),mets[0].Ey()):TSU::Trigo::atan2(mets[0].Ex(),mets[0].Ey()); TRG_MSG_DEBUG("MET phi values " << metphi << " " ); output.push_back( GenericTOB( missingET, 0, metphi ) ); diff --git a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoStandAlone.cxx b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoStandAlone.cxx index 3a0013fe0590a835fa358fab4cd47fa5449e2c3c..e00b12928979079cda5d612c5b6c9ab730c285d5 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoStandAlone.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoStandAlone.cxx @@ -101,7 +101,7 @@ int run(int argc, const char* argv[]) { // read the menu TrigConf::L1Menu l1menu; TrigConf::JsonFileLoader fileLoader; -fileLoader.loadFile(argv[1], l1menu); + fileLoader.loadFile(argv[1], l1menu); //TFile *f = new TFile(argc>=4 ? argv[3] : "L1TopoSimulation.root","RECREATE"); @@ -122,7 +122,8 @@ fileLoader.loadFile(argv[1], l1menu); // instantiate steering TCS::TopoSteering steering; - steering.setUseBitwise(false); + steering.setUseBitwise(true); + steering.setLegacyMode(false); steering.setupFromConfiguration(l1menu); steering.setMsgLevel( msgLvl ); diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Expo.h b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Expo.h new file mode 100644 index 0000000000000000000000000000000000000000..d3c074c59064213de1b43784b4aa0d731b6c9271 --- /dev/null +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Expo.h @@ -0,0 +1,18 @@ +/* + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef EXPO_H +#define EXPO_H + +#include <string> +#include <vector> +#include <unordered_map> +#include "L1TopoSimulationUtils/L1TopoDataTypes.h" + +namespace TSU { + struct Expo{ + static const std::unordered_map<int,std::string> E; + }; +} +#endif diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Hyperbolic.h b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Hyperbolic.h index 926d789e1a52eff3727a2755d9c1791b86144d75..b5fba43e708ffa7ddec74af92cf8b30f633c0144 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Hyperbolic.h +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Hyperbolic.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /********************************* * Hyperbolic.h @@ -15,11 +15,13 @@ #include <string> #include <vector> +#include <unordered_map> #include "L1TopoSimulationUtils/L1TopoDataTypes.h" namespace TSU { struct Hyperbolic{ - static const std::vector<std::string> Cosh; + static const std::unordered_map<unsigned,std::string> Coshleg; + static const std::unordered_map<unsigned,std::string> Cosh; }; } #endif diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Kinematics.h b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Kinematics.h index 39d99a165fc7fdcd5402d95a30baa29b0f12a140..feeae1d4e7b0f7cef31d7212e1e32cf1e6a98899 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Kinematics.h +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Kinematics.h @@ -22,12 +22,18 @@ namespace TSU { static unsigned int calcInvMassBWLegacy(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2); static unsigned int calcTMassBWLegacy(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2); static unsigned int calcDeltaR2BWLegacy(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2); + static float calcCosLegacy(unsigned phi); + static float calcSinLegacy(unsigned phi); static unsigned int calcDeltaPhiBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2); static unsigned int calcDeltaEtaBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2); static unsigned int calcInvMassBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2); static unsigned int calcTMassBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2); static unsigned int calcDeltaR2BW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2); + static unsigned int calcXi1(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2); + static unsigned int calcXi2(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2); + static float calcCos(unsigned phi); + static float calcSin(unsigned phi); /** @brief compute the sum in quadrature of two ints diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Trigo.h b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Trigo.h index 846f4c4ff19d0b176cdf8f7e717678e070bd1da9..f762b2a30e0d5f89afe227d27c29da1b0a1acfc8 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Trigo.h +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Trigo.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /********************************* * Trigo.h @@ -15,13 +15,17 @@ #include <string> #include <vector> +#include <unordered_map> #include "L1TopoDataTypes.h" namespace TSU { struct Trigo{ - static const std::vector<std::string> Cos; - static const std::vector<std::string> Sin; - static int atan2(TSU::L1TopoDataTypes<16,0> x, TSU::L1TopoDataTypes<16,0> y); + static const std::unordered_map<unsigned,std::string> Cosleg; + static const std::unordered_map<unsigned,std::string> Sinleg; + static const std::unordered_map<unsigned,std::string> Cos; + static const std::unordered_map<unsigned,std::string> Sin; + static int atan2leg(TSU::L1TopoDataTypes<16,0> x, TSU::L1TopoDataTypes<16,0> y); + static int atan2(TSU::L1TopoDataTypes<16,0> x, TSU::L1TopoDataTypes<16,0> y); }; } #endif diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Expo.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Expo.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c81b744d1376bc82c2c616d8702adac49f04393c --- /dev/null +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Expo.cxx @@ -0,0 +1,522 @@ +/* + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ + +#include "L1TopoSimulationUtils/Expo.h" +//extra comment +// 10 integer bit(s) 10 decimal bit(s); (512 entries) +const std::unordered_map<int,std::string> TSU::Expo::E = + { + {-6400,"00000000000000000010"}, // value = 0.001661557273173934(0.001953125), argument value = -6.4 + {-6375,"00000000000000000010"}, // value = 0.001703619795802574(0.001953125), argument value = -6.375 + {-6350,"00000000000000000010"}, // value = 0.0017467471362611182(0.001953125), argument value = -6.3500000000000005 + {-6325,"00000000000000000010"}, // value = 0.0017909662505412698(0.001953125), argument value = -6.325 + {-6300,"00000000000000000010"}, // value = 0.0018363047770289056(0.001953125), argument value = -6.300000000000001 + {-6275,"00000000000000000010"}, // value = 0.0018827910537789773(0.001953125), argument value = -6.275 + {-6250,"00000000000000000010"}, // value = 0.0019304541362277093(0.001953125), argument value = -6.25 + {-6225,"00000000000000000010"}, // value = 0.001979323815353195(0.001953125), argument value = -6.2250000000000005 + {-6200,"00000000000000000010"}, // value = 0.002029430636295734(0.001953125), argument value = -6.2 + {-6175,"00000000000000000010"}, // value = 0.0020808059174495276(0.001953125), argument value = -6.175000000000001 + {-6150,"00000000000000000010"}, // value = 0.002133481770037708(0.001953125), argument value = -6.15 + {-6125,"00000000000000000010"}, // value = 0.002187491118182885(0.001953125), argument value = -6.125 + {-6100,"00000000000000000010"}, // value = 0.002242867719485801(0.001953125), argument value = -6.1000000000000005 + {-6075,"00000000000000000010"}, // value = 0.002299646186124936(0.001953125), argument value = -6.075 + {-6050,"00000000000000000010"}, // value = 0.0023578620064902307(0.001953125), argument value = -6.050000000000001 + {-6025,"00000000000000000010"}, // value = 0.0024175515673645035(0.001953125), argument value = -6.025 + {-6000,"00000000000000000011"}, // value = 0.0024787521766663585(0.0029296875), argument value = -6.0 + {-5975,"00000000000000000011"}, // value = 0.002541502086768856(0.0029296875), argument value = -5.9750000000000005 + {-5950,"00000000000000000011"}, // value = 0.0026058405184084983(0.0029296875), argument value = -5.95 + {-5925,"00000000000000000011"}, // value = 0.002671807685199448(0.0029296875), argument value = -5.925000000000001 + {-5900,"00000000000000000011"}, // value = 0.0027394448187683684(0.0029296875), argument value = -5.9 + {-5875,"00000000000000000011"}, // value = 0.0028087941945255128(0.0029296875), argument value = -5.875 + {-5850,"00000000000000000011"}, // value = 0.0028798991580882404(0.0029296875), argument value = -5.8500000000000005 + {-5825,"00000000000000000011"}, // value = 0.0029528041523734466(0.0029296875), argument value = -5.825 + {-5800,"00000000000000000011"}, // value = 0.0030275547453758127(0.0029296875), argument value = -5.800000000000001 + {-5775,"00000000000000000011"}, // value = 0.0031041976586493087(0.0029296875), argument value = -5.775 + {-5750,"00000000000000000011"}, // value = 0.003182780796509667(0.0029296875), argument value = -5.75 + {-5725,"00000000000000000011"}, // value = 0.0032633532759761452(0.0029296875), argument value = -5.7250000000000005 + {-5700,"00000000000000000011"}, // value = 0.003345965457471272(0.0029296875), argument value = -5.7 + {-5675,"00000000000000000100"}, // value = 0.0034306689762977315(0.00390625), argument value = -5.675000000000001 + {-5650,"00000000000000000100"}, // value = 0.0035175167749121284(0.00390625), argument value = -5.65 + {-5625,"00000000000000000100"}, // value = 0.0036065631360157305(0.00390625), argument value = -5.625 + {-5600,"00000000000000000100"}, // value = 0.003697863716482929(0.00390625), argument value = -5.6000000000000005 + {-5575,"00000000000000000100"}, // value = 0.003791475582148608(0.00390625), argument value = -5.575 + {-5550,"00000000000000000100"}, // value = 0.003887457243476127(0.00390625), argument value = -5.550000000000001 + {-5525,"00000000000000000100"}, // value = 0.0039858686921282905(0.00390625), argument value = -5.525 + {-5500,"00000000000000000100"}, // value = 0.004086771438464067(0.00390625), argument value = -5.5 + {-5475,"00000000000000000100"}, // value = 0.004190228549984576(0.00390625), argument value = -5.4750000000000005 + {-5450,"00000000000000000100"}, // value = 0.00429630469075234(0.00390625), argument value = -5.45 + {-5425,"00000000000000000101"}, // value = 0.004405066161808402(0.0048828125), argument value = -5.425000000000001 + {-5400,"00000000000000000101"}, // value = 0.004516580942612666(0.0048828125), argument value = -5.4 + {-5375,"00000000000000000101"}, // value = 0.004630918733533246(0.0048828125), argument value = -5.375 + {-5350,"00000000000000000101"}, // value = 0.004748150999411473(0.0048828125), argument value = -5.3500000000000005 + {-5325,"00000000000000000101"}, // value = 0.004868351014229763(0.0048828125), argument value = -5.325 + {-5300,"00000000000000000101"}, // value = 0.004991593906910213(0.0048828125), argument value = -5.300000000000001 + {-5275,"00000000000000000101"}, // value = 0.005117956708272651(0.0048828125), argument value = -5.275 + {-5250,"00000000000000000101"}, // value = 0.005247518399181385(0.0048828125), argument value = -5.25 + {-5225,"00000000000000000110"}, // value = 0.005380359959910816(0.005859375), argument value = -5.2250000000000005 + {-5200,"00000000000000000110"}, // value = 0.0055165644207607716(0.005859375), argument value = -5.2 + {-5175,"00000000000000000110"}, // value = 0.005656216913953104(0.005859375), argument value = -5.175000000000001 + {-5150,"00000000000000000110"}, // value = 0.005799404726842141(0.005859375), argument value = -5.15 + {-5125,"00000000000000000110"}, // value = 0.005946217356472094(0.005859375), argument value = -5.125 + {-5100,"00000000000000000110"}, // value = 0.006096746565515633(0.005859375), argument value = -5.1000000000000005 + {-5075,"00000000000000000110"}, // value = 0.006251086439628561(0.005859375), argument value = -5.075 + {-5050,"00000000000000000111"}, // value = 0.006409333446256377(0.0068359375), argument value = -5.050000000000001 + {-5025,"00000000000000000111"}, // value = 0.006571586494929613(0.0068359375), argument value = -5.025 + {-5000,"00000000000000000111"}, // value = 0.006737946999085467(0.0068359375), argument value = -5.0 + {-4975,"00000000000000000111"}, // value = 0.006908518939454525(0.0068359375), argument value = -4.9750000000000005 + {-4950,"00000000000000000111"}, // value = 0.0070834089290521185(0.0068359375), argument value = -4.95 + {-4925,"00000000000000000111"}, // value = 0.0072627262798148845(0.0068359375), argument value = -4.925000000000001 + {-4900,"00000000000000001000"}, // value = 0.007446583070924338(0.0078125), argument value = -4.9 + {-4875,"00000000000000001000"}, // value = 0.007635094218859962(0.0078125), argument value = -4.875 + {-4850,"00000000000000001000"}, // value = 0.007828377549225767(0.0078125), argument value = -4.8500000000000005 + {-4825,"00000000000000001000"}, // value = 0.008026553870395154(0.0078125), argument value = -4.825 + {-4800,"00000000000000001000"}, // value = 0.008229747049020023(0.0078125), argument value = -4.800000000000001 + {-4775,"00000000000000001001"}, // value = 0.00843808408745153(0.0087890625), argument value = -4.775 + {-4750,"00000000000000001001"}, // value = 0.008651695203120634(0.0087890625), argument value = -4.75 + {-4725,"00000000000000001001"}, // value = 0.008870713909928251(0.0087890625), argument value = -4.7250000000000005 + {-4700,"00000000000000001001"}, // value = 0.009095277101695816(0.0087890625), argument value = -4.7 + {-4675,"00000000000000001010"}, // value = 0.009325525137728318(0.009765625), argument value = -4.675000000000001 + {-4650,"00000000000000001010"}, // value = 0.009561601930543505(0.009765625), argument value = -4.65 + {-4625,"00000000000000001010"}, // value = 0.009803655035821828(0.009765625), argument value = -4.625 + {-4600,"00000000000000001010"}, // value = 0.010051835744633576(0.009765625), argument value = -4.6000000000000005 + {-4575,"00000000000000001011"}, // value = 0.01030629917800074(0.0107421875), argument value = -4.575 + {-4550,"00000000000000001011"}, // value = 0.010567204383852646(0.0107421875), argument value = -4.550000000000001 + {-4525,"00000000000000001011"}, // value = 0.010834714436436152(0.0107421875), argument value = -4.525 + {-4500,"00000000000000001011"}, // value = 0.011108996538242306(0.0107421875), argument value = -4.5 + {-4475,"00000000000000001100"}, // value = 0.011390222124513367(0.01171875), argument value = -4.4750000000000005 + {-4450,"00000000000000001100"}, // value = 0.011678566970395442(0.01171875), argument value = -4.45 + {-4425,"00000000000000001100"}, // value = 0.011974211300803611(0.01171875), argument value = -4.425000000000001 + {-4400,"00000000000000001101"}, // value = 0.012277339903068436(0.0126953125), argument value = -4.4 + {-4375,"00000000000000001101"}, // value = 0.012588142242433998(0.0126953125), argument value = -4.375 + {-4350,"00000000000000001101"}, // value = 0.012906812580479873(0.0126953125), argument value = -4.35 + {-4325,"00000000000000001110"}, // value = 0.013233550096540928(0.013671875), argument value = -4.325 + {-4300,"00000000000000001110"}, // value = 0.013568559012200922(0.013671875), argument value = -4.300000000000001 + {-4275,"00000000000000001110"}, // value = 0.01391204871893762(0.013671875), argument value = -4.275 + {-4250,"00000000000000001111"}, // value = 0.014264233908999256(0.0146484375), argument value = -4.25 + {-4225,"00000000000000001111"}, // value = 0.014625334709594222(0.0146484375), argument value = -4.225 + {-4200,"00000000000000001111"}, // value = 0.014995576820477703(0.0146484375), argument value = -4.2 + {-4175,"00000000000000010000"}, // value = 0.01537519165502142(0.015625), argument value = -4.175000000000001 + {-4150,"00000000000000010000"}, // value = 0.015764416484854486(0.015625), argument value = -4.15 + {-4125,"00000000000000010001"}, // value = 0.016163494588165874(0.0166015625), argument value = -4.125 + {-4100,"00000000000000010001"}, // value = 0.016572675401761255(0.0166015625), argument value = -4.1 + {-4075,"00000000000000010001"}, // value = 0.016992214676969066(0.0166015625), argument value = -4.075 + {-4050,"00000000000000010010"}, // value = 0.0174223746394935(0.017578125), argument value = -4.050000000000001 + {-4025,"00000000000000010010"}, // value = 0.017863424153314034(0.017578125), argument value = -4.025 + {-4000,"00000000000000010011"}, // value = 0.01831563888873418(0.0185546875), argument value = -4.0 + {-3975,"00000000000000010011"}, // value = 0.0187793014946844(0.0185546875), argument value = -3.975 + {-3950,"00000000000000010100"}, // value = 0.01925470177538692(0.01953125), argument value = -3.95 + {-3925,"00000000000000010100"}, // value = 0.019742136871492774(0.01953125), argument value = -3.9250000000000003 + {-3900,"00000000000000010101"}, // value = 0.02024191144580438(0.0205078125), argument value = -3.9000000000000004 + {-3875,"00000000000000010101"}, // value = 0.020754337873699742(0.0205078125), argument value = -3.875 + {-3850,"00000000000000010110"}, // value = 0.02127973643837717(0.021484375), argument value = -3.85 + {-3825,"00000000000000010110"}, // value = 0.021818435531042762(0.021484375), argument value = -3.825 + {-3800,"00000000000000010111"}, // value = 0.02237077185616559(0.0224609375), argument value = -3.8000000000000003 + {-3775,"00000000000000010111"}, // value = 0.02293709064192892(0.0224609375), argument value = -3.7750000000000004 + {-3750,"00000000000000011000"}, // value = 0.023517745856009107(0.0234375), argument value = -3.75 + {-3725,"00000000000000011001"}, // value = 0.024113100426816865(0.0244140625), argument value = -3.725 + {-3700,"00000000000000011001"}, // value = 0.024723526470339388(0.0244140625), argument value = -3.7 + {-3675,"00000000000000011010"}, // value = 0.02534940552272493(0.025390625), argument value = -3.6750000000000003 + {-3650,"00000000000000011011"}, // value = 0.025991128778755333(0.0263671875), argument value = -3.6500000000000004 + {-3625,"00000000000000011011"}, // value = 0.026649097336355485(0.0263671875), argument value = -3.625 + {-3600,"00000000000000011100"}, // value = 0.02732372244729256(0.02734375), argument value = -3.6 + {-3575,"00000000000000011101"}, // value = 0.028015425774221808(0.0283203125), argument value = -3.575 + {-3550,"00000000000000011101"}, // value = 0.028724639654239423(0.0283203125), argument value = -3.5500000000000003 + {-3525,"00000000000000011110"}, // value = 0.02945180736910728(0.029296875), argument value = -3.5250000000000004 + {-3500,"00000000000000011111"}, // value = 0.0301973834223185(0.0302734375), argument value = -3.5 + {-3475,"00000000000000100000"}, // value = 0.030961833823176882(0.03125), argument value = -3.475 + {-3450,"00000000000000100001"}, // value = 0.03174563637806794(0.0322265625), argument value = -3.45 + {-3425,"00000000000000100001"}, // value = 0.03254928098910342(0.0322265625), argument value = -3.4250000000000003 + {-3400,"00000000000000100010"}, // value = 0.033373269960326066(0.033203125), argument value = -3.4000000000000004 + {-3375,"00000000000000100011"}, // value = 0.03421811831166603(0.0341796875), argument value = -3.375 + {-3350,"00000000000000100100"}, // value = 0.035084354100845025(0.03515625), argument value = -3.35 + {-3325,"00000000000000100101"}, // value = 0.035972518753429654(0.0361328125), argument value = -3.325 + {-3300,"00000000000000100110"}, // value = 0.036883167401239994(0.037109375), argument value = -3.3000000000000003 + {-3275,"00000000000000100111"}, // value = 0.03781686922932507(0.0380859375), argument value = -3.2750000000000004 + {-3250,"00000000000000101000"}, // value = 0.03877420783172201(0.0390625), argument value = -3.25 + {-3225,"00000000000000101001"}, // value = 0.039755781576221304(0.0400390625), argument value = -3.225 + {-3200,"00000000000000101010"}, // value = 0.04076220397836621(0.041015625), argument value = -3.2 + {-3175,"00000000000000101011"}, // value = 0.041794104084919896(0.0419921875), argument value = -3.1750000000000003 + {-3150,"00000000000000101100"}, // value = 0.042852126867040166(0.04296875), argument value = -3.1500000000000004 + {-3125,"00000000000000101101"}, // value = 0.04393693362340742(0.0439453125), argument value = -3.125 + {-3100,"00000000000000101110"}, // value = 0.0450492023935578(0.044921875), argument value = -3.1 + {-3075,"00000000000000101111"}, // value = 0.0461896283816801(0.0458984375), argument value = -3.075 + {-3050,"00000000000000110000"}, // value = 0.04735892439114091(0.046875), argument value = -3.0500000000000003 + {-3025,"00000000000000110010"}, // value = 0.048557821270009946(0.048828125), argument value = -3.0250000000000004 + {-3000,"00000000000000110011"}, // value = 0.049787068367863944(0.0498046875), argument value = -3.0 + {-2975,"00000000000000110100"}, // value = 0.051047434004154395(0.05078125), argument value = -2.975 + {-2950,"00000000000000110110"}, // value = 0.05233970594843238(0.052734375), argument value = -2.95 + {-2925,"00000000000000110111"}, // value = 0.05366469191273011(0.0537109375), argument value = -2.9250000000000003 + {-2900,"00000000000000111000"}, // value = 0.05502322005640721(0.0546875), argument value = -2.9000000000000004 + {-2875,"00000000000000111010"}, // value = 0.05641613950377735(0.056640625), argument value = -2.875 + {-2850,"00000000000000111011"}, // value = 0.057844320874838456(0.0576171875), argument value = -2.85 + {-2825,"00000000000000111101"}, // value = 0.05930865682943872(0.0595703125), argument value = -2.825 + {-2800,"00000000000000111110"}, // value = 0.06081006262521795(0.060546875), argument value = -2.8000000000000003 + {-2775,"00000000000001000000"}, // value = 0.0623494766896734(0.0625), argument value = -2.7750000000000004 + {-2750,"00000000000001000001"}, // value = 0.06392786120670757(0.0634765625), argument value = -2.75 + {-2725,"00000000000001000011"}, // value = 0.06554620271802433(0.0654296875), argument value = -2.725 + {-2700,"00000000000001000101"}, // value = 0.06720551273974976(0.0673828125), argument value = -2.7 + {-2675,"00000000000001000111"}, // value = 0.06890682839466256(0.0693359375), argument value = -2.6750000000000003 + {-2650,"00000000000001001000"}, // value = 0.07065121306042957(0.0703125), argument value = -2.6500000000000004 + {-2625,"00000000000001001010"}, // value = 0.07243975703425146(0.072265625), argument value = -2.625 + {-2600,"00000000000001001100"}, // value = 0.07427357821433388(0.07421875), argument value = -2.6 + {-2575,"00000000000001001110"}, // value = 0.07615382279861033(0.076171875), argument value = -2.575 + {-2550,"00000000000001010000"}, // value = 0.07808166600115313(0.078125), argument value = -2.5500000000000003 + {-2525,"00000000000001010010"}, // value = 0.08005831278672051(0.080078125), argument value = -2.5250000000000004 + {-2500,"00000000000001010100"}, // value = 0.0820849986238988(0.08203125), argument value = -2.5 + {-2475,"00000000000001010110"}, // value = 0.08416299025731036(0.083984375), argument value = -2.475 + {-2450,"00000000000001011000"}, // value = 0.0862935864993705(0.0859375), argument value = -2.45 + {-2425,"00000000000001011011"}, // value = 0.08847811904208727(0.0888671875), argument value = -2.4250000000000003 + {-2400,"00000000000001011101"}, // value = 0.09071795328941247(0.0908203125), argument value = -2.4000000000000004 + {-2375,"00000000000001011111"}, // value = 0.09301448921066349(0.0927734375), argument value = -2.375 + {-2350,"00000000000001100010"}, // value = 0.09536916221554957(0.095703125), argument value = -2.3500000000000005 + {-2325,"00000000000001100100"}, // value = 0.09778344405135005(0.09765625), argument value = -2.325 + {-2300,"00000000000001100111"}, // value = 0.10025884372280375(0.1005859375), argument value = -2.3 + {-2275,"00000000000001101001"}, // value = 0.10279690843528635(0.1025390625), argument value = -2.2750000000000004 + {-2250,"00000000000001101100"}, // value = 0.10539922456186433(0.10546875), argument value = -2.25 + {-2225,"00000000000001101111"}, // value = 0.10806741863482922(0.1083984375), argument value = -2.2250000000000005 + {-2200,"00000000000001110001"}, // value = 0.11080315836233387(0.1103515625), argument value = -2.2 + {-2175,"00000000000001110100"}, // value = 0.11360815367076377(0.11328125), argument value = -2.175 + {-2150,"00000000000001110111"}, // value = 0.11648415777349691(0.1162109375), argument value = -2.1500000000000004 + {-2125,"00000000000001111010"}, // value = 0.11943296826671962(0.119140625), argument value = -2.125 + {-2100,"00000000000001111101"}, // value = 0.12245642825298185(0.1220703125), argument value = -2.1000000000000005 + {-2075,"00000000000010000001"}, // value = 0.1255564274931972(0.1259765625), argument value = -2.075 + {-2050,"00000000000010000100"}, // value = 0.12873490358780423(0.12890625), argument value = -2.05 + {-2025,"00000000000010000111"}, // value = 0.13199384318783017(0.1318359375), argument value = -2.0250000000000004 + {-2000,"00000000000010001011"}, // value = 0.1353352832366127(0.1357421875), argument value = -2.0 + {-1975,"00000000000010001110"}, // value = 0.13876131224295518(0.138671875), argument value = -1.9750000000000005 + {-1950,"00000000000010010010"}, // value = 0.14227407158651353(0.142578125), argument value = -1.9500000000000002 + {-1925,"00000000000010010101"}, // value = 0.14587575685622742(0.1455078125), argument value = -1.9249999999999998 + {-1900,"00000000000010011001"}, // value = 0.149568619222635(0.1494140625), argument value = -1.9000000000000004 + {-1875,"00000000000010011101"}, // value = 0.15335496684492847(0.1533203125), argument value = -1.875 + {-1850,"00000000000010100001"}, // value = 0.15723716631362752(0.1572265625), argument value = -1.8500000000000005 + {-1825,"00000000000010100101"}, // value = 0.16121764412977674(0.1611328125), argument value = -1.8250000000000002 + {-1800,"00000000000010101001"}, // value = 0.16529888822158656(0.1650390625), argument value = -1.7999999999999998 + {-1775,"00000000000010101110"}, // value = 0.16948344949947003(0.169921875), argument value = -1.7750000000000004 + {-1750,"00000000000010110010"}, // value = 0.17377394345044514(0.173828125), argument value = -1.75 + {-1725,"00000000000010110110"}, // value = 0.17817305177289833(0.177734375), argument value = -1.7250000000000005 + {-1700,"00000000000010111011"}, // value = 0.1826835240527346(0.1826171875), argument value = -1.7000000000000002 + {-1675,"00000000000011000000"}, // value = 0.18730817948195705(0.1875), argument value = -1.6749999999999998 + {-1650,"00000000000011000101"}, // value = 0.19204990862075405(0.1923828125), argument value = -1.6500000000000004 + {-1625,"00000000000011001010"}, // value = 0.19691167520419406(0.197265625), argument value = -1.625 + {-1600,"00000000000011001111"}, // value = 0.20189651799465547(0.2021484375), argument value = -1.5999999999999996 + {-1575,"00000000000011010100"}, // value = 0.2070075526811526(0.20703125), argument value = -1.5750000000000002 + {-1550,"00000000000011011001"}, // value = 0.2122479738267431(0.2119140625), argument value = -1.5499999999999998 + {-1525,"00000000000011011111"}, // value = 0.2176210568652328(0.2177734375), argument value = -1.5250000000000004 + {-1500,"00000000000011100100"}, // value = 0.22313016014842982(0.22265625), argument value = -1.5 + {-1475,"00000000000011101010"}, // value = 0.2287787270452225(0.228515625), argument value = -1.4749999999999996 + {-1450,"00000000000011110000"}, // value = 0.23457028809379762(0.234375), argument value = -1.4500000000000002 + {-1425,"00000000000011110110"}, // value = 0.24050846320834218(0.240234375), argument value = -1.4249999999999998 + {-1400,"00000000000011111101"}, // value = 0.24659696394160638(0.2470703125), argument value = -1.4000000000000004 + {-1375,"00000000000100000011"}, // value = 0.25283959580474646(0.2529296875), argument value = -1.375 + {-1350,"00000000000100001001"}, // value = 0.2592402606458916(0.2587890625), argument value = -1.3499999999999996 + {-1325,"00000000000100010000"}, // value = 0.26580295908892654(0.265625), argument value = -1.3250000000000002 + {-1300,"00000000000100010111"}, // value = 0.27253179303401265(0.2724609375), argument value = -1.2999999999999998 + {-1275,"00000000000100011110"}, // value = 0.2794309682214072(0.279296875), argument value = -1.2750000000000004 + {-1250,"00000000000100100101"}, // value = 0.2865047968601901(0.2861328125), argument value = -1.25 + {-1225,"00000000000100101101"}, // value = 0.29375770032353293(0.2939453125), argument value = -1.2249999999999996 + {-1200,"00000000000100110100"}, // value = 0.301194211912202(0.30078125), argument value = -1.2000000000000002 + {-1175,"00000000000100111100"}, // value = 0.3088189796880199(0.30859375), argument value = -1.1749999999999998 + {-1150,"00000000000101000100"}, // value = 0.3166367693790531(0.31640625), argument value = -1.1500000000000004 + {-1125,"00000000000101001100"}, // value = 0.32465246735834974(0.32421875), argument value = -1.125 + {-1100,"00000000000101010101"}, // value = 0.33287108369807966(0.3330078125), argument value = -1.0999999999999996 + {-1075,"00000000000101011101"}, // value = 0.3412977553009936(0.3408203125), argument value = -1.0750000000000002 + {-1050,"00000000000101100110"}, // value = 0.34993774911115544(0.349609375), argument value = -1.0499999999999998 + {-1025,"00000000000101101111"}, // value = 0.35879646540595145(0.3583984375), argument value = -1.0250000000000004 + {-1000,"00000000000101111001"}, // value = 0.36787944117144233(0.3681640625), argument value = -1.0 + {-975,"00000000000110000010"}, // value = 0.37719235356315706(0.376953125), argument value = -0.9749999999999996 + {-950,"00000000000110001100"}, // value = 0.3867410234545011(0.38671875), argument value = -0.9500000000000002 + {-925,"00000000000110010110"}, // value = 0.39653141907499295(0.396484375), argument value = -0.9249999999999998 + {-900,"00000000000110100000"}, // value = 0.40656965974059894(0.40625), argument value = -0.9000000000000004 + {-875,"00000000000110101011"}, // value = 0.4168620196785084(0.4169921875), argument value = -0.875 + {-850,"00000000000110110110"}, // value = 0.4274149319487268(0.427734375), argument value = -0.8499999999999996 + {-825,"00000000000111000001"}, // value = 0.4382349924649492(0.4384765625), argument value = -0.8250000000000002 + {-800,"00000000000111001100"}, // value = 0.4493289641172217(0.44921875), argument value = -0.7999999999999998 + {-775,"00000000000111011000"}, // value = 0.46070378099896564(0.4609375), argument value = -0.7750000000000004 + {-750,"00000000000111100100"}, // value = 0.4723665527410147(0.47265625), argument value = -0.75 + {-725,"00000000000111110000"}, // value = 0.48432456895536263(0.484375), argument value = -0.7249999999999996 + {-700,"00000000000111111101"}, // value = 0.4965853037914094(0.4970703125), argument value = -0.7000000000000002 + {-675,"00000000001000001001"}, // value = 0.5091564206075493(0.5087890625), argument value = -0.6749999999999998 + {-650,"00000000001000010111"}, // value = 0.5220457767610158(0.5224609375), argument value = -0.6500000000000004 + {-625,"00000000001000100100"}, // value = 0.5352614285189903(0.53515625), argument value = -0.625 + {-600,"00000000001000110010"}, // value = 0.5488116360940266(0.548828125), argument value = -0.5999999999999996 + {-575,"00000000001001000000"}, // value = 0.5627048688069556(0.5625), argument value = -0.5750000000000002 + {-550,"00000000001001001111"}, // value = 0.5769498103804868(0.5771484375), argument value = -0.5499999999999998 + {-525,"00000000001001011110"}, // value = 0.5915553643668149(0.591796875), argument value = -0.5250000000000004 + {-500,"00000000001001101101"}, // value = 0.6065306597126334(0.6064453125), argument value = -0.5 + {-475,"00000000001001111101"}, // value = 0.6218850564650203(0.6220703125), argument value = -0.47499999999999964 + {-450,"00000000001010001101"}, // value = 0.6376281516217732(0.6376953125), argument value = -0.4500000000000002 + {-425,"00000000001010011101"}, // value = 0.6537697851298474(0.6533203125), argument value = -0.4249999999999998 + {-400,"00000000001010101110"}, // value = 0.6703200460356391(0.669921875), argument value = -0.40000000000000036 + {-375,"00000000001011000000"}, // value = 0.6872892787909722(0.6875), argument value = -0.375 + {-350,"00000000001011010010"}, // value = 0.7046880897187137(0.705078125), argument value = -0.34999999999999964 + {-325,"00000000001011100100"}, // value = 0.7225273536420721(0.72265625), argument value = -0.3250000000000002 + {-300,"00000000001011110111"}, // value = 0.740818220681718(0.7412109375), argument value = -0.2999999999999998 + {-275,"00000000001100001010"}, // value = 0.7595721232249683(0.759765625), argument value = -0.27500000000000036 + {-250,"00000000001100011101"}, // value = 0.7788007830714049(0.7783203125), argument value = -0.25 + {-225,"00000000001100110010"}, // value = 0.7985162187593773(0.798828125), argument value = -0.22499999999999964 + {-200,"00000000001101000110"}, // value = 0.8187307530779817(0.818359375), argument value = -0.20000000000000018 + {-175,"00000000001101011100"}, // value = 0.8394570207692075(0.83984375), argument value = -0.17499999999999982 + {-150,"00000000001101110001"}, // value = 0.8607079764250575(0.8603515625), argument value = -0.15000000000000036 + {-125,"00000000001110001000"}, // value = 0.8824969025845955(0.8828125), argument value = -0.125 + {-100,"00000000001110011111"}, // value = 0.9048374180359599(0.9052734375), argument value = -0.09999999999999964 + {-75,"00000000001110110110"}, // value = 0.9277434863285527(0.927734375), argument value = -0.07500000000000018 + {-50,"00000000001111001110"}, // value = 0.9512294245007141(0.951171875), argument value = -0.04999999999999982 + {-25,"00000000001111100111"}, // value = 0.9753099120283323(0.9755859375), argument value = -0.025000000000000355 + {0,"00000000010000000000"}, // value = 1.0(1.0), argument value = 0.0 + {25,"00000000010000011010"}, // value = 1.0253151205244293(1.025390625), argument value = 0.025000000000000355 + {50,"00000000010000110101"}, // value = 1.051271096376024(1.0517578125), argument value = 0.04999999999999982 + {75,"00000000010001010000"}, // value = 1.0778841508846317(1.078125), argument value = 0.07500000000000018 + {100,"00000000010001101100"}, // value = 1.1051709180756473(1.10546875), argument value = 0.09999999999999964 + {125,"00000000010010001000"}, // value = 1.1331484530668263(1.1328125), argument value = 0.125 + {150,"00000000010010100110"}, // value = 1.1618342427282835(1.162109375), argument value = 0.15000000000000036 + {175,"00000000010011000100"}, // value = 1.1912462166123579(1.19140625), argument value = 0.17499999999999982 + {200,"00000000010011100011"}, // value = 1.22140275816017(1.2216796875), argument value = 0.20000000000000018 + {225,"00000000010100000010"}, // value = 1.252322716191864(1.251953125), argument value = 0.22499999999999964 + {250,"00000000010100100011"}, // value = 1.2840254166877414(1.2841796875), argument value = 0.25 + {275,"00000000010101000100"}, // value = 1.316530674867622(1.31640625), argument value = 0.27500000000000036 + {300,"00000000010101100110"}, // value = 1.349858807576003(1.349609375), argument value = 0.2999999999999998 + {325,"00000000010110001001"}, // value = 1.3840306459807517(1.3837890625), argument value = 0.3250000000000002 + {350,"00000000010110101101"}, // value = 1.4190675485932567(1.4189453125), argument value = 0.34999999999999964 + {375,"00000000010111010010"}, // value = 1.4549914146182013(1.455078125), argument value = 0.375 + {400,"00000000010111111000"}, // value = 1.4918246976412708(1.4921875), argument value = 0.40000000000000036 + {425,"00000000011000011110"}, // value = 1.5295904196633785(1.529296875), argument value = 0.4249999999999998 + {450,"00000000011001000110"}, // value = 1.5683121854901692(1.568359375), argument value = 0.4500000000000002 + {475,"00000000011001101111"}, // value = 1.6080141974857822(1.6083984375), argument value = 0.47499999999999964 + {500,"00000000011010011000"}, // value = 1.6487212707001282(1.6484375), argument value = 0.5 + {525,"00000000011011000011"}, // value = 1.6904588483790919(1.6904296875), argument value = 0.5250000000000004 + {550,"00000000011011101111"}, // value = 1.7332530178673948(1.7333984375), argument value = 0.5499999999999998 + {575,"00000000011100011100"}, // value = 1.7771305269140387(1.77734375), argument value = 0.5750000000000002 + {600,"00000000011101001010"}, // value = 1.8221188003905082(1.822265625), argument value = 0.5999999999999996 + {625,"00000000011101111001"}, // value = 1.8682459574322223(1.8681640625), argument value = 0.625 + {650,"00000000011110101010"}, // value = 1.9155408290138967(1.916015625), argument value = 0.6500000000000004 + {675,"00000000011111011011"}, // value = 1.964032975969847(1.9638671875), argument value = 0.6749999999999998 + {700,"00000000100000001110"}, // value = 2.013752707470477(2.013671875), argument value = 0.7000000000000002 + {725,"00000000100001000010"}, // value = 2.064731099966486(2.064453125), argument value = 0.7249999999999996 + {750,"00000000100001111000"}, // value = 2.117000016612675(2.1171875), argument value = 0.75 + {775,"00000000100010101111"}, // value = 2.170592127183443(2.1708984375), argument value = 0.7750000000000004 + {800,"00000000100011100111"}, // value = 2.2255409284924674(2.2255859375), argument value = 0.7999999999999998 + {825,"00000000100100100001"}, // value = 2.281880765329304(2.2822265625), argument value = 0.8250000000000002 + {850,"00000000100101011100"}, // value = 2.3396468519259903(2.33984375), argument value = 0.8499999999999996 + {875,"00000000100110011000"}, // value = 2.398875293967098(2.3984375), argument value = 0.875 + {900,"00000000100111010111"}, // value = 2.4596031111569507(2.4599609375), argument value = 0.9000000000000004 + {925,"00000000101000010110"}, // value = 2.5218682603581475(2.521484375), argument value = 0.9249999999999998 + {950,"00000000101001011000"}, // value = 2.585709659315847(2.5859375), argument value = 0.9500000000000002 + {975,"00000000101010011011"}, // value = 2.6511672109826057(2.6513671875), argument value = 0.9749999999999996 + {1000,"00000000101011100000"}, // value = 2.718281828459045(2.71875), argument value = 1.0 + {1025,"00000000101100100110"}, // value = 2.7870954605658516(2.787109375), argument value = 1.0250000000000004 + {1050,"00000000101101101110"}, // value = 2.8576511180631634(2.857421875), argument value = 1.0499999999999998 + {1075,"00000000101110111000"}, // value = 2.929992900533702(2.9296875), argument value = 1.0750000000000002 + {1100,"00000000110000000100"}, // value = 3.004166023946432(3.00390625), argument value = 1.0999999999999996 + {1125,"00000000110001010010"}, // value = 3.080216848918031(3.080078125), argument value = 1.125 + {1150,"00000000110010100010"}, // value = 3.158192909689769(3.158203125), argument value = 1.1500000000000004 + {1175,"00000000110011110100"}, // value = 3.23814294383796(3.23828125), argument value = 1.1749999999999998 + {1200,"00000000110101001000"}, // value = 3.320116922736548(3.3203125), argument value = 1.2000000000000002 + {1225,"00000000110110011110"}, // value = 3.404166082790818(3.404296875), argument value = 1.2249999999999996 + {1250,"00000000110111110110"}, // value = 3.4903429574618414(3.490234375), argument value = 1.25 + {1275,"00000000111001010001"}, // value = 3.5787014101015804(3.5791015625), argument value = 1.2750000000000004 + {1300,"00000000111010101101"}, // value = 3.6692966676192436(3.6689453125), argument value = 1.2999999999999998 + {1325,"00000000111100001100"}, // value = 3.7621853549999114(3.76171875), argument value = 1.3250000000000002 + {1350,"00000000111101101110"}, // value = 3.857425530696973(3.857421875), argument value = 1.3499999999999996 + {1375,"00000000111111010010"}, // value = 3.955076722920577(3.955078125), argument value = 1.375 + {1400,"00000001000000111001"}, // value = 4.055199966844676(4.0556640625), argument value = 1.4000000000000004 + {1425,"00000001000010100010"}, // value = 4.157857842756006(4.158203125), argument value = 1.4249999999999998 + {1450,"00000001000100001101"}, // value = 4.263114515168819(4.2626953125), argument value = 1.4500000000000002 + {1475,"00000001000101111100"}, // value = 4.371035772929757(4.37109375), argument value = 1.4749999999999996 + {1500,"00000001000111101101"}, // value = 4.4816890703380645(4.4814453125), argument value = 1.5 + {1525,"00000001001001100001"}, // value = 4.59514356930669(4.5947265625), argument value = 1.5250000000000004 + {1550,"00000001001011011001"}, // value = 4.71147018259074(4.7119140625), argument value = 1.5499999999999998 + {1575,"00000001001101010011"}, // value = 4.830741618110279(4.8310546875), argument value = 1.5750000000000002 + {1600,"00000001001111010000"}, // value = 4.953032424395113(4.953125), argument value = 1.5999999999999996 + {1625,"00000001010001010000"}, // value = 5.0784190371800815(5.078125), argument value = 1.625 + {1650,"00000001010011010100"}, // value = 5.20697982717985(5.20703125), argument value = 1.6500000000000004 + {1675,"00000001010101011011"}, // value = 5.33879514907318(5.3388671875), argument value = 1.6750000000000007 + {1700,"00000001010111100101"}, // value = 5.4739473917271955(5.4736328125), argument value = 1.6999999999999993 + {1725,"00000001011001110011"}, // value = 5.612521029693155(5.6123046875), argument value = 1.7249999999999996 + {1750,"00000001011100000101"}, // value = 5.754602676005731(5.7548828125), argument value = 1.75 + {1775,"00000001011110011010"}, // value = 5.900281136319018(5.900390625), argument value = 1.7750000000000004 + {1800,"00000001100000110011"}, // value = 6.04964746441295(6.0498046875), argument value = 1.8000000000000007 + {1825,"00000001100011010000"}, // value = 6.202795019104861(6.203125), argument value = 1.8249999999999993 + {1850,"00000001100101110000"}, // value = 6.359819522601829(6.359375), argument value = 1.8499999999999996 + {1875,"00000001101000010101"}, // value = 6.5208191203301125(6.5205078125), argument value = 1.875 + {1900,"00000001101010111110"}, // value = 6.685894442279272(6.685546875), argument value = 1.9000000000000004 + {1925,"00000001101101101100"}, // value = 6.855148665899183(6.85546875), argument value = 1.9250000000000007 + {1950,"00000001110000011101"}, // value = 7.028687580589288(7.0283203125), argument value = 1.9499999999999993 + {1975,"00000001110011010100"}, // value = 7.206619653820465(7.20703125), argument value = 1.9749999999999996 + {2000,"00000001110110001110"}, // value = 7.38905609893065(7.388671875), argument value = 2.0 + {2025,"00000001111001001110"}, // value = 7.576110944636849(7.576171875), argument value = 2.0250000000000004 + {2050,"00000001111100010010"}, // value = 7.767901106306778(7.767578125), argument value = 2.0500000000000007 + {2075,"00000001111111011100"}, // value = 7.964546459034766(7.96484375), argument value = 2.0749999999999993 + {2100,"00000010000010101010"}, // value = 8.166169912567646(8.166015625), argument value = 2.0999999999999996 + {2125,"00000010000101111110"}, // value = 8.372897488127265(8.373046875), argument value = 2.125 + {2150,"00000010001001010111"}, // value = 8.584858397177896(8.5849609375), argument value = 2.1500000000000004 + {2175,"00000010001100110101"}, // value = 8.802185122187613(8.8017578125), argument value = 2.1750000000000007 + {2200,"00000010010000011010"}, // value = 9.025013499434115(9.025390625), argument value = 2.1999999999999993 + {2225,"00000010010100000100"}, // value = 9.25348280390689(9.25390625), argument value = 2.2249999999999996 + {2250,"00000010010111110011"}, // value = 9.487735836358526(9.4873046875), argument value = 2.25 + {2275,"00000010011011101001"}, // value = 9.727919012559887(9.7275390625), argument value = 2.2750000000000004 + {2300,"00000010011111100110"}, // value = 9.974182454814727(9.974609375), argument value = 2.3000000000000007 + {2325,"00000010100011101000"}, // value = 10.226680085790992(10.2265625), argument value = 2.3249999999999993 + {2350,"00000010100111110001"}, // value = 10.48556972472757(10.4853515625), argument value = 2.3499999999999996 + {2375,"00000010101100000001"}, // value = 10.751013186076355(10.7509765625), argument value = 2.375 + {2400,"00000010110000011000"}, // value = 11.023176380641605(11.0234375), argument value = 2.4000000000000004 + {2425,"00000010110100110101"}, // value = 11.30222941927959(11.3017578125), argument value = 2.4250000000000007 + {2450,"00000010111001011010"}, // value = 11.58834671922338(11.587890625), argument value = 2.4499999999999993 + {2475,"00000010111110000111"}, // value = 11.881707113099395(11.8818359375), argument value = 2.4749999999999996 + {2500,"00000011000010111011"}, // value = 12.182493960703473(12.1826171875), argument value = 2.5 + {2525,"00000011000111110111"}, // value = 12.490895263606813(12.4912109375), argument value = 2.5250000000000004 + {2550,"00000011001100111010"}, // value = 12.807103782663042(12.806640625), argument value = 2.5500000000000007 + {2575,"00000011010010000110"}, // value = 13.131317158490006(13.130859375), argument value = 2.5749999999999993 + {2600,"00000011010111011011"}, // value = 13.463738035001686(13.4638671875), argument value = 2.5999999999999996 + {2625,"00000011011100111000"}, // value = 13.804574186067095(13.8046875), argument value = 2.625 + {2650,"00000011100010011110"}, // value = 14.154038645375808(14.154296875), argument value = 2.6500000000000004 + {2675,"00000011101000001101"}, // value = 14.512349839590925(14.5126953125), argument value = 2.6750000000000007 + {2700,"00000011101110000101"}, // value = 14.879731724872823(14.8798828125), argument value = 2.6999999999999993 + {2725,"00000011110100000111"}, // value = 15.256413926859151(15.2568359375), argument value = 2.7249999999999996 + {2750,"00000011111010010010"}, // value = 15.642631884188171(15.642578125), argument value = 2.75 + {2775,"00000100000000101000"}, // value = 16.038626995655676(16.0390625), argument value = 2.7750000000000004 + {2800,"00000100000111000111"}, // value = 16.444646771097062(16.4443359375), argument value = 2.8000000000000007 + {2825,"00000100001101110010"}, // value = 16.86094498608902(16.861328125), argument value = 2.8249999999999993 + {2850,"00000100010100100111"}, // value = 17.287781840567632(17.2880859375), argument value = 2.8499999999999996 + {2875,"00000100011011100111"}, // value = 17.725424121461643(17.7255859375), argument value = 2.875 + {2900,"00000100100010110010"}, // value = 18.174145369443067(18.173828125), argument value = 2.9000000000000004 + {2925,"00000100101010001001"}, // value = 18.634226049899016(18.6337890625), argument value = 2.9250000000000007 + {2950,"00000100110001101100"}, // value = 19.105953728231633(19.10546875), argument value = 2.9499999999999993 + {2975,"00000100111001011100"}, // value = 19.589623249595984(19.58984375), argument value = 2.9749999999999996 + {3000,"00000101000001011000"}, // value = 20.085536923187668(20.0859375), argument value = 3.0 + {3025,"00000101001001100000"}, // value = 20.594004711196035(20.59375), argument value = 3.0250000000000004 + {3050,"00000101010001110110"}, // value = 21.115344422540627(21.115234375), argument value = 3.0500000000000007 + {3075,"00000101011010011001"}, // value = 21.64988191151204(21.6494140625), argument value = 3.0749999999999993 + {3100,"00000101100011001011"}, // value = 22.197951281441625(22.1982421875), argument value = 3.0999999999999996 + {3125,"00000101101100001010"}, // value = 22.75989509352673(22.759765625), argument value = 3.125 + {3150,"00000101110101011000"}, // value = 23.336064580942722(23.3359375), argument value = 3.1500000000000004 + {3175,"00000101111110110101"}, // value = 23.92681986837515(23.9267578125), argument value = 3.1750000000000007 + {3200,"00000110001000100001"}, // value = 24.532530197109374(24.5322265625), argument value = 3.200000000000001 + {3225,"00000110010010011101"}, // value = 25.153574155818355(25.1533203125), argument value = 3.2249999999999996 + {3250,"00000110011100101001"}, // value = 25.790339917193062(25.7900390625), argument value = 3.25 + {3275,"00000110100111000110"}, // value = 26.443225480562802(26.443359375), argument value = 3.2750000000000004 + {3300,"00000110110001110011"}, // value = 27.112638920657908(27.1123046875), argument value = 3.3000000000000007 + {3325,"00000110111100110010"}, // value = 27.79899864266969(27.798828125), argument value = 3.325000000000001 + {3350,"00000111001000000011"}, // value = 28.502733643767268(28.5029296875), argument value = 3.3499999999999996 + {3375,"00000111010011100110"}, // value = 29.22428378123494(29.224609375), argument value = 3.375 + {3400,"00000111011111011011"}, // value = 29.964100047397025(29.9638671875), argument value = 3.4000000000000004 + {3425,"00000111101011100100"}, // value = 30.722644851502935(30.72265625), argument value = 3.4250000000000007 + {3450,"00000111111000000000"}, // value = 31.500392308747966(31.5), argument value = 3.450000000000001 + {3475,"00001000000100110001"}, // value = 32.297828536610666(32.2978515625), argument value = 3.4749999999999996 + {3500,"00001000010001110110"}, // value = 33.11545195869231(33.115234375), argument value = 3.5 + {3525,"00001000011111010001"}, // value = 33.95377361624755(33.9541015625), argument value = 3.5250000000000004 + {3550,"00001000101101000001"}, // value = 34.81331748760205(34.8134765625), argument value = 3.5500000000000007 + {3575,"00001000111011000111"}, // value = 35.69462081565591(35.6943359375), argument value = 3.575000000000001 + {3600,"00001001001001100101"}, // value = 36.598234443677974(36.5986328125), argument value = 3.5999999999999996 + {3625,"00001001011000011001"}, // value = 37.524723159601(37.5244140625), argument value = 3.625 + {3650,"00001001100111100110"}, // value = 38.47466604903214(38.474609375), argument value = 3.6500000000000004 + {3675,"00001001110111001011"}, // value = 39.448656857200554(39.4482421875), argument value = 3.6750000000000007 + {3700,"00001010000111001010"}, // value = 40.447304360067434(40.447265625), argument value = 3.700000000000001 + {3725,"00001010010111100011"}, // value = 41.471232744830736(41.4716796875), argument value = 3.7249999999999996 + {3750,"00001010101000010110"}, // value = 42.52108200006278(42.521484375), argument value = 3.75 + {3775,"00001010111001100100"}, // value = 43.59750831572351(43.59765625), argument value = 3.7750000000000004 + {3800,"00001011001011001110"}, // value = 44.70118449330086(44.701171875), argument value = 3.8000000000000007 + {3825,"00001011011101010101"}, // value = 45.832800366333515(45.8330078125), argument value = 3.825000000000001 + {3850,"00001011101111111001"}, // value = 46.993063231579264(46.9931640625), argument value = 3.8499999999999996 + {3875,"00001100000010111011"}, // value = 48.182698291098816(48.1826171875), argument value = 3.875 + {3900,"00001100010110011100"}, // value = 49.40244910553019(49.40234375), argument value = 3.9000000000000004 + {3925,"00001100101010011101"}, // value = 50.653078058838666(50.6533203125), argument value = 3.9250000000000007 + {3950,"00001100111110111110"}, // value = 51.93536683483149(51.935546875), argument value = 3.950000000000001 + {3975,"00001101010100000000"}, // value = 53.250116905735595(53.25), argument value = 3.9749999999999996 + {4000,"00001101101001100101"}, // value = 54.598150033144236(54.5986328125), argument value = 4.0 + {4025,"00001101111111101100"}, // value = 55.980308781644155(55.98046875), argument value = 4.025 + {4050,"00001110010110010111"}, // value = 57.39745704544624(57.3974609375), argument value = 4.050000000000001 + {4075,"00001110101101100111"}, // value = 58.85048058834746(58.8505859375), argument value = 4.075000000000001 + {4100,"00001111000101011100"}, // value = 60.34028759736195(60.33984375), argument value = 4.1 + {4125,"00001111011101111001"}, // value = 61.867809250367884(61.8681640625), argument value = 4.125 + {4150,"00001111110110111100"}, // value = 63.434000298123344(63.43359375), argument value = 4.15 + {4175,"00010000010000101001"}, // value = 65.03983966101701(65.0400390625), argument value = 4.175000000000001 + {4200,"00010000101010111111"}, // value = 66.68633104092521(66.6865234375), argument value = 4.200000000000001 + {4225,"00010001000101111111"}, // value = 68.3745035485581(68.3740234375), argument value = 4.225 + {4250,"00010001100001101100"}, // value = 70.10541234668786(70.10546875), argument value = 4.25 + {4275,"00010001111110000101"}, // value = 71.88013930965907(71.8798828125), argument value = 4.275 + {4300,"00010010011011001101"}, // value = 73.69979369959584(73.7001953125), argument value = 4.300000000000001 + {4325,"00010010111001000011"}, // value = 75.56551285972668(75.5654296875), argument value = 4.325000000000001 + {4350,"00010011010111101010"}, // value = 77.47846292526083(77.478515625), argument value = 4.35 + {4375,"00010011110111000010"}, // value = 79.43983955226133(79.439453125), argument value = 4.375 + {4400,"00010100010111001110"}, // value = 81.45086866496814(81.451171875), argument value = 4.4 + {4425,"00010100111000001101"}, // value = 83.51280722204127(83.5126953125), argument value = 4.425000000000001 + {4450,"00010101011010000010"}, // value = 85.62694400220066(85.626953125), argument value = 4.450000000000001 + {4475,"00010101111100101110"}, // value = 87.79460040975476(87.794921875), argument value = 4.475 + {4500,"00010110100000010010"}, // value = 90.01713130052181(90.017578125), argument value = 4.5 + {4525,"00010111000100101111"}, // value = 92.29592582865789(92.2958984375), argument value = 4.525 + {4550,"00010111101010001000"}, // value = 94.63240831492415(94.6328125), argument value = 4.550000000000001 + {4575,"00011000010000011101"}, // value = 97.02803913693344(97.0283203125), argument value = 4.575000000000001 + {4600,"00011000110111110000"}, // value = 99.48431564193378(99.484375), argument value = 4.6 + {4625,"00011001100000000011"}, // value = 102.00277308269969(102.0029296875), argument value = 4.625 + {4650,"00011010001001010111"}, // value = 104.58498557711422(104.5849609375), argument value = 4.65 + {4675,"00011010110011101110"}, // value = 107.23256709204456(107.232421875), argument value = 4.675000000000001 + {4700,"00011011011111001010"}, // value = 109.94717245212361(109.947265625), argument value = 4.700000000000001 + {4725,"00011100001011101100"}, // value = 112.73049837406913(112.73046875), argument value = 4.725 + {4750,"00011100111001010110"}, // value = 115.58428452718766(115.583984375), argument value = 4.75 + {4775,"00011101101000001011"}, // value = 118.51031462072334(118.5107421875), argument value = 4.775 + {4800,"00011110011000001011"}, // value = 121.51041751873497(121.5107421875), argument value = 4.800000000000001 + {4825,"00011111001001011001"}, // value = 124.58646838319545(124.5869140625), argument value = 4.825000000000001 + {4850,"00011111111011110110"}, // value = 127.7403898460288(127.740234375), argument value = 4.85 + {4875,"00100000101111100110"}, // value = 130.9741532108186(130.974609375), argument value = 4.875 + {4900,"00100001100100101001"}, // value = 134.28977968493552(134.2900390625), argument value = 4.9 + {4925,"00100010011011000010"}, // value = 137.68934164285872(137.689453125), argument value = 4.925000000000001 + {4950,"00100011010010110011"}, // value = 141.174963921477(141.1748046875), argument value = 4.950000000000001 + {4975,"00100100001011111111"}, // value = 144.74882514818088(144.7490234375), argument value = 4.975 + {5000,"00100101000110100111"}, // value = 148.4131591025766(148.4130859375), argument value = 5.0 + {5025,"00100110000010101110"}, // value = 152.17025611266962(152.169921875), argument value = 5.025 + {5050,"00100111000000010111"}, // value = 156.0224644863951(156.0224609375), argument value = 5.050000000000001 + {5075,"00100111111111100100"}, // value = 159.97219197938668(159.97265625), argument value = 5.075000000000001 + {5100,"00101001000000010110"}, // value = 164.0219072999017(164.021484375), argument value = 5.1 + {5125,"00101010000010110010"}, // value = 168.17414165184545(168.173828125), argument value = 5.125 + {5150,"00101011000110111010"}, // value = 172.43149031685434(172.431640625), argument value = 5.15 + {5175,"00101100001100110000"}, // value = 176.79661427643245(176.796875), argument value = 5.175000000000001 + {5200,"00101101010100010111"}, // value = 181.27224187515137(181.2724609375), argument value = 5.200000000000001 + {5225,"00101110011101110010"}, // value = 185.86117052595398(185.861328125), argument value = 5.225 + {5250,"00101111101001000100"}, // value = 190.56626845863(190.56640625), argument value = 5.25 + {5275,"00110000110110010000"}, // value = 195.39047651255095(195.390625), argument value = 5.275 + {5300,"00110010000101011001"}, // value = 200.33680997479183(200.3369140625), argument value = 5.300000000000001 + {5325,"00110011010110100010"}, // value = 205.40836046478336(205.408203125), argument value = 5.325000000000001 + {5350,"00110100101001101111"}, // value = 210.60829786667438(210.6083984375), argument value = 5.35 + {5375,"00110101111111000010"}, // value = 215.9398723106141(215.939453125), argument value = 5.375 + {5400,"00110111010110100000"}, // value = 221.40641620418717(221.40625), argument value = 5.4 + {5425,"00111000110000001100"}, // value = 227.0113463152781(227.01171875), argument value = 5.425000000000001 + {5450,"00111010001100001000"}, // value = 232.7581659076623(232.7578125), argument value = 5.450000000000001 + {5475,"00111011101010011010"}, // value = 238.65046693065943(238.650390625), argument value = 5.475 + {5500,"00111101001011000101"}, // value = 244.69193226422038(244.6923828125), argument value = 5.5 + {5525,"00111110101110001100"}, // value = 250.8863380208446(250.88671875), argument value = 5.525 + {5550,"01000000010011110011"}, // value = 257.23755590577497(257.2373046875), argument value = 5.550000000000001 + {5575,"01000001111100000000"}, // value = 263.74955563693925(263.75), argument value = 5.575000000000001 + {5600,"01000011100110110101"}, // value = 270.42640742615254(270.4267578125), argument value = 5.6 + {5625,"01000101010100010111"}, // value = 277.272284523134(277.2724609375), argument value = 5.625 + {5650,"01000111000100101010"}, // value = 284.29146582392093(284.291015625), argument value = 5.65 + {5675,"01001000110111110100"}, // value = 291.4883385453202(291.48828125), argument value = 5.675000000000001 + {5700,"01001010101101111000"}, // value = 298.8674009670606(298.8671875), argument value = 5.700000000000001 + {5725,"01001100100110111100"}, // value = 306.4332652433641(306.43359375), argument value = 5.725 + {5750,"01001110100011000011"}, // value = 314.1906602856942(314.1904296875), argument value = 5.75 + {5775,"01010000100010010100"}, // value = 322.14443471847653(322.14453125), argument value = 5.775 + {5800,"01010010100100110011"}, // value = 330.2995599096489(330.2998046875), argument value = 5.800000000000001 + {5825,"01010100101010100101"}, // value = 338.66113307792756(338.6611328125), argument value = 5.825000000000001 + {5850,"01010110110011110000"}, // value = 347.23438047873447(347.234375), argument value = 5.85 + {5875,"01011001000000011001"}, // value = 356.0246606707791(356.0244140625), argument value = 5.875 + {5900,"01011011010000100110"}, // value = 365.0374678653289(365.037109375), argument value = 5.9 + {5925,"01011101100100011101"}, // value = 374.27843536027217(374.2783203125), argument value = 5.925000000000001 + {5950,"01011111111100000011"}, // value = 383.75333906111223(383.7529296875), argument value = 5.950000000000001 + {5975,"01100010010111011111"}, // value = 393.4681010910957(393.4677734375), argument value = 5.975 + {6000,"01100100110110110111"}, // value = 403.4287934927351(403.4287109375), argument value = 6.0 + {6025,"01100111011010010001"}, // value = 413.6416420230288(413.6416015625), argument value = 6.025 + {6050,"01101010000001110100"}, // value = 424.11303004476457(424.11328125), argument value = 6.050000000000001 + {6075,"01101100101101100110"}, // value = 434.84950251632864(434.849609375), argument value = 6.075000000000001 + {6100,"01101111011101101110"}, // value = 445.85777008251677(445.857421875), argument value = 6.1 + {6125,"01110010010010010100"}, // value = 457.14471326890896(457.14453125), argument value = 6.125 + {6150,"01110101001011011111"}, // value = 468.717386782417(468.7177734375), argument value = 6.15 + {6175,"01111000001001010101"}, // value = 480.58302392070937(480.5830078125), argument value = 6.175000000000001 + {6200,"01111011001011111111"}, // value = 492.7490410932568(492.7490234375), argument value = 6.200000000000001 + {6225,"01111110010011100100"}, // value = 505.2230424568286(505.22265625), argument value = 6.225 + {6250,"10000001100000001101"}, // value = 518.012824668342(518.0126953125), argument value = 6.25 + {6275,"10000100110010000001"}, // value = 531.1263817580211(531.1259765625), argument value = 6.275 + {6300,"10001000001001001010"}, // value = 544.5719101259294(544.572265625), argument value = 6.300000000000001 + {6325,"10001011100101101110"}, // value = 558.357813664986(558.357421875), argument value = 6.325000000000001 + {6350,"10001111000111111001"}, // value = 572.4927090136708(572.4931640625), argument value = 6.35 + {6375,"10010010101111110001"} // value = 586.9854309417088(586.9853515625), argument value = 6.375 + }; diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Hyperbolic.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Hyperbolic.cxx index 312a34021f5d088be266cd19a6a7b6c41b56005e..3ea82b7cbe34f7cad959156f16de43993ff38e8e 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Hyperbolic.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Hyperbolic.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /********************************* * Hyperbolic.cxx @@ -9,90 +9,489 @@ * @brief Lookup table for hyperbolic functions. * Values is in Qm.n format m=11, n = 7 * -**********************************/ + **********************************/ #include "L1TopoSimulationUtils/Hyperbolic.h" //extra comment // 11 integer bit(s) + 7decimal bit(s); (79 entries) -const std::vector<std::string> TSU::Hyperbolic::Cosh = { - "000000000010000000", // value = 1.0, argument value = 0.0 - "000000000010000001", // value = 1.0050041680558035, argument value = 0.1 - "000000000010000011", // value = 1.020066755619076, argument value = 0.2 - "000000000010000110", // value = 1.0453385141288605, argument value = 0.30000000000000004 - "000000000010001010", // value = 1.081072371838455, argument value = 0.4 - "000000000010010000", // value = 1.1276259652063807, argument value = 0.5 - "000000000010011000", // value = 1.1854652182422678, argument value = 0.6000000000000001 - "000000000010100001", // value = 1.255169005630943, argument value = 0.7000000000000001 - "000000000010101011", // value = 1.3374349463048447, argument value = 0.8 - "000000000010110111", // value = 1.4330863854487745, argument value = 0.9 - "000000000011000110", // value = 1.5430806348152437, argument value = 1.0 - "000000000011010110", // value = 1.6685185538222564, argument value = 1.1 - "000000000011101000", // value = 1.8106555673243752, argument value = 1.2000000000000002 - "000000000011111100", // value = 1.9709142303266285, argument value = 1.3 - "000000000100010011", // value = 2.150898465393141, argument value = 1.4000000000000001 - "000000000100101101", // value = 2.352409615243247, argument value = 1.5 - "000000000101001010", // value = 2.5774644711948853, argument value = 1.6 - "000000000101101010", // value = 2.8283154578899676, argument value = 1.7000000000000002 - "000000000110001110", // value = 3.1074731763172667, argument value = 1.8 - "000000000110110101", // value = 3.417731530750953, argument value = 1.9000000000000001 - "000000000111100010", // value = 3.7621956910836314, argument value = 2.0 - "000000001000010010", // value = 4.144313170410316, argument value = 2.1 - "000000001001001001", // value = 4.567908328898228, argument value = 2.2 - "000000001010000101", // value = 5.037220649268764, argument value = 2.3000000000000003 - "000000001011000111", // value = 5.556947166965509, argument value = 2.4000000000000004 - "000000001100010001", // value = 6.132289479663686, argument value = 2.5 - "000000001101100010", // value = 6.769005806608012, argument value = 2.6 - "000000001110111101", // value = 7.473468618806294, argument value = 2.7 - "000000010000100000", // value = 8.252728416861137, argument value = 2.8000000000000003 - "000000010010001111", // value = 9.114584294749738, argument value = 2.9000000000000004 - "000000010100001001", // value = 10.067661995777765, argument value = 3.0 - "000000010110010000", // value = 11.121500241917596, argument value = 3.1 - "000000011000100101", // value = 12.28664620054386, argument value = 3.2 - "000000011011001010", // value = 13.574761044029566, argument value = 3.3000000000000003 - "000000011110000000", // value = 14.998736658678675, argument value = 3.4000000000000004 - "000000100001001001", // value = 16.572824671057315, argument value = 3.5 - "000000100100101000", // value = 18.31277908306264, argument value = 3.6 - "000000101000011110", // value = 20.23601394326887, argument value = 3.7 - "000000101100101110", // value = 22.3617776325785, argument value = 3.8000000000000003 - "000000110001011011", // value = 24.711345508487994, argument value = 3.9000000000000004 - "000000110110100111", // value = 27.308232836016487, argument value = 4.0 - "000000111100010111", // value = 30.17843013638188, argument value = 4.1000000000000005 - "000001000010101101", // value = 33.35066330887282, argument value = 4.2 - "000001001001101110", // value = 36.85668112930399, argument value = 4.3 - "000001010001011110", // value = 40.7315730024356, argument value = 4.4 - "000001011010000010", // value = 45.014120148530026, argument value = 4.5 - "000001100011100000", // value = 49.74718373883925, argument value = 4.6000000000000005 - "000001101101111101", // value = 54.97813386461261, argument value = 4.7 - "000001111001100001", // value = 60.75932363289199, argument value = 4.800000000000001 - "000010000110010011", // value = 67.14861313400323, argument value = 4.9 - "000010010100011011", // value = 74.20994852478785, argument value = 5.0 - "000010100100000010", // value = 82.01400202323367, argument value = 5.1000000000000005 - "000010110101010010", // value = 90.63887921978599, argument value = 5.2 - "000011001000010110", // value = 100.17090078434937, argument value = 5.300000000000001 - "000011011101011010", // value = 110.70546639256489, argument value = 5.4 - "000011110100101101", // value = 122.34800951782942, argument value = 5.5 - "000100001110011100", // value = 135.21505264493462, argument value = 5.6000000000000005 - "000100101010111000", // value = 149.43537346625888, argument value = 5.7 - "000101001010010011", // value = 165.15129373219713, argument value = 5.800000000000001 - "000101101101000011", // value = 182.52010365507383, argument value = 5.9 - "000110010011011100", // value = 201.7156361224559, argument value = 6.0 - "000110111101110111", // value = 222.93000647511832, argument value = 6.1000000000000005 - "000111101100110000", // value = 246.3755352619463, argument value = 6.2 - "001000100000100101", // value = 272.28687321535324, argument value = 6.300000000000001 - "001001011001110110", // value = 300.9233497146777, argument value = 6.4 - "001010011001001001", // value = 332.5715682417774, argument value = 6.5 - "001011011111000110", // value = 367.5482748050054, argument value = 6.6000000000000005 - "001100101100011010", // value = 406.203528039723, argument value = 6.7 - "001110000001110110", // value = 448.9242027127831, argument value = 6.800000000000001 - "001111100000010010", // value = 496.1378616952276, argument value = 6.9 - "010001001000101001", // value = 548.317035155212, argument value = 7.0 - "010010111011111110", // value = 605.9839497987504, argument value = 7.1000000000000005 - "010100111011011100", // value = 669.7157554901132, argument value = 7.2 - "010111001000010011", // value = 740.1503015616607, argument value = 7.300000000000001 - "011001100011111111", // value = 817.992520624344, argument value = 7.4 - "011100010000000011", // value = 904.0214837702166, argument value = 7.5 - "011111001110001101", // value = 999.0981977777762, argument value = 7.6000000000000005 - "100010100000010110", // value = 1104.174222357196, argument value = 7.7 - "100110001000100111" // value = 1220.3011936797398, argument value = 7.800000000000001 -}; +const std::unordered_map<unsigned,std::string> TSU::Hyperbolic::Coshleg = + { + //Legacy + {0,"000000000010000000"}, // value = 1.0, argument value = 0.0 + {1,"000000000010000001"}, // value = 1.0050041680558035, argument value = 0.1 + {2,"000000000010000011"}, // value = 1.020066755619076, argument value = 0.2 + {3,"000000000010000110"}, // value = 1.0453385141288605, argument value = 0.30000000000000004 + {4,"000000000010001010"}, // value = 1.081072371838455, argument value = 0.4 + {5,"000000000010010000"}, // value = 1.1276259652063807, argument value = 0.5 + {6,"000000000010011000"}, // value = 1.1854652182422678, argument value = 0.6000000000000001 + {7,"000000000010100001"}, // value = 1.255169005630943, argument value = 0.7000000000000001 + {8,"000000000010101011"}, // value = 1.3374349463048447, argument value = 0.8 + {9,"000000000010110111"}, // value = 1.4330863854487745, argument value = 0.9 + {10,"000000000011000110"}, // value = 1.5430806348152437, argument value = 1.0 + {11,"000000000011010110"}, // value = 1.6685185538222564, argument value = 1.1 + {12,"000000000011101000"}, // value = 1.8106555673243752, argument value = 1.2000000000000002 + {13,"000000000011111100"}, // value = 1.9709142303266285, argument value = 1.3 + {14,"000000000100010011"}, // value = 2.150898465393141, argument value = 1.4000000000000001 + {15,"000000000100101101"}, // value = 2.352409615243247, argument value = 1.5 + {16,"000000000101001010"}, // value = 2.5774644711948853, argument value = 1.6 + {17,"000000000101101010"}, // value = 2.8283154578899676, argument value = 1.7000000000000002 + {18,"000000000110001110"}, // value = 3.1074731763172667, argument value = 1.8 + {19,"000000000110110101"}, // value = 3.417731530750953, argument value = 1.9000000000000001 + {20,"000000000111100010"}, // value = 3.7621956910836314, argument value = 2.0 + {21,"000000001000010010"}, // value = 4.144313170410316, argument value = 2.1 + {22,"000000001001001001"}, // value = 4.567908328898228, argument value = 2.2 + {23,"000000001010000101"}, // value = 5.037220649268764, argument value = 2.3000000000000003 + {24,"000000001011000111"}, // value = 5.556947166965509, argument value = 2.4000000000000004 + {25,"000000001100010001"}, // value = 6.132289479663686, argument value = 2.5 + {26,"000000001101100010"}, // value = 6.769005806608012, argument value = 2.6 + {27,"000000001110111101"}, // value = 7.473468618806294, argument value = 2.7 + {28,"000000010000100000"}, // value = 8.252728416861137, argument value = 2.8000000000000003 + {29,"000000010010001111"}, // value = 9.114584294749738, argument value = 2.9000000000000004 + {30,"000000010100001001"}, // value = 10.067661995777765, argument value = 3.0 + {31,"000000010110010000"}, // value = 11.121500241917596, argument value = 3.1 + {32,"000000011000100101"}, // value = 12.28664620054386, argument value = 3.2 + {33,"000000011011001010"}, // value = 13.574761044029566, argument value = 3.3000000000000003 + {34,"000000011110000000"}, // value = 14.998736658678675, argument value = 3.4000000000000004 + {35,"000000100001001001"}, // value = 16.572824671057315, argument value = 3.5 + {36,"000000100100101000"}, // value = 18.31277908306264, argument value = 3.6 + {37,"000000101000011110"}, // value = 20.23601394326887, argument value = 3.7 + {38,"000000101100101110"}, // value = 22.3617776325785, argument value = 3.8000000000000003 + {39,"000000110001011011"}, // value = 24.711345508487994, argument value = 3.9000000000000004 + {40,"000000110110100111"}, // value = 27.308232836016487, argument value = 4.0 + {41,"000000111100010111"}, // value = 30.17843013638188, argument value = 4.1000000000000005 + {42,"000001000010101101"}, // value = 33.35066330887282, argument value = 4.2 + {43,"000001001001101110"}, // value = 36.85668112930399, argument value = 4.3 + {44,"000001010001011110"}, // value = 40.7315730024356, argument value = 4.4 + {45,"000001011010000010"}, // value = 45.014120148530026, argument value = 4.5 + {46,"000001100011100000"}, // value = 49.74718373883925, argument value = 4.6000000000000005 + {47,"000001101101111101"}, // value = 54.97813386461261, argument value = 4.7 + {48,"000001111001100001"}, // value = 60.75932363289199, argument value = 4.800000000000001 + {49,"000010000110010011"}, // value = 67.14861313400323, argument value = 4.9 + {50,"000010010100011011"}, // value = 74.20994852478785, argument value = 5.0 + {51,"000010100100000010"}, // value = 82.01400202323367, argument value = 5.1000000000000005 + {52,"000010110101010010"}, // value = 90.63887921978599, argument value = 5.2 + {53,"000011001000010110"}, // value = 100.17090078434937, argument value = 5.300000000000001 + {54,"000011011101011010"}, // value = 110.70546639256489, argument value = 5.4 + {55,"000011110100101101"}, // value = 122.34800951782942, argument value = 5.5 + {56,"000100001110011100"}, // value = 135.21505264493462, argument value = 5.6000000000000005 + {57,"000100101010111000"}, // value = 149.43537346625888, argument value = 5.7 + {58,"000101001010010011"}, // value = 165.15129373219713, argument value = 5.800000000000001 + {59,"000101101101000011"}, // value = 182.52010365507383, argument value = 5.9 + {60,"000110010011011100"}, // value = 201.7156361224559, argument value = 6.0 + {61,"000110111101110111"}, // value = 222.93000647511832, argument value = 6.1000000000000005 + {62,"000111101100110000"}, // value = 246.3755352619463, argument value = 6.2 + {63,"001000100000100101"}, // value = 272.28687321535324, argument value = 6.300000000000001 + {64,"001001011001110110"}, // value = 300.9233497146777, argument value = 6.4 + {65,"001010011001001001"}, // value = 332.5715682417774, argument value = 6.5 + {66,"001011011111000110"}, // value = 367.5482748050054, argument value = 6.6000000000000005 + {67,"001100101100011010"}, // value = 406.203528039723, argument value = 6.7 + {68,"001110000001110110"}, // value = 448.9242027127831, argument value = 6.800000000000001 + {69,"001111100000010010"}, // value = 496.1378616952276, argument value = 6.9 + {70,"010001001000101001"}, // value = 548.317035155212, argument value = 7.0 + {71,"010010111011111110"}, // value = 605.9839497987504, argument value = 7.1000000000000005 + {72,"010100111011011100"}, // value = 669.7157554901132, argument value = 7.2 + {73,"010111001000010011"}, // value = 740.1503015616607, argument value = 7.300000000000001 + {74,"011001100011111111"}, // value = 817.992520624344, argument value = 7.4 + {75,"011100010000000011"}, // value = 904.0214837702166, argument value = 7.5 + {76,"011111001110001101"}, // value = 999.0981977777762, argument value = 7.6000000000000005 + {77,"100010100000010110"}, // value = 1104.174222357196, argument value = 7.7 + {78,"100110001000100111"}, // value = 1220.3011936797398, argument value = 7.800000000000001 + }; +//Phase1 +const std::unordered_map<unsigned,std::string> TSU::Hyperbolic::Cosh = + { + {0,"000000000000010000000000"}, // value = 1.0(1.0), argument value = 0.0 + {25,"000000000000010000000000"}, // value = 1.0003125162763808(1.0), argument value = 0.025 + {50,"000000000000010000000001"}, // value = 1.001250260438369(1.0009765625), argument value = 0.05 + {75,"000000000000010000000011"}, // value = 1.0028138186065922(1.0029296875), argument value = 0.07500000000000001 + {100,"000000000000010000000101"}, // value = 1.0050041680558035(1.0048828125), argument value = 0.1 + {125,"000000000000010000001000"}, // value = 1.0078226778257109(1.0078125), argument value = 0.125 + {150,"000000000000010000001100"}, // value = 1.0112711095766704(1.01171875), argument value = 0.15000000000000002 + {175,"000000000000010000010000"}, // value = 1.0153516186907827(1.015625), argument value = 0.17500000000000002 + {200,"000000000000010000010101"}, // value = 1.020066755619076(1.0205078125), argument value = 0.2 + {225,"000000000000010000011010"}, // value = 1.0254194674756207(1.025390625), argument value = 0.225 + {250,"000000000000010000100000"}, // value = 1.0314130998795732(1.03125), argument value = 0.25 + {275,"000000000000010000100111"}, // value = 1.038051399046295(1.0380859375), argument value = 0.275 + {300,"000000000000010000101110"}, // value = 1.0453385141288605(1.044921875), argument value = 0.30000000000000004 + {325,"000000000000010000110111"}, // value = 1.0532789998114118(1.0537109375), argument value = 0.325 + {350,"000000000000010000111111"}, // value = 1.0618778191559854(1.0615234375), argument value = 0.35000000000000003 + {375,"000000000000010001001001"}, // value = 1.0711403467045868(1.0712890625), argument value = 0.375 + {400,"000000000000010001010011"}, // value = 1.081072371838455(1.0810546875), argument value = 0.4 + {425,"000000000000010001011110"}, // value = 1.091680102396613(1.091796875), argument value = 0.42500000000000004 + {450,"000000000000010001101001"}, // value = 1.102970168555971(1.1025390625), argument value = 0.45 + {475,"000000000000010001110110"}, // value = 1.1149496269754016(1.115234375), argument value = 0.47500000000000003 + {500,"000000000000010010000011"}, // value = 1.1276259652063807(1.1279296875), argument value = 0.5 + {525,"000000000000010010010000"}, // value = 1.1410071063729532(1.140625), argument value = 0.525 + {550,"000000000000010010011111"}, // value = 1.155101414123941(1.1552734375), argument value = 0.55 + {575,"000000000000010010101110"}, // value = 1.169917697860497(1.169921875), argument value = 0.5750000000000001 + {600,"000000000000010010111110"}, // value = 1.1854652182422678(1.185546875), argument value = 0.6000000000000001 + {625,"000000000000010011001111"}, // value = 1.2017536929756063(1.2021484375), argument value = 0.625 + {650,"000000000000010011100000"}, // value = 1.2187933028874562(1.21875), argument value = 0.65 + {675,"000000000000010011110010"}, // value = 1.2365946982886982(1.236328125), argument value = 0.675 + {700,"000000000000010100000101"}, // value = 1.255169005630943(1.2548828125), argument value = 0.7000000000000001 + {725,"000000000000010100011001"}, // value = 1.2745278344609245(1.2744140625), argument value = 0.7250000000000001 + {750,"000000000000010100101110"}, // value = 1.2946832846768448(1.294921875), argument value = 0.75 + {775,"000000000000010101000011"}, // value = 1.315647954091204(1.3154296875), argument value = 0.775 + {800,"000000000000010101011010"}, // value = 1.3374349463048447(1.337890625), argument value = 0.8 + {825,"000000000000010101110001"}, // value = 1.3600578788971267(1.3603515625), argument value = 0.8250000000000001 + {850,"000000000000010110001001"}, // value = 1.383530891937359(1.3837890625), argument value = 0.8500000000000001 + {875,"000000000000010110100010"}, // value = 1.4078686568228032(1.408203125), argument value = 0.875 + {900,"000000000000010110111011"}, // value = 1.4330863854487745(1.4326171875), argument value = 0.9 + {925,"000000000000010111010110"}, // value = 1.4591998397165704(1.458984375), argument value = 0.925 + {950,"000000000000010111110010"}, // value = 1.4862253413851738(1.486328125), argument value = 0.9500000000000001 + {975,"000000000000011000001111"}, // value = 1.514179782272882(1.5146484375), argument value = 0.9750000000000001 + {1000,"000000000000011000101100"}, // value = 1.5430806348152437(1.54296875), argument value = 1.0 + {1025,"000000000000011001001011"}, // value = 1.5729459629859013(1.5732421875), argument value = 1.0250000000000001 + {1050,"000000000000011001101010"}, // value = 1.6037944335871597(1.603515625), argument value = 1.05 + {1075,"000000000000011010001011"}, // value = 1.6356453279173475(1.6357421875), argument value = 1.075 + {1100,"000000000000011010101101"}, // value = 1.6685185538222564(1.6689453125), argument value = 1.1 + {1125,"000000000000011011001111"}, // value = 1.7024346581381904(1.7021484375), argument value = 1.125 + {1150,"000000000000011011110011"}, // value = 1.7374148395344107(1.7373046875), argument value = 1.1500000000000001 + {1175,"000000000000011100011000"}, // value = 1.7734809617629903(1.7734375), argument value = 1.175 + {1200,"000000000000011100111110"}, // value = 1.8106555673243752(1.810546875), argument value = 1.2000000000000002 + {1225,"000000000000011101100101"}, // value = 1.848961891557176(1.8486328125), argument value = 1.225 + {1250,"000000000000011110001110"}, // value = 1.8884238771610158(1.888671875), argument value = 1.25 + {1275,"000000000000011110110111"}, // value = 1.9290661891614935(1.9287109375), argument value = 1.2750000000000001 + {1300,"000000000000011111100010"}, // value = 1.9709142303266285(1.970703125), argument value = 1.3 + {1325,"000000000000100000001110"}, // value = 2.013994157044419(2.013671875), argument value = 1.3250000000000002 + {1350,"000000000000100000111100"}, // value = 2.058332895671433(2.05859375), argument value = 1.35 + {1375,"000000000000100001101010"}, // value = 2.1039581593626617(2.103515625), argument value = 1.375 + {1400,"000000000000100010011011"}, // value = 2.150898465393141(2.1513671875), argument value = 1.4000000000000001 + {1425,"000000000000100011001100"}, // value = 2.1991831529821746(2.19921875), argument value = 1.425 + {1450,"000000000000100011111111"}, // value = 2.248842401631308(2.2490234375), argument value = 1.4500000000000002 + {1475,"000000000000100100110011"}, // value = 2.2999072499874904(2.2998046875), argument value = 1.475 + {1500,"000000000000100101101001"}, // value = 2.352409615243247(2.3525390625), argument value = 1.5 + {1525,"000000000000100110100000"}, // value = 2.406382313085961(2.40625), argument value = 1.5250000000000001 + {1550,"000000000000100111011001"}, // value = 2.4618590782087426(2.4619140625), argument value = 1.55 + {1575,"000000000000101000010011"}, // value = 2.5188745853957157(2.5185546875), argument value = 1.5750000000000002 + {1600,"000000000000101001001111"}, // value = 2.5774644711948853(2.5771484375), argument value = 1.6 + {1625,"000000000000101010001101"}, // value = 2.6376653561921377(2.6376953125), argument value = 1.625 + {1650,"000000000000101011001100"}, // value = 2.6995148679003016(2.69921875), argument value = 1.6500000000000001 + {1675,"000000000000101100001101"}, // value = 2.7630516642775667(2.7626953125), argument value = 1.675 + {1700,"000000000000101101010000"}, // value = 2.8283154578899676(2.828125), argument value = 1.7000000000000002 + {1725,"000000000000101110010101"}, // value = 2.8953470407330277(2.8955078125), argument value = 1.725 + {1750,"000000000000101111011011"}, // value = 2.964188309728088(2.9638671875), argument value = 1.75 + {1775,"000000000000110000100100"}, // value = 3.0348822929092436(3.03515625), argument value = 1.7750000000000001 + {1800,"000000000000110001101110"}, // value = 3.1074731763172667(3.107421875), argument value = 1.8 + {1825,"000000000000110010111010"}, // value = 3.1820063316173215(3.181640625), argument value = 1.8250000000000002 + {1850,"000000000000110100001001"}, // value = 3.25852834445773(3.2587890625), argument value = 1.85 + {1875,"000000000000110101011001"}, // value = 3.3370870435875206(3.3369140625), argument value = 1.875 + {1900,"000000000000110110101100"}, // value = 3.417731530750953(3.41796875), argument value = 1.9000000000000001 + {1925,"000000000000111000000001"}, // value = 3.500512211377703(3.5009765625), argument value = 1.925 + {1950,"000000000000111001011000"}, // value = 3.585480826087904(3.5859375), argument value = 1.9500000000000002 + {1975,"000000000000111010110001"}, // value = 3.6726904830317118(3.6728515625), argument value = 1.975 + {2000,"000000000000111100001100"}, // value = 3.7621956910836314(3.76171875), argument value = 2.0 + {2025,"000000000000111101101011"}, // value = 3.8540523939123377(3.8544921875), argument value = 2.025 + {2050,"000000000000111111001011"}, // value = 3.9483180049472892(3.9482421875), argument value = 2.0500000000000003 + {2075,"000000000001000000101110"}, // value = 4.0450514432639855(4.044921875), argument value = 2.075 + {2100,"000000000001000010010100"}, // value = 4.144313170410316(4.14453125), argument value = 2.1 + {2125,"000000000001000011111100"}, // value = 4.246165228196992(4.24609375), argument value = 2.125 + {2150,"000000000001000101100111"}, // value = 4.350671277475695(4.3505859375), argument value = 2.15 + {2175,"000000000001000111010101"}, // value = 4.457896637929187(4.4580078125), argument value = 2.1750000000000003 + {2200,"000000000001001001000110"}, // value = 4.567908328898228(4.568359375), argument value = 2.2 + {2225,"000000000001001010111001"}, // value = 4.6807751112708615(4.6806640625), argument value = 2.225 + {2250,"000000000001001100110000"}, // value = 4.796567530460195(4.796875), argument value = 2.25 + {2275,"000000000001001110101001"}, // value = 4.915357960497585(4.9150390625), argument value = 2.275 + {2300,"000000000001010000100110"}, // value = 5.037220649268764(5.037109375), argument value = 2.3000000000000003 + {2325,"000000000001010010100110"}, // value = 5.1622317649211755(5.162109375), argument value = 2.325 + {2350,"000000000001010100101001"}, // value = 5.2904694434715624(5.2900390625), argument value = 2.35 + {2375,"000000000001010110110000"}, // value = 5.422013837643509(5.421875), argument value = 2.375 + {2400,"000000000001011000111010"}, // value = 5.556947166965509(5.556640625), argument value = 2.4000000000000004 + {2425,"000000000001011011001000"}, // value = 5.695353769160835(5.6953125), argument value = 2.4250000000000003 + {2450,"000000000001011101011001"}, // value = 5.837320152861381(5.8369140625), argument value = 2.45 + {2475,"000000000001011111101111"}, // value = 5.982935051678355(5.9833984375), argument value = 2.475 + {2500,"000000000001100010000111"}, // value = 6.132289479663686(6.1318359375), argument value = 2.5 + {2525,"000000000001100100100100"}, // value = 6.285476788196767(6.28515625), argument value = 2.5250000000000004 + {2550,"000000000001100111000101"}, // value = 6.442592724332095(6.4423828125), argument value = 2.5500000000000003 + {2575,"000000000001101001101010"}, // value = 6.603735490644314(6.603515625), argument value = 2.575 + {2600,"000000000001101100010011"}, // value = 6.769005806608012(6.7685546875), argument value = 2.6 + {2625,"000000000001101111000001"}, // value = 6.938506971550673(6.9384765625), argument value = 2.625 + {2650,"000000000001110001110011"}, // value = 7.112344929218119(7.1123046875), argument value = 2.6500000000000004 + {2675,"000000000001110100101010"}, // value = 7.290628333992791(7.291015625), argument value = 2.6750000000000003 + {2700,"000000000001110111100101"}, // value = 7.473468618806294(7.4736328125), argument value = 2.7 + {2725,"000000000001111010100101"}, // value = 7.660980064788592(7.6611328125), argument value = 2.725 + {2750,"000000000001111101101010"}, // value = 7.853279872697439(7.853515625), argument value = 2.75 + {2775,"000000000010000000110100"}, // value = 8.050488236172674(8.05078125), argument value = 2.7750000000000004 + {2800,"000000000010000100000011"}, // value = 8.252728416861137(8.2529296875), argument value = 2.8000000000000003 + {2825,"000000000010000111010111"}, // value = 8.460126821459237(8.4599609375), argument value = 2.825 + {2850,"000000000010001010110001"}, // value = 8.67281308072124(8.6728515625), argument value = 2.85 + {2875,"000000000010001110010000"}, // value = 8.89092013048271(8.890625), argument value = 2.875 + {2900,"000000000010010001110101"}, // value = 9.114584294749738(9.1142578125), argument value = 2.9000000000000004 + {2925,"000000000010010101100000"}, // value = 9.343945370905868(9.34375), argument value = 2.9250000000000003 + {2950,"000000000010011001010001"}, // value = 9.579146717090042(9.5791015625), argument value = 2.95 + {2975,"000000000010011101001000"}, // value = 9.820335341800075(9.8203125), argument value = 2.975 + {3000,"000000000010100001000101"}, // value = 10.067661995777765(10.0673828125), argument value = 3.0 + {3025,"000000000010100101001001"}, // value = 10.321281266233022(10.3212890625), argument value = 3.0250000000000004 + {3050,"000000000010101001010011"}, // value = 10.581351673465878(10.5810546875), argument value = 3.0500000000000003 + {3075,"000000000010101101100100"}, // value = 10.848035769946868(10.84765625), argument value = 3.075 + {3100,"000000000010110001111100"}, // value = 11.121500241917596(11.12109375), argument value = 3.1 + {3125,"000000000010110110011100"}, // value = 11.401916013575068(11.40234375), argument value = 3.125 + {3150,"000000000010111011000010"}, // value = 11.68945835390488(11.689453125), argument value = 3.1500000000000004 + {3175,"000000000010111111110000"}, // value = 11.984306986230031(11.984375), argument value = 3.1750000000000003 + {3200,"000000000011000100100110"}, // value = 12.28664620054386(12.287109375), argument value = 3.2 + {3225,"000000000011001001100011"}, // value = 12.596664968697294(12.5966796875), argument value = 3.225 + {3250,"000000000011001110101001"}, // value = 12.914557062512392(12.9150390625), argument value = 3.25 + {3275,"000000000011010011110110"}, // value = 13.240521174896063(13.240234375), argument value = 3.2750000000000004 + {3300,"000000000011011001001101"}, // value = 13.574761044029566(13.5751953125), argument value = 3.3000000000000003 + {3325,"000000000011011110101100"}, // value = 13.917485580711547(13.91796875), argument value = 3.325 + {3350,"000000000011100100010011"}, // value = 14.268908998934064(14.2685546875), argument value = 3.35 + {3375,"000000000011101010000100"}, // value = 14.629250949773304(14.62890625), argument value = 3.375 + {3400,"000000000011101111111111"}, // value = 14.998736658678675(14.9990234375), argument value = 3.4000000000000004 + {3425,"000000000011110110000011"}, // value = 15.377597066246011(15.3779296875), argument value = 3.4250000000000003 + {3450,"000000000011111100010000"}, // value = 15.766068972563003(15.765625), argument value = 3.45 + {3475,"000000000100000010101000"}, // value = 16.16439518521693(16.1640625), argument value = 3.475 + {3500,"000000000100001001001011"}, // value = 16.572824671057315(16.5732421875), argument value = 3.5 + {3525,"000000000100001111110111"}, // value = 16.99161271180833(16.9912109375), argument value = 3.5250000000000004 + {3550,"000000000100010110101111"}, // value = 17.421021063628135(17.4208984375), argument value = 3.5500000000000003 + {3575,"000000000100011101110010"}, // value = 17.86131812071505(17.861328125), argument value = 3.575 + {3600,"000000000100100101000000"}, // value = 18.31277908306264(18.3125), argument value = 3.6 + {3625,"000000000100101100011010"}, // value = 18.775686128468678(18.775390625), argument value = 3.625 + {3650,"000000000100110100000000"}, // value = 19.250328588905447(19.25), argument value = 3.6500000000000004 + {3675,"000000000100111011110011"}, // value = 19.73700313136163(19.7373046875), argument value = 3.6750000000000003 + {3700,"000000000101000011110010"}, // value = 20.23601394326887(20.236328125), argument value = 3.7 + {3725,"000000000101001011111110"}, // value = 20.747672922628787(20.748046875), argument value = 3.725 + {3750,"000000000101010100010111"}, // value = 21.272299872959398(21.2724609375), argument value = 3.75 + {3775,"000000000101011100111110"}, // value = 21.81022270318272(21.810546875), argument value = 3.7750000000000004 + {3800,"000000000101100101110010"}, // value = 22.3617776325785(22.361328125), argument value = 3.8000000000000003 + {3825,"000000000101101110110110"}, // value = 22.92730940093226(22.927734375), argument value = 3.825 + {3850,"000000000101111000000111"}, // value = 23.507171484008833(23.5068359375), argument value = 3.85 + {3875,"000000000110000001101000"}, // value = 24.101726314486257(24.1015625), argument value = 3.875 + {3900,"000000000110001011011000"}, // value = 24.711345508487994(24.7109375), argument value = 3.9000000000000004 + {3925,"000000000110010101011000"}, // value = 25.33641009785507(25.3359375), argument value = 3.9250000000000003 + {3950,"000000000110011111101001"}, // value = 25.977310768303415(25.9775390625), argument value = 3.95 + {3975,"000000000110101010001010"}, // value = 26.634448103615153(26.634765625), argument value = 3.975 + {4000,"000000000110110100111100"}, // value = 27.308232836016487(27.30859375), argument value = 4.0 + {4025,"000000000110111111111111"}, // value = 27.999086102898733(27.9990234375), argument value = 4.025 + {4050,"000000000111001011010100"}, // value = 28.70743971004284(28.70703125), argument value = 4.05 + {4075,"000000000111010110111100"}, // value = 29.43373640151219(29.43359375), argument value = 4.075 + {4100,"000000000111100010110111"}, // value = 30.17843013638188(30.1787109375), argument value = 4.1000000000000005 + {4125,"000000000111101111000101"}, // value = 30.941986372478024(30.9423828125), argument value = 4.125 + {4150,"000000000111111011100110"}, // value = 31.7248823573041(31.724609375), argument value = 4.15 + {4175,"000000001000001000011100"}, // value = 32.52760742633599(32.52734375), argument value = 4.175 + {4200,"000000001000010101100111"}, // value = 33.35066330887282(33.3505859375), argument value = 4.2 + {4225,"000000001000100011000111"}, // value = 34.19456444163387(34.1943359375), argument value = 4.2250000000000005 + {4250,"000000001000110000111101"}, // value = 35.05983829029843(35.0595703125), argument value = 4.25 + {4275,"000000001000111111001010"}, // value = 35.947025679189004(35.947265625), argument value = 4.275 + {4300,"000000001001001101101101"}, // value = 36.85668112930399(36.8564453125), argument value = 4.3 + {4325,"000000001001011100101000"}, // value = 37.789373204911584(37.7890625), argument value = 4.325 + {4350,"000000001001101011111100"}, // value = 38.74568486892069(38.74609375), argument value = 4.3500000000000005 + {4375,"000000001001111011101000"}, // value = 39.726213847251884(39.7265625), argument value = 4.375 + {4400,"000000001010001011101101"}, // value = 40.7315730024356(40.7314453125), argument value = 4.4 + {4425,"000000001010011100001101"}, // value = 41.762390716671(41.7626953125), argument value = 4.425 + {4450,"000000001010101101000111"}, // value = 42.81931128458549(42.8193359375), argument value = 4.45 + {4475,"000000001010111110011101"}, // value = 43.902995315939684(43.9033203125), argument value = 4.4750000000000005 + {4500,"000000001011010000001110"}, // value = 45.014120148530026(45.013671875), argument value = 4.5 + {4525,"000000001011100010011101"}, // value = 46.153380271547164(46.1533203125), argument value = 4.525 + {4550,"000000001011110101001001"}, // value = 47.321487759653955(47.3212890625), argument value = 4.55 + {4575,"000000001100001000010100"}, // value = 48.51917271805568(48.51953125), argument value = 4.575 + {4600,"000000001100011011111101"}, // value = 49.74718373883925(49.7470703125), argument value = 4.6000000000000005 + {4625,"000000001100110000000110"}, // value = 51.00628836886776(51.005859375), argument value = 4.625 + {4650,"000000001101000100110000"}, // value = 52.29727358952238(52.296875), argument value = 4.65 + {4675,"000000001101011001111100"}, // value = 53.6209463085911(53.62109375), argument value = 4.675 + {4700,"000000001101101111101010"}, // value = 54.97813386461261(54.978515625), argument value = 4.7 + {4725,"000000001110000101111011"}, // value = 56.36968454398958(56.3701171875), argument value = 4.7250000000000005 + {4750,"000000001110011100110000"}, // value = 57.796468111195395(57.796875), argument value = 4.75 + {4775,"000000001110110100001010"}, // value = 59.25937635240539(59.259765625), argument value = 4.775 + {4800,"000000001111001100001010"}, // value = 60.75932363289199(60.759765625), argument value = 4.800000000000001 + {4825,"000000001111100100110000"}, // value = 62.29724746853287(62.296875), argument value = 4.825 + {4850,"000000001111111101111111"}, // value = 63.874109111789075(63.8740234375), argument value = 4.8500000000000005 + {4875,"000000010000010111110111"}, // value = 65.49089415251873(65.4912109375), argument value = 4.875 + {4900,"000000010000110010011000"}, // value = 67.14861313400323(67.1484375), argument value = 4.9 + {4925,"000000010001001101100101"}, // value = 68.84830218456926(68.8486328125), argument value = 4.925000000000001 + {4950,"000000010001101001011101"}, // value = 70.59102366520295(70.5908203125), argument value = 4.95 + {4975,"000000010010000110000011"}, // value = 72.37786683356023(72.3779296875), argument value = 4.9750000000000005 + {5000,"000000010010100011010111"}, // value = 74.20994852478785(74.2099609375), argument value = 5.0 + {5025,"000000010011000001011011"}, // value = 76.08841384958228(76.0888671875), argument value = 5.025 + {5050,"000000010011100000001111"}, // value = 78.01443690992068(78.0146484375), argument value = 5.050000000000001 + {5075,"000000010011111111110101"}, // value = 79.98922153291308(79.9892578125), argument value = 5.075 + {5100,"000000010100100000001110"}, // value = 82.01400202323367(82.013671875), argument value = 5.1000000000000005 + {5125,"000000010101000001011100"}, // value = 84.09004393460096(84.08984375), argument value = 5.125 + {5150,"000000010101100011100000"}, // value = 86.21864486079059(86.21875), argument value = 5.15 + {5175,"000000010110000110011011"}, // value = 88.4011352466732(88.4013671875), argument value = 5.175000000000001 + {5200,"000000010110101010001110"}, // value = 90.63887921978599(90.638671875), argument value = 5.2 + {5225,"000000010111001110111100"}, // value = 92.93327544295703(92.93359375), argument value = 5.2250000000000005 + {5250,"000000010111110100100101"}, // value = 95.28575798851459(95.2861328125), argument value = 5.25 + {5275,"000000011000011011001011"}, // value = 97.6977972346296(97.6982421875), argument value = 5.275 + {5300,"000000011001000010101111"}, // value = 100.17090078434937(100.1708984375), argument value = 5.300000000000001 + {5325,"000000011001101011010100"}, // value = 102.7066144078987(102.70703125), argument value = 5.325 + {5350,"000000011010010100111010"}, // value = 105.30652300883698(105.306640625), argument value = 5.3500000000000005 + {5375,"000000011010111111100100"}, // value = 107.97225161467382(107.97265625), argument value = 5.375 + {5400,"000000011011101011010010"}, // value = 110.70546639256489(110.705078125), argument value = 5.4 + {5425,"000000011100011000001000"}, // value = 113.50787569071996(113.5078125), argument value = 5.425000000000001 + {5450,"000000011101000110000110"}, // value = 116.38123110617641(116.380859375), argument value = 5.45 + {5475,"000000011101110101001111"}, // value = 119.32732857960482(119.3271484375), argument value = 5.4750000000000005 + {5500,"000000011110100101100100"}, // value = 122.34800951782942(122.34765625), argument value = 5.5 + {5525,"000000011111010111001000"}, // value = 125.44516194476836(125.4453125), argument value = 5.525 + {5550,"000000100000001001111100"}, // value = 128.62072168150922(128.62109375), argument value = 5.550000000000001 + {5575,"000000100000111110000010"}, // value = 131.87667355626058(131.876953125), argument value = 5.575 + {5600,"000000100001110011011100"}, // value = 135.21505264493462(135.21484375), argument value = 5.6000000000000005 + {5625,"000000100010101010001101"}, // value = 138.637945543135(138.6376953125), argument value = 5.625 + {5650,"000000100011100010010111"}, // value = 142.14749167034793(142.1474609375), argument value = 5.65 + {5675,"000000100100011011111100"}, // value = 145.74588460714824(145.74609375), argument value = 5.675000000000001 + {5700,"000000100101010110111110"}, // value = 149.43537346625888(149.435546875), argument value = 5.7 + {5725,"000000100110010011100000"}, // value = 153.21826429832015(153.21875), argument value = 5.7250000000000005 + {5750,"000000100111010001100011"}, // value = 157.09692153324536(157.0966796875), argument value = 5.75 + {5775,"000000101000010001001100"}, // value = 161.0737694580676(161.07421875), argument value = 5.775 + {5800,"000000101001010010011011"}, // value = 165.15129373219713(165.1513671875), argument value = 5.800000000000001 + {5825,"000000101010010101010100"}, // value = 169.33204294103982(169.33203125), argument value = 5.825 + {5850,"000000101011011001111001"}, // value = 173.6186301889464(173.6181640625), argument value = 5.8500000000000005 + {5875,"000000101100100000001110"}, // value = 178.01373473248682(178.013671875), argument value = 5.875 + {5900,"000000101101101000010101"}, // value = 182.52010365507383(182.5205078125), argument value = 5.9 + {5925,"000000101110110010010000"}, // value = 187.1405535839787(187.140625), argument value = 5.925000000000001 + {5950,"000000101111111110000011"}, // value = 191.87797245081515(191.8779296875), argument value = 5.95 + {5975,"000000110001001011110001"}, // value = 196.73532129659145(196.7353515625), argument value = 5.9750000000000005 + {6000,"000000110010011011011101"}, // value = 201.7156361224559(201.7158203125), argument value = 6.0 + {6025,"000000110011101101001010"}, // value = 206.82202978729808(206.822265625), argument value = 6.025 + {6050,"000000110101000000111011"}, // value = 212.05769395338552(212.0576171875), argument value = 6.050000000000001 + {6075,"000000110110010110110100"}, // value = 217.4259010812572(217.42578125), argument value = 6.075 + {6100,"000000110111101110111000"}, // value = 222.93000647511832(222.9296875), argument value = 6.1000000000000005 + {6125,"000000111001001001001011"}, // value = 228.57345038001358(228.5732421875), argument value = 6.125 + {6150,"000000111010100101110000"}, // value = 234.35976013209353(234.359375), argument value = 6.15 + {6175,"000000111100000100101100"}, // value = 240.2925523633134(240.29296875), argument value = 6.175000000000001 + {6200,"000000111101100110000001"}, // value = 246.3755352619463(246.3759765625), argument value = 6.2 + {6225,"000000111111001001110011"}, // value = 252.6125108903222(252.6123046875), argument value = 6.2250000000000005 + {6250,"000001000000110000001000"}, // value = 259.0073775612391(259.0078125), argument value = 6.25 + {6275,"000001000010011001000010"}, // value = 265.5641322745374(265.564453125), argument value = 6.275 + {6300,"000001000100000100100110"}, // value = 272.28687321535324(272.287109375), argument value = 6.300000000000001 + {6325,"000001000101110010111000"}, // value = 279.17980231561796(279.1796875), argument value = 6.325 + {6350,"000001000111100011111101"}, // value = 286.24722788040384(286.2470703125), argument value = 6.3500000000000005 + {6375,"000001001001010111111001"}, // value = 293.4935672807523(293.4931640625), argument value = 6.375 + {6400,"000001001011001110110010"}, // value = 300.9233497146777(300.923828125), argument value = 6.4 + {6425,"000001001101001000101010"}, // value = 308.5412190380608(308.541015625), argument value = 6.425000000000001 + {6450,"000001001111000101101000"}, // value = 316.35193666721113(316.3515625), argument value = 6.45 + {6475,"000001010001000101110001"}, // value = 324.3603845549079(324.3603515625), argument value = 6.4750000000000005 + {6500,"000001010011001001001001"}, // value = 332.5715682417774(332.5712890625), argument value = 6.5 + {6525,"000001010101001111110110"}, // value = 340.9906199849213(340.990234375), argument value = 6.525 + {6550,"000001010111011001111110"}, // value = 349.62280196574204(349.623046875), argument value = 6.550000000000001 + {6575,"000001011001100111100101"}, // value = 358.47350957897885(358.4736328125), argument value = 6.575 + {6600,"000001011011111000110001"}, // value = 367.5482748050054(367.5478515625), argument value = 6.6000000000000005 + {6625,"000001011110001101101001"}, // value = 376.85276966749615(376.8525390625), argument value = 6.625 + {6650,"000001100000100110010010"}, // value = 386.3928097786277(386.392578125), argument value = 6.65 + {6675,"000001100011000010110011"}, // value = 396.17435797402396(396.1748046875), argument value = 6.675000000000001 + {6700,"000001100101100011010000"}, // value = 406.203528039723(406.203125), argument value = 6.7 + {6725,"000001101000000111110010"}, // value = 416.4865885334937(416.486328125), argument value = 6.7250000000000005 + {6750,"000001101010110000011111"}, // value = 427.02996670288616(427.0302734375), argument value = 6.75 + {6775,"000001101101011101011100"}, // value = 437.84025250247294(437.83984375), argument value = 6.775 + {6800,"000001110000001110110010"}, // value = 448.9242027127831(448.923828125), argument value = 6.800000000000001 + {6825,"000001110011000100101000"}, // value = 460.28874516351084(460.2890625), argument value = 6.825 + {6850,"000001110101111111000100"}, // value = 471.94098306363594(471.94140625), argument value = 6.8500000000000005 + {6875,"000001111000111110001110"}, // value = 483.8881994411576(483.888671875), argument value = 6.875 + {6900,"000001111100000010001101"}, // value = 496.1378616952276(496.1376953125), argument value = 6.9 + {6925,"000001111111001011001010"}, // value = 508.6976262635147(508.697265625), argument value = 6.925000000000001 + {6950,"000010000010011001001101"}, // value = 521.5753434077284(521.5751953125), argument value = 6.95 + {6975,"000010000101101100011110"}, // value = 534.7790621202903(534.779296875), argument value = 6.9750000000000005 + {7000,"000010001001000101000101"}, // value = 548.317035155212(548.3173828125), argument value = 7.0 + {7025,"000010001100100011001010"}, // value = 562.1977241863401(562.197265625), argument value = 7.025 + {7050,"000010010000000110111000"}, // value = 576.4298050961729(576.4296875), argument value = 7.050000000000001 + {7075,"000010010011110000010111"}, // value = 591.0221733985724(591.0224609375), argument value = 7.075 + {7100,"000010010111011111110000"}, // value = 605.9839497987504(605.984375), argument value = 7.1000000000000005 + {7125,"000010011011010101001100"}, // value = 621.324485894003(621.32421875), argument value = 7.125 + {7150,"000010011111010000110111"}, // value = 637.0533700187677(637.0537109375), argument value = 7.15 + {7175,"000010100011010010111001"}, // value = 653.1804332376405(653.1806640625), argument value = 7.175000000000001 + {7200,"000010100111011011011101"}, // value = 669.7157554901132(669.7158203125), argument value = 7.2 + {7225,"000010101011101010101110"}, // value = 686.6696718908651(686.669921875), argument value = 7.2250000000000005 + {7250,"000010110000000000110110"}, // value = 704.0527791895422(704.052734375), argument value = 7.25 + {7275,"000010110100011110000001"}, // value = 721.8759423940755(721.8759765625), argument value = 7.275 + {7300,"000010111001000010011010"}, // value = 740.1503015616607(740.150390625), argument value = 7.300000000000001 + {7325,"000010111101101110001101"}, // value = 758.8872787616575(758.8876953125), argument value = 7.325 + {7350,"000011000010100001100101"}, // value = 778.0985852147576(778.0986328125), argument value = 7.3500000000000005 + {7375,"000011000111011100101111"}, // value = 797.7962286128738(797.7958984375), argument value = 7.375 + {7400,"000011001100011111111000"}, // value = 817.992520624344(817.9921875), argument value = 7.4 + {7425,"000011010001101011001101"}, // value = 838.7000845891201(838.7001953125), argument value = 7.425000000000001 + {7450,"000011010110111110111010"}, // value = 859.9318634087675(859.931640625), argument value = 7.45 + {7475,"000011011100011011001110"}, // value = 881.701127636203(881.701171875), argument value = 7.4750000000000005 + {7500,"000011100010000000010110"}, // value = 904.0214837702166(904.021484375), argument value = 7.5 + {7525,"000011100111101110100001"}, // value = 926.9068827599834(926.9072265625), argument value = 7.525 + {7550,"000011101101100101111101"}, // value = 950.3716287248538(950.3720703125), argument value = 7.550000000000001 + {7575,"000011110011100110111001"}, // value = 974.4303878948974(974.4306640625), argument value = 7.575 + {7600,"000011111001110001100101"}, // value = 999.0981977777762(999.0986328125), argument value = 7.6000000000000005 + {7625,"000100000000000110010000"}, // value = 1024.3904765576706(1024.390625), argument value = 7.625 + {7650,"000100000110100101001011"}, // value = 1050.3230327321533(1050.3232421875), argument value = 7.65 + {7675,"000100001101001110100110"}, // value = 1076.9120749930087(1076.912109375), argument value = 7.675000000000001 + {7700,"000100010100000010110010"}, // value = 1104.174222357196(1104.173828125), argument value = 7.7 + {7725,"000100011011000010000010"}, // value = 1132.1265145542775(1132.126953125), argument value = 7.7250000000000005 + {7750,"000100100010001100100101"}, // value = 1160.7864226767988(1160.7861328125), argument value = 7.75 + {7775,"000100101001100010110000"}, // value = 1190.1718601002976(1190.171875), argument value = 7.775 + {7800,"000100110001000100110100"}, // value = 1220.3011936797398(1220.30078125), argument value = 7.800000000000001 + {7825,"000100111000110011000110"}, // value = 1251.1932552294047(1251.193359375), argument value = 7.825 + {7850,"000101000000101101111000"}, // value = 1282.8673532933847(1282.8671875), argument value = 7.8500000000000005 + {7875,"000101001000110101100000"}, // value = 1315.3432852140468(1315.34375), argument value = 7.875 + {7900,"000101010001001010010001"}, // value = 1348.641349506025(1348.6416015625), argument value = 7.9 + {7925,"000101011001101100100001"}, // value = 1382.782358543445(1382.7822265625), argument value = 7.925000000000001 + {7950,"000101100010011100100111"}, // value = 1417.7876515683374(1417.7880859375), argument value = 7.95 + {7975,"000101101011011010110111"}, // value = 1453.679108028365(1453.6787109375), argument value = 7.9750000000000005 + {8000,"000101110100100111101011"}, // value = 1490.479161252178(1490.4794921875), argument value = 8.0 + {8025,"000101111110000011011000"}, // value = 1528.2108124709878(1528.2109375), argument value = 8.025 + {8050,"000110000111101110010111"}, // value = 1566.897645195074(1566.8974609375), argument value = 8.05 + {8075,"000110010001101001000001"}, // value = 1606.5638399542527(1606.5634765625), argument value = 8.075000000000001 + {8100,"000110011011110011110000"}, // value = 1647.2341894114893(1647.234375), argument value = 8.1 + {8125,"000110100110001110111101"}, // value = 1688.9341138591324(1688.9345703125), argument value = 8.125 + {8150,"000110110000111011000010"}, // value = 1731.6896771074073(1731.689453125), argument value = 8.15 + {8175,"000110111011111000011100"}, // value = 1775.5276027751552(1775.52734375), argument value = 8.175 + {8200,"000111000111000111100111"}, // value = 1820.4752909929643(1820.4755859375), argument value = 8.200000000000001 + {8225,"000111010010101000111110"}, // value = 1866.5608355291386(1866.560546875), argument value = 8.225 + {8250,"000111011110011101000001"}, // value = 1913.8130413492318(1913.8134765625), argument value = 8.25 + {8275,"000111101010100100001100"}, // value = 1962.2614426200678(1962.26171875), argument value = 8.275 + {8300,"000111110110111110111111"}, // value = 2011.93632116957(2011.9365234375), argument value = 8.3 + {8325,"001000000011101101111010"}, // value = 2062.8687254138863(2062.869140625), argument value = 8.325000000000001 + {8350,"001000010000110001011101"}, // value = 2115.0904897636565(2115.0908203125), argument value = 8.35 + {8375,"001000011110001010001001"}, // value = 2168.634254521569(2168.6337890625), argument value = 8.375 + {8400,"001000101011111000100010"}, // value = 2223.533486283591(2223.533203125), argument value = 8.4 + {8425,"001000111001111101001010"}, // value = 2279.822498856696(2279.822265625), argument value = 8.425 + {8450,"001001001000011000100101"}, // value = 2337.536474706104(2337.5361328125), argument value = 8.450000000000001 + {8475,"001001010111001011011001"}, // value = 2396.7114869454663(2396.7119140625), argument value = 8.475 + {8500,"001001100110010110001010"}, // value = 2457.384521883752(2457.384765625), argument value = 8.5 + {8525,"001001110101111001100000"}, // value = 2519.593502142867(2519.59375), argument value = 8.525 + {8550,"001010000101110110000010"}, // value = 2583.377310360547(2583.376953125), argument value = 8.55 + {8575,"001010010110001100011010"}, // value = 2648.7758134932687(2648.775390625), argument value = 8.575000000000001 + {8600,"001010100110111101010010"}, // value = 2715.829887734386(2715.830078125), argument value = 8.6 + {8625,"001010111000001001010011"}, // value = 2784.5814440631048(2784.5810546875), argument value = 8.625 + {8650,"001011001001110001001011"}, // value = 2855.0734544401785(2855.0732421875), argument value = 8.65 + {8675,"001011011011110101100110"}, // value = 2927.349978666803(2927.349609375), argument value = 8.675 + {8700,"001011101110010111010011"}, // value = 3001.4561919234197(3001.4560546875), argument value = 8.700000000000001 + {8725,"001100000001010111000001"}, // value = 3077.438413005671(3077.4384765625), argument value = 8.725 + {8750,"001100010100110101100000"}, // value = 3155.344133275175(3155.34375), argument value = 8.75 + {8775,"001100101000110011100011"}, // value = 3235.2220463431404(3235.2216796875), argument value = 8.775 + {8800,"001100111101010001111101"}, // value = 3317.1220785054825(3317.1220703125), argument value = 8.8 + {8825,"001101010010010001100010"}, // value = 3401.0954199483745(3401.095703125), argument value = 8.825000000000001 + {8850,"001101100111110011000111"}, // value = 3487.194556743776(3487.1943359375), argument value = 8.85 + {8875,"001101111101110111100101"}, // value = 3575.4733036549615(3575.4736328125), argument value = 8.875 + {8900,"001110010100011111110011"}, // value = 3665.986837772461(3665.9873046875), argument value = 8.9 + {8925,"001110101011101100101011"}, // value = 3758.7917330015634(3758.7919921875), argument value = 8.925 + {8950,"001111000011011111001001"}, // value = 3853.945995422843(3853.9462890625), argument value = 8.950000000000001 + {8975,"001111011011111000001001"}, // value = 3951.5090995478395(3951.5087890625), argument value = 8.975 + {9000,"001111110100111000101011"}, // value = 4051.5420254925943(4051.5419921875), argument value = 9.0 + {9025,"010000001110100001101110"}, // value = 4154.107297092162(4154.107421875), argument value = 9.025 + {9050,"010000101000110100010011"}, // value = 4259.269020980078(4259.2685546875), argument value = 9.05 + {9075,"010001000011110001011111"}, // value = 4367.092926657075(4367.0927734375), argument value = 9.075000000000001 + {9100,"010001011111011010010110"}, // value = 4477.646407574158(4477.646484375), argument value = 9.1 + {9125,"010001111011101111111111"}, // value = 4590.998563255739(4590.9990234375), argument value = 9.125 + {9150,"010010011000110011100010"}, // value = 4707.220242489037(4707.220703125), argument value = 9.15 + {9175,"010010110110100110001001"}, // value = 4826.384087606909(4826.3837890625), argument value = 9.175 + {9200,"010011010101001001000010"}, // value = 4948.564579891665(4948.564453125), argument value = 9.200000000000001 + {9225,"010011110100011101011010"}, // value = 5073.838086128286(5073.837890625), argument value = 9.225 + {9250,"010100010100100100100010"}, // value = 5202.282906336188(5202.283203125), argument value = 9.25 + {9275,"010100110101011111101011"}, // value = 5333.979322709224(5333.9794921875), argument value = 9.275 + {9300,"010101010111010000001010"}, // value = 5469.009649794712(5469.009765625), argument value = 9.3 + {9325,"010101111001110111010101"}, // value = 5607.458285942687(5607.4580078125), argument value = 9.325000000000001 + {9350,"010110011101010110100110"}, // value = 5749.411766057619(5749.412109375), argument value = 9.35 + {9375,"010111000001101111010110"}, // value = 5894.958815685577(5894.958984375), argument value = 9.375 + {9400,"010111100111000011000011"}, // value = 6044.190406470527(6044.1904296875), argument value = 9.4 + {9425,"011000001101010011001101"}, // value = 6197.19981301461(6197.2001953125), argument value = 9.425 + {9450,"011000110100100001010101"}, // value = 6354.082671177795(6354.0830078125), argument value = 9.450000000000001 + {9475,"011001011100101111000000"}, // value = 6514.937037853392(6514.9375), argument value = 9.475 + {9500,"011010000101111101110100"}, // value = 6679.863452256852(6679.86328125), argument value = 9.5 + {9525,"011010110000001111011100"}, // value = 6848.964998765972(6848.96484375), argument value = 9.525 + {9550,"011011011011100101100100"}, // value = 7022.347371352046(7022.34765625), argument value = 9.55 + {9575,"011100001000000001111010"}, // value = 7200.118939642016(7200.119140625), argument value = 9.575000000000001 + {9600,"011100110101100110010000"}, // value = 7382.3908166530155(7382.390625), argument value = 9.600000000000001 + {9625,"011101100100010100011100"}, // value = 7569.276928241617(7569.27734375), argument value = 9.625 + {9650,"011110010100001110010100"}, // value = 7760.8940843112505(7760.89453125), argument value = 9.65 + {9675,"011111000101010101110011"}, // value = 7957.362051822112(7957.3623046875), argument value = 9.675 + {9700,"011111110111101100110111"}, // value = 8158.803629649473(8158.8037109375), argument value = 9.700000000000001 + {9725,"100000101011010101100001"}, // value = 8365.34472533695(8365.3447265625), argument value = 9.725000000000001 + {9750,"100001100000010001110101"}, // value = 8577.114433792824(8577.1142578125), argument value = 9.75 + {9775,"100010010110100011111011"}, // value = 8794.245117978593(8794.2451171875), argument value = 9.775 + {9800,"100011001110001101111101"} // value = 9016.872491640062(9016.8720703125), argument value = 9.8 + }; diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/KFLUT.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/KFLUT.cxx index c30a7b3a7ed7fbd07d1304527b38ee959027d765..f048ce01d31b896f5e2b7dd3dec40dbb90bc7129 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/KFLUT.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/KFLUT.cxx @@ -83,6 +83,10 @@ void TCS::KFLUT::fillLUT(){ LUTKF.push_back(v3); LUTKF.push_back(v4); - - + //Correction for rounding when 7 decimal bit applied + for (auto &vet : LUTKF){ + for (auto &veta : vet){ + veta = std::round(veta*std::pow(2,7))/std::pow(2,7); + } + } } diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Kinematics.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Kinematics.cxx index e9cf4ed6292ccb8bc26f2eeec61a5a3a4ea4cdf6..8b4b4ba4c3ac50b28007e698da9372406ddbada8 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Kinematics.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Kinematics.cxx @@ -12,6 +12,7 @@ #include "L1TopoSimulationUtils/Hyperbolic.h" #include "L1TopoSimulationUtils/L1TopoDataTypes.h" #include "L1TopoSimulationUtils/Trigo.h" +#include "L1TopoSimulationUtils/Expo.h" #include "L1TopoEvent/GenericTOB.h" @@ -32,7 +33,7 @@ unsigned int TSU::Kinematics::calcDeltaEtaBWLegacy(const TCS::GenericTOB* tob1, unsigned int TSU::Kinematics::calcInvMassBWLegacy(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2){ - auto bit_cosheta = TSU::L1TopoDataTypes<19,7>(TSU::Hyperbolic::Cosh.at(std::abs(tob1->eta() - tob2->eta()))); + auto bit_cosheta = TSU::L1TopoDataTypes<19,7>(TSU::Hyperbolic::Coshleg.at(std::abs(tob1->eta() - tob2->eta()))); //In case of EM objects / jets / taus the phi angle goes between 0 and 64 while muons are between -32 and 32, applying a shift to keep delta-phi in the allowed range. int phi_tob1 = tob1->phi(); int phi_tob2 = tob2->phi(); @@ -42,7 +43,7 @@ unsigned int TSU::Kinematics::calcInvMassBWLegacy(const TCS::GenericTOB* tob1, c if(phi_tob1 >= 32) phi_tob1 = phi_tob1-64; if(phi_tob2 >= 32) phi_tob2 = phi_tob2-64; } - auto bit_cosphi = TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Cos.at(std::abs( phi_tob1 - phi_tob2 ))); + auto bit_cosphi = TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Cosleg.at(std::abs( phi_tob1 - phi_tob2 ))); TSU::L1TopoDataTypes<11,0> bit_Et1(tob1->Et()); TSU::L1TopoDataTypes<11,0> bit_Et2(tob2->Et()); auto bit_invmass2 = bit_Et1*bit_Et2*(bit_cosheta - bit_cosphi)*2; @@ -50,7 +51,7 @@ unsigned int TSU::Kinematics::calcInvMassBWLegacy(const TCS::GenericTOB* tob1, c } unsigned int TSU::Kinematics::calcTMassBWLegacy(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { - auto bit_cosphi = TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Cos.at(std::abs(tob1->phi() - tob2->phi()))); + auto bit_cosphi = TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Cosleg.at(std::abs(tob1->phi() - tob2->phi()))); TSU::L1TopoDataTypes<11,0> bit_Et1(tob1->Et()); TSU::L1TopoDataTypes<11,0> bit_Et2(tob2->Et()); TSU::L1TopoDataTypes<22,0> bit_tmass2 = 2*bit_Et1*bit_Et2*(1. - bit_cosphi); @@ -70,6 +71,14 @@ unsigned int TSU::Kinematics::calcDeltaR2BWLegacy(const TCS::GenericTOB* tob1, c return bit_dr2; } +float TSU::Kinematics::calcCosLegacy(unsigned phi){ + return float(TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Cosleg.at(phi))); +} + +float TSU::Kinematics::calcSinLegacy(unsigned phi){ + return float(TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Sinleg.at(phi))); +} + unsigned int TSU::Kinematics::calcDeltaPhiBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2){ int dphiB = std::abs( tob1->phi() - tob2->phi() ); if(dphiB>64) @@ -87,25 +96,26 @@ unsigned int TSU::Kinematics::calcDeltaEtaBW(const TCS::GenericTOB* tob1, const unsigned int TSU::Kinematics::calcInvMassBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2){ - auto bit_cosheta = TSU::L1TopoDataTypes<19,7>(TSU::Hyperbolic::Cosh.at(std::abs(tob1->eta() - tob2->eta()))); + auto bit_cosheta = TSU::L1TopoDataTypes<14,10>(TSU::Hyperbolic::Cosh.at(100*std::abs(tob1->eta() - tob2->eta()))); //In case of EM objects / jets / taus the phi angle goes between 0 and 64 while muons are between -32 and 32, applying a shift to keep delta-phi in the allowed range. + //those cases should happen only in mixed EM/jets/tau plus mu triggers, if both phi's are in [0,2pi] will not get in int phi_tob1 = tob1->phi(); int phi_tob2 = tob2->phi(); - //those cases should happen only in mixed EM/jets/tau plus mu triggers, if both phi's are in [0,2pi] will not get in if ( std::abs(phi_tob1-phi_tob2)>=64 ) { if(phi_tob1 >= 32) phi_tob1 = phi_tob1-64; if(phi_tob2 >= 32) phi_tob2 = phi_tob2-64; } - auto bit_cosphi = TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Cos.at(std::abs( phi_tob1 - phi_tob2 ))); + auto bit_cosphi = TSU::L1TopoDataTypes<12,10>(TSU::Trigo::Cos.at(100*std::abs( phi_tob1 - phi_tob2 ))); TSU::L1TopoDataTypes<11,0> bit_Et1(tob1->Et()); TSU::L1TopoDataTypes<11,0> bit_Et2(tob2->Et()); auto bit_invmass2 = bit_Et1*bit_Et2*(bit_cosheta - bit_cosphi)*2; + return int(bit_invmass2) ; } unsigned int TSU::Kinematics::calcTMassBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { - auto bit_cosphi = TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Cos.at(std::abs(tob1->phi() - tob2->phi()))); + auto bit_cosphi = TSU::L1TopoDataTypes<12,10>(TSU::Trigo::Cos.at(100*std::abs(tob1->phi() - tob2->phi()))); TSU::L1TopoDataTypes<11,0> bit_Et1(tob1->Et()); TSU::L1TopoDataTypes<11,0> bit_Et2(tob2->Et()); TSU::L1TopoDataTypes<22,0> bit_tmass2 = 2*bit_Et1*bit_Et2*(1. - bit_cosphi); @@ -153,6 +163,40 @@ unsigned long TSU::Kinematics::quadraticSumBW(int i1, int i2){ return result; } +unsigned int TSU::Kinematics::calcXi1(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { + double scale = 1.4; // this will be converted MeV and unsigned when unit is right + double shift = 20; // this will be converted MeV and unsigned when unit is right + TSU::L1TopoDataTypes<11,0> bit_Et1(static_cast<unsigned>(scale*tob1->Et()+shift)); + TSU::L1TopoDataTypes<11,0> bit_Et2(static_cast<unsigned>(scale*tob2->Et()+shift)); + auto bit_eeta1 = TSU::L1TopoDataTypes<20,10>(TSU::Expo::E.at(100*tob1->eta())); + auto bit_eeta2 = TSU::L1TopoDataTypes<20,10>(TSU::Expo::E.at(100*tob2->eta())); + + auto xi_bit = bit_Et1*bit_eeta1+bit_Et2*bit_eeta2; + + return int(xi_bit); +} + +unsigned int TSU::Kinematics::calcXi2(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { + double scale = 1.4; // this will be converted MeV and unsigned when unit is right + double shift = 20; // this will be converted MeV and unsigned when unit is right + TSU::L1TopoDataTypes<11,0> bit_Et1(static_cast<unsigned>(scale*tob1->Et()+shift)); + TSU::L1TopoDataTypes<11,0> bit_Et2(static_cast<unsigned>(scale*tob2->Et()+shift)); + auto bit_eeta1 = TSU::L1TopoDataTypes<20,10>(TSU::Expo::E.at(-100*tob1->eta())); + auto bit_eeta2 = TSU::L1TopoDataTypes<20,10>(TSU::Expo::E.at(-100*tob2->eta())); + + auto xi_bit = bit_Et1*bit_eeta1+bit_Et2*bit_eeta2; + + return int(xi_bit); +} + +float TSU::Kinematics::calcCos(unsigned phi){ + return float(TSU::L1TopoDataTypes<12,10>(TSU::Trigo::Cos.at(100*phi))); +} + +float TSU::Kinematics::calcSin(unsigned phi){ + return float(TSU::L1TopoDataTypes<12,10>(TSU::Trigo::Sin.at(100*phi))); +} + /*------------------------------------------ NON-BITWISE --------------------------------------------------*/ unsigned int TSU::Kinematics::calcDeltaPhi(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Trigo.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Trigo.cxx index 9761e5895b749b84f41ea42b6b5d3d21361d6845..d377460b15321e25e9093df1a97dadce12d22c5f 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Trigo.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Trigo.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /********************************* * Trigo.cxx @@ -10,214 +10,583 @@ * Resolution is in PI/32. Values is in Qm.n format * with the MSB reserved for sign, and m=1, n = 7 * -**********************************/ + **********************************/ #include "L1TopoSimulationUtils/Trigo.h" #include <cmath> -const std::vector<std::string> TSU::Trigo::Cos= { - std::string("010000000"), // 1.0 - std::string("001111111"), // 0.9951847266721969 - std::string("001111110"), // 0.9807852804032304 - std::string("001111010"), // 0.9569403357322088 - std::string("001110110"), // 0.9238795325112867 - std::string("001110001"), // 0.881921264348355 // 5 - std::string("001101010"), // 0.8314696123025452 - std::string("001100011"), // 0.773010453362737 - std::string("001011011"), // 0.7071067811865476 - std::string("001010001"), // 0.6343932841636455 - std::string("001000111"), // 0.5555702330196023 // 10 - std::string("000111100"), // 0.4713967368259978 - std::string("000110001"), // 0.38268343236508984 - std::string("000100101"), // 0.29028467725446233 - std::string("000011001"), // 0.19509032201612833 - std::string("000001101"), // 0.09801714032956077 // 15 - std::string("000000000"), // 6.123233995736766e-17 - std::string("111110011"), // -0.09801714032956065 - std::string("111100111"), // -0.1950903220161282 - std::string("111011011"), // -0.29028467725446216 - std::string("111001111"), // -0.3826834323650897 // 20 - std::string("111000100"), // -0.4713967368259977 - std::string("110111001"), // -0.555570233019602 - std::string("110101111"), // -0.6343932841636454 - std::string("110100101"), // -0.7071067811865475 - std::string("110011101"), // -0.773010453362737 // 25 - std::string("110010110"), // -0.8314696123025453 - std::string("110001111"), // -0.8819212643483549 - std::string("110001010"), // -0.9238795325112867 - std::string("110000110"), // -0.9569403357322088 - std::string("110000010"), // -0.9807852804032304 // 30 - std::string("110000001"), // -0.9951847266721968 - std::string("110000000"), // -1.0 - std::string("110000001"), // -0.9951847266721969 - std::string("110000010"), // -0.9807852804032304 - std::string("110000110"), // -0.9569403357322089 // 35 - std::string("110001010"), // -0.9238795325112868 - std::string("110001111"), // -0.881921264348355 - std::string("110010110"), // -0.8314696123025455 - std::string("110011101"), // -0.7730104533627371 - std::string("110100101"), // -0.7071067811865477 // 40 - std::string("110101111"), // -0.6343932841636459 - std::string("110111001"), // -0.5555702330196022 - std::string("111000100"), // -0.47139673682599786 - std::string("111001111"), // -0.38268343236509034 - std::string("111011011"), // -0.29028467725446244 // 45 - std::string("111100111"), // -0.19509032201612866 - std::string("111110011"), // -0.09801714032956045 - std::string("000000000"), // -1.8369701987210297e-16 - std::string("000001101"), // 0.09801714032956009 - std::string("000011001"), // 0.1950903220161283 - std::string("000100101"), // 0.29028467725446205 - std::string("000110001"), // 0.38268343236509 - std::string("000111100"), // 0.4713967368259976 - std::string("001000111"), // 0.5555702330196018 - std::string("001010001"), // 0.6343932841636456 - std::string("001011011"), // 0.7071067811865474 - std::string("001100011"), // 0.7730104533627367 - std::string("001101010"), // 0.8314696123025452 - std::string("001110001"), // 0.8819212643483548 - std::string("001110110"), // 0.9238795325112865 - std::string("001111010"), // 0.9569403357322088 - std::string("001111110"), // 0.9807852804032303 - std::string("001111111") // 0.9951847266721969 -}; - - -const std::vector<std::string> TSU::Trigo::Sin = { - std::string("000000000"), // 0.0 // 0 - std::string("000001101"), // 0.0980171403295606 - std::string("000011001"), // 0.19509032201612825 - std::string("000100101"), // 0.29028467725446233 - std::string("000110001"), // 0.3826834323650898 - std::string("000111100"), // 0.47139673682599764 // 5 - std::string("001000111"), // 0.5555702330196022 - std::string("001010001"), // 0.6343932841636455 - std::string("001011011"), // 0.7071067811865475 - std::string("001100011"), // 0.773010453362737 - std::string("001101010"), // 0.8314696123025452 // 10 - std::string("001110001"), // 0.8819212643483549 - std::string("001110110"), // 0.9238795325112867 - std::string("001111010"), // 0.9569403357322089 - std::string("001111110"), // 0.9807852804032304 - std::string("001111111"), // 0.9951847266721968 // 15 - std::string("010000000"), // 1.0 - std::string("001111111"), // 0.9951847266721969 - std::string("001111110"), // 0.9807852804032304 - std::string("001111010"), // 0.9569403357322089 - std::string("001110110"), // 0.9238795325112867 // 20 - std::string("001110001"), // 0.881921264348355 - std::string("001101010"), // 0.8314696123025455 - std::string("001100011"), // 0.7730104533627371 - std::string("001011011"), // 0.7071067811865476 - std::string("001010001"), // 0.6343932841636455 // 25 - std::string("001000111"), // 0.5555702330196022 - std::string("000111100"), // 0.47139673682599786 - std::string("000110001"), // 0.3826834323650899 - std::string("000100101"), // 0.2902846772544624 - std::string("000011001"), // 0.1950903220161286 // 30 - std::string("000001101"), // 0.09801714032956083 - std::string("000000000"), // 1.2246467991473532e-16 - std::string("111110011"), // -0.09801714032956059 - std::string("111100111"), // -0.19509032201612836 - std::string("111011011"), // -0.2902846772544621 // 35 - std::string("111001111"), // -0.38268343236508967 - std::string("111000100"), // -0.47139673682599764 - std::string("110111001"), // -0.555570233019602 - std::string("110101111"), // -0.6343932841636453 - std::string("110100101"), // -0.7071067811865475 // 40 - std::string("110011101"), // -0.7730104533627367 - std::string("110010110"), // -0.8314696123025452 - std::string("110001111"), // -0.8819212643483549 - std::string("110001010"), // -0.9238795325112865 - std::string("110000110"), // -0.9569403357322088 // 45 - std::string("110000010"), // -0.9807852804032303 - std::string("110000001"), // -0.9951847266721969 - std::string("110000000"), // -1.0 - std::string("110000001"), // -0.9951847266721969 - std::string("110000010"), // -0.9807852804032304 // 50 - std::string("110000110"), // -0.9569403357322089 - std::string("110001010"), // -0.9238795325112866 - std::string("110001111"), // -0.881921264348355 - std::string("110010110"), // -0.8314696123025455 - std::string("110011101"), // -0.7730104533627369 // 55 - std::string("110100101"), // -0.7071067811865477 - std::string("110101111"), // -0.6343932841636459 - std::string("110111001"), // -0.5555702330196022 - std::string("111000100"), // -0.4713967368259979 - std::string("111001111"), // -0.3826834323650904 // 60 - std::string("111011011"), // -0.2902846772544625 - std::string("111100111"), // -0.19509032201612872 - std::string("111110011") // -0.0980171403295605 // 63 -}; +const std::unordered_map<unsigned,std::string> TSU::Trigo::Cosleg= + { + //legacy + {0,"010000000"}, // 1.0 + {1,"001111111"}, // 0.9951847266721969 + {2,"001111110"}, // 0.9807852804032304 + {3,"001111010"}, // 0.9569403357322088 + {4,"001110110"}, // 0.9238795325112867 + {5,"001110001"}, // 0.881921264348355 // 5 + {6,"001101010"}, // 0.8314696123025452 + {7,"001100011"}, // 0.773010453362737 + {8,"001011011"}, // 0.7071067811865476 + {9,"001010001"}, // 0.6343932841636455 + {10,"001000111"}, // 0.5555702330196023 // 10 + {11,"000111100"}, // 0.4713967368259978 + {12,"000110001"}, // 0.38268343236508984 + {13,"000100101"}, // 0.29028467725446233 + {14,"000011001"}, // 0.19509032201612833 + {15,"000001101"}, // 0.09801714032956077 // 15 + {16,"000000000"}, // 6.123233995736766e-17 + {17,"111110011"}, // -0.09801714032956065 + {18,"111100111"}, // -0.1950903220161282 + {19,"111011011"}, // -0.29028467725446216 + {20,"111001111"}, // -0.3826834323650897 // 20 + {21,"111000100"}, // -0.4713967368259977 + {22,"110111001"}, // -0.555570233019602 + {23,"110101111"}, // -0.6343932841636454 + {24,"110100101"}, // -0.7071067811865475 + {25,"110011101"}, // -0.773010453362737 // 25 + {26,"110010110"}, // -0.8314696123025453 + {27,"110001111"}, // -0.8819212643483549 + {28,"110001010"}, // -0.9238795325112867 + {29,"110000110"}, // -0.9569403357322088 + {30,"110000010"}, // -0.9807852804032304 // 30 + {31,"110000001"}, // -0.9951847266721968 + {32,"110000000"}, // -1.0 + {33,"110000001"}, // -0.9951847266721969 + {34,"110000010"}, // -0.9807852804032304 + {35,"110000110"}, // -0.9569403357322089 // 35 + {36,"110001010"}, // -0.9238795325112868 + {37,"110001111"}, // -0.881921264348355 + {38,"110010110"}, // -0.8314696123025455 + {39,"110011101"}, // -0.7730104533627371 + {40,"110100101"}, // -0.7071067811865477 // 40 + {41,"110101111"}, // -0.6343932841636459 + {42,"110111001"}, // -0.5555702330196022 + {43,"111000100"}, // -0.47139673682599786 + {44,"111001111"}, // -0.38268343236509034 + {45,"111011011"}, // -0.29028467725446244 // 45 + {46,"111100111"}, // -0.19509032201612866 + {47,"111110011"}, // -0.09801714032956045 + {48,"000000000"}, // -1.8369701987210297e-16 + {49,"000001101"}, // 0.09801714032956009 + {50,"000011001"}, // 0.1950903220161283 + {51,"000100101"}, // 0.29028467725446205 + {52,"000110001"}, // 0.38268343236509 + {53,"000111100"}, // 0.4713967368259976 + {54,"001000111"}, // 0.5555702330196018 + {55,"001010001"}, // 0.6343932841636456 + {56,"001011011"}, // 0.7071067811865474 + {57,"001100011"}, // 0.7730104533627367 + {58,"001101010"}, // 0.8314696123025452 + {59,"001110001"}, // 0.8819212643483548 + {60,"001110110"}, // 0.9238795325112865 + {61,"001111010"}, // 0.9569403357322088 + {62,"001111110"}, // 0.9807852804032303 + {63,"001111111"} // 0.9951847266721969 + }; + +//phase1 +const std::unordered_map<unsigned,std::string> TSU::Trigo::Cos= + { + {0,"010000000000"}, // value = 1.0(1.0), argument value = 0.0 + {50,"001111111111"}, // value = 0.9987954562051724(0.9990234375), argument value = 0.04908738521234052 + {100,"001111111011"}, // value = 0.9951847266721969(0.9951171875), argument value = 0.09817477042468103 + {150,"001111110101"}, // value = 0.989176509964781(0.9892578125), argument value = 0.14726215563702155 + {200,"001111101100"}, // value = 0.9807852804032304(0.98046875), argument value = 0.19634954084936207 + {250,"001111100001"}, // value = 0.970031253194544(0.9697265625), argument value = 0.2454369260617026 + {300,"001111010100"}, // value = 0.9569403357322088(0.95703125), argument value = 0.2945243112740431 + {350,"001111000100"}, // value = 0.9415440651830208(0.94140625), argument value = 0.3436116964863836 + {400,"001110110010"}, // value = 0.9238795325112867(0.923828125), argument value = 0.39269908169872414 + {450,"001110011110"}, // value = 0.9039892931234433(0.904296875), argument value = 0.44178646691106466 + {500,"001110000111"}, // value = 0.881921264348355(0.8818359375), argument value = 0.4908738521234052 + {550,"001101101110"}, // value = 0.8577286100002721(0.857421875), argument value = 0.5399612373357456 + {600,"001101010011"}, // value = 0.8314696123025452(0.8310546875), argument value = 0.5890486225480862 + {650,"001100110110"}, // value = 0.8032075314806449(0.802734375), argument value = 0.6381360077604268 + {700,"001100011000"}, // value = 0.773010453362737(0.7734375), argument value = 0.6872233929727672 + {750,"001011110111"}, // value = 0.7409511253549591(0.7412109375), argument value = 0.7363107781851077 + {800,"001011010100"}, // value = 0.7071067811865476(0.70703125), argument value = 0.7853981633974483 + {850,"001010110000"}, // value = 0.6715589548470183(0.671875), argument value = 0.8344855486097889 + {900,"001010001010"}, // value = 0.6343932841636455(0.634765625), argument value = 0.8835729338221293 + {950,"001001100010"}, // value = 0.5956993044924335(0.595703125), argument value = 0.9326603190344698 + {1000,"001000111001"}, // value = 0.5555702330196023(0.5556640625), argument value = 0.9817477042468103 + {1050,"001000001110"}, // value = 0.5141027441932217(0.513671875), argument value = 1.030835089459151 + {1100,"000111100011"}, // value = 0.4713967368259978(0.4716796875), argument value = 1.0799224746714913 + {1150,"000110110110"}, // value = 0.4275550934302822(0.427734375), argument value = 1.1290098598838318 + {1200,"000110001000"}, // value = 0.38268343236508984(0.3828125), argument value = 1.1780972450961724 + {1250,"000101011001"}, // value = 0.33688985339222005(0.3369140625), argument value = 1.227184630308513 + {1300,"000100101001"}, // value = 0.29028467725446233(0.2900390625), argument value = 1.2762720155208536 + {1350,"000011111001"}, // value = 0.24298017990326398(0.2431640625), argument value = 1.325359400733194 + {1400,"000011001000"}, // value = 0.19509032201612833(0.1953125), argument value = 1.3744467859455345 + {1450,"000010010110"}, // value = 0.14673047445536175(0.146484375), argument value = 1.423534171157875 + {1500,"000001100100"}, // value = 0.09801714032956077(0.09765625), argument value = 1.4726215563702154 + {1550,"000000110010"}, // value = 0.049067674327418126(0.048828125), argument value = 1.521708941582556 + {1600,"000000000000"}, // value = 6.123233995736766e-17(0.0), argument value = 1.5707963267948966 + {1650,"111111001110"}, // value = -0.04906767432741801(-0.048828125), argument value = 1.6198837120072371 + {1700,"111110011100"}, // value = -0.09801714032956065(-0.09765625), argument value = 1.6689710972195777 + {1750,"111101101010"}, // value = -0.14673047445536164(-0.146484375), argument value = 1.718058482431918 + {1800,"111100111000"}, // value = -0.1950903220161282(-0.1953125), argument value = 1.7671458676442586 + {1850,"111100000111"}, // value = -0.24298017990326387(-0.2431640625), argument value = 1.8162332528565992 + {1900,"111011010111"}, // value = -0.29028467725446216(-0.2900390625), argument value = 1.8653206380689396 + {1950,"111010100111"}, // value = -0.33688985339221994(-0.3369140625), argument value = 1.9144080232812801 + {2000,"111001111000"}, // value = -0.3826834323650897(-0.3828125), argument value = 1.9634954084936207 + {2050,"111001001010"}, // value = -0.42755509343028186(-0.427734375), argument value = 2.012582793705961 + {2100,"111000011101"}, // value = -0.4713967368259977(-0.4716796875), argument value = 2.061670178918302 + {2150,"110111110010"}, // value = -0.5141027441932217(-0.513671875), argument value = 2.110757564130642 + {2200,"110111000111"}, // value = -0.555570233019602(-0.5556640625), argument value = 2.1598449493429825 + {2250,"110110011110"}, // value = -0.5956993044924334(-0.595703125), argument value = 2.2089323345553233 + {2300,"110101110110"}, // value = -0.6343932841636454(-0.634765625), argument value = 2.2580197197676637 + {2350,"110101010000"}, // value = -0.6715589548470184(-0.671875), argument value = 2.3071071049800045 + {2400,"110100101100"}, // value = -0.7071067811865475(-0.70703125), argument value = 2.356194490192345 + {2450,"110100001001"}, // value = -0.7409511253549589(-0.7412109375), argument value = 2.405281875404685 + {2500,"110011101000"}, // value = -0.773010453362737(-0.7734375), argument value = 2.454369260617026 + {2550,"110011001010"}, // value = -0.8032075314806448(-0.802734375), argument value = 2.5034566458293663 + {2600,"110010101101"}, // value = -0.8314696123025453(-0.8310546875), argument value = 2.552544031041707 + {2650,"110010010010"}, // value = -0.857728610000272(-0.857421875), argument value = 2.6016314162540475 + {2700,"110001111001"}, // value = -0.8819212643483549(-0.8818359375), argument value = 2.650718801466388 + {2750,"110001100010"}, // value = -0.9039892931234433(-0.904296875), argument value = 2.6998061866787286 + {2800,"110001001110"}, // value = -0.9238795325112867(-0.923828125), argument value = 2.748893571891069 + {2850,"110000111100"}, // value = -0.9415440651830207(-0.94140625), argument value = 2.7979809571034093 + {2900,"110000101100"}, // value = -0.9569403357322088(-0.95703125), argument value = 2.84706834231575 + {2950,"110000011111"}, // value = -0.970031253194544(-0.9697265625), argument value = 2.8961557275280905 + {3000,"110000010100"}, // value = -0.9807852804032304(-0.98046875), argument value = 2.945243112740431 + {3050,"110000001011"}, // value = -0.989176509964781(-0.9892578125), argument value = 2.9943304979527716 + {3100,"110000000101"}, // value = -0.9951847266721968(-0.9951171875), argument value = 3.043417883165112 + {3150,"110000000001"}, // value = -0.9987954562051724(-0.9990234375), argument value = 3.0925052683774528 + {3200,"110000000000"}, // value = -1.0(-1.0), argument value = 3.141592653589793 + {3250,"110000000001"}, // value = -0.9987954562051724(-0.9990234375), argument value = 3.1906800388021335 + {3300,"110000000101"}, // value = -0.9951847266721969(-0.9951171875), argument value = 3.2397674240144743 + {3350,"110000001011"}, // value = -0.989176509964781(-0.9892578125), argument value = 3.2888548092268146 + {3400,"110000010100"}, // value = -0.9807852804032304(-0.98046875), argument value = 3.3379421944391554 + {3450,"110000011111"}, // value = -0.970031253194544(-0.9697265625), argument value = 3.3870295796514958 + {3500,"110000101100"}, // value = -0.9569403357322089(-0.95703125), argument value = 3.436116964863836 + {3550,"110000111100"}, // value = -0.9415440651830208(-0.94140625), argument value = 3.485204350076177 + {3600,"110001001110"}, // value = -0.9238795325112868(-0.923828125), argument value = 3.5342917352885173 + {3650,"110001100010"}, // value = -0.9039892931234434(-0.904296875), argument value = 3.5833791205008576 + {3700,"110001111001"}, // value = -0.881921264348355(-0.8818359375), argument value = 3.6324665057131984 + {3750,"110010010010"}, // value = -0.8577286100002721(-0.857421875), argument value = 3.6815538909255388 + {3800,"110010101101"}, // value = -0.8314696123025455(-0.8310546875), argument value = 3.730641276137879 + {3850,"110011001010"}, // value = -0.8032075314806449(-0.802734375), argument value = 3.77972866135022 + {3900,"110011101000"}, // value = -0.7730104533627371(-0.7734375), argument value = 3.8288160465625602 + {3950,"110100001001"}, // value = -0.7409511253549591(-0.7412109375), argument value = 3.877903431774901 + {4000,"110100101100"}, // value = -0.7071067811865477(-0.70703125), argument value = 3.9269908169872414 + {4050,"110101010000"}, // value = -0.6715589548470187(-0.671875), argument value = 3.9760782021995817 + {4100,"110101110110"}, // value = -0.6343932841636459(-0.634765625), argument value = 4.025165587411922 + {4150,"110110011110"}, // value = -0.5956993044924331(-0.595703125), argument value = 4.074252972624263 + {4200,"110111000111"}, // value = -0.5555702330196022(-0.5556640625), argument value = 4.123340357836604 + {4250,"110111110010"}, // value = -0.5141027441932218(-0.513671875), argument value = 4.172427743048944 + {4300,"111000011101"}, // value = -0.47139673682599786(-0.4716796875), argument value = 4.221515128261284 + {4350,"111001001010"}, // value = -0.4275550934302825(-0.427734375), argument value = 4.270602513473625 + {4400,"111001111000"}, // value = -0.38268343236509034(-0.3828125), argument value = 4.319689898685965 + {4450,"111010100111"}, // value = -0.33688985339221994(-0.3369140625), argument value = 4.368777283898306 + {4500,"111011010111"}, // value = -0.29028467725446244(-0.2900390625), argument value = 4.417864669110647 + {4550,"111100000111"}, // value = -0.24298017990326412(-0.2431640625), argument value = 4.466952054322987 + {4600,"111100111000"}, // value = -0.19509032201612866(-0.1953125), argument value = 4.516039439535327 + {4650,"111101101010"}, // value = -0.1467304744553623(-0.146484375), argument value = 4.565126824747668 + {4700,"111110011100"}, // value = -0.09801714032956045(-0.09765625), argument value = 4.614214209960009 + {4750,"111111001110"}, // value = -0.04906767432741803(-0.048828125), argument value = 4.663301595172349 + {4800,"000000000000"}, // value = -1.8369701987210297e-16(0.0), argument value = 4.71238898038469 + {4850,"000000110010"}, // value = 0.04906767432741766(0.048828125), argument value = 4.76147636559703 + {4900,"000001100100"}, // value = 0.09801714032956009(0.09765625), argument value = 4.81056375080937 + {4950,"000010010110"}, // value = 0.14673047445536194(0.146484375), argument value = 4.859651136021712 + {5000,"000011001000"}, // value = 0.1950903220161283(0.1953125), argument value = 4.908738521234052 + {5050,"000011111001"}, // value = 0.24298017990326376(0.2431640625), argument value = 4.957825906446392 + {5100,"000100101001"}, // value = 0.29028467725446205(0.2900390625), argument value = 5.006913291658733 + {5150,"000101011001"}, // value = 0.3368898533922196(0.3369140625), argument value = 5.056000676871073 + {5200,"000110001000"}, // value = 0.38268343236509(0.3828125), argument value = 5.105088062083414 + {5250,"000110110110"}, // value = 0.42755509343028214(0.427734375), argument value = 5.154175447295755 + {5300,"000111100011"}, // value = 0.4713967368259976(0.4716796875), argument value = 5.203262832508095 + {5350,"001000001110"}, // value = 0.5141027441932216(0.513671875), argument value = 5.252350217720435 + {5400,"001000111001"}, // value = 0.5555702330196018(0.5556640625), argument value = 5.301437602932776 + {5450,"001001100010"}, // value = 0.5956993044924329(0.595703125), argument value = 5.350524988145116 + {5500,"001010001010"}, // value = 0.6343932841636456(0.634765625), argument value = 5.399612373357457 + {5550,"001010110000"}, // value = 0.6715589548470183(0.671875), argument value = 5.448699758569798 + {5600,"001011010100"}, // value = 0.7071067811865474(0.70703125), argument value = 5.497787143782138 + {5650,"001011110111"}, // value = 0.7409511253549589(0.7412109375), argument value = 5.546874528994478 + {5700,"001100011000"}, // value = 0.7730104533627367(0.7734375), argument value = 5.595961914206819 + {5750,"001100110110"}, // value = 0.803207531480645(0.802734375), argument value = 5.64504929941916 + {5800,"001101010011"}, // value = 0.8314696123025452(0.8310546875), argument value = 5.6941366846315 + {5850,"001101101110"}, // value = 0.857728610000272(0.857421875), argument value = 5.743224069843841 + {5900,"001110000111"}, // value = 0.8819212643483548(0.8818359375), argument value = 5.792311455056181 + {5950,"001110011110"}, // value = 0.9039892931234431(0.904296875), argument value = 5.841398840268521 + {6000,"001110110010"}, // value = 0.9238795325112865(0.923828125), argument value = 5.890486225480862 + {6050,"001111000100"}, // value = 0.9415440651830208(0.94140625), argument value = 5.939573610693203 + {6100,"001111010100"}, // value = 0.9569403357322088(0.95703125), argument value = 5.988660995905543 + {6150,"001111100001"}, // value = 0.970031253194544(0.9697265625), argument value = 6.037748381117884 + {6200,"001111101100"}, // value = 0.9807852804032303(0.98046875), argument value = 6.086835766330224 + {6250,"001111110101"}, // value = 0.9891765099647809(0.9892578125), argument value = 6.135923151542564 + {6300,"001111111011"}, // value = 0.9951847266721969(0.9951171875), argument value = 6.1850105367549055 + {6350,"001111111111"} // value = 0.9987954562051724(0.9990234375), argument value = 6.234097921967246 + }; + + +const std::unordered_map<unsigned,std::string> TSU::Trigo::Sinleg = + { + {0,"000000000"}, // 0.0 // 0 + {1,"000001101"}, // 0.0980171403295606 + {2,"000011001"}, // 0.19509032201612825 + {3,"000100101"}, // 0.29028467725446233 + {4,"000110001"}, // 0.3826834323650898 + {5,"000111100"}, // 0.47139673682599764 // 5 + {6,"001000111"}, // 0.5555702330196022 + {7,"001010001"}, // 0.6343932841636455 + {8,"001011011"}, // 0.7071067811865475 + {9,"001100011"}, // 0.773010453362737 + {10,"001101010"}, // 0.8314696123025452 // 10 + {11,"001110001"}, // 0.8819212643483549 + {12,"001110110"}, // 0.9238795325112867 + {13,"001111010"}, // 0.9569403357322089 + {14,"001111110"}, // 0.9807852804032304 + {15,"001111111"}, // 0.9951847266721968 // 15 + {16,"010000000"}, // 1.0 + {17,"001111111"}, // 0.9951847266721969 + {18,"001111110"}, // 0.9807852804032304 + {19,"001111010"}, // 0.9569403357322089 + {20,"001110110"}, // 0.9238795325112867 // 20 + {21,"001110001"}, // 0.881921264348355 + {22,"001101010"}, // 0.8314696123025455 + {23,"001100011"}, // 0.7730104533627371 + {24,"001011011"}, // 0.7071067811865476 + {25,"001010001"}, // 0.6343932841636455 // 25 + {26,"001000111"}, // 0.5555702330196022 + {27,"000111100"}, // 0.47139673682599786 + {28,"000110001"}, // 0.3826834323650899 + {29,"000100101"}, // 0.2902846772544624 + {30,"000011001"}, // 0.1950903220161286 // 30 + {31,"000001101"}, // 0.09801714032956083 + {32,"000000000"}, // 1.2246467991473532e-16 + {33,"111110011"}, // -0.09801714032956059 + {34,"111100111"}, // -0.19509032201612836 + {35,"111011011"}, // -0.2902846772544621 // 35 + {36,"111001111"}, // -0.38268343236508967 + {37,"111000100"}, // -0.47139673682599764 + {38,"110111001"}, // -0.555570233019602 + {39,"110101111"}, // -0.6343932841636453 + {40,"110100101"}, // -0.7071067811865475 // 40 + {41,"110011101"}, // -0.7730104533627367 + {42,"110010110"}, // -0.8314696123025452 + {43,"110001111"}, // -0.8819212643483549 + {44,"110001010"}, // -0.9238795325112865 + {45,"110000110"}, // -0.9569403357322088 // 45 + {46,"110000010"}, // -0.9807852804032303 + {47,"110000001"}, // -0.9951847266721969 + {48,"110000000"}, // -1.0 + {49,"110000001"}, // -0.9951847266721969 + {50,"110000010"}, // -0.9807852804032304 // 50 + {51,"110000110"}, // -0.9569403357322089 + {52,"110001010"}, // -0.9238795325112866 + {53,"110001111"}, // -0.881921264348355 + {54,"110010110"}, // -0.8314696123025455 + {55,"110011101"}, // -0.7730104533627369 // 55 + {56,"110100101"}, // -0.7071067811865477 + {57,"110101111"}, // -0.6343932841636459 + {58,"110111001"}, // -0.5555702330196022 + {59,"111000100"}, // -0.4713967368259979 + {60,"111001111"}, // -0.3826834323650904 // 60 + {61,"111011011"}, // -0.2902846772544625 + {62,"111100111"}, // -0.19509032201612872 + {63,"111110011"} // -0.0980171403295605 // 63 + }; + +//phase1 +const std::unordered_map<unsigned,std::string> TSU::Trigo::Sin= + { + {0,"000000000000"}, // 0.0 + {50,"000000110010"}, // 0.049067674327418015 + {100,"000001100100"}, // 0.0980171403295606 + {150,"000010010110"}, // 0.14673047445536175 + {200,"000011001000"}, // 0.19509032201612825 + {250,"000011111001"}, // 0.24298017990326387 + {300,"000100101001"}, // 0.29028467725446233 + {350,"000101011001"}, // 0.33688985339222005 + {400,"000110001000"}, // 0.3826834323650898 + {450,"000110110110"}, // 0.4275550934302821 + {500,"000111100011"}, // 0.47139673682599764 + {550,"001000001110"}, // 0.5141027441932217 + {600,"001000111001"}, // 0.5555702330196022 + {650,"001001100010"}, // 0.5956993044924334 + {700,"001010001010"}, // 0.6343932841636455 + {750,"001010110000"}, // 0.6715589548470183 + {800,"001011010100"}, // 0.7071067811865475 + {850,"001011110111"}, // 0.7409511253549591 + {900,"001100011000"}, // 0.773010453362737 + {950,"001100110110"}, // 0.8032075314806448 + {1000,"001101010011"}, // 0.8314696123025452 + {1050,"001101101110"}, // 0.8577286100002721 + {1100,"001110000111"}, // 0.8819212643483549 + {1150,"001110011110"}, // 0.9039892931234433 + {1200,"001110110010"}, // 0.9238795325112867 + {1250,"001111000100"}, // 0.9415440651830208 + {1300,"001111010100"}, // 0.9569403357322089 + {1350,"001111100001"}, // 0.970031253194544 + {1400,"001111101100"}, // 0.9807852804032304 + {1450,"001111110101"}, // 0.989176509964781 + {1500,"001111111011"}, // 0.9951847266721968 + {1550,"001111111111"}, // 0.9987954562051724 + {1600,"010000000000"}, // 1.0 + {1650,"001111111111"}, // 0.9987954562051724 + {1700,"001111111011"}, // 0.9951847266721969 + {1750,"001111110101"}, // 0.989176509964781 + {1800,"001111101100"}, // 0.9807852804032304 + {1850,"001111100001"}, // 0.970031253194544 + {1900,"001111010100"}, // 0.9569403357322089 + {1950,"001111000100"}, // 0.9415440651830208 + {2000,"001110110010"}, // 0.9238795325112867 + {2050,"001110011110"}, // 0.9039892931234434 + {2100,"001110000111"}, // 0.881921264348355 + {2150,"001101101110"}, // 0.8577286100002721 + {2200,"001101010011"}, // 0.8314696123025455 + {2250,"001100110110"}, // 0.8032075314806449 + {2300,"001100011000"}, // 0.7730104533627371 + {2350,"001011110111"}, // 0.740951125354959 + {2400,"001011010100"}, // 0.7071067811865476 + {2450,"001010110000"}, // 0.6715589548470186 + {2500,"001010001010"}, // 0.6343932841636455 + {2550,"001001100010"}, // 0.5956993044924335 + {2600,"001000111001"}, // 0.5555702330196022 + {2650,"001000001110"}, // 0.5141027441932218 + {2700,"000111100011"}, // 0.47139673682599786 + {2750,"000110110110"}, // 0.42755509343028203 + {2800,"000110001000"}, // 0.3826834323650899 + {2850,"000101011001"}, // 0.33688985339222033 + {2900,"000100101001"}, // 0.2902846772544624 + {2950,"000011111001"}, // 0.24298017990326407 + {3000,"000011001000"}, // 0.1950903220161286 + {3050,"000010010110"}, // 0.1467304744553618 + {3100,"000001100100"}, // 0.09801714032956083 + {3150,"000000110010"}, // 0.049067674327417966 + {3200,"000000000000"}, // 1.2246467991473532e-16 + {3250,"111111001110"}, // -0.049067674327417724 + {3300,"111110011100"}, // -0.09801714032956059 + {3350,"111101101010"}, // -0.14673047445536158 + {3400,"111100111000"}, // -0.19509032201612836 + {3450,"111100000111"}, // -0.24298017990326382 + {3500,"111011010111"}, // -0.2902846772544621 + {3550,"111010100111"}, // -0.3368898533922201 + {3600,"111001111000"}, // -0.38268343236508967 + {3650,"111001001010"}, // -0.4275550934302818 + {3700,"111000011101"}, // -0.47139673682599764 + {3750,"110111110010"}, // -0.5141027441932216 + {3800,"110111000111"}, // -0.555570233019602 + {3850,"110110011110"}, // -0.5956993044924332 + {3900,"110101110110"}, // -0.6343932841636453 + {3950,"110101010000"}, // -0.6715589548470184 + {4000,"110100101100"}, // -0.7071067811865475 + {4050,"110100001001"}, // -0.7409511253549589 + {4100,"110011101000"}, // -0.7730104533627367 + {4150,"110011001010"}, // -0.803207531480645 + {4200,"110010101101"}, // -0.8314696123025452 + {4250,"110010010010"}, // -0.857728610000272 + {4300,"110001111001"}, // -0.8819212643483549 + {4350,"110001100010"}, // -0.9039892931234431 + {4400,"110001001110"}, // -0.9238795325112865 + {4450,"110000111100"}, // -0.9415440651830208 + {4500,"110000101100"}, // -0.9569403357322088 + {4550,"110000011111"}, // -0.970031253194544 + {4600,"110000010100"}, // -0.9807852804032303 + {4650,"110000001011"}, // -0.9891765099647809 + {4700,"110000000101"}, // -0.9951847266721969 + {4750,"110000000001"}, // -0.9987954562051724 + {4800,"110000000000"}, // -1.0 + {4850,"110000000001"}, // -0.9987954562051724 + {4900,"110000000101"}, // -0.9951847266721969 + {4950,"110000001011"}, // -0.9891765099647809 + {5000,"110000010100"}, // -0.9807852804032304 + {5050,"110000011111"}, // -0.970031253194544 + {5100,"110000101100"}, // -0.9569403357322089 + {5150,"110000111100"}, // -0.9415440651830209 + {5200,"110001001110"}, // -0.9238795325112866 + {5250,"110001100010"}, // -0.9039892931234433 + {5300,"110001111001"}, // -0.881921264348355 + {5350,"110010010010"}, // -0.8577286100002722 + {5400,"110010101101"}, // -0.8314696123025455 + {5450,"110011001010"}, // -0.8032075314806453 + {5500,"110011101000"}, // -0.7730104533627369 + {5550,"110100001001"}, // -0.7409511253549591 + {5600,"110100101100"}, // -0.7071067811865477 + {5650,"110101010000"}, // -0.6715589548470187 + {5700,"110101110110"}, // -0.6343932841636459 + {5750,"110110011110"}, // -0.5956993044924332 + {5800,"110111000111"}, // -0.5555702330196022 + {5850,"110111110010"}, // -0.5141027441932219 + {5900,"111000011101"}, // -0.4713967368259979 + {5950,"111001001010"}, // -0.42755509343028253 + {6000,"111001111000"}, // -0.3826834323650904 + {6050,"111010100111"}, // -0.33688985339222 + {6100,"111011010111"}, // -0.2902846772544625 + {6150,"111100000111"}, // -0.24298017990326418 + {6200,"111100111000"}, // -0.19509032201612872 + {6250,"111101101010"}, // -0.1467304744553624 + {6300,"111110011100"}, // -0.0980171403295605 + {6350,"111111001110"} // -0.04906767432741809 + }; + +int TSU::Trigo::atan2leg(TSU::L1TopoDataTypes<16,0> x, TSU::L1TopoDataTypes<16,0> y){ + short int octant=0; + if((x.value()&(1<<16))&&(y.value()&(1<<16))){ // Ex and Ey negative + if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 4; //100 + else octant = 5; // 101 + } else if(x.value()&(1<<16)){ + if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 3; //011 + else octant = 2; // 010 + } else if(y.value()&(1<<16)){ + if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 7; //111 + else octant = 6; // 110 + } else { // Ex and Ey both positive + if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 0; //000 + else octant = 1; // 001 + } + + auto signed_x_f = x; + auto signed_y_f = y; + if(octant==0||octant==3||octant==4||octant==7){ + //signed_x_f = (abs(int(x))); + signed_x_f = x.abs(); + signed_y_f = y.abs(); + } else { + //signed_x_f = (abs(int(y))); + signed_x_f = y.abs(); + signed_y_f = x.abs(); + } + + const std::vector<std::string> atan2_thresholds = { + "000010011101100", // 1.260 (0.9) + "000011000010101", // 1.557 (1.0) + "000011110101100", // 1.964 (1.1) + "000101000001100", // 2.572 (1.2) + "000111000010010", // 3.602 (1.3) + "001011010100101", // 5.797 (1.4) + "011011100010101"}; // 14.101 (1.5) + unsigned int flag = 0; + for(size_t j=0;j<atan2_thresholds.size(); ++j){ + auto thresh = TSU::L1TopoDataTypes<15,10>(atan2_thresholds.at(j)); + auto yy = signed_y_f*thresh; + if(signed_x_f.to_float() > yy.to_float()) flag = (flag | (1<<j)); + } + unsigned int octant_fine = 0; + if(flag==0) octant_fine = 7; + else if(flag==1) octant_fine = 6; + else if(flag==3) octant_fine = 5; + else if(flag==7) octant_fine = 4; + else if(flag==15) octant_fine = 3; + else if(flag==31) octant_fine = 2; + else if(flag==63) octant_fine = 1; + else if(flag==127) octant_fine = 0; + + unsigned int octant_fine2 = 0; + if(flag==0) octant_fine2 = 0; + else if(flag==1) octant_fine2 = 1; + else if(flag==3) octant_fine2 = 2; + else if(flag==7) octant_fine2 = 3; + else if(flag==15) octant_fine2 = 4; + else if(flag==31) octant_fine2 = 5; + else if(flag==63) octant_fine2 = 6; + else if(flag==127) octant_fine2 = 7; + + int intphi = octant << 3; + if(octant==0||octant==2||octant==4||octant==6){ + intphi |= octant_fine; + } else { + intphi |= octant_fine2; + } + + return intphi; +} int TSU::Trigo::atan2(TSU::L1TopoDataTypes<16,0> x, TSU::L1TopoDataTypes<16,0> y){ - short int octant=0; - if((x.value()&(1<<16))&&(y.value()&(1<<16))){ // Ex and Ey negative - if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 4; //100 - else octant = 5; // 101 - } else if(x.value()&(1<<16)){ - if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 3; //011 - else octant = 2; // 010 - } else if(y.value()&(1<<16)){ - if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 7; //111 - else octant = 6; // 110 - } else { // Ex and Ey both positive - if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 0; //000 - else octant = 1; // 001 - } - - auto signed_x_f = x; - auto signed_y_f = y; - if(octant==0||octant==3||octant==4||octant==7){ - //signed_x_f = (abs(int(x))); - signed_x_f = x.abs(); - signed_y_f = y.abs(); - } else { - //signed_x_f = (abs(int(y))); - signed_x_f = y.abs(); - signed_y_f = x.abs(); - } - - const std::vector<std::string> atan2_thresholds = { - "000010011101100", // 1.260 (0.9) - "000011000010101", // 1.557 (1.0) - "000011110101100", // 1.964 (1.1) - "000101000001100", // 2.572 (1.2) - "000111000010010", // 3.602 (1.3) - "001011010100101", // 5.797 (1.4) - "011011100010101"}; // 14.101 (1.5) - unsigned int flag = 0; - for(size_t j=0;j<atan2_thresholds.size(); ++j){ - auto thresh = TSU::L1TopoDataTypes<15,10>(atan2_thresholds.at(j)); - auto yy = signed_y_f*thresh; - if(signed_x_f.to_float() > yy.to_float()) flag = (flag | (1<<j)); - } - unsigned int octant_fine = 0; - if(flag==0) octant_fine = 7; - else if(flag==1) octant_fine = 6; - else if(flag==3) octant_fine = 5; - else if(flag==7) octant_fine = 4; - else if(flag==15) octant_fine = 3; - else if(flag==31) octant_fine = 2; - else if(flag==63) octant_fine = 1; - else if(flag==127) octant_fine = 0; - - unsigned int octant_fine2 = 0; - if(flag==0) octant_fine2 = 0; - else if(flag==1) octant_fine2 = 1; - else if(flag==3) octant_fine2 = 2; - else if(flag==7) octant_fine2 = 3; - else if(flag==15) octant_fine2 = 4; - else if(flag==31) octant_fine2 = 5; - else if(flag==63) octant_fine2 = 6; - else if(flag==127) octant_fine2 = 7; - - int intphi = octant << 3; - if(octant==0||octant==2||octant==4||octant==6){ - intphi |= octant_fine; - } else { - intphi |= octant_fine2; - } - - return intphi; + short int octant=0; + if((x.value()&(1<<16))&&(y.value()&(1<<16))){ // Ex and Ey negative + if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 4; //100 + else octant = 5; // 101 + } else if(x.value()&(1<<16)){ + if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 3; //011 + else octant = 2; // 010 + } else if(y.value()&(1<<16)){ + if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 7; //111 + else octant = 6; // 110 + } else { // Ex and Ey both positive + if(std::abs(y.to_float()) < std::abs(x.to_float())) octant = 0; //000 + else octant = 1; // 001 + } + + auto signed_x_f = x; + auto signed_y_f = y; + if(octant==0||octant==3||octant==4||octant==7){ + //signed_x_f = (abs(int(x))); + signed_x_f = x.abs(); + signed_y_f = y.abs(); + } else { + //signed_x_f = (abs(int(y))); + signed_x_f = y.abs(); + signed_y_f = x.abs(); + } + + // For phi in the first sector (0.8 < phi < 1.6) store the possible values of the tan + const std::vector<std::string> atan2_thresholds = + { + "00000010010001101", // tan(0.85)=1.1383327132284393 rounded to 1.1376953125 + "00000010100001010", // tan(0.9)=1.2601582175503392 rounded to 1.259765625 + "00000010110010111", // tan(0.95)=1.398382589287699 rounded to 1.3974609375 + "00000011000111010", // tan(1.0)=1.5574077246549023 rounded to 1.556640625 + "00000011011111001", // tan(1.05)=1.7433153099831704 rounded to 1.7431640625 + "00000011111011011", // tan(1.1)=1.9647596572486523 rounded to 1.9638671875 + "00000100011110000", // tan(1.15)=2.2344969487553255 rounded to 2.234375 + "00000101001001001", // tan(1.2)=2.5721516221263188 rounded to 2.5712890625 + "00000110000001001", // tan(1.25)=3.0095696738628313 rounded to 3.0087890625 + "00000111001101000", // tan(1.3)=3.6021024479679786 rounded to 3.6015625 + "00001000111010010", // tan(1.35)=4.455221759562705 rounded to 4.455078125 + "00001011100110001", // tan(1.4)=5.797883715482887 rounded to 5.7978515625 + "00010000011110011", // tan(1.4500000000000002)=8.238092752965619 rounded to 8.2373046875 + "00011100001100111", // tan(1.5)=14.101419947171719 rounded to 14.1005859375 + "01100000001010000" // tan(1.55)=48.07848247921907 rounded to 48.078125 + }; + + unsigned int flag = 0; + for(size_t j=0;j<atan2_thresholds.size(); ++j){ + auto thresh = TSU::L1TopoDataTypes<17,10>(atan2_thresholds.at(j)); + auto yy = signed_y_f*thresh; + if(signed_x_f.to_float() > yy.to_float()) flag = (flag | (1<<j)); + } + unsigned int octant_fine = 0; + if(flag==0) octant_fine = 15; + else if(flag==1) octant_fine = 14; + else if(flag==3) octant_fine = 13; + else if(flag==7) octant_fine = 12; + else if(flag==15) octant_fine = 11; + else if(flag==31) octant_fine = 10; + else if(flag==63) octant_fine = 9; + else if(flag==127) octant_fine = 8; + else if(flag==255) octant_fine = 7; + else if(flag==511) octant_fine = 6; + else if(flag==1023) octant_fine = 5; + else if(flag==2047) octant_fine = 4; + else if(flag==3071) octant_fine = 3; + else if(flag==5119) octant_fine = 2; + else if(flag==9215) octant_fine = 1; + else if(flag==17407) octant_fine = 0; + + unsigned int octant_fine2 = 0; + if(flag==0) octant_fine2 = 0; + else if(flag==1) octant_fine2 = 1; + else if(flag==3) octant_fine2 = 2; + else if(flag==7) octant_fine2 = 3; + else if(flag==15) octant_fine2 = 4; + else if(flag==31) octant_fine2 = 5; + else if(flag==63) octant_fine2 = 6; + else if(flag==127) octant_fine2 = 7; + else if(flag==255) octant_fine2 = 8; + else if(flag==511) octant_fine2 = 9; + else if(flag==1023) octant_fine2 = 10; + else if(flag==2047) octant_fine2 = 11; + else if(flag==3071) octant_fine2 = 12; + else if(flag==5119) octant_fine2 = 13; + else if(flag==9215) octant_fine2 = 14; + else if(flag==17407) octant_fine2 = 15; + + int intphi = octant << 3; + if(octant==0||octant==2||octant==4||octant==6){ + intphi |= octant_fine; + } else { + intphi |= octant_fine2; + } + + return intphi; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/share/L1TopoSimulationUtils_test.ref b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/share/L1TopoSimulationUtils_test.ref index 1f9caaf4de0dc5ef3c4f8100995dd5dbf15d4d4a..9fd7e940c1598619ed75b265ec5aca647cbbef6b 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/share/L1TopoSimulationUtils_test.ref +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/share/L1TopoSimulationUtils_test.ref @@ -1,16 +1,16 @@ ** test1: L1TopoSimulationUtils cosh at different delta-eta values** -delta eta: abs(0 - 23) = 23, cosh 000000001010000101 -delta eta: abs(0 - 23) = 23, cosh 000000001010000101 -delta eta: abs(0 - 24) = 24, cosh 000000001011000111 +delta eta: abs(0 - 23) = 23, cosh 000000000001010000100110 +delta eta: abs(0 - 23) = 23, cosh 000000000001010000100110 +delta eta: abs(0 - 24) = 24, cosh 000000000001011000111010 ** test2: L1TopoSimulationUtils KFLUT correction vs. et and eta** - et 4 [0], eta 2.4 [12] : 0.52 >>> - et 12 [0], eta 2.4 [12] : 0.52 >>> - et 4 [0], eta 2.6 [13] : 0.59 >>> - et 12 [0], eta 2.6 [13] : 0.59 >>> - et 4 [0], eta 2.9 [14] : 0.62 >>> - et 12 [0], eta 2.9 [14] : 0.62 >>> - et 4 [0], eta 3.1 [14] : 0.62 >>> - et 12 [0], eta 3.1 [14] : 0.62 >>> + et 4 [0], eta 2.4 [12] : 0.523438 >>> + et 12 [0], eta 2.4 [12] : 0.523438 >>> + et 4 [0], eta 2.6 [13] : 0.59375 >>> + et 12 [0], eta 2.6 [13] : 0.59375 >>> + et 4 [0], eta 2.9 [14] : 0.617188 >>> + et 12 [0], eta 2.9 [14] : 0.617188 >>> + et 4 [0], eta 3.1 [14] : 0.617188 >>> + et 12 [0], eta 3.1 [14] : 0.617188 >>> ** test3: L1TopoSimulationUtils KFLUT saturation** This out_of_range is expected for ET values beyond 1024 : vector::_M_range_check: __n (which is 5) >= this->size() (which is 5) ** test4: L1TopoSimulationUtils quadraticSumBW bitshift** @@ -46,4 +46,4 @@ This out_of_range is expected for ET values beyond 1024 : vector::_M_range_check sum2(-32767, -32767) : std = 46339 bw = 46339 sum2(0, 65535) : std = 65535 bw = 65535 sum2(362, 65535) : std = 65535 bw = 65535 - sum2(46340, 46340) : std = 65534 bw = 65534 + sum2(46340, 46340) : std = 65534 bw = 65534 \ No newline at end of file diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/test/L1TopoSimulationUtils_test.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/test/L1TopoSimulationUtils_test.cxx index 3153ce0007ee043231e9a013238657326c86d400..e63aa6fc49fd076687298d33c190dcb0e5e96a05 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/test/L1TopoSimulationUtils_test.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/test/L1TopoSimulationUtils_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /** @@ -39,9 +39,9 @@ void test1() ClusterTOB cluster_fix0; // one cluster fixed at eta=0 ClusterTOB cluster_var; // one cluster scanning eta values - for(double ieta : {23, int(23.5), 24}) { + for(double ieta : {23., 23.5, 24.}) { cluster_var.setEta(ieta); - auto cosh_val = TSU::Hyperbolic::Cosh.at(abs(cluster_fix0.eta() - cluster_var.eta())); + auto cosh_val = TSU::Hyperbolic::Cosh.at(static_cast<int>(100*abs(cluster_fix0.eta() - cluster_var.eta()))); cout<<"delta eta: " <<" abs("<<cluster_fix0.eta()<<" - "<<cluster_var.eta()<<")" <<" = "<<abs(cluster_fix0.eta() - cluster_var.eta()) @@ -55,24 +55,24 @@ void test2() { cout << "** test2: L1TopoSimulationUtils KFLUT correction vs. et and eta**\n"; TCS::KFLUT kflut; - + // use roughly the center of the bins defined in KFLUT.cxx + one outsider for(const double eta : {0.05, 0.2, 0.41, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.9, 3.1, 3.5}) { - for(const unsigned int et : {4, 12, 24, 48, 96, 360}) { - int iet = kflut.getetbin(et); - int ieta = kflut.getetabin(std::abs(eta)); - double corrfactor = kflut.getcorrKF(iet, ieta); - const bool large = corrfactor>+0.5; - const bool small = corrfactor<-0.5; - if(small or large) { - cout<<" et "<<et<<" ["<<iet<<"], " - <<" eta "<<eta<<" ["<<ieta<<"] : " - <<corrfactor<<(large ? " >>>" : - small ? " <<<" : - "") - <<endl; - } - } // for(et) + for(const unsigned int et : {4, 12, 24, 48, 96, 360}) { + int iet = kflut.getetbin(et); + int ieta = kflut.getetabin(std::abs(eta)); + double corrfactor = kflut.getcorrKF(iet, ieta); + const bool large = corrfactor>+0.5; + const bool small = corrfactor<-0.5; + if(small or large) { + cout<<" et "<<et<<" ["<<iet<<"], " + <<" eta "<<eta<<" ["<<ieta<<"] : " + <<corrfactor<<(large ? " >>>" : + small ? " <<<" : + "") + <<endl; + } + } // for(et) } // for(eta) } @@ -174,11 +174,10 @@ int test4() int main() -{ +{ test1(); test2(); test3(); int result = test4(); - return result; } diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py index b8f374c8283809853a5fdde909834b770c656d4f..11504c3bdd0f3a5b97c00061503842b971fcaddb 100644 --- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py +++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py @@ -434,7 +434,7 @@ TriggerHLTListRun3 = [ # FS tracks ('xAOD::TrackParticleContainer#HLT_IDTrack_FS_FTF', 'BS ESD AODFULL', 'Jet'), - ('xAOD::TrackParticleAuxContainer#HLT_IDTrack_FS_FTFAux.', 'BS ESD AODFULL', 'Jet'), + ('xAOD::TrackParticleAuxContainer#HLT_IDTrack_FS_FTFAux.passPFTrackPresel.muonCaloTag.muonScore.ptCone20.etConeCore.trackIso.RErr.EOverP.caloIso.trkPtFraction.tagFakeTrack.tagMuonTrack.tagIsoTrack', 'BS ESD AODFULL', 'Jet'), # FS vertices ('xAOD::VertexContainer#HLT_IDVertex_FS', 'BS ESD AODFULL', 'Jet'), diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py index f61a991a82dd44f6b27b89b8962980d9400dcdf0..918a9f83c8e83d8e1f7453ac9bf576bf88b35d5e 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py @@ -1,6 +1,7 @@ # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.AthConfigFlags import AthConfigFlags +from AthenaCommon.SystemOfUnits import GeV from AthenaCommon.Logging import logging log=logging.getLogger('TriggerConfigFlags') @@ -342,6 +343,18 @@ def createTriggerFlags(): from TrigInDetConfig.TrigTrackingCutFlags import createTrigTrackingFlags flags.addFlagsCategory( 'Trigger.InDetTracking', createTrigTrackingFlags ) + # NB: Longer term it may be worth moving these into a PF set of config flags, but right now the only ones that exist do not seem to be used in the HLT. + # When we use component accumulators for this in the HLT maybe we should revisit this + # PFO-muon removal option for the full-scan hadronic signatures. + # Options are: + # "None": Do no PFO-muon removal + # "Calo": Use the calo-tagging tools from the muon slice + # "Iso" : Use the mainly isolation-based selections based on the MET associator package + flags.addFlag("Trigger.FSHad.PFOMuonRemoval", "None") + + # the minimum pT threshold to use for the muon removal + flags.addFlag("Trigger.FSHad.PFOMuonRemovalMinPt", 10 * GeV) + return flags # for reference, this flags are skipped as never used or never set in fact, or set identical to de default or used in a very old JO: # fakeLVL1, useCaloTTL diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py index e7e3a69abbaefec142f23442f137a4ac504fd167..09cd6c5167309b12b57ffd6c8e0874def944d6d6 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py @@ -91,7 +91,7 @@ def standardJetBuildSequence( configFlags, dataSource, clustersKey, **jetRecoDic from eflowRec.PFHLTSequence import PFHLTSequence (pfseq, pfoPrefix) = RecoFragmentsPool.retrieve( PFHLTSequence, - configFlags, clustersin=clustersKey, tracktype=jetRecoDict["trkopt"]) + configFlags, clustersin=clustersKey, tracktype=jetRecoDict["trkopt"], cellsin="CaloCellsFS") buildSeq += pfseq jetDef = JetRecoConfiguration.defineJets(jetRecoDict,pfoPrefix=pfoPrefix,prefix=jetNamePrefix) else: diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/AlgInputConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/AlgInputConfig.py index 56482c0ec8c2fe846bb5f6c5a18b61559c29e4a0..f2f784a8eb7e15b0efc4a08cb032e88d95457fd9 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/AlgInputConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/AlgInputConfig.py @@ -46,13 +46,16 @@ return the mapping of input nicknames to values. from abc import ABC, abstractmethod from collections import defaultdict +from AthenaCommon.Logging import logging + +log = logging.getLogger(__name__) class AlgInputConfig(ABC): """ Base class for building up inputs for the FEXes """ def __init__(self, produces, step=None): - """ Initialise the class + """Initialise the class ========= Arguments @@ -102,7 +105,7 @@ class InputConfigRegistry: self._configs[x] = config def build_steps(self, requested, RoIs, recoDict): - """ Build the necessary input sequence, separated by steps + """Build the necessary input sequence, separated by steps ========= Arguments @@ -124,6 +127,7 @@ class InputConfigRegistry: inputs = {} # Internal mapping of input nickname to step input_steps = {} + log.debug("Producing steps for requested inputs: %s", requested) for name in requested: this_steps = self._create_input( name, RoIs, recoDict, input_steps=input_steps, inputs=inputs @@ -132,11 +136,13 @@ class InputConfigRegistry: steps[step] += seq_list # Now convert the steps into a list steps = [steps[idx] for idx in range(max(steps.keys()) + 1)] + log.debug("Built steps for inputs: %s", inputs) + log.debug("Steps are:\n%s", steps) return steps, inputs def _create_input(self, name, RoIs, recoDict, input_steps, inputs, _seen=None): - """ Create an input and its dependencies - + """Create an input and its dependencies + ========= Arguments ========= @@ -155,6 +161,7 @@ class InputConfigRegistry: The provided input_steps and inputs parameters are also updated with the new inputs that have been produced """ + log.debug("Creating inputs for %s", name) if _seen is None: _seen = [] elif name in _seen: @@ -162,6 +169,7 @@ class InputConfigRegistry: "Circular dependency: {}".format(" -> ".join(_seen + [name])) ) if name in input_steps: + log.debug("Input already created") # We've already seen this step so return dummies return {} steps = defaultdict(list) @@ -170,10 +178,9 @@ class InputConfigRegistry: config = self._configs[name] except KeyError: raise KeyError(f"Requested input {name} not defined") - # If config.step is None, use this to record the max step among - # config's dependencies - step = config.step if config.step is not None else -1 - for dep_name in config.dependencies(recoDict): + dependencies = config.dependencies(recoDict) + log.debug("Dependencies are %s", dependencies) + for dep_name in dependencies: dep_steps = self._create_input( dep_name, RoIs, recoDict, input_steps, inputs, _seen + [name] ) @@ -182,20 +189,24 @@ class InputConfigRegistry: raise ValueError( f"Dependency {dep_name} is in a later step '{dep_step}' than {name} which requires it (step = {config.step})" ) - else: - step = max(step, dep_step) # Add these reco sequences to our output lists for step, seq_list in dep_steps.items(): steps[step] += seq_list + if config.step is None: + if len(dependencies) == 0: + raise ValueError(f"Unable to work out step for input config {name}!") + # If the config doesn't specify a step then we run this as early as possible - i.e. in the latest step of all its dependencies + this_step = max(input_steps[dep] for dep in dependencies) + else: + this_step = config.step + log.debug("%s step is %i", name, this_step) # Finally, add *our* info - if step < 0: - raise ValueError(f"Unable to work out step for input config {name}!") - if step > len(RoIs): - raise ValueError(f"Step {step} is greater than the number of RoIs ({RoIs})") - sequences, this_inputs = config.create_sequence(inputs, RoIs[step], recoDict) - steps[step] += sequences + if this_step > len(RoIs): + raise ValueError(f"Step {this_step} is greater than the number of RoIs ({RoIs})") + sequences, this_inputs = config.create_sequence(inputs, RoIs[this_step], recoDict) + steps[this_step] += sequences inputs.update(this_inputs) # Add this to the list of things we've already seen, along with everything else it's made for made in this_inputs.keys(): - input_steps[made] = step + input_steps[made] = this_step return steps diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/METRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/METRecoSequences.py index 0881027345ab8392acb3d1e5c2d8d02f77b8c76b..709e87aa6e915d14b55ad09d65f817fa3ab0d71f 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/METRecoSequences.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MET/METRecoSequences.py @@ -36,8 +36,12 @@ log = logging.getLogger(__name__) def jetRecoDictForMET(**recoDict): """ Get a jet reco dict that's usable for the MET slice """ - jrd = {k: recoDict.get(k, JetChainParts_Default[k]) for k in jetRecoKeys if not k=='cleaning'} - jrd.update({'cleaning':'noCleaning'}) + jrd = { + k: recoDict.get(k, JetChainParts_Default[k]) + for k in jetRecoKeys + if not k == "cleaning" + } + jrd.update({"cleaning": "noCleaning"}) # Rename the cluster calibration try: jrd["clusterCalib"] = recoDict["calib"] @@ -116,8 +120,8 @@ default_inputs.add_input(ClusterInputConfig()) class EMClusterInputConfig(AlgInputConfig): - """ Input config that forces the clusters produced to be at the EM scale - + """Input config that forces the clusters produced to be at the EM scale + We have this so that we can force PFOs to be produced at the EM scale, however a better solution would probably be to add 'em' to the trigger name or to change the 'calib' default to be "default" and then have the algorithm @@ -173,7 +177,7 @@ class PFOInputConfig(AlgInputConfig): return "Clusters" if recoDict["calib"] == "em" else "EMClusters" def dependencies(self, recoDict): - return [self._input_clusters(recoDict), "Tracks", "Vertices", "TVA"] + return [self._input_clusters(recoDict), "Tracks", "Vertices", "TVA", "Cells"] def create_sequence(self, inputs, RoIs, recoDict): pfSeq, pfoPrefix = RecoFragmentsPool.retrieve( @@ -181,6 +185,7 @@ class PFOInputConfig(AlgInputConfig): flags=None, clustersin=inputs[self._input_clusters(recoDict)], tracktype="ftf", + cellsin=inputs["Cells"], ) # The jet constituent modifier sequence here is to apply the correct weights # and decorate the PV matching decoration. If we've specified constituent @@ -310,7 +315,7 @@ default_inputs.add_input(CVFClusterInputConfig()) class JetInputConfig(AlgInputConfig): - """ Helper input config for jets + """Helper input config for jets Note that if the jets require JVT but are topo jets there is nothing in the recoDict (unless the calibration is gsc) to force tracking to run. Therefore diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py index d6c6c787295b9bdbf3972ef95c403026560cff5f..1e6ff10965b35fb9b97d8f1b5b2751bd6a26c082 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py @@ -26,6 +26,7 @@ from TileGeoModel.TileGMConfig import TileGMCfg from MuonConfig.MuonSegmentFindingConfig import MooSegmentFinderAlgCfg from MuonConfig.MuonTrackBuildingConfig import MuonTrackBuildingCfg from MuonCombinedConfig.MuonCombinedReconstructionConfig import MuonCombinedMuonCandidateAlgCfg, MuonInsideOutRecoAlgCfg +from MuonSegmentTrackMaker.MuonTrackMakerAlgsMonitoring import MuPatTrackBuilderMonitoring from MuonCombinedConfig.MuonCombinedReconstructionConfig import MuonCombinedInDetCandidateAlgCfg, MuonCombinedAlgCfg, MuonCreatorAlgCfg from TrigMuonEF.TrigMuonEFConfig_newJO import TrigMuonEFTrackIsolationAlgCfg, MuonFilterAlgCfg, MergeEFMuonsAlgCfg @@ -366,7 +367,7 @@ def muEFSAStep(flags, chainDict, name='RoI'): #Reco recoMS.mergeReco( MooSegmentFinderAlgCfg(flags,name="TrigMooSegmentFinder_"+name,UseTGCNextBC=False, UseTGCPriorBC=False)) - recoMS.mergeReco(MuonTrackBuildingCfg(flags, name="TrigMuPatTrackBuilder_"+name)) + recoMS.mergeReco(MuonTrackBuildingCfg(flags, name="TrigMuPatTrackBuilder_"+name, MonTool = MuPatTrackBuilderMonitoring("MuPatTrackBuilderMonitoringSA_"+name))) recoMS.mergeReco(MuonTrackParticleCnvCfg(flags, name = "TrigMuonTrackParticleCnvAlg_"+name)) recoMS.mergeReco(MuonCombinedMuonCandidateAlgCfg(flags, name = "TrigMuonCandidateAlg_"+name)) recoMS.mergeReco(MuonCreatorAlgCfg(flags, name = "TrigMuonCreatorAlg_"+name, MuonContainerLocation="Muons_"+name))