diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py index a6f9e4c44901844180dfd01e2f1f2845f037c8aa..f07a08f9a8136ab5b7ba000ddcd21acd25e8cdc1 100644 --- a/Control/AthenaConfiguration/python/AllConfigFlags.py +++ b/Control/AthenaConfiguration/python/AllConfigFlags.py @@ -289,7 +289,7 @@ def _createCfgFlags(): def __btagging(): from JetTagConfig.BTaggingConfigFlags import createBTaggingConfigFlags return createBTaggingConfigFlags() - _addFlagsCategory(acf,"BTagging",__btagging, 'BTagging') + _addFlagsCategory(acf,"BTagging",__btagging, 'JetTagConfig') def __hi(): from HIRecConfig.HIRecConfigFlags import createHIRecConfigFlags diff --git a/Control/AthenaConfiguration/python/iconfTool/models/loaders.py b/Control/AthenaConfiguration/python/iconfTool/models/loaders.py index c4f31ce1b65837ac1a35ed0aadb3ff473da44161..ff4de8f2ebe56a09686f3f4357f439b64c269f0d 100755 --- a/Control/AthenaConfiguration/python/iconfTool/models/loaders.py +++ b/Control/AthenaConfiguration/python/iconfTool/models/loaders.py @@ -88,6 +88,13 @@ baseParser.add_argument( action="store_true", ) +baseParser.add_argument( + "--skipProperties", + help="Do not load properties other than those referring to other components", + action="store_true", +) + + baseParser.add_argument( "--debug", help="Enable tool debugging messages", @@ -268,6 +275,54 @@ def shortenDefaultComponents(dic, args) -> Dict: conf[key] = shorten_defaults(value) return conf +def isReference(value, compname, conf) -> bool: + """Returns true if value stores reference to other components + value - the value to check + compname - full component name + conf - complete config dict + """ + try: + value = ast.literal_eval(str(value)) + except Exception: + pass + + if isinstance(value, str): + ctype_name = value.split('/') + instance = None + if len(ctype_name) == 2: + instance = ctype_name[1] + if len(ctype_name) == 1: + instance = ctype_name[0] + if instance: + if f"{compname}.{instance}" in conf: # private tool + return [f"{compname}.{instance}"] + if f"ToolSvc.{instance}" in conf: # public tool + return [f"ToolSvc.{instance}"] + if instance in conf: # service + return [instance] + if len(ctype_name) == 2: # in either case for 2 elements value we consider that as comp + return [ctype_name[1]] + + elif isinstance(value, list): + refs = [isReference(el, compname, conf) for el in value] + if any(refs): + flattened = [] + [flattened.extend(el) for el in refs if el] + return flattened + return [] + + +def skipProperties(conf, args) -> Dict: + updated = {} + for (name, properties) in conf.items(): + updated[name] = {} + if not isinstance(properties, dict): # keep it + updated[name] = properties + else: + for property_name, value in properties.items(): + if isReference( value, name, conf) or property_name == 'Members': # later for sequences structure + updated[name][property_name] = value + return updated def loadConfigFile(fname, args) -> Dict: """loads config file into a dictionary, supports several modifications of the input switched on via additional arguments @@ -349,6 +404,9 @@ def loadConfigFile(fname, args) -> Dict: if args.shortenDefaultComponents: conf = shortenDefaultComponents(conf, args) + + if args.skipProperties: + conf = skipProperties(conf, args) return conf class ComponentsFileLoader: diff --git a/Control/AthenaConfiguration/share/confTool.py b/Control/AthenaConfiguration/share/confTool.py index 59f5625f861a85de478127e7604bb559358e68e9..838bdf6298d6ffe5d54ca106fc506f97d2eff583 100755 --- a/Control/AthenaConfiguration/share/confTool.py +++ b/Control/AthenaConfiguration/share/confTool.py @@ -10,7 +10,7 @@ import pickle import re import sys -from AthenaConfiguration.iconfTool.models.loaders import loadConfigFile, baseParser, componentRenamingDict, loadDifferencesFile +from AthenaConfiguration.iconfTool.models.loaders import loadConfigFile, baseParser, componentRenamingDict, loadDifferencesFile, isReference class fullColor: reset="\033[0m" difference="\033[91m" @@ -73,8 +73,11 @@ def parse_args(): help="Ignore differences enlisted in file (to be used only with diffing)") parser.add_argument("--color", - help="Use colored output even for file output (usefull when piping to less -R to to HTML conversion", + help="Use colored output even for file output (useful when piping to less -R to to HTML conversion", action="store_true") + + parser.add_argument("-s", "--structured", + help="Print only a single component, in a structured manner (reflecting components parent children)") args = parser.parse_args() main(args) @@ -97,6 +100,12 @@ def main(args): conf = loadConfigFile(fileName, args) _print(conf, color) + if args.structured: + for fileName in args.file: + conf = loadConfigFile(fileName, args) + _structuredPrint(conf, args.structured) + + if args.toJSON: if len(args.file) != 1: sys.exit( @@ -149,6 +158,28 @@ def _printComps(conf): if isinstance(item, dict): print(k) +def _structuredPrint(conf, start): + def _oneCompPrint(d, comp, indent = ""): + print(f"{indent}{comp}") + for prop,val in d.items(): + print(f"{indent} {prop} = {val}") + if prop == "Members" or prop == "TopAlg": + continue + refs = isReference(val, comp, conf) + for ref in refs: + if ref in conf: + _oneCompPrint(conf[ref], ref, indent + " - ") + + if start not in conf: + print(f"{start} is absent in the config, unfortunately the name has to be exact") + return + settings = conf.get(start) + if isinstance(settings, dict): + _oneCompPrint(settings, start) + else: + print(settings) + + def _compareConfig(configRef, configChk, args, color): # Find superset of all components: allComps = list(set(configRef.keys()) | set(configChk.keys())) diff --git a/Control/AthenaKernel/src/CondCont.cxx b/Control/AthenaKernel/src/CondCont.cxx index bce3cf440b1a16fcdbfe8638ca680a8bddb6e76b..d9e83b84338ef7a5a0800a59535ee723fcdecf02 100644 --- a/Control/AthenaKernel/src/CondCont.cxx +++ b/Control/AthenaKernel/src/CondCont.cxx @@ -1044,9 +1044,7 @@ CondContMixedBase::insertMixed (const EventIDRange& r, if (r.start().isTimeStamp() ) { start_key = keyFromTimestamp (r.start()); } - else { - std::cout << "WLDEBUG: no TimeStamp in r.start(), assume inifinte range" << std::endl; - } + key_type stop_key = keyFromTimestamp (r.stop()); StatusCode sc = StatusCode::SUCCESS; diff --git a/Control/AthenaServices/src/AthenaOutputStream.cxx b/Control/AthenaServices/src/AthenaOutputStream.cxx index b952462ac41359fd0e0ba28bc769c8b33868c5bf..25c6ebe56cf406ea80a46d060aeba807ab1afe4d 100644 --- a/Control/AthenaServices/src/AthenaOutputStream.cxx +++ b/Control/AthenaServices/src/AthenaOutputStream.cxx @@ -378,10 +378,17 @@ void AthenaOutputStream::handle(const Incident& inc) std::unique_lock lock(m_mutex); if( inc.type() == "MetaDataStop" ) { - if( m_outSeqSvc->inUse() and m_outSeqSvc->inConcurrentEventsMode() ) { - // all substreams should be closed by this point - ATH_MSG_DEBUG("Ignoring MetaDataStop incident in ES mode"); - return; + if( m_outSeqSvc->inUse() ) { + if( m_outSeqSvc->inConcurrentEventsMode() ) { + // EventService MT - all substreams should be closed by this point + ATH_MSG_DEBUG("Ignoring MetaDataStop incident in ES/MT mode"); + return; + } + if( m_outSeqSvc->lastIncident() == "EndEvent" ) { + // in r22 EndEvent comes before output writing - queue metadata writing and disconnect for after Event write + m_writeMetadataAndDisconnect = true; + return; + } } // not in Event Service writeMetaData(); @@ -531,6 +538,14 @@ StatusCode AthenaOutputStream::execute() { failed = true; } } + if( m_writeMetadataAndDisconnect ) { + writeMetaData(); + m_writeMetadataAndDisconnect = false; + // finalize will disconnect output + if( !finalize().isSuccess() ) { + failed = true; + } + } if (failed) { return(StatusCode::FAILURE); } diff --git a/Control/AthenaServices/src/AthenaOutputStream.h b/Control/AthenaServices/src/AthenaOutputStream.h index bc4c71e1bed707752be431d7b588df8c8a857caa..dfafc4b0bb0b55a5c6ab90f6dfa32e207aa6643e 100644 --- a/Control/AthenaServices/src/AthenaOutputStream.h +++ b/Control/AthenaServices/src/AthenaOutputStream.h @@ -142,13 +142,15 @@ protected: /// map to record number of writes per object typedef std::map CounterMapType; CounterMapType m_objectWriteCounter; - /// Vector of names of AlgTools that are executed by this stream /// pointer to AthenaOutputStreamTool ToolHandle m_streamer; /// vector of AlgTools that that are executed by this stream ToolHandleArray m_helperTools; + // flag set by MetaDataStop if OutputSequencer is used with EndEvent + bool m_writeMetadataAndDisconnect = false; + // ------- Event Ranges handling in MT ------- /// map of filenames assigned to active slots std::map< unsigned, std::string > m_slotRangeMap; diff --git a/Control/AthenaServices/src/MetaDataSvc.cxx b/Control/AthenaServices/src/MetaDataSvc.cxx index f59d4964032892b4c4d3904ab47d7761a3b79f78..7c1fe6465352797bbc49f778ec4ddefb3e7776d8 100644 --- a/Control/AthenaServices/src/MetaDataSvc.cxx +++ b/Control/AthenaServices/src/MetaDataSvc.cxx @@ -372,7 +372,7 @@ void MetaDataSvc::handle(const Incident& inc) { //__________________________________________________________________________ // This method is currently called only from OutputStreamSequencerSvc -StatusCode MetaDataSvc::transitionMetaDataFile(const std::string& outputConn) +StatusCode MetaDataSvc::transitionMetaDataFile(const std::string& outputConn, bool disconnect) { ATH_MSG_DEBUG("transitionMetaDataFile: " << outputConn ); @@ -380,21 +380,20 @@ StatusCode MetaDataSvc::transitionMetaDataFile(const std::string& outputConn) FileIncident inc("transitionMetaDataFile", "EndInputFile", "dummyMetaInputFileName", ""); ATH_CHECK(retireMetadataSource(inc)); - // Make sure metadata is ready for writing - // MN TODO: this call is redundant due to AthenaOutputStream.cxx:447 - remove later - ATH_CHECK(this->prepareOutput()); + // Reset flag to allow calling prepareOutput again at next transition + m_outputPreprared = false; Incident metaDataStopIncident(name(), "MetaDataStop"); m_incSvc->fireIncident(metaDataStopIncident); - AthCnvSvc* cnvSvc = dynamic_cast(m_addrCrtr.operator->()); - if (cnvSvc) { - if (!cnvSvc->disconnectOutput(outputConn).isSuccess()) { - ATH_MSG_WARNING("Cannot get disconnect Output Files"); + if( disconnect ) { + AthCnvSvc* cnvSvc = dynamic_cast(m_addrCrtr.operator->()); + if (cnvSvc) { + if (!cnvSvc->disconnectOutput(outputConn).isSuccess()) { + ATH_MSG_WARNING("Cannot get disconnect Output Files"); + } } } - // Reset flag to allow calling prepareOutput again at next transition - m_outputPreprared = false; return(StatusCode::SUCCESS); } diff --git a/Control/AthenaServices/src/MetaDataSvc.h b/Control/AthenaServices/src/MetaDataSvc.h index 44200a0e50999f22fa18a02412f5178526c3ed10..0dae85ebe30c2e551dc6ea5c33ab485bc486c3e7 100644 --- a/Control/AthenaServices/src/MetaDataSvc.h +++ b/Control/AthenaServices/src/MetaDataSvc.h @@ -232,8 +232,8 @@ class MetaDataSvc : public ::AthService, virtual void handle(const Incident& incident) override; /// Transition output metadata file - fire MeteDataStop incident to transition - /// OutputStream - StatusCode transitionMetaDataFile(const std::string& outputConn); + /// OutputStream and disconnect now if requested + StatusCode transitionMetaDataFile(const std::string& outputConn, bool disconnect); /** Implements IIoComponent interface * sets m_outputPreprared to false and prints some information. diff --git a/Control/AthenaServices/src/OutputStreamSequencerSvc.cxx b/Control/AthenaServices/src/OutputStreamSequencerSvc.cxx index 3bef39c7f1d4dd87e8d507bcb08cb5f70ace9a32..b83880f7a72adf5d2990d1bf8b0457b2821f264b 100644 --- a/Control/AthenaServices/src/OutputStreamSequencerSvc.cxx +++ b/Control/AthenaServices/src/OutputStreamSequencerSvc.cxx @@ -41,6 +41,11 @@ StatusCode OutputStreamSequencerSvc::initialize() { incsvc->addListener(this, IncidentType::BeginProcessing, 100); ATH_MSG_DEBUG("Listening to " << incidentName() << " incidents" ); ATH_MSG_DEBUG("Reporting is " << (m_reportingOn.value()? "ON" : "OFF") ); + // Retrieve MetaDataSvc + if( !m_metaDataSvc.isValid() and !m_metaDataSvc.retrieve().isSuccess() ) { + ATH_MSG_ERROR("Cannot get MetaDataSvc"); + return StatusCode::FAILURE; + } } if( inConcurrentEventsMode() ) { @@ -92,6 +97,7 @@ void OutputStreamSequencerSvc::handle(const Incident& inc) auto slot = Gaudi::Hive::currentContext().slot(); if( slot == EventContext::INVALID_CONTEXT_ID ) slot = 0; + m_lastIncident = inc.type(); if( inc.type() == incidentName() ) { // NextEventRange std::string rangeID; @@ -100,23 +106,18 @@ void OutputStreamSequencerSvc::handle(const Incident& inc) rangeID = fileInc->fileName(); ATH_MSG_DEBUG("Requested (through incident) Next Event Range filename extension: " << rangeID); } - if( not inConcurrentEventsMode() ) { - // finish the previous Range here only in SEQUENTIAL (threads<2) event processing - if( rangeID=="dummy" or // for EventService MP - ( rangeID=="" and m_fileSequenceNumber>=0 ) ) { // for Athena SP Event 1+ - // Write metadata on the incident finishing a Range (filename=="dummy") in ES - // or on non-file incident (filename=="") in regular LoopMgr (skip first incident) + + if( rangeID == "dummy" ) { + if( not inConcurrentEventsMode() ) { + // finish the previous Range here only in SEQUENTIAL (threads<2) event processing + // Write metadata on the incident finishing a Range (filename=="dummy") in ES MP ATH_MSG_DEBUG("MetaData transition"); - // Retrieve MetaDataSvc - if( !m_metaDataSvc.isValid() and !m_metaDataSvc.retrieve().isSuccess() ) { - throw GaudiException("Cannot get MetaDataSvc", name(), StatusCode::FAILURE); - } - if( !m_metaDataSvc->transitionMetaDataFile(m_lastFileName).isSuccess() ) { + // immediate write and disconnect for ES, otherwise do it after Event write is done + bool disconnect { true }; + if( !m_metaDataSvc->transitionMetaDataFile( m_lastFileName, disconnect ).isSuccess() ) { throw GaudiException("Cannot transition MetaData", name(), StatusCode::FAILURE); } } - } - if( rangeID=="dummy" ) { // exit now, wait for the next (real) incident that will start the next range return; } @@ -136,6 +137,16 @@ void OutputStreamSequencerSvc::handle(const Incident& inc) m_rangeIDinSlot[ slot ] = rangeID; // remember range ID for next events in the same range m_currentRangeID = rangeID; + + if( not inConcurrentEventsMode() ) { + // non-file incident case (filename=="") in regular SP LoopMgr + ATH_MSG_DEBUG("MetaData transition"); + bool disconnect { false }; + // MN: may not know the full filename yet, but that is only needed for disconnect==true + if( !m_metaDataSvc->transitionMetaDataFile( "" /*m_lastFileName*/, disconnect ).isSuccess() ) { + throw GaudiException("Cannot transition MetaData", name(), StatusCode::FAILURE); + } + } } else if( inc.type() == IncidentType::BeginProcessing ) { // new event start - assing current rangeId to its slot diff --git a/Control/AthenaServices/src/OutputStreamSequencerSvc.h b/Control/AthenaServices/src/OutputStreamSequencerSvc.h index 704b515e1ed3b63fc5356e9e5ce8873b24318cca..82f4531d2c32fe63442c6f1a8323c9a8032ad08e 100644 --- a/Control/AthenaServices/src/OutputStreamSequencerSvc.h +++ b/Control/AthenaServices/src/OutputStreamSequencerSvc.h @@ -73,6 +73,9 @@ public: // Non-static members /// Are there concurrent events? (threads>1) static bool inConcurrentEventsMode(); + /// Last incident type that was handled + const std::string& lastIncident() { return m_lastIncident; } + private: // data ServiceHandle m_metaDataSvc; @@ -85,6 +88,9 @@ private: // data /// Recently constructed full file name (useful in single threaded processing) std::string m_lastFileName; + /// Last incident type that was handled + std::string m_lastIncident; + /// EventRange ID for all slots std::vector m_rangeIDinSlot; diff --git a/Control/CxxUtils/CMakeLists.txt b/Control/CxxUtils/CMakeLists.txt index d1717711cd23e3ac8a04b54a256b7bd56a523cca..ae7b3ce7e4156a9f1fc2853e74393efc8ef858c5 100644 --- a/Control/CxxUtils/CMakeLists.txt +++ b/Control/CxxUtils/CMakeLists.txt @@ -148,13 +148,13 @@ if( ATLAS_RELEASE_MODE ) return() endif() -# Install the ubsan.supp file already during the CMake configuration. +# Install the ubsan and gccchecker config files already during the CMake configuration. # This is necessary because the file may be needed very early during the # build, and we don't explicitly make everything else wait for this # file's installation. Creating a race condition. -file( INSTALL share/ubsan.supp +file( INSTALL share/ubsan.supp share/checkergcc.config DESTINATION ${CMAKE_SHARE_OUTPUT_DIRECTORY} ) -install( FILES share/ubsan.supp +install( FILES share/ubsan.supp share/checkergcc.config DESTINATION ${CMAKE_INSTALL_SHAREDIR} ) # Set the directory to put the configured environment setup file into: diff --git a/Control/CxxUtils/CxxUtils/features.h b/Control/CxxUtils/CxxUtils/features.h index dc8c0a34ce7112f95195b726ee01fc3eac9c02f9..51c7222e9426943a18befadb220b54cfe18ba753 100644 --- a/Control/CxxUtils/CxxUtils/features.h +++ b/Control/CxxUtils/CxxUtils/features.h @@ -14,20 +14,28 @@ #include +/// Do we support the compatible set of GCC and clang extensions +/// These are our main compilers. +#if (defined(__GNUC__) || defined(__clang__)) && \ + !(defined(__ICC) || defined(__COVERITY__) || \ + defined(__CUDACC__) || defined(__CLING__)) +# define HAVE_GCC_CLANG_EXTENSIONS 1 +#else +# define HAVE_GCC_CLANG_EXTENSIONS 0 +#endif -/// Do we have function multiversioning? GCC and clang > 7 support -/// the target attribute -#if ( defined(__i386__) || defined(__x86_64__) ) && defined(__ELF__) && \ - defined(__GNUC__) && !(defined(__clang__) && __clang_major__ < 8) && \ - !defined(__CLING__) && !defined(__ICC) && !defined(__COVERITY__) && \ - !defined(__CUDACC__) && !defined(CL_SYCL_LANGUAGE_VERSION) && \ - !defined(SYCL_LANGUAGE_VERSION) && !defined(__HIP__) -# define HAVE_FUNCTION_MULTIVERSIONING 1 +/// Do we have function multiversioning? +/// GCC and clang support the target attribute +#if HAVE_GCC_CLANG_EXTENSIONS && \ + (defined(__i386__) || defined(__x86_64__)) && defined(__ELF__) && \ + !defined(__HIP__) && !defined(CL_SYCL_LANGUAGE_VERSION) && \ + !defined(SYCL_LANGUAGE_VERSION) +#define HAVE_FUNCTION_MULTIVERSIONING 1 #else # define HAVE_FUNCTION_MULTIVERSIONING 0 #endif -/// Do we also have the target_clones attribute? +/// Do we additionally have the target_clones attribute? /// GCC and clang >=14 support it. /// ...But at least for GCC11 and clang 14 in /// order to work for both we have to apply @@ -39,8 +47,7 @@ #endif /// Do we have support for all GCC intrinsics? -#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && \ - !defined(__COVERITY__) && !defined(__CUDACC__) +#if HAVE_GCC_CLANG_EXTENSIONS && !defined(__clang__) # define HAVE_GCC_INTRINSICS 1 #else # define HAVE_GCC_INTRINSICS 0 @@ -56,7 +63,7 @@ // __builtin_popcount // __builtin_popcountl // __builtin_popcountll -#if defined(__GNUC__) || defined(__clang__) +#if HAVE_GCC_CLANG_EXTENSIONS # define HAVE_BITCOUNT_INTRINSICS 1 #else # define HAVE_BITCOUNT_INTRINSICS 0 @@ -64,8 +71,7 @@ // Do we have the vector_size attribute for writing explicitly // vectorized code? -#if (defined(__GNUC__) || defined(__clang__)) && !defined(__CLING__) && \ - !defined(__ICC) && !defined(__COVERITY__) && !defined(__CUDACC__) +#if HAVE_GCC_CLANG_EXTENSIONS # define HAVE_VECTOR_SIZE_ATTRIBUTE 1 #else # define HAVE_VECTOR_SIZE_ATTRIBUTE 0 diff --git a/Control/CxxUtils/CxxUtilsEnvironmentConfig.cmake.in b/Control/CxxUtils/CxxUtilsEnvironmentConfig.cmake.in index 00f62a107f076f9886d6f6568a19f91e507e5cf2..c69e0a771d588e22d3962f660fb7be1b604baace 100644 --- a/Control/CxxUtils/CxxUtilsEnvironmentConfig.cmake.in +++ b/Control/CxxUtils/CxxUtilsEnvironmentConfig.cmake.in @@ -1,4 +1,4 @@ -# $Id$ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration # # This module is used to set up run-time environment variables relating # to the compiler. @@ -9,7 +9,9 @@ # Set the environment variables: set( CXXUTILSENVIRONMENT_ENVIRONMENT FORCESET UBSAN_OPTIONS - suppressions=\${@CMAKE_PROJECT_NAME@_DIR}/@CMAKE_INSTALL_SHAREDIR@/ubsan.supp ) + suppressions=\${@CMAKE_PROJECT_NAME@_DIR}/@CMAKE_INSTALL_SHAREDIR@/ubsan.supp + FORCESET CHECKERGCCPLUGINS_CONFIG + \${@CMAKE_PROJECT_NAME@_DIR}/@CMAKE_INSTALL_SHAREDIR@/checkergcc.config ) # Silently declare the module found: set( CXXUTILSENVIRONMENT_FOUND TRUE ) diff --git a/Control/CxxUtils/share/checkergcc.config b/Control/CxxUtils/share/checkergcc.config new file mode 100644 index 0000000000000000000000000000000000000000..00391a327db5f7aa7d05766cd16ce156414f406e --- /dev/null +++ b/Control/CxxUtils/share/checkergcc.config @@ -0,0 +1,23 @@ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +# +# Configuration file for the checkergcc plugins. +# see https://gitlab.cern.ch/atlas/atlasexternals/tree/master/External/CheckerGccPlugins +# +# Updates to this file only take effect after re-running the cmake configuration! +# + +[thread.check_paths] +# Hack: disable checking of auto-generated Cint dictionaries: +-CMakeFiles +Calorimeter +-Calorimeter/CaloRec +-Calorimeter/CaloCnv/CaloJiveXML +HighGranularityTimingDetector +HLT +LumiBlock +MagneticField +Tools +-Tools/LWHists +Trigger +-Trigger/TrigAnalysis/TrigInDetAnalysisUser +-Trigger/TrigAnalysis/TrigInDetAnalysisExample diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx index 9abc201aba6f83a9cb92a317a61c2c2dea2e2d89..29d0f98efc4044558486213748ef11e85593cafc 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx @@ -188,7 +188,7 @@ StatusCode AthenaPoolCnvSvc::createObj(IOpaqueAddress* pAddress, DataObject*& re TokenAddress* tokAddr = dynamic_cast(pAddress); if (tokAddr != nullptr && tokAddr->getToken() != nullptr && (boost::starts_with(tokAddr->getToken()->contID(), m_persSvcPerInputType.value() + "(") || boost::starts_with(tokAddr->getToken()->contID(), m_persSvcPerInputType.value() + "_"))) { const unsigned int maxContext = m_poolSvc->getInputContextMap().size(); - const unsigned int auxContext = m_poolSvc->getInputContext(tokAddr->getToken()->classID().toString(), 1); + const unsigned int auxContext = m_poolSvc->getInputContext(tokAddr->getToken()->classID().toString() + tokAddr->getToken()->dbID().toString(), 1); char text[32]; ::sprintf(text, "[CTXT=%08X]", auxContext); if (m_poolSvc->getInputContextMap().size() > maxContext) { diff --git a/ForwardDetectors/AFP/AFP_Digitization/python/AFP_DigitizationConfigNew.py b/ForwardDetectors/AFP/AFP_Digitization/python/AFP_DigitizationConfigNew.py index 8422c00a139a3235fde3a44533acfaf5ce1b0b8e..642e05c6b7735f492cd25440502241ab8fffeefc 100644 --- a/ForwardDetectors/AFP/AFP_Digitization/python/AFP_DigitizationConfigNew.py +++ b/ForwardDetectors/AFP/AFP_Digitization/python/AFP_DigitizationConfigNew.py @@ -90,53 +90,3 @@ def AFP_DigitizationCfg(flags, **kwargs): acc.merge(AFP_DigitizationOutputCfg(flags)) return acc - - -if __name__ == "__main__": - """Test AFP ComponentAccumulator Digitization configuration modules, inspired by Digitization/DigitizationConfigNew_test.py""" - - from AthenaCommon.Logging import log - from AthenaCommon.Constants import DEBUG - from AthenaCommon.Configurable import Configurable - from AthenaConfiguration.AllConfigFlags import ConfigFlags - from Digitization.DigitizationSteering import DigitizationMainCfg, DigitizationMessageSvcCfg - - # Set up logging and new style config - log.setLevel(DEBUG) - Configurable.configurableRun3Behavior = True - - # Configure - ConfigFlags.Input.Files = ["test.pool.root"] - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-RUN2-09" - ConfigFlags.Detector.EnableAFP = True - ConfigFlags.Detector.GeometryAFP = False - ConfigFlags.GeoModel.Align.Dynamic = False - ConfigFlags.Concurrency.NumThreads = 1 - ConfigFlags.Concurrency.NumConcurrentEvents=1 - ConfigFlags.Beam.NumberOfCollisions = 0. - ConfigFlags.Output.RDOFileName = "myRDO.pool.root" - - # TODO: temporary - ConfigFlags.Digitization.TruthOutput = True - - ConfigFlags.fillFromArgs() # enable unit tests to switch only parts of reco: AFP_Digitization.py Detector.EnableAFP=True - ConfigFlags.lock() - ConfigFlags.dump() - - # Construct our accumulator to run - acc = DigitizationMainCfg(ConfigFlags) - acc.merge(DigitizationMessageSvcCfg(ConfigFlags)) - - # Dump config - acc.getService("StoreGateSvc").Dump = True - acc.getService("ConditionStore").Dump = True - acc.printConfig(withDetails=True) - ConfigFlags.dump() - - acc.foreach_component("*AFP*").OutputLevel=DEBUG - - # Execute and finish - status = acc.run(maxEvents=3) - if status.isFailure(): - import sys - sys.exit(-1) diff --git a/ForwardDetectors/AFP/AFP_Digitization/python/AFP_DigitizationConfigNew_test.py b/ForwardDetectors/AFP/AFP_Digitization/python/AFP_DigitizationConfigNew_test.py new file mode 100644 index 0000000000000000000000000000000000000000..bec27f20233143f387d1b1fb8306d341fc589ab0 --- /dev/null +++ b/ForwardDetectors/AFP/AFP_Digitization/python/AFP_DigitizationConfigNew_test.py @@ -0,0 +1,66 @@ +#!/bin/env python + +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + +# file AFP_DigitizationConfigNew_test.py +# author Petr Balek +# date 2022-05-25 + +# brief A script to test AFP_Digitization package. Mostly inspired by Digitization/DigitizationConfigNew_test.py, but includes switching AFP digitization on (it's off by default). To test it: +# 0. setup athena enviroment +# 1a. run this script: +# $ python AFP_DigitizationConfigNew_test.py +# 1b. it's also possible to add some arguments: +# $ python AFP_DigitizationConfigNew_test.py Detector.EnableAFP=True +# 2. you may want to continue with reconstruction: +# $ RecoSteeringTest.py --filesInput=myRDO.pool.root --RDO Reco.EnableAFP=True + + +if __name__ == "__main__": + """Test AFP ComponentAccumulator Digitization configuration modules, inspired by Digitization/DigitizationConfigNew_test.py""" + + from AthenaCommon.Logging import log + from AthenaCommon.Constants import DEBUG + from AthenaCommon.Configurable import Configurable + from AthenaConfiguration.AllConfigFlags import ConfigFlags + from Digitization.DigitizationSteering import DigitizationMainCfg, DigitizationMessageSvcCfg + + # Set up logging and new style config + log.setLevel(DEBUG) + Configurable.configurableRun3Behavior = True + + # Configure + ConfigFlags.Input.Files = ["test.pool.root"] + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-RUN2-09" + ConfigFlags.Detector.EnableAFP = True + ConfigFlags.Detector.GeometryAFP = False + ConfigFlags.GeoModel.Align.Dynamic = False + ConfigFlags.Concurrency.NumThreads = 1 + ConfigFlags.Concurrency.NumConcurrentEvents=1 + ConfigFlags.Exec.MaxEvents=3 + ConfigFlags.Beam.NumberOfCollisions = 0. + ConfigFlags.Output.RDOFileName = "myRDO.pool.root" + + # TODO: temporary + ConfigFlags.Digitization.TruthOutput = True + + ConfigFlags.fillFromArgs() + ConfigFlags.lock() + + # Construct our accumulator to run + acc = DigitizationMainCfg(ConfigFlags) + acc.merge(DigitizationMessageSvcCfg(ConfigFlags)) + + # Dump config + acc.getService("StoreGateSvc").Dump = True + acc.getService("ConditionStore").Dump = True + acc.printConfig(withDetails=True) + ConfigFlags.dump() + + acc.foreach_component("*AFP*").OutputLevel=DEBUG + + # Execute and finish + status = acc.run() + if status.isFailure(): + import sys + sys.exit(-1) diff --git a/ForwardDetectors/AFP/AFP_Digitization/src/AFP_PileUpTool.cxx b/ForwardDetectors/AFP/AFP_Digitization/src/AFP_PileUpTool.cxx index 1992b3434c4c1500c49c9454a9f10d59491f372d..2c18899b5134790e838702dc3b09ae85e7c368dd 100644 --- a/ForwardDetectors/AFP/AFP_Digitization/src/AFP_PileUpTool.cxx +++ b/ForwardDetectors/AFP/AFP_Digitization/src/AFP_PileUpTool.cxx @@ -72,11 +72,11 @@ StatusCode AFP_PileUpTool::initialize() // check the input object names if (m_TDSimHitCollectionKey.key().empty()) { - ATH_MSG_ERROR("Property TDSimHitCollectionName not set !"); + ATH_MSG_FATAL("Property TDSimHitCollectionName not set !"); return StatusCode::FAILURE; } if (m_SIDSimHitCollectionKey.key().empty()) { - ATH_MSG_ERROR("Property SIDSimHitCollectionName not set !"); + ATH_MSG_FATAL("Property SIDSimHitCollectionName not set !"); return StatusCode::FAILURE; } @@ -94,8 +94,6 @@ StatusCode AFP_PileUpTool::initialize() } else { - ATH_CHECK(m_TDSimHitCollectionKey.initialize()); - ATH_CHECK(m_SIDSimHitCollectionKey.initialize()); ATH_MSG_INFO("TD SimHits container key: " <retrieveSubEvtsData(m_TDSimHitCollectionName, TDSimHitCollList, numberOfTDSimHits).isSuccess()) and TDSimHitCollList.size() == 0) { - ATH_MSG_ERROR ( "Could not fill TimedTDSimHitCollList" ); + ATH_MSG_FATAL ( "Could not fill TimedTDSimHitCollList" ); return StatusCode::FAILURE; } ATH_MSG_DEBUG ( " PileUp: Merge " << TDSimHitCollList.size() << " AFP_TDSimHitCollections with key " << m_TDSimHitCollectionName << " found." ); @@ -266,7 +264,7 @@ StatusCode AFP_PileUpTool::processAllSubEvents(const EventContext& ctx) TimedSIDSimHitCollList SIDSimHitCollList; unsigned int numberOfSIDSimHits{0}; if (not (m_mergeSvc->retrieveSubEvtsData(m_SIDSimHitCollectionName, SIDSimHitCollList, numberOfSIDSimHits).isSuccess()) and SIDSimHitCollList.size() == 0) { - ATH_MSG_ERROR ( "Could not fill TimedSIDSimHitCollList" ); + ATH_MSG_FATAL ( "Could not fill TimedSIDSimHitCollList" ); return StatusCode::FAILURE; } ATH_MSG_DEBUG ( " PileUp: Merge " << SIDSimHitCollList.size() << " AFP_SIDSimHitCollections with key " << m_SIDSimHitCollectionName << " found." ); diff --git a/ForwardDetectors/AFP/AFP_Reconstruction/AFP_SiClusterTools/CMakeLists.txt b/ForwardDetectors/AFP/AFP_Reconstruction/AFP_SiClusterTools/CMakeLists.txt index 3748a42310c818398ab5b0ab6c45ccba9e159b6e..45afe21da2691de861429839b5dedf6e3f404580 100644 --- a/ForwardDetectors/AFP/AFP_Reconstruction/AFP_SiClusterTools/CMakeLists.txt +++ b/ForwardDetectors/AFP/AFP_Reconstruction/AFP_SiClusterTools/CMakeLists.txt @@ -5,7 +5,7 @@ atlas_subdir( AFP_SiClusterTools ) # External dependencies: find_package( CLHEP ) -find_package( ROOT COMPONENTS Math GenVector ) +find_package( ROOT COMPONENTS MathCore GenVector ) atlas_add_library( AFP_SiClusterToolsLib src/*.cxx diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModelXml/ATLAS_CHECK_THREAD_SAFETY b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModelXml/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..893641d49bc1a2a5190f2178eef749b957329298 --- /dev/null +++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModelXml/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModelXml diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/ATLAS_CHECK_THREAD_SAFETY b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..7b5406ab9a68254d457dbcd37b1209d4f2aa9c93 --- /dev/null +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.cxx b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.cxx index d3700e7f4b41b391c86318c674bb94dbc74e7f8a..962424c5e2545b65da8418d91646a546dd170602 100644 --- a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.cxx +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.cxx @@ -256,9 +256,10 @@ void HGTD_TimingResolution::print() { } } -void HGTD_TimingResolution::simulatePulse( +HGTD_TimingResolution::PulseWaveform HGTD_TimingResolution::simulatePulse( CLHEP::HepRandomEngine *rndm_engine) const { + PulseWaveform pulseWaveform{}; float pulseParameter[4] = {0}; pulseParameter[0] = 0.036; // Width (scale) parameter of Landau density pulseParameter[1] = @@ -288,23 +289,25 @@ void HGTD_TimingResolution::simulatePulse( float p_time; // Convolution integral of Landau and Gaussian by sum - for (int i = 412; i < 527; i++) { + for (size_t i = 412; i < 527; i++) { fland = TMath::Landau(3.5 + (i * 0.005), mpc, pulseParameter[0]) / pulseParameter[0]; p_time = (1.5 + (i % 6 - i) * 0.005) / (sqrt(2) * pulseParameter[3]); - for (int point = i % 6; point < 400; point += 6) { + for (size_t point = i % 6; point < pulseWaveform.size(); point += 6) { p_time += step_par; - m_pulseWaveform[point] += fland * exp16(-p_time * p_time); + pulseWaveform[point] += fland * exp16(-p_time * p_time); } } - for (int point = 0; point < 400; point++) { - m_pulseWaveform[point] = f_weight * m_pulseWaveform[point]; + for (size_t point = 0; point < pulseWaveform.size(); point++) { + pulseWaveform[point] = f_weight * pulseWaveform[point]; } + + return pulseWaveform; } -void HGTD_TimingResolution::calculatePulse( +void HGTD_TimingResolution::calculatePulse(const PulseWaveform& pulseWaveform, std::map> &pulsebin, const float t, const float E, float *max, CLHEP::HepRandomEngine *rndm_engine) const { @@ -312,9 +315,9 @@ void HGTD_TimingResolution::calculatePulse( float energy = 0; float time = 0; - for (int point = 0; point < 400; point++) { + for (size_t point = 0; point < pulseWaveform.size(); point++) { - energy = m_pulseWaveform[point] * E + + energy = pulseWaveform[point] * E + CLHEP::RandGaussZiggurat::shoot(rndm_engine, 0, 0.015) * E; time = t + point * 0.005; timebin = (int)(t / 0.005) + point; @@ -340,8 +343,8 @@ float HGTD_TimingResolution::calculateTime( CLHEP::HepRandomEngine *rndm_engine) const { std::map> pulseBins; float max_hit[4] = {0}; - simulatePulse(rndm_engine); - calculatePulse(pulseBins, t, E, max_hit, rndm_engine); + const PulseWaveform pulse = simulatePulse(rndm_engine); + calculatePulse(pulse, pulseBins, t, E, max_hit, rndm_engine); for (auto &pulse : pulseBins) { pulse.second.first = pulse.second.first / pulse.second.second; // We look the the time when E=Emax/2 to get the time diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.h b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.h index e43e4f880715981ba15ab6b595e7ecca7dc16a21..4ea712997657358a0f6f7045b7d0e264c3a35abc 100644 --- a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.h +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_TimingResolution.h @@ -13,6 +13,7 @@ #ifndef HGTD_TIMINGRESOLUTION_H #define HGTD_TIMINGRESOLUTION_H +#include #include #include #include @@ -40,6 +41,8 @@ public: private: + typedef std::array PulseWaveform; //> &pulsebin, + void calculatePulse(const PulseWaveform& pulseWaveform, + std::map> &pulsebin, float t, float E, float *max, CLHEP::HepRandomEngine* rndm_engine) const; std::string m_version{""}; @@ -91,14 +95,11 @@ private: std::vector> m_doseResolution{}; std::vector> m_doseGain{}; - float m_sensorNoiseFactor = + const float m_sensorNoiseFactor = 0.0229; // factor use to simulate the electronic noise (1mm*1mm) - float m_cfdThreshold = 0.5; // fraction of max amplitude at which the time is - // extracted (default: 50%) - - float mutable m_pulseWaveform[400] = {0}; // Signal Pulse - + const float m_cfdThreshold = 0.5; // fraction of max amplitude at which the time is + // extracted (default: 50%) }; #endif diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/ATLAS_CHECK_THREAD_SAFETY b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..f0f8a2553df173b2f7f0c2bb5731618031609c4b --- /dev/null +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx index 074de514a5a95c625976947d16f21d154600166b..0554ba10ee1801c13f383cab53c89e68a5b4f034 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx @@ -19,7 +19,7 @@ HGTD_ClusterContainerCnv::HGTD_ClusterContainerCnv(ISvcLocator* svcloc) HGTD_ClusterContainer* HGTD_ClusterContainerCnv::createTransient() { - static pool::Guid p1_guid( + static const pool::Guid p1_guid( "7B3D57D6-F590-4266-974D-A0807122DA5F"); // with HGTD_Cluster_p1 ATH_MSG_DEBUG("createTransient(): main converter"); diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_RDO_ContainerCnv.cxx b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_RDO_ContainerCnv.cxx index 72997a442376c38fb8ef1be88f1de47d0348a4ce..9e35dbf13e59c4443eb107b58e57c6f25e60d30f 100644 --- a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_RDO_ContainerCnv.cxx +++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_RDO_ContainerCnv.cxx @@ -16,7 +16,7 @@ HGTD_RDO_ContainerCnv::HGTD_RDO_ContainerCnv(ISvcLocator* svcloc) HGTD_RDO_Container* HGTD_RDO_ContainerCnv::createTransient() { - static pool::Guid p1_guid( + static const pool::Guid p1_guid( "C25315CC-F0A2-43D6-8F42-012BE34B0107"); // with HGTD_RDO_p1 ATH_MSG_DEBUG("createTransient(): main converter"); diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/RadDamage/IBLLeakageCurrentData/plot.C b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/RadDamage/IBLLeakageCurrentData/plot.C index d1068c0ff710c4862ddbea491b347205170c34f7..93dc1726b22ecb1685d1cbc00d71111269c77757 100644 --- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/RadDamage/IBLLeakageCurrentData/plot.C +++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/RadDamage/IBLLeakageCurrentData/plot.C @@ -71,7 +71,7 @@ void from_ssv(string suffix){ string value; std::istringstream iss(line); - double vals[4]; + double vals[4]={}; int j = 0; while(getline(iss,value,',')){ vals[j] = stod(value); diff --git a/InnerDetector/InDetConditions/InDetCoolCoralClientUtils/src/CoolCoralClient.cpp b/InnerDetector/InDetConditions/InDetCoolCoralClientUtils/src/CoolCoralClient.cpp index 9f7efd52a2863062502f47f7ac5a4df01bfd10bb..5c40f7f7c91b18db0f6544e4a48602ef52d0d14e 100644 --- a/InnerDetector/InDetConditions/InDetCoolCoralClientUtils/src/CoolCoralClient.cpp +++ b/InnerDetector/InDetConditions/InDetCoolCoralClientUtils/src/CoolCoralClient.cpp @@ -793,7 +793,6 @@ void COOLCORALClient::fillTables(const std::string& part_trt){ std::vector buffer(999); if (itAfile.is_open()){ while (itAfile.getline(&buffer[0],999,'\n')) { - std::string sline(buffer.begin(),buffer.begin()+strlen(&buffer[0])); std::istringstream sbuf(&buffer[0]); sbuf >> tuid >> iovfkttc >> tbyteswap >> tphysaddr @@ -886,7 +885,6 @@ void COOLCORALClient::fillTables(const std::string& part_trt){ ifstream itGRfile (filename); if (itGRfile.is_open()){ while (itGRfile.getline(&buffer[0],999,'\n')) { - std::string sline(buffer.begin(),buffer.begin()+strlen(&buffer[0])); std::istringstream sbuf(&buffer[0]); sbuf >> tgruid >> tgrname >> group >> duty @@ -986,7 +984,6 @@ void COOLCORALClient::fillTables(const std::string& part_trt){ if (irAfile.is_open()){ while (irAfile.getline(&buffer[0],999,'\n')) { - std::string sline(buffer.begin(),buffer.begin()+strlen(&buffer[0])); std::istringstream sbuf(&buffer[0]); sbuf >> rodid >> rodbyteswap >> rodphysaddr @@ -1073,7 +1070,6 @@ void COOLCORALClient::fillTables(const std::string& part_trt){ if (idAfile.is_open()){ while (idAfile.getline(&buffer[0],999,'\n')) { - std::string sline(buffer.begin(),buffer.begin()+strlen(&buffer[0])); std::istringstream sbuf(&buffer[0]); sbuf >> byteswap >> physaddr >> fragtype >> dtname @@ -1304,7 +1300,6 @@ void COOLCORALClient::createConnect(const std::string& part_trt){ std::vector buffer(999); if (itAfile.is_open()){ while (itAfile.getline(&buffer[0],999,'\n')) { - std::string sline(buffer.begin(),buffer.begin()+strlen(&buffer[0])); if (part_trt=="barrel"){ std::istringstream sbuf(&buffer[0]); sbuf >> part >> crate >> slot @@ -1366,8 +1361,8 @@ int COOLCORALClient::GetTTCdummy(int ttc_id){ struct timeval start_time{}, end_time{}; int total_usecs=0; gettimeofday(&start_time, nullptr); - TTCobj_t *ttc_param; - std::vector ttc_params; + std::unique_ptr ttc_param; + std::vector> ttc_params; TTCGroupobj_t ttcgr_param; DTMROCobj_t dtmroc_param; @@ -1538,7 +1533,7 @@ int COOLCORALClient::GetTTCdummy(int ttc_id){ int nRows = 0; while ( cursor0.next() ) { const coral::AttributeList &row0 = cursor0.currentRow(); - ttc_param = new TTCobj_t; + ttc_param = std::make_unique(); ttc_param->VMEslot = row0[1].data(); ttc_param->Delay = row0[2].data(); @@ -1634,7 +1629,7 @@ int COOLCORALClient::GetTTCdummy(int ttc_id){ } delete query2; query2=nullptr; printf("Total %d DTMROC records\n", nRows2); - ttc_params.push_back(ttc_param); + ttc_params.push_back(std::move(ttc_param)); ++nRows; } delete query0; query0=nullptr; @@ -2583,7 +2578,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s std::vector buffer(999); if (itAfile.is_open()){ while (itAfile.getline(&buffer[0],999,'\n')) { - std::string sline(buffer.begin(),buffer.begin()+strlen(&buffer[0])); std::istringstream sbuf(&buffer[0]); sbuf >> tuid >> iovfkttc >> tbyteswap >> tphysaddr @@ -2686,7 +2680,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s if (itGRfile.is_open()){ while (itGRfile.getline(&buffer[0],999,'\n')) { - std::string sline(buffer.begin(),buffer.begin()+strlen(&buffer[0])); std::istringstream sbuf(&buffer[0]); sbuf >> tgruid >> tgrname >> group >> duty @@ -2795,7 +2788,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s if (irAfile.is_open()){ while (irAfile.getline(&buffer[0],999,'\n')) { - std::string sline(buffer.begin(),buffer.begin()+strlen(&buffer[0])); std::istringstream sbuf(&buffer[0]); sbuf >> rodid >> rodbyteswap >> rodphysaddr @@ -2890,7 +2882,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s if (idAfile.is_open()){ while (idAfile.getline(&buffer[0],999,'\n')) { - std::string sline(buffer.begin(),buffer.begin()+strlen(&buffer[0])); std::istringstream sbuf(&buffer[0]); sbuf >> byteswap >> physaddr >> fragtype >> dtname @@ -4121,8 +4112,6 @@ void COOLCORALClient::fillMap(){ std::vector buffer(999); if (itAfile.is_open()){ while (itAfile.getline(&buffer[0],999,'\n')) { - std::string sline(buffer.begin(),buffer.begin()+strlen(&buffer[0])); - std::istringstream sbuf(&buffer[0]); sbuf >> conn_struct.part >> conn_struct.crate >> conn_struct.slot diff --git a/InnerDetector/InDetConfig/python/ITkTrackRecoConfig.py b/InnerDetector/InDetConfig/python/ITkTrackRecoConfig.py index e53f721db1b12a9aa3a6e25d328200e77ade3fd8..2a973700d5e9a8b798d1a9019f44e3c984ca659a 100644 --- a/InnerDetector/InDetConfig/python/ITkTrackRecoConfig.py +++ b/InnerDetector/InDetConfig/python/ITkTrackRecoConfig.py @@ -117,6 +117,13 @@ def CombinedTrackingPassFlagSets(flags): return flags_set +def ITkClusterSplitProbabilityContainerName(flags): + + flags_set = CombinedTrackingPassFlagSets(flags) + extension = flags_set[-1].ITk.Tracking.ActivePass.extension + ClusterSplitProbContainer = "ITkAmbiguityProcessorSplitProb" + extension + return ClusterSplitProbContainer + def ITkTrackRecoCfg(flags): """Configures complete ID tracking """ result = ComponentAccumulator() @@ -167,7 +174,7 @@ def ITkTrackRecoCfg(flags): result.merge(ITkTrackCollectionMergerAlgCfg(flags, InputCombinedTracks = InputCombinedITkTracks, - CombinedITkClusterSplitProbContainer = ClusterSplitProbContainer)) + CombinedITkClusterSplitProbContainer = ITkClusterSplitProbabilityContainerName(flags))) if flags.ITk.Tracking.doTruth: from InDetConfig.ITkTrackTruthConfig import ITkTrackTruthCfg @@ -181,7 +188,7 @@ def ITkTrackRecoCfg(flags): if flags.ITk.Tracking.writeExtendedPRDInfo: from InDetConfig.InDetPrepRawDataToxAODConfig import ITkPixelPrepDataToxAODCfg, ITkStripPrepDataToxAODCfg - result.merge(ITkPixelPrepDataToxAODCfg(flags, ClusterSplitProbabilityName = ClusterSplitProbContainer)) + result.merge(ITkPixelPrepDataToxAODCfg(flags, ClusterSplitProbabilityName = ITkClusterSplitProbabilityContainerName(flags))) result.merge(ITkStripPrepDataToxAODCfg(flags)) from DerivationFrameworkInDet.InDetToolsConfig import ITkTrackStateOnSurfaceDecoratorCfg @@ -214,6 +221,23 @@ def ITkTrackRecoOutputCfg(flags): if not flags.ITk.Tracking.writeExtendedPRDInfo: excludedAuxData += '.-msosLink' + # Save PRD + toESD += [ + "InDet::SCT_ClusterContainer#ITkStripClusters", + "InDet::PixelClusterContainer#ITkPixelClusters", + "InDet::PixelGangedClusterAmbiguities#ITkPixelClusterAmbiguitiesMap", + "InDet::PixelGangedClusterAmbiguities#ITkSplitClusterAmbiguityMap" + ] + toESD += ["Trk::ClusterSplitProbabilityContainer#" + ITkClusterSplitProbabilityContainerName(flags)] + + # add tracks + if flags.ITk.Tracking.doStoreTrackSeeds: + toESD += ["TrackCollection#SiSPSeedSegments"] + + toESD += ["TrackCollection#SiSPSeededTracks"] + toESD += ["TrackCollection#CombinedInDetTracks"] + + ##### AOD ##### toAOD += ["xAOD::TrackParticleContainer#InDetTrackParticles"] toAOD += [f"xAOD::TrackParticleAuxContainer#InDetTrackParticlesAux.{excludedAuxData}"] diff --git a/InnerDetector/InDetConfig/python/TrackRecoConfig.py b/InnerDetector/InDetConfig/python/TrackRecoConfig.py index efa7966250e93c77352c1074d8f96f7ac0c0fb8c..b53f0b5ae741d8b33f0ee8ec9aaa9a34b49c44a6 100644 --- a/InnerDetector/InDetConfig/python/TrackRecoConfig.py +++ b/InnerDetector/InDetConfig/python/TrackRecoConfig.py @@ -277,7 +277,15 @@ def CombinedTrackingPassFlagSets(flags): return flags_set +def ClusterSplitProbabilityContainerName(flags): + flags_set = CombinedTrackingPassFlagSets(flags) + extension = flags_set[-1].InDet.Tracking.ActivePass.extension + ClusterSplitProbContainer = "InDetAmbiguityProcessorSplitProb" + extension + if len(flags_set)==1 and flags.InDet.Tracking.doBackTracking: # Only primary pass + back-tracking + ClusterSplitProbContainer = "InDetTRT_SeededAmbiguityProcessorSplitProb" + + return ClusterSplitProbContainer def InDetTrackRecoCfg(flags): if flags.Detector.GeometryITk: @@ -502,7 +510,7 @@ def InDetTrackRecoCfg(flags): InputCombinedTracks = InputCombinedInDetTracks, OutputCombinedTracks = "CombinedInDetTracks", AssociationMapName = "PRDtoTrackMapCombinedInDetTracks", - CombinedInDetClusterSplitProbContainer = ClusterSplitProbContainer)) + CombinedInDetClusterSplitProbContainer = ClusterSplitProbabilityContainerName(flags))) if flags.InDet.doTruth: from InDetConfig.TrackTruthConfig import InDetTrackTruthCfg @@ -522,7 +530,7 @@ def InDetTrackRecoCfg(flags): if flags.InDet.Tracking.writeExtendedPRDInfo: from InDetConfig.InDetPrepRawDataToxAODConfig import InDetPixelPrepDataToxAODCfg, InDetSCT_PrepDataToxAODCfg, InDetTRT_PrepDataToxAODCfg - result.merge(InDetPixelPrepDataToxAODCfg(flags, ClusterSplitProbabilityName = ClusterSplitProbContainer)) + result.merge(InDetPixelPrepDataToxAODCfg(flags, ClusterSplitProbabilityName = ClusterSplitProbabilityContainerName(flags))) result.merge(InDetSCT_PrepDataToxAODCfg(flags)) result.merge(InDetTRT_PrepDataToxAODCfg(flags)) @@ -595,98 +603,86 @@ def InDetTrackRecoOutputCfg(flags): toESD += ["ComTime#TRT_Phase"] # Save PRD - if special: # flags.InDet.writePRDs: globalflags.DataSource == 'data' and flags.InDet.doHeavyIon() - toESD += [ - "InDet::SCT_ClusterContainer#SCT_Clusters", - "InDet::PixelClusterContainer#PixelClusters", - "InDet::TRT_DriftCircleContainer#TRT_DriftCircles", - "InDet::PixelGangedClusterAmbiguities#PixelClusterAmbiguitiesMap", - ] - if flags.InDet.Tracking.doPixelClusterSplitting: - toESD += ["InDet::PixelGangedClusterAmbiguities#SplitClusterAmbiguityMap"] - toESD += ["IDCInDetBSErrContainer#SCT_FlaggedCondData"] - toESD += ["Trk::ClusterSplitProbabilityContainer#*"] # TODO: proper name + toESD += [ + "InDet::SCT_ClusterContainer#SCT_Clusters", + "InDet::PixelClusterContainer#PixelClusters", + "InDet::TRT_DriftCircleContainer#TRT_DriftCircles", + "InDet::PixelGangedClusterAmbiguities#PixelClusterAmbiguitiesMap", + ] + if flags.InDet.Tracking.doPixelClusterSplitting: + toESD += ["InDet::PixelGangedClusterAmbiguities#SplitClusterAmbiguityMap"] + toESD += ["IDCInDetBSErrContainer#SCT_FlaggedCondData"] + toESD += ["Trk::ClusterSplitProbabilityContainer#" + ClusterSplitProbabilityContainerName(flags)] # add tracks - if flags.InDet.Tracking.doStoreTrackSeeds and special: # flags.InDet.doWriteTracksToESD: + if flags.InDet.Tracking.doStoreTrackSeeds: toESD += ["TrackCollection#SiSPSeedSegments"] - if special: # flags.InDet.doWriteTracksToESD: - toESD += ["TrackCollection#SiSPSeededTracks"] - - if flags.InDet.Tracking.doTrackSegmentsPixel: - toESD += ["TrackCollection#ResolvedPixelTracks"] - if flags.InDet.doTruth: - toESD += ["TrackTruthCollection#ResolvedPixelTracksTruthCollection"] - toESD += ["DetailedTrackTruthCollection#ResolvedPixelTracksDetailedTruth"] - - if flags.InDet.Tracking.doTrackSegmentsSCT: - toESD += ["TrackCollection#ResolvedSCTTracks"] - if flags.InDet.doTruth: - toESD += ["TrackTruthCollection#ResolvedSCTTracksTruthCollection"] - toESD += ["DetailedTrackTruthCollection#ResolvedSCTTracksDetailedTruth"] + toESD += ["TrackCollection#SiSPSeededTracks"] - if flags.InDet.Tracking.doTrackSegmentsTRT: - toESD += ["TrackCollection#StandaloneTRTTracks"] - if flags.InDet.doTruth: - toESD += ["TrackTruthCollection#StandaloneTRTTracksTruthCollection"] - toESD += ["DetailedTrackTruthCollection#StandaloneTRTTracksDetailedTruth"] + if flags.InDet.Tracking.doTrackSegmentsPixel: + toESD += ["TrackCollection#ResolvedPixelTracks"] + if flags.InDet.doTruth: + toESD += ["TrackTruthCollection#ResolvedPixelTracksTruthCollection"] + toESD += ["DetailedTrackTruthCollection#ResolvedPixelTracksDetailedTruth"] - if flags.InDet.Tracking.doPseudoTracking: - toESD += ["TrackCollection#InDetPseudoTracks"] - if flags.InDet.doTruth: - toESD += ["TrackTruthCollection#InDetPseudoTracksTruthCollection"] - toESD += ["DetailedTrackTruthCollection#InDetPseudoTracksDetailedTruth"] + if flags.InDet.Tracking.doTrackSegmentsSCT: + toESD += ["TrackCollection#ResolvedSCTTracks"] + if flags.InDet.doTruth: + toESD += ["TrackTruthCollection#ResolvedSCTTracksTruthCollection"] + toESD += ["DetailedTrackTruthCollection#ResolvedSCTTracksDetailedTruth"] - if special: # flags.InDet.doTIDE_AmbiTrackMonitoring: - toESD += ["TrackCollection#ObservedTracksCollection"] - if flags.InDet.doTruth: - toESD += ["TrackTruthCollection#InDetObservedTrackTruthCollection"] - toESD += ["DetailedTrackTruthCollection#InDetObservedTrackDetailedTruth"] + if flags.InDet.Tracking.doTrackSegmentsTRT: + toESD += ["TrackCollection#StandaloneTRTTracks"] + if flags.InDet.doTruth: + toESD += ["TrackTruthCollection#StandaloneTRTTracksTruthCollection"] + toESD += ["DetailedTrackTruthCollection#StandaloneTRTTracksDetailedTruth"] - if flags.InDet.Tracking.doDBMstandalone: - toESD += ["TrackCollection#ResolvedDBMTracks"] - if flags.InDet.doTruth: - toESD += ["TrackTruthCollection#ResolvedDBMTracksTruthCollection"] - toESD += ["DetailedTrackTruthCollection#ResolvedDBMTracksDetailedTruth"] + if flags.InDet.Tracking.doPseudoTracking: + toESD += ["TrackCollection#InDetPseudoTracks"] + if flags.InDet.doTruth: + toESD += ["TrackTruthCollection#InDetPseudoTracksTruthCollection"] + toESD += ["DetailedTrackTruthCollection#InDetPseudoTracksDetailedTruth"] - # add the forward tracks for combined muon reconstruction - if flags.InDet.Tracking.doForwardTracks: - toESD += ["TrackCollection#ResolvedForwardTracks"] - if flags.InDet.doTruth: - toESD += ["TrackTruthCollection#ResolvedForwardTracksTruthCollection"] - toESD += ["DetailedTrackTruthCollection#ResolvedForwardTracksDetailedTruth"] + if flags.InDet.Tracking.doDBMstandalone: + toESD += ["TrackCollection#ResolvedDBMTracks"] + if flags.InDet.doTruth: + toESD += ["TrackTruthCollection#ResolvedDBMTracksTruthCollection"] + toESD += ["DetailedTrackTruthCollection#ResolvedDBMTracksDetailedTruth"] - if flags.InDet.Tracking.doBeamGas: - # TODO - pass + # add the forward tracks for combined muon reconstruction + if flags.InDet.Tracking.doForwardTracks: + toESD += ["TrackCollection#ResolvedForwardTracks"] + if flags.InDet.doTruth: + toESD += ["TrackTruthCollection#ResolvedForwardTracksTruthCollection"] + toESD += ["DetailedTrackTruthCollection#ResolvedForwardTracksDetailedTruth"] - if flags.InDet.Tracking.doBeamHalo: - # TODO - pass + if flags.InDet.Tracking.doBeamGas: + # TODO + pass - if flags.InDet.Tracking.doTrackSegmentsDisappearing: - toESD += ["TrackCollection#DisappearingTracks"] - if flags.InDet.doTruth: - toESD += ["TrackTruthCollection#DisappearingTracksTruthCollection"] - toESD += ["DetailedTrackTruthCollection#DisappearingTracksDetailedTruth"] + if flags.InDet.Tracking.doTrackSegmentsDisappearing: + toESD += ["TrackCollection#DisappearingTracks"] + if flags.InDet.doTruth: + toESD += ["TrackTruthCollection#DisappearingTracksTruthCollection"] + toESD += ["DetailedTrackTruthCollection#DisappearingTracksDetailedTruth"] - # Add TRT Segments (only if standalone is off). - # TODO: no TP converter? - # if not flags.InDet.doTRTStandalone: - # toESD += ["Trk::SegmentCollection#TRTSegments"] + # Add TRT Segments (only if standalone is off). + # TODO: no TP converter? + # if not flags.InDet.doTRTStandalone: + # toESD += ["Trk::SegmentCollection#TRTSegments"] - # Save (Detailed) Track Truth - if flags.InDet.doTruth: - toESD += ["TrackTruthCollection#TrackTruthCollection"] - toESD += ["DetailedTrackTruthCollection#DetailedTrackTruth"] + # Save (Detailed) Track Truth + if flags.InDet.doTruth: + toESD += ["TrackTruthCollection#TrackTruthCollection"] + toESD += ["DetailedTrackTruthCollection#DetailedTrackTruth"] - # save PRD MultiTruth - toESD += [ - "PRD_MultiTruthCollection#PRD_MultiTruthPixel", - "PRD_MultiTruthCollection#PRD_MultiTruthSCT", - "PRD_MultiTruthCollection#PRD_MultiTruthTRT", - ] + # save PRD MultiTruth + toESD += [ + "PRD_MultiTruthCollection#PRD_MultiTruthPixel", + "PRD_MultiTruthCollection#PRD_MultiTruthSCT", + "PRD_MultiTruthCollection#PRD_MultiTruthTRT", + ] if not flags.Input.isMC: toESD += [ @@ -696,6 +692,8 @@ def InDetTrackRecoOutputCfg(flags): "IDCInDetBSErrContainer#SCT_ByteStreamErrs", ] + toESD += ["TrackCollection#CombinedInDetTracks"] + ##### AOD ##### toAOD += ["xAOD::TrackParticleContainer#InDetTrackParticles"] toAOD += [f"xAOD::TrackParticleAuxContainer#InDetTrackParticlesAux.{excludedAuxData}"] diff --git a/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_TB04.cxx b/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_TB04.cxx index 37133b208d139bbfea604b0ab65fb004529194bd..888068c854be9b010bb819ce8081aca20e396384 100644 --- a/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_TB04.cxx +++ b/InnerDetector/InDetDetDescr/TRT_Cabling/src/TRT_FillCablingData_TB04.cxx @@ -128,12 +128,12 @@ void TRT_FillCablingData_TB04::defineParameters() int numberOfStrawsInLayersC[] = {23, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 28}; - std::vector ncol0 (numberOfStrawsInLayersA, - numberOfStrawsInLayersA + sizeof(numberOfStrawsInLayersA) / sizeof(int)); - std::vector ncol1 (numberOfStrawsInLayersB, - numberOfStrawsInLayersB + sizeof(numberOfStrawsInLayersB) / sizeof(int)); - std::vector ncol2 (numberOfStrawsInLayersC, - numberOfStrawsInLayersC + sizeof(numberOfStrawsInLayersC) / sizeof(int)); + std::vector ncol0 (std::begin(numberOfStrawsInLayersA), + std::end(numberOfStrawsInLayersA)); + std::vector ncol1 (std::begin(numberOfStrawsInLayersB), + std::end(numberOfStrawsInLayersB)); + std::vector ncol2 (std::begin(numberOfStrawsInLayersC), + std::end(numberOfStrawsInLayersC)); m_ncol.push_back(ncol0); m_ncol.push_back(ncol1); diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/scripts/fit_EoverP.C b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/scripts/fit_EoverP.C index 76f623a2de7a4bb24503b2fb59e2f1927823db62..143b501d6f7219b8583401490b05bcb69bd1bad5 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/scripts/fit_EoverP.C +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/scripts/fit_EoverP.C @@ -1486,7 +1486,7 @@ void MakeScaling(TString inputDir) 39274.9}; */ -double pt[100]; +double pt[100] = {}; TH2F* meanPtVsEta = (TH2F*) file0->Get("meanPtVsEta"); for(int i(1); i <= meanPtVsEta->GetNbinsX(); ++i){ 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 500e2fc44b0cef5c56774b0c29db7631c027a1d4..90ec0b7322bcc0f2e69b39298d13c6b3acabe5ec 100755 --- a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_Trajectory_xk.cxx +++ b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_Trajectory_xk.cxx @@ -366,20 +366,21 @@ void InDet::TRT_Trajectory_xk::trackFindingWithoutDriftTimeBL(double DA) bool InDet::TRT_Trajectory_xk::searchStartStop() { + if (m_lastRoad<1) return false; + if (m_lastRoad>399){ + throw std::runtime_error("Too many roads in InDet::TRT_Trajectory_xk::searchStartStop"); + } const double rs = 2.00, rse = 1.85, sr = 40; - - int w[400], W = 0; + + int w[400]={}; + int W = 0; for(int e = m_firstRoad; e<=m_lastRoad; ++e) { - double D = m_elements[e].findCloseLink(m_A,m_B); int b = m_elements[e].bestlink(); - w[e] = 0; 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; - } W+=w[e]; } diff --git a/LArCalorimeter/LArG4/LArG4Code/src/LArCalculatorSvcImp.cxx b/LArCalorimeter/LArG4/LArG4Code/src/LArCalculatorSvcImp.cxx index d536ae84ebe9e1bbe8fb5434f9f2da1cf73f24dd..08c42bb75f306331a5e1b3fb29cb751eb0ff6e0f 100644 --- a/LArCalorimeter/LArG4/LArG4Code/src/LArCalculatorSvcImp.cxx +++ b/LArCalorimeter/LArG4/LArG4Code/src/LArCalculatorSvcImp.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "LArG4Code/LArCalculatorSvcImp.h" @@ -9,7 +9,7 @@ LArCalculatorSvcImp::LArCalculatorSvcImp(const std::string& name, ISvcLocator *pSvcLocator) : base_class(name, pSvcLocator) , m_BirksLaw(true) - , m_Birksk(0.0486) + , m_Birksk(0.05832)// value updated for G4 10.6.p03 - 1.2 times the previous value of 0.0486 used in all campaigns before MC21. , m_OOTcut(300*CLHEP::ns) { declareProperty("BirksLaw",m_BirksLaw); diff --git a/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/ATLAS_CHECK_THREAD_SAFETY b/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..1af1a9923810385af177b0d6293fb09a97ee0742 --- /dev/null +++ b/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +LumiBlock/LumiBlockPers/LumiBlockAthenaPool diff --git a/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/src/LumiBlockCollectionCnv.cxx b/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/src/LumiBlockCollectionCnv.cxx index 441d55c5e28a4e7f01b8bf432b08f5fe12149fac..a56be5acb6559e92b8f31a340b63d565ce153ff4 100755 --- a/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/src/LumiBlockCollectionCnv.cxx +++ b/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/src/LumiBlockCollectionCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -8,13 +8,11 @@ ///////////////////////////////////////////////////////////////// #include "LumiBlockCollectionCnv.h" -#include "LumiBlockTPCnv/LumiBlockCollectionCnv_p1.h" -#include "LumiBlockTPCnv/LumiBlockCollectionCnv_p2.h" LumiBlockCollection_PERS* LumiBlockCollectionCnv::createPersistent(LumiBlockCollection* transCont) { MsgStream log(msgSvc(), "LumiBlockCollectionConverter" ); - LumiBlockCollection_PERS * persObj = m_TPConverter.createPersistent( transCont, log ); + LumiBlockCollection_PERS * persObj = m_converter.createPersistent( transCont, log ); log << MSG::DEBUG << "Success" << endmsg; return persObj; @@ -22,20 +20,16 @@ LumiBlockCollection_PERS* LumiBlockCollectionCnv::createPersistent(LumiBlockColl LumiBlockCollection* LumiBlockCollectionCnv::createTransient() { MsgStream log(msgSvc(), "LumiBlockCollectionConverter" ); - static pool::Guid p1_guid("CF1F40C9-6125-4C35-87FF-DDA2C319000C"); - static pool::Guid p2_guid("DEF9282A-F174-4382-8248-B94567CD869F"); - - static LumiBlockCollectionCnv_p1 TPConverter_p1; - static LumiBlockCollectionCnv_p2 TPConverter_p2; - + static const pool::Guid p1_guid("CF1F40C9-6125-4C35-87FF-DDA2C319000C"); + static const pool::Guid p2_guid("DEF9282A-F174-4382-8248-B94567CD869F"); if( compareClassGuid(p2_guid) ) { std::unique_ptr< LumiBlockCollection_p2 > col_vect( poolReadObject< LumiBlockCollection_p2 >() ); - return TPConverter_p2.createTransient( col_vect.get(), log ); + return m_converter.createTransient( col_vect.get(), log ); } else if( compareClassGuid(p1_guid) ) { std::unique_ptr< LumiBlockCollection_p1 > col_vect( poolReadObject< LumiBlockCollection_p1 >() ); - return TPConverter_p1.createTransient( col_vect.get(), log ); + return m_converter_p1.createTransient( col_vect.get(), log ); } else { throw std::runtime_error("Unsupported persistent version of LumiBlockCollection"); diff --git a/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/src/LumiBlockCollectionCnv.h b/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/src/LumiBlockCollectionCnv.h index c753371b4d985e92f840b0616079069aa646feb4..a6f7dc9df17c814a5dd16df02e7319b4024aa1d7 100644 --- a/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/src/LumiBlockCollectionCnv.h +++ b/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/src/LumiBlockCollectionCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -13,6 +13,7 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "LumiBlockData/LumiBlockCollection.h" +#include "LumiBlockTPCnv/LumiBlockCollectionCnv_p1.h" #include "LumiBlockTPCnv/LumiBlockCollectionCnv_p2.h" // the latest persistent representation type of LumiBlockCollection @@ -29,10 +30,10 @@ protected: virtual LumiBlockCollection_PERS* createPersistent (LumiBlockCollection* transCont); virtual LumiBlockCollection* createTransient (); - // virtual AthenaPoolTopLevelTPCnvBase* getTopLevelTPCnv() { return &m_TPConverter; } - private: - LumiBlockCollectionCnv_p2 m_TPConverter; + LumiBlockCollectionCnv_p1 m_converter_p1; + LumiBlockCollectionCnv_p2 m_converter; + }; #endif // LUMIBLOCKCOLLECTIONCNV__H diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/MM_RawDataCnv_p3.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/MM_RawDataCnv_p3.cxx index de23c31675385123f7283192d71ca4939fd5db23..136c61fbc48a74f93331a55f9e98c48b314d34cf 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/MM_RawDataCnv_p3.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/MM_RawDataCnv_p3.cxx @@ -33,7 +33,7 @@ Muon::MM_RawData* Muon::MM_RawDataCnv_p3::createTransient(const Muon::MM_RawData // To save disk space, the persistent version does not have this bolean but uses the relBCID as flag. In detector data the relBCID has a range of 0-7, // therefore a relBCID of 9 indicates that charge and time are in physical units while smaller values of the relBCID indicate that they are in counts. // In case of the time being in nano seconds, the relBCID is anyhow not meaningfull while if the time is in counts it is decomposed into the tdo (time) and the relBCID. - bool timeAndChargeInCounts = ((persObj->m_relBcid) == 9); + bool timeAndChargeInCounts = ((persObj->m_relBcid) != 9); Muon::MM_RawData* trans = new MM_RawData( Identifier (persObj->m_id), persObj->m_channel, persObj->m_time, diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/STGC_RawDataCnv_p3.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/STGC_RawDataCnv_p3.cxx index e1b376c969860ea4ee05c7d3dd90eb78275c062f..13ebd33b2845caef33c8613e3ff1950787efdd31 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/STGC_RawDataCnv_p3.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/STGC_RawDataCnv_p3.cxx @@ -33,7 +33,7 @@ Muon::STGC_RawData* Muon::STGC_RawDataCnv_p3::createTransient(const Muon::STGC_R // To save disk space, the persistent version does not have this bolean but uses the relBCID as flag. In detector data the bcTag has a maximum range of 0-7, // therefore a bcTag of 9 indicates that charge and time are in physical units while smaller values of the relBCID indicate that they are in counts. // In case of the time being in nano seconds, the bcTag is anyhow not meaningfull while if the time is in counts it is decomposed into the tdo (time) and the bcTag. - bool timeAndChargeInCounts = ((persObj->m_bcTag) == 9); + bool timeAndChargeInCounts = ((persObj->m_bcTag) != 9); Muon::STGC_RawData* trans = new STGC_RawData( Identifier (persObj->m_id), persObj->m_bcTag, static_cast(persObj->m_time),// place holder for tdo->time from calibration diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/CMAidentity.h b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/CMAidentity.h index 9851dd358ebbd2fe18ed0e43e0489bcba671393d..31360b02fb482a1598766614417e0e5674c158f6 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/CMAidentity.h +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/CMAidentity.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef CMAIDENTITY_H @@ -44,7 +44,7 @@ private: CMAcoverage which_sector(PhiCoverage); public: - CMAidentity(defineParams pars); + CMAidentity(const defineParams& pars); CMAidentity(ViewType, CMAcoverage, int, int, int, int, int); CMAidentity(ViewType, CMAcoverage, int); diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/CMAparameters.h b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/CMAparameters.h index 5651451b4e9b00f693524fa5685be9da9d548527..c6fab473b439a42b66a8a5449f837498df0d097a 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/CMAparameters.h +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/CMAparameters.h @@ -117,7 +117,7 @@ protected: [[nodiscard]] std::string error(const std::string&); public: - CMAparameters(parseParams parse); + CMAparameters(const parseParams& parse); CMAparameters(const CMAparameters&); virtual ~CMAparameters(); diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/EtaCMA.h b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/EtaCMA.h index fff29eff401a0aeb5acf4b9383e5ea23ea1cb122..31dacb541663af1010a573cdf566051a4d6ed218 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/EtaCMA.h +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/EtaCMA.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef ETACMA_H @@ -35,7 +35,7 @@ namespace RPC_CondCabling { bool begin_at_RPC_Z_boundary(void) const; public: - EtaCMA(parseParams parse); + EtaCMA(const parseParams& parse); EtaCMA(const EtaCMA&); virtual ~EtaCMA(); diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/EvenPhiCMA.h b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/EvenPhiCMA.h index 051ddae7ea812c758620f7659cabd3e2f0cb94f1..2dfb1566682d80a1040c9866e62d4f595e923bbb 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/EvenPhiCMA.h +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/EvenPhiCMA.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef EVENPHICMA_H @@ -34,7 +34,7 @@ namespace RPC_CondCabling { int get_max_strip_readout(int); public: - EvenPhiCMA(parseParams parse); + EvenPhiCMA(const parseParams& parse); EvenPhiCMA(const EvenPhiCMA&); virtual ~EvenPhiCMA(); diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RDOindex.h b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RDOindex.h index 86bbefc8260760eb5d737626a078a9f69f03610d..7876f20d723082e689c7d0bceacb099f943201c6 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RDOindex.h +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RDOindex.h @@ -150,7 +150,7 @@ public: void pad_identifier(Identifier& id) const; private: - const RpcIdHelper& m_rpcIdHelper; + const RpcIdHelper* m_rpcIdHelper; friend std::ostream& operator<<(std::ostream&, const RDOindex&); }; diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RpcCablingCondData.h b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RpcCablingCondData.h index 6d6ead9b0f988b44b1e6a11b87aa11c34d558b98..c9e458e17c39baa7040dff73af25e2efbc0f0229 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RpcCablingCondData.h +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RpcCablingCondData.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef RPCCABLINGCONDDATA_H @@ -163,7 +163,10 @@ private: int m_MaxType; // list of RPCPadParameters - RPCPadParameters m_RPCPadParameters_array[64][8]; + // max PADId was 8 in Run2, increased to 10 for Run3 to allow BIS78 + static constexpr unsigned MAX_PADID = 10; + static constexpr unsigned MAX_LOGICSECTOR = 64; + RPCPadParameters m_RPCPadParameters_array[MAX_LOGICSECTOR][MAX_PADID]; Identifier m_offline_id[2][32][10]; }; diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/SectorLogicSetup.h b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/SectorLogicSetup.h index 58b0589d0326bdf9aa6df236306212e2605894f8..a6485bd59ea3c86d03a498ff609555832cf1624f 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/SectorLogicSetup.h +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/SectorLogicSetup.h @@ -109,31 +109,39 @@ namespace RPC_CondCabling { const CMAparameters::CMAlist give_CMAs(const int, const ViewType, const int, const int) const; - bool give_RoI_borders(CMAidentity ETA, CMAidentity PHI, unsigned int& firstEtaCode, unsigned int& lastEtaCode, + bool give_RoI_borders(const CMAidentity& ETA, + const CMAidentity& PHI, + unsigned int& firstEtaCode, unsigned int& lastEtaCode, unsigned int& firstPhiCode, unsigned int& lastPhiCode) const; - bool give_LowPt_borders(CMAidentity ETA, CMAidentity PHI, unsigned int& firstEtaCode, unsigned int& lastEtaCode, + bool give_LowPt_borders(const CMAidentity& ETA, + const CMAidentity& PHI, + unsigned int& firstEtaCode, unsigned int& lastEtaCode, unsigned int& firstPhiCode, unsigned int& lastPhiCode) const; - bool give_HighPt_borders(CMAidentity ETA, CMAidentity PHI, unsigned int& firstEtaCode, unsigned int& lastEtaCode, + bool give_HighPt_borders(const CMAidentity& ETA, + const CMAidentity& PHI, + unsigned int& firstEtaCode, unsigned int& lastEtaCode, unsigned int& firstPhiCode, unsigned int& lastPhiCode) const; - bool give_LowPt_layout(CMAidentity ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code, + bool give_LowPt_layout(const CMAidentity& ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code, unsigned short int& stop_pivot_ch, unsigned int& stop_pivot_code, unsigned short int& start_confirm_ch, unsigned int& start_confirm_code, unsigned short int& stop_confirm_ch, unsigned int& stop_confirm_code) const; - bool give_HighPt_layout(CMAidentity ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code, + bool give_HighPt_layout(const CMAidentity& ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code, unsigned short int& stop_pivot_ch, unsigned int& stop_pivot_code, unsigned short int& start_confirm_ch, unsigned int& start_confirm_code, unsigned short int& stop_confirm_ch, unsigned int& stop_confirm_code) const; - const CMAparameters* give_CMA(CMAidentity CMA) const; + const CMAparameters* give_CMA(const CMAidentity& CMA) const; - bool correct(CMAidentity CMA, L1RPCcabCorrection type, CMAinput it, unsigned int layer, unsigned short int Channel1, + bool correct(const CMAidentity& CMA, + L1RPCcabCorrection type, CMAinput it, unsigned int layer, unsigned short int Channel1, unsigned short int Channel2, short int num) const; - std::list give_strip_code(CMAidentity CMA, int logic_sector, unsigned short int lh, unsigned short int ijk, + std::list give_strip_code(const CMAidentity& CMA, + int logic_sector, unsigned short int lh, unsigned short int ijk, unsigned short int Channel) const; bool operator+=(RPCchamberdata&); diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAcablingdata.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAcablingdata.cxx index 74b82430f8d05566fbc1c84b298db27968209ee3..7f1afc3291a9fbf15344dbebd03e8b7cacaaf6cb 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAcablingdata.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAcablingdata.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RPC_CondCabling/CMAcablingdata.h" @@ -16,7 +16,7 @@ CMAcablingdata::CMAcablingdata(DBline& data, int type) : BaseObject(Logic, "CMA if (get_data(data, parser)) { if (m_view == ViewType::Eta) { m_etaCMA.emplace_back(parser); } } - data++; + ++data; } while (!data("}")); } diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAidentity.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAidentity.cxx index 2a5d5d98403edcd17ce99d2af642992039075660..2002d6cf139a808465d4348fe943820062cb9bf6 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAidentity.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAidentity.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RPC_CondCabling/CMAidentity.h" @@ -26,7 +26,7 @@ const std::string CMAidentity::name(const ViewType view, const CMAcoverage cover std::string v_name = cover + side + "CMA"; return v_name; } -CMAidentity::CMAidentity(defineParams pars) : m_params{pars} {} +CMAidentity::CMAidentity(const defineParams& pars) : m_params{pars} {} CMAidentity::CMAidentity(ViewType view, CMAcoverage side, int number, int eta_index, int phi_index, int PAD_index, int Ixx_index) { m_params.view = view; diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAparameters.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAparameters.cxx index 1dfe2a047e1d3a4198b6b1ab52b55ab2ce1e12fb..39f4928b77add99a0cabacc2de2be88f38649919 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAparameters.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMAparameters.cxx @@ -62,14 +62,18 @@ unsigned int CMAparameters::last_highPt_code() const { return m_last_highPt_code CMAparameters::CMAconfiguration CMAparameters::conf_type() const { return m_conf_type; } -CMAparameters::CMAparameters(CMAparameters::parseParams parse) : - CablingObject(parse, CMAidentity::name(parse.view, parse.coverage)), m_params{parse} { - m_id = std::make_unique(parse); +CMAparameters::CMAparameters(const CMAparameters::parseParams& parse) : + CablingObject(parse, CMAidentity::name(parse.view, parse.coverage)), + m_params{parse}, + m_id (std::make_unique(parse)) +{ } -CMAparameters::CMAparameters(const CMAparameters& cma) : CablingObject(cma), m_params{cma.m_params} { - m_id = std::make_unique(cma.id()); - +CMAparameters::CMAparameters(const CMAparameters& cma) + : CablingObject(cma), + m_params{cma.m_params}, + m_id (std::make_unique(cma.id())) +{ const CMAprogram* proglow = cma.lowPt_program(); const CMAprogram* proghigh = cma.highPt_program(); if (proglow) { m_lowPt_program = std ::make_unique(*proglow); } diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMApivotdata.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMApivotdata.cxx index eafc2382b17dd1910c3c55dd134fd5b351cb88b0..fbb3429faa06cf08cb773c3c5d4f50df5cb96f7f 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMApivotdata.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/CMApivotdata.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RPC_CondCabling/CMApivotdata.h" @@ -8,8 +8,10 @@ using namespace RPC_CondCabling; -CMApivotdata::CMApivotdata(DBline& data, int type, const std::string& layout) : BaseObject(Logic, "CMA Data") { - m_layout = layout; +CMApivotdata::CMApivotdata(DBline& data, int type, const std::string& layout) + : BaseObject(Logic, "CMA Data"), + m_layout (layout) +{ (++data)("{"); do { CMAparameters::parseParams parser; @@ -26,7 +28,7 @@ CMApivotdata::CMApivotdata(DBline& data, int type, const std::string& layout) : } } } - data++; + ++data; } while (!data("}")); } void CMApivotdata::reset_data() { diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/EtaCMA.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/EtaCMA.cxx index f786b4462d6ae7b885f4f8dd6c3ebf4ec5844c8b..f936e6c04b778851b9f0ff47e5727483d0ffcf12 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/EtaCMA.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/EtaCMA.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "GaudiKernel/MsgStream.h" @@ -15,7 +15,9 @@ using namespace RPC_CondCabling; -EtaCMA::EtaCMA(CMAparameters::parseParams parse) : CMAparameters(parse) { +EtaCMA::EtaCMA(const CMAparameters::parseParams& parse) + : CMAparameters(parse) +{ m_pivot_rpc_read = 1; m_lowPt_rpc_read = 1; m_highPt_rpc_read = 1; @@ -26,11 +28,13 @@ EtaCMA::EtaCMA(CMAparameters::parseParams parse) : CMAparameters(parse) { create_highPt_map(m_highPt_rpc_read); } -EtaCMA::EtaCMA(const EtaCMA& cma) : CMAparameters(cma) { - m_pivot_RPCs = cma.pivot_RPCs(); - m_lowPt_RPCs = cma.lowPt_RPCs(); - m_highPt_RPCs = cma.highPt_RPCs(); - m_inversion = cma.inversion(); +EtaCMA::EtaCMA(const EtaCMA& cma) + : CMAparameters(cma), + m_pivot_RPCs (cma.pivot_RPCs()), + m_lowPt_RPCs (cma.lowPt_RPCs()), + m_highPt_RPCs (cma.highPt_RPCs()), + m_inversion (cma.inversion()) +{ m_conf_type = CMAparameters::Atlas; } diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/EvenPhiCMA.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/EvenPhiCMA.cxx index 2f59bf3faa0e121c2a8420a2a8d46d53d423075e..5533c4126dfa5ead22b98372cdeca1f6819f24cb 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/EvenPhiCMA.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/EvenPhiCMA.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "GaudiKernel/MsgStream.h" @@ -20,7 +20,7 @@ const EvenPhiCMA::WORlink& EvenPhiCMA::highPt_WORs() const { return m_highPt_WOR bool EvenPhiCMA::inversion() const { return m_inversion; } -EvenPhiCMA::EvenPhiCMA(EvenPhiCMA::parseParams pars) : CMAparameters(pars) { +EvenPhiCMA::EvenPhiCMA(const EvenPhiCMA::parseParams& pars) : CMAparameters(pars) { m_inversion = false; m_conf_type = CMAparameters::Atlas; @@ -39,11 +39,13 @@ EvenPhiCMA::EvenPhiCMA(EvenPhiCMA::parseParams pars) : CMAparameters(pars) { } } -EvenPhiCMA::EvenPhiCMA(const EvenPhiCMA& cma) : CMAparameters(cma) { - m_pivot_WORs = cma.pivot_WORs(); - m_lowPt_WORs = cma.lowPt_WORs(); - m_highPt_WORs = cma.highPt_WORs(); - m_inversion = cma.inversion(); +EvenPhiCMA::EvenPhiCMA(const EvenPhiCMA& cma) + : CMAparameters(cma), + m_pivot_WORs (cma.pivot_WORs()), + m_lowPt_WORs (cma.lowPt_WORs()), + m_highPt_WORs (cma.highPt_WORs()), + m_inversion (cma.inversion()) +{ m_conf_type = CMAparameters::Atlas; } diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/OddPhiCMA.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/OddPhiCMA.cxx index 462661de41f220996add1a8ac1b212aba7d86134..b82a525574a94e9b6accbd4ac5c28a1be1e831e4 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/OddPhiCMA.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/OddPhiCMA.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "GaudiKernel/MsgStream.h" @@ -38,11 +38,13 @@ OddPhiCMA::OddPhiCMA(parseParams parse) : CMAparameters(parse) { } } -OddPhiCMA::OddPhiCMA(const OddPhiCMA& cma) : CMAparameters(cma) { - m_pivot_WORs = cma.pivot_WORs(); - m_lowPt_WORs = cma.lowPt_WORs(); - m_highPt_WORs = cma.highPt_WORs(); - m_inversion = cma.inversion(); +OddPhiCMA::OddPhiCMA(const OddPhiCMA& cma) + : CMAparameters(cma), + m_pivot_WORs (cma.pivot_WORs()), + m_lowPt_WORs (cma.lowPt_WORs()), + m_highPt_WORs (cma.highPt_WORs()), + m_inversion (cma.inversion()) +{ m_conf_type = CMAparameters::Atlas; } diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RDOindex.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RDOindex.cxx index a6b72c2e7572c3ec0356a4771be47e2978b6b53e..353b8e451b7ad47a9e9a7684f67e5a5118d6461b 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RDOindex.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RDOindex.cxx @@ -11,7 +11,7 @@ RDOindex::RDOindex(unsigned int PAD, unsigned int code, const RpcIdHelper& helper) : m_PADid{static_cast(PAD)}, m_lvl1_code{code}, - m_rpcIdHelper (helper) + m_rpcIdHelper (&helper) { set_indexes(); } @@ -26,7 +26,7 @@ RDOindex::RDOindex(unsigned int PAD, unsigned int code, const std::string& Name, m_doubletR{dR}, m_doubletZ{dZ}, m_doubletPhi{dP}, - m_rpcIdHelper (helper) + m_rpcIdHelper (&helper) { set_indexes(); } @@ -84,7 +84,7 @@ void RDOindex::pad_identifier(Identifier& id) const { doublet_phi = m_doubletPhi; } - id = m_rpcIdHelper.padID(name, eta, phi, doublet_r, doublet_z, doublet_phi); + id = m_rpcIdHelper->padID(name, eta, phi, doublet_r, doublet_z, doublet_phi); } } diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RPCchamberdata.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RPCchamberdata.cxx index f1afe45b850fa368f271fdc1ade8e03f3b840e24..6fbb3af7f4e94ce6424ab27b35a66a3148d1ea0a 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RPCchamberdata.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RPCchamberdata.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RPC_CondCabling/RPCchamberdata.h" @@ -30,7 +30,7 @@ RPCchamberdata::RPCchamberdata(DBline& data, int type) : BaseObject(Logic, "RPC params.stripsInPhiCon = stripsInPhiCon; if (get_data(data, params)) { m_rpc.emplace_back(params); } - data++; + ++data; } while (!data("}")); } diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RpcCablingCondData.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RpcCablingCondData.cxx index 48ff6d705adbbbc658c9a115e25d3efa9648fb6f..022e1974c363f1a26e048bb77c2fd2493a8ddf8f 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RpcCablingCondData.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RpcCablingCondData.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RPC_CondCabling/RpcCablingCondData.h" @@ -404,7 +404,7 @@ StatusCode RpcCablingCondData::giveROB_fromPRD(const IdentifierHash prdHashId, s bool RpcCablingCondData::give_Pad_Parameters(unsigned short int logic_sector, unsigned short int PADId, bool& feet, bool& eta_and_phi, unsigned short int& cma_mask, unsigned short int& feet_th0, unsigned short int& feet_th1, unsigned short int& feet_th2) const { - if (logic_sector >= 64 || PADId >= 10) return false; // max PADId was 8 in Run2, increased to 10 for Run3 to allow BIS78 + if (logic_sector >= MAX_LOGICSECTOR || PADId >= MAX_PADID) return false; feet = m_RPCPadParameters_array[logic_sector][PADId].feet_on(); eta_and_phi = m_RPCPadParameters_array[logic_sector][PADId].eta_and_phi(); diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/SectorLogicSetup.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/SectorLogicSetup.cxx index b6a54afa4f785da48d34c5e59e96ee09c24bfce9..8433bec96df43d15357233b359aeb2f2d215a7ef 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/SectorLogicSetup.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/SectorLogicSetup.cxx @@ -11,10 +11,14 @@ using namespace RPC_CondCabling; SectorLogicSetup::SectorLogicSetup(int type, const std::string& database, const std::string& layout, bool conf) : - BaseObject(Logic, "Sector Logic Map"), m_positive_sector(""), m_negative_sector(""), m_sector_type(type) { - m_online_database = database; - m_layout = layout; - m_cosmic = conf; + BaseObject(Logic, "Sector Logic Map"), + m_positive_sector(""), + m_negative_sector(""), + m_sector_type(type), + m_online_database (database), + m_layout (layout), + m_cosmic (conf) +{ } std::string SectorLogicSetup::no_elements(const std::string& tech, int stat) { @@ -322,7 +326,9 @@ const CMAparameters::CMAlist SectorLogicSetup::give_CMAs(const int sector, const return list; } -bool SectorLogicSetup::give_RoI_borders(CMAidentity ETA, CMAidentity PHI, unsigned int& firstEtaCode, unsigned int& lastEtaCode, +bool SectorLogicSetup::give_RoI_borders(const CMAidentity& ETA, + const CMAidentity& PHI, + unsigned int& firstEtaCode, unsigned int& lastEtaCode, unsigned int& firstPhiCode, unsigned int& lastPhiCode) const { EtaCMAmap::const_iterator etaCMA = find_etaCMA(ETA.PAD_index(), ETA.Ixx_index()); if (etaCMA == m_etaCMAs.end()) return false; @@ -346,7 +352,9 @@ bool SectorLogicSetup::give_RoI_borders(CMAidentity ETA, CMAidentity PHI, unsign return firstEtaCode != lastEtaCode; } -bool SectorLogicSetup::give_LowPt_borders(CMAidentity ETA, CMAidentity PHI, unsigned int& firstEtaCode, unsigned int& lastEtaCode, +bool SectorLogicSetup::give_LowPt_borders(const CMAidentity& ETA, + const CMAidentity& PHI, + unsigned int& firstEtaCode, unsigned int& lastEtaCode, unsigned int& firstPhiCode, unsigned int& lastPhiCode) const { EtaCMAmap::const_iterator etaCMA = find_etaCMA(ETA.PAD_index(), ETA.Ixx_index()); if (etaCMA == m_etaCMAs.end()) return false; @@ -370,7 +378,9 @@ bool SectorLogicSetup::give_LowPt_borders(CMAidentity ETA, CMAidentity PHI, unsi return true; } -bool SectorLogicSetup::give_HighPt_borders(CMAidentity ETA, CMAidentity PHI, unsigned int& firstEtaCode, unsigned int& lastEtaCode, +bool SectorLogicSetup::give_HighPt_borders(const CMAidentity& ETA, + const CMAidentity& PHI, + unsigned int& firstEtaCode, unsigned int& lastEtaCode, unsigned int& firstPhiCode, unsigned int& lastPhiCode) const { EtaCMAmap::const_iterator etaCMA = find_etaCMA(ETA.PAD_index(), ETA.Ixx_index()); if (etaCMA == m_etaCMAs.end()) return false; @@ -394,7 +404,7 @@ bool SectorLogicSetup::give_HighPt_borders(CMAidentity ETA, CMAidentity PHI, uns return true; } -bool SectorLogicSetup::give_LowPt_layout(CMAidentity ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code, +bool SectorLogicSetup::give_LowPt_layout(const CMAidentity& ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code, unsigned short int& stop_pivot_ch, unsigned int& stop_pivot_code, unsigned short int& start_confirm_ch, unsigned int& start_confirm_code, unsigned short int& stop_confirm_ch, unsigned int& stop_confirm_code) const { @@ -443,7 +453,7 @@ bool SectorLogicSetup::give_LowPt_layout(CMAidentity ID, unsigned short int& sta return !(start_confirm_ch == 999 || stop_confirm_ch == 999); } -bool SectorLogicSetup::give_HighPt_layout(CMAidentity ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code, +bool SectorLogicSetup::give_HighPt_layout(const CMAidentity& ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code, unsigned short int& stop_pivot_ch, unsigned int& stop_pivot_code, unsigned short int& start_confirm_ch, unsigned int& start_confirm_code, unsigned short int& stop_confirm_ch, unsigned int& stop_confirm_code) const { @@ -492,7 +502,7 @@ bool SectorLogicSetup::give_HighPt_layout(CMAidentity ID, unsigned short int& st return !(start_confirm_ch == 999 || stop_confirm_ch == 999); } -const CMAparameters* SectorLogicSetup::give_CMA(CMAidentity CMA) const { +const CMAparameters* SectorLogicSetup::give_CMA(const CMAidentity& CMA) const { if (CMA.type() == Eta) { EtaCMAmap::const_iterator etaCMA = find_etaCMA(CMA.PAD_index(), CMA.Ixx_index()); return (etaCMA != m_etaCMAs.end()) ? &((*etaCMA).second) : nullptr; @@ -511,7 +521,8 @@ const CMAparameters* SectorLogicSetup::give_CMA(CMAidentity CMA) const { return nullptr; } -bool SectorLogicSetup::correct(CMAidentity CMA, L1RPCcabCorrection type, CMAinput it, unsigned int ly, unsigned short int Channel1, +bool SectorLogicSetup::correct(const CMAidentity& CMA, + L1RPCcabCorrection type, CMAinput it, unsigned int ly, unsigned short int Channel1, unsigned short int Channel2, short int number) const { if (CMA.type() == Eta) { EtaCMAmap::const_iterator etaCMA = find_etaCMA(CMA.PAD_index(), CMA.Ixx_index()); @@ -530,7 +541,8 @@ bool SectorLogicSetup::correct(CMAidentity CMA, L1RPCcabCorrection type, CMAinpu return false; } -std::list SectorLogicSetup::give_strip_code(CMAidentity CMA, int logic_sector, unsigned short int lh, unsigned short int ijk, +std::list SectorLogicSetup::give_strip_code(const CMAidentity& CMA, + int logic_sector, unsigned short int lh, unsigned short int ijk, unsigned short int Channel) const { std::list StripCodes; diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/WiredORdata.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/WiredORdata.cxx index 48bf37f338063564e41e25957edaa58d3d4cb1ad..dc37490ae5c84de548f7d3f5384570eca8509e0e 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/WiredORdata.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/WiredORdata.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RPC_CondCabling/WiredORdata.h" @@ -23,7 +23,7 @@ WiredORdata::WiredORdata(DBline& data, int type) : BaseObject{Logic, "Wired OR D parse_params.station = m_station; parse_params.number = -1; if (get_data(data, parse_params)) { m_wor.emplace_back(parse_params); } - data++; + ++data; } while (!data("}")); } WiredORdata::~WiredORdata() = default; diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/CMakeLists.txt b/MuonSpectrometer/MuonValidation/MuonPRDTest/CMakeLists.txt index 0c6d9aa593c12ef14194533a1530a77d94835583..5f68b8b5606ce91f7724bcc90dcffbfacd35679d 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/CMakeLists.txt +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/CMakeLists.txt @@ -10,7 +10,7 @@ find_package( CLHEP ) atlas_add_library (MuonPRDTestLib MuonPRDTest/*.h Root/*.cxx PUBLIC_HEADERS MuonPRDTest - LINK_LIBRARIES AthenaBaseComps GeneratorObjects MuonDigitContainer MuonIdHelpersLib MuonReadoutGeometry MuonSimData MuonSimEvent MuonTesterTreeLib StoreGateLib + LINK_LIBRARIES AthenaBaseComps GeneratorObjects MuonDigitContainer MuonIdHelpersLib MuonReadoutGeometry MuonSimData MuonSimEvent MuonPrepRawData MuonRDO MuonCSC_CnvToolsLib MuonTesterTreeLib StoreGateLib PRIVATE_LINK_LIBRARIES AthenaKernel AtlasHepMCLib ) # Component(s) in the package: diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCDigitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCDigitVariables.h index 8bf4eb36712b78668c931b64f0a5837b33acbd3f..b9f928428c0aa9cf8b73a74ba228e496abd347b3 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCDigitVariables.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCDigitVariables.h @@ -23,7 +23,6 @@ namespace MuonPRDTest{ ScalarBranch& m_CSC_nDigits{parent().newScalar("N_Digits_CSC")}; VectorBranch& m_CSC_dig_localPosX{parent().newVector("Digits_CSC_localPosX")}; VectorBranch& m_CSC_dig_localPosY{parent().newVector("Digits_CSC_localPosY")}; - VectorBranch& m_CSC_dig_stripNumber{parent().newVector("Digits_CSC_stripNumber")}; ThreeVectorBranch m_CSC_dig_globalPos{parent(), "Digits_CSC_globalPos"}; CscIdentifierBranch m_CSC_dig_id{parent(), "Digits_CSC"}; }; diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCPRDVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..bb6af1be7c260856236dea6c81256a8639983ff0 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCPRDVariables.h @@ -0,0 +1,34 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_CSCPRDVARIABLES_H +#define MuonPRDTEST_CSCPRDVARIABLES_H + +#include "MuonPrepRawData/CscPrepDataContainer.h" +#include "MuonPRDTest/PrdTesterModule.h" + +namespace MuonPRDTest{ + class CSCPRDVariables : public PrdTesterModule { + public: + CSCPRDVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~CSCPRDVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + ScalarBranch& m_CSC_nPRD{parent().newScalar("N_PRD_CSC")}; + VectorBranch& m_CSC_PRD_localPosX{parent().newVector("PRD_CSC_localPosX")}; + VectorBranch& m_CSC_PRD_localPosY{parent().newVector("PRD_CSC_localPosY")}; + ThreeVectorBranch m_CSC_PRD_globalPos{parent(), "PRD_CSC_globalPos"}; + VectorBranch& m_CSC_PRD_time{parent().newVector("PRD_CSC_time")}; + VectorBranch& m_CSC_PRD_charge{parent().newVector("PRD_CSC_charge")}; + CscIdentifierBranch m_CSC_PRD_id{parent(), "PRD_CSC"}; + }; +}; + +#endif // MuonPRDTEST_CSCPRDVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCRDOVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..f02cf959dfb2054b16055082e1bbb839d079f1f8 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/CSCRDOVariables.h @@ -0,0 +1,43 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_CSCRDOVARIABLES_H +#define MuonPRDTEST_CSCRDOVARIABLES_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonRDO/CscRawDataContainer.h" +#include "MuonCSC_CnvTools/ICSC_RDO_Decoder.h" +#include "MuonIdHelpers/CscIdHelper.h" + +namespace MuonPRDTest{ + class CSCRDOVariables : public PrdTesterModule { + public: + CSCRDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl, const MuonIdHelper* idhelper, const Muon::ICSC_RDO_Decoder* rdo_decoder); + + ~CSCRDOVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + void setHelper(const MuonIdHelper* idhelper){ + m_CscIdHelper = dynamic_cast(idhelper); + if(!m_CscIdHelper) { + throw std::runtime_error("casting IdHelper to CscIdHelper failed"); + } + } + SG::ReadHandleKey m_key{}; + const CscIdHelper* m_CscIdHelper{nullptr}; + const Muon::ICSC_RDO_Decoder* m_rdo_decoder{nullptr}; + ScalarBranch& m_CSC_nRDO{parent().newScalar("N_RDO_CSC")}; + VectorBranch& m_CSC_rdo_localPosX{parent().newVector("RDO_CSC_localPosX")}; + VectorBranch& m_CSC_rdo_localPosY{parent().newVector("RDO_CSC_localPosY")}; + VectorBranch& m_CSC_rdo_time{parent().newVector("RDO_CSC_time")}; + ThreeVectorBranch m_CSC_rdo_globalPos{parent(), "RDO_CSC_globalPos"}; + CscIdentifierBranch m_CSC_rdo_id{parent(), "RDO_CSC"}; + }; +}; + +#endif // MuonPRDTEST_CSCRDOVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMDigitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMDigitVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..63f2714238fc986b2159d4fa8d9fbf3f9502b78a --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMDigitVariables.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_MMDigitVARIABLES_H +#define MuonPRDTEST_MMDigitVARIABLES_H + +#include "MuonDigitContainer/MmDigitContainer.h" +#include "MuonPRDTest/PrdTesterModule.h" + +namespace MuonPRDTest{ + class MMDigitVariables : public PrdTesterModule { + public: + MMDigitVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~MMDigitVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + ScalarBranch& m_NSWMM_nDigits{parent().newScalar("N_Digits_MM")}; + VectorBranch>& m_NSWMM_dig_time{parent().newVector>("Digits_MM_time")}; + VectorBranch>& m_NSWMM_dig_charge{parent().newVector>("Digits_MM_charge")}; + VectorBranch>& m_NSWMM_dig_stripPosition{parent().newVector>("Digits_MM_stripPosition")}; + VectorBranch>& m_NSWMM_dig_sr_time{parent().newVector>("Digits_MM_stripResponse_time")}; + VectorBranch>& m_NSWMM_dig_sr_charge{parent().newVector>("Digits_MM_stripResponse_charge")}; + VectorBranch>& m_NSWMM_dig_sr_stripPosition{parent().newVector>("Digits_MM_stripResponse_stripPosition")}; + VectorBranch>& m_NSWMM_dig_time_trigger{parent().newVector>("Digits_MM_time_trigger")}; + VectorBranch>& m_NSWMM_dig_charge_trigger{parent().newVector>("Digits_MM_charge_trigger")}; + VectorBranch>& m_NSWMM_dig_position_trigger{parent().newVector>("Digits_MM_position_trigger")}; + VectorBranch>& m_NSWMM_dig_MMFE_VMM_id_trigger{parent().newVector>("Digits_MM_MMFE_VMM_id_trigger")}; + VectorBranch>& m_NSWMM_dig_VMM_id_trigger{parent().newVector>("Digits_MM_VMM_id_trigger")}; + VectorBranch& m_NSWMM_dig_stripLposX{parent().newVector("Digits_MM_stripLposX")}; + VectorBranch& m_NSWMM_dig_stripLposY{parent().newVector("Digits_MM_stripLposY")}; + ThreeVectorBranch m_NSWMM_dig_stripGpos{parent(), "Digits_MM_stripGpos"}; + VectorBranch& m_NSWMM_dig_sr_stripLposX{parent().newVector("Digits_MM_stripResponse_stripLposX")}; + VectorBranch& m_NSWMM_dig_sr_stripLposY{parent().newVector("Digits_MM_stripResponse_stripLposY")}; + ThreeVectorBranch m_NSWMM_dig_sr_stripGpos{parent(), "Digits_MM_stripResponse_stripGpos"}; + MmIdentifierBranch m_NSWMM_dig_id{parent(), "Digits_MM"}; + }; +}; +#endif // MuonPRDTEST_MMDigitVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMPRDVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..6e6a041e4f3ac5c0fa9373bd0dbdbf8d3fe9bb7d --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMPRDVariables.h @@ -0,0 +1,42 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_MMPRDVARIABLES_H +#define MuonPRDTEST_MMPRDVARIABLES_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonPrepRawData/MMPrepDataContainer.h" +#include "MuonRDO/MM_RawDataContainer.h" + +namespace MuonPRDTest{ + class MMPRDVariables : public PrdTesterModule { + public: + MMPRDVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~MMPRDVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + SG::ReadHandleKey m_rdokey{}; + ScalarBranch& m_NSWMM_nPRD{parent().newScalar("N_PRD_MM")}; + VectorBranch& m_NSWMM_PRD_time{parent().newVector("PRD_MM_time")}; + VectorBranch& m_NSWMM_PRD_covMatrix_1_1{parent().newVector("PRD_MM_covMatrix_1_1")}; + VectorBranch& m_NSWMM_PRD_nRdos{parent().newVector("PRD_MM_nRdos")}; + VectorBranch& m_NSWMM_PRD_localPosX{parent().newVector("PRD_MM_localPosX")}; + VectorBranch& m_NSWMM_PRD_localPosY{parent().newVector("PRD_MM_localPosY")}; + ThreeVectorBranch m_NSWMM_PRD_globalPos{parent(), "PRD_MM_globalPos"}; + VectorBranch& m_NSWMM_PRD_rdos_time{parent().newVector("PRD_MM_rdos_time")}; + VectorBranch& m_NSWMM_PRD_rdos_charge{parent().newVector("PRD_MM_rdos_charge")}; + VectorBranch& m_NSWMM_PRD_rdos_channel{parent().newVector("PRD_MM_rdos_channel")}; + VectorBranch& m_NSWMM_PRD_uTPCAngle{parent().newVector("PRD_MM_uTPCAngle")}; + VectorBranch& m_NSWMM_PRD_uTPCChiSqProb{parent().newVector("PRD_MM_uTPCChiSqProb")}; + MmIdentifierBranch m_NSWMM_PRD_id{parent(), "PRD_MM"}; + }; +}; + +#endif // MuonPRDTEST_MMPRDVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMRDOVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..50c29a60bab49c69a0b8307b643ec9fc2cc0e52f --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMRDOVariables.h @@ -0,0 +1,35 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_MMRDOVARIABLES_H +#define MuonPRDTEST_MMRDOVARIABLES_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonRDO/MM_RawDataContainer.h" + +namespace MuonPRDTest{ + class MMRDOVariables : public PrdTesterModule { + public: + MMRDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~MMRDOVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_rdokey{}; + ScalarBranch& m_NSWMM_nRDO{parent().newScalar("N_RDO_MM")}; + VectorBranch& m_NSWMM_rdo_time{parent().newVector("RDO_MM_time")}; + VectorBranch& m_NSWMM_rdo_charge{parent().newVector("RDO_MM_charge")}; + VectorBranch& m_NSWMM_rdo_relBcid{parent().newVector("RDO_MM_relBcid")}; + VectorBranch& m_NSWMM_rdo_localPosX{parent().newVector("RDO_MM_localPosX")}; + VectorBranch& m_NSWMM_rdo_localPosY{parent().newVector("RDO_MM_localPosY")}; + ThreeVectorBranch m_NSWMM_rdo_globalPos{parent(), "RDO_MM_globalPos"}; + MmIdentifierBranch m_NSWMM_rdo_id{parent(), "RDO_MM"}; + }; +}; + +#endif // MuonPRDTEST_MMRDOVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMSDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMSDOVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..4ff79081d97e4a594e22abf21ab880ea9a7bfc63 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMSDOVariables.h @@ -0,0 +1,37 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MUONPRDTEST_MMSDOVARIABLES_H +#define MUONPRDTEST_MMSDOVARIABLES_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonSimData/MuonSimDataCollection.h" + +namespace MuonPRDTest{ + class MMSDOVariables : public PrdTesterModule { + public: + MMSDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~MMSDOVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + + ScalarBranch& m_NSWMM_nsdo{parent().newScalar("nSDO_MM")}; + MmIdentifierBranch m_NSWMM_sdo_id{parent(), "SDO_MM"}; + VectorBranch& m_NSWMM_sdo_word{parent().newVector("SDO_MM_word")}; + VectorBranch& m_NSWMM_sdo_barcode{parent().newVector("SDO_MM_barcode")}; + VectorBranch& m_NSWMM_sdo_globaltime{parent().newVector("SDO_MM_global_time")}; + + ThreeVectorBranch m_NSWMM_dig_globalPos{parent(), "SDO_MM_globalPos"}; + VectorBranch& m_NSWMM_sdo_localPosX{parent().newVector("SDO_MM_localPosX")}; + VectorBranch& m_NSWMM_sdo_localPosY{parent().newVector("SDO_MM_localPosY")}; + }; +}; + +#endif // MMSDOVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMSimHitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMSimHitVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..27969a57d5c1bb8eb62915cc666a7cf4c74f0457 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MMSimHitVariables.h @@ -0,0 +1,40 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MMSimHitVariables_H +#define MMSimHitVariables_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonIdHelpers/MmIdHelper.h" +#include "MuonSimEvent/MMSimHitCollection.h" + +namespace MuonPRDTest{ + class MMSimHitVariables : public PrdTesterModule { + public: + MMSimHitVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + bool fill(const EventContext& ctx) override final; + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + ThreeVectorBranch m_NSWMM_hitGlobalPosition{parent(), "Hits_MM_GlobalPosition"}; + ThreeVectorBranch m_NSWMM_hitGlobalDirection{parent(), "Hits_MM_GlobalDirection"}; + VectorBranch& m_NSWMM_particleEncoding{parent().newVector("Hits_MM_particleEncoding")}; + VectorBranch& m_NSWMM_kineticEnergy{parent().newVector("Hits_MM_kineticEnergy")}; + VectorBranch& m_NSWMM_depositEnergy{parent().newVector("Hits_MM_depositEnergy")}; + VectorBranch& m_NSWMM_isInsideBounds{parent().newVector("Hits_MM_isInsideBounds")}; + VectorBranch& m_NSWMM_trackId{parent().newVector("Hits_MM_trackId")}; + ScalarBranch& m_NSWMM_nSimHits{parent().newScalar("Hits_MM_nHits")}; + MmIdentifierBranch m_NSWMM_Id{parent(), "Hits_MM_off"}; + VectorBranch& m_NSWMM_globalTime{parent().newVector("Hits_MM_globalTime")}; + ThreeVectorBranch m_NSWMM_detector_globalPosition{parent(), "Hits_MM_detector_globalPosition"}; + ThreeVectorBranch m_NSWMM_hitToDsurfacePosition{parent(), "Hits_MM_hitToDsurfacePosition"}; + ThreeVectorBranch m_NSWMM_hitToRsurfacePosition{parent(), "Hits_MM_hitToRsurfacePosition"}; + VectorBranch& m_NSWMM_FastDigitRsurfacePositionX{parent().newVector("Hits_MM_FastDigitRsurfacePositionX")}; + VectorBranch& m_NSWMM_FastDigitRsurfacePositionY{parent().newVector("Hits_MM_FastDigitRsurfacePositionY")}; + }; +}; + +#endif // MMSimHitVariables_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MuonPRDTestDict.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MuonPRDTestDict.h index 008541ca6ebaea9c7c021cb15a5cbf9f2ff40095..39faa32f0a01e01662098c790d61db7ae60671bd 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MuonPRDTestDict.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/MuonPRDTestDict.h @@ -9,11 +9,25 @@ #include #include #include +#include +#include #include #include #include +#include +#include #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #endif diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/TGCPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/TGCPRDVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..635311306916f9545d1b8c56b6979a66ba41469c --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/TGCPRDVariables.h @@ -0,0 +1,32 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_TGCPRDVARIABLES_H +#define MuonPRDTEST_TGCPRDVARIABLES_H + +#include "MuonPrepRawData/TgcPrepDataContainer.h" +#include "MuonPRDTest/PrdTesterModule.h" + +namespace MuonPRDTest{ + class TGCPRDVariables : public PrdTesterModule { + public: + TGCPRDVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~TGCPRDVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + ScalarBranch& m_TGC_nPRD{parent().newScalar("N_PRD_TGC")}; + VectorBranch& m_TGC_PRD_localPosX{parent().newVector("PRD_TGC_localPosX")}; + VectorBranch& m_TGC_PRD_localPosY{parent().newVector("PRD_TGC_localPosY")}; + ThreeVectorBranch m_TGC_PRD_globalPos{parent(), "PRD_TGC_globalPos"}; + TgcIdentifierBranch m_TGC_PRD_id{parent(), "PRD_TGC"}; + }; +}; + +#endif // MuonPRDTEST_TGCPRDVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/TGCRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/TGCRDOVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..9845312f39e29664e75b66e6bf75328bce477167 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/TGCRDOVariables.h @@ -0,0 +1,34 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_TGCRDOVARIABLES_H +#define MuonPRDTEST_TGCRDOVARIABLES_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonRDO/TgcRdoContainer.h" +#include "TGCcablingInterface/ITGCcablingSvc.h" + +namespace MuonPRDTest{ + class TGCRDOVariables : public PrdTesterModule { + public: + TGCRDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl, const ITGCcablingSvc* cabling_svc); + + ~TGCRDOVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + const ITGCcablingSvc* m_tgcCabling{nullptr}; + ScalarBranch& m_TGC_nRDO{parent().newScalar("N_RDO_TGC")}; + VectorBranch& m_TGC_rdo_localPosX{parent().newVector("RDO_TGC_localPosX")}; + VectorBranch& m_TGC_rdo_localPosY{parent().newVector("RDO_TGC_localPosY")}; + ThreeVectorBranch m_TGC_rdo_globalPos{parent(), "RDO_TGC_globalPos"}; + TgcIdentifierBranch m_TGC_rdo_id{parent(), "RDO_TGC"}; + }; +}; + +#endif // MuonPRDTEST_TGCRDOVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCDigitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCDigitVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..f07003b4fef1e6ecc50cc40d9a461fa44084c509 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCDigitVariables.h @@ -0,0 +1,40 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_sTGCDigitVARIABLES_H +#define MuonPRDTEST_sTGCDigitVARIABLES_H + +#include "MuonDigitContainer/sTgcDigitContainer.h" +#include "MuonPRDTest/PrdTesterModule.h" + +namespace MuonPRDTest{ + class sTgcDigitVariables : public PrdTesterModule { + public: + sTgcDigitVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~sTgcDigitVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + ScalarBranch& m_NSWsTGC_nDigits{parent().newScalar("N_Digits_sTGC")}; + VectorBranch& m_NSWsTGC_dig_localPosX{parent().newVector("Digits_sTGC_localPosX")}; + VectorBranch& m_NSWsTGC_dig_localPosY{parent().newVector("Digits_sTGC_localPosY")}; + VectorBranch& m_NSWsTGC_dig_time{parent().newVector("Digits_sTGC_time")}; + VectorBranch& m_NSWsTGC_dig_bctag{parent().newVector("Digits_sTGC_bctag")}; + VectorBranch& m_NSWsTGC_dig_charge{parent().newVector("Digits_sTGC_charge")}; + VectorBranch& m_NSWsTGC_dig_isDead{parent().newVector("Digits_sTGC_isDead")}; + VectorBranch& m_NSWsTGC_dig_isPileup{parent().newVector("Digits_sTGC_isPileup")}; + VectorBranch& m_NSWsTGC_dig_channelNumber{parent().newVector("Digits_sTGC_channelNumber")}; + ThreeVectorBranch m_NSWsTGC_dig_globalPos{parent(), "Digits_sTGC_globalPos"}; + ThreeVectorBranch m_NSWsTGC_dig_PadglobalCornerPos{parent(), "Digits_sTGC_PadglobalCornerPos"}; + VectorBranch& m_NSWsTGC_dig_channelPosX{parent().newVector("Digits_sTGC_localPosX")}; + VectorBranch& m_NSWsTGC_dig_channelPosY{parent().newVector("Digits_sTGC_localPosY")}; + sTgcIdentifierBranch m_NSWsTGC_dig_id{parent(), "Digits_sTGC"}; + }; +}; +#endif // MuonPRDTEST_sTGCDigitVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCPRDVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..ed4ab0c78d87f74fd519f9285cee595952e17f7f --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCPRDVariables.h @@ -0,0 +1,36 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_sTGCPRDVARIABLES_H +#define MuonPRDTEST_sTGCPRDVARIABLES_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonPrepRawData/sTgcPrepDataContainer.h" + +namespace MuonPRDTest{ + class sTGCPRDVariables : public PrdTesterModule { + public: + sTGCPRDVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~sTGCPRDVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + ScalarBranch& m_NSWsTGC_nPRD{parent().newScalar("N_PRD_sTGC")}; + VectorBranch& m_NSWsTGC_PRD_charge{parent().newVector("PRD_sTGC_charge")}; + VectorBranch& m_NSWsTGC_PRD_bcTag{parent().newVector("RDO_sTGC_bcTag")}; + VectorBranch& m_NSWsTGC_PRD_localPosX{parent().newVector("PRD_sTGC_localPosX")}; + VectorBranch& m_NSWsTGC_PRD_localPosY{parent().newVector("PRD_sTGC_localPosY")}; + ThreeVectorBranch m_NSWsTGC_PRD_globalPos{parent(), "PRD_sTGC_globalPos"}; + VectorBranch& m_NSWsTGC_PRD_covMatrix_1_1{parent().newVector("PRD_sTGC_covMatrix_1_1")}; + VectorBranch& m_NSWsTGC_PRD_covMatrix_2_2{parent().newVector("PRD_sTGC_covMatrix_2_2")}; + sTgcIdentifierBranch m_NSWsTGC_PRD_id{parent(), "PRD_sTGC"}; + }; +}; + +#endif // MuonPRDTEST_sTGCPRDVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCRDOVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..654bc26a4c3c3e8239ebf096be102f1fc4a4b854 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCRDOVariables.h @@ -0,0 +1,37 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MuonPRDTEST_sTGCRDOVARIABLES_H +#define MuonPRDTEST_sTGCRDOVARIABLES_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonRDO/STGC_RawDataContainer.h" + +namespace MuonPRDTest{ + class sTGCRDOVariables : public PrdTesterModule { + public: + sTGCRDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~sTGCRDOVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + ScalarBranch& m_NSWsTGC_nRDO{parent().newScalar("N_RDO_sTGC")}; + VectorBranch& m_NSWsTGC_rdo_time{parent().newVector("RDO_sTGC_time")}; + VectorBranch& m_NSWsTGC_rdo_charge{parent().newVector("RDO_sTGC_charge")}; + VectorBranch& m_NSWsTGC_rdo_tdo{parent().newVector("RDO_sTGC_tdo")}; + VectorBranch& m_NSWsTGC_rdo_bcTag{parent().newVector("RDO_sTGC_bcTag")}; + VectorBranch& m_NSWsTGC_rdo_isDead{parent().newVector("RDO_sTGC_isDead")}; + VectorBranch& m_NSWsTGC_rdo_localPosX{parent().newVector("RDO_sTGC_localPosX")}; + VectorBranch& m_NSWsTGC_rdo_localPosY{parent().newVector("RDO_sTGC_localPosY")}; + ThreeVectorBranch m_NSWsTGC_rdo_globalPos{parent(), "RDO_sTGC_globalPos"}; + sTgcIdentifierBranch m_NSWsTGC_rdo_id{parent(), "RDO_sTGC"}; + }; +}; + +#endif // MuonPRDTEST_sTGCRDOVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCSDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCSDOVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..64f60cd384b26c46b12b145c3b658cba8860b04b --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCSDOVariables.h @@ -0,0 +1,39 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MUONPRDTEST_sTGCSDOVARIABLES_H +#define MUONPRDTEST_sTGCSDOVARIABLES_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonSimData/MuonSimDataCollection.h" + +namespace MuonPRDTest{ + class sTgcSDOVariables : public PrdTesterModule { + public: + sTgcSDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + ~sTgcSDOVariables() = default; + + bool fill(const EventContext& ctx) override final; + + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + + ScalarBranch& m_NSWsTGC_nsdo{parent().newScalar("nSDO_sTGC")}; + sTgcIdentifierBranch m_NSWsTGC_sdo_id{parent(), "SDO_sTGC"}; + VectorBranch& m_NSWsTGC_sdo_word{parent().newVector("SDO_sTGC_word")}; + VectorBranch& m_NSWsTGC_sdo_barcode{parent().newVector("SDO_sTGC_barcode")}; + VectorBranch& m_NSWsTGC_sdo_globaltime{parent().newVector("SDO_sTGC_global_time")}; + + ThreeVectorBranch m_NSWsTGC_dig_globalPos{parent(), "SDO_sTGC_globalPos"}; + VectorBranch& m_NSWsTGC_sdo_E{parent().newVector("SDO_sTGC_E")}; + VectorBranch& m_NSWsTGC_sdo_tof{parent().newVector("SDO_sTGC_tof")}; + VectorBranch& m_NSWsTGC_sdo_localPosX{parent().newVector("SDO_sTGC_localPosX")}; + VectorBranch& m_NSWsTGC_sdo_localPosY{parent().newVector("SDO_sTGC_localPosY")}; + }; +}; + +#endif // sTGCSDOVARIABLES_H \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCSimHitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCSimHitVariables.h new file mode 100644 index 0000000000000000000000000000000000000000..d8de256f578bb662a468a88bc9435a90ff60ef45 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/MuonPRDTest/sTGCSimHitVariables.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef sTGCSimHitVariables_H +#define sTGCSimHitVariables_H + +#include "MuonPRDTest/PrdTesterModule.h" +#include "MuonIdHelpers/sTgcIdHelper.h" +#include "MuonSimEvent/sTGCSimHitCollection.h" + +namespace MuonPRDTest{ + class sTGCSimHitVariables : public PrdTesterModule { + public: + sTGCSimHitVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl); + + bool fill(const EventContext& ctx) override final; + bool declare_keys() override final; + + private: + SG::ReadHandleKey m_key{}; + ThreeVectorBranch m_NSWsTGC_hitGlobalPosition{parent(), "Hits_sTGC_GlobalPosition"}; + ThreeVectorBranch m_NSWsTGC_hitGlobalDirection{parent(), "Hits_sTGC_GlobalDirection"}; + ThreeVectorBranch m_NSWsTGC_hitGlobalPrePosition{parent(), "Hits_sTGC_GlobalPrePosition"}; + VectorBranch& m_NSWsTGC_particleEncoding{parent().newVector("Hits_sTGC_particleEncoding")}; + VectorBranch& m_NSWsTGC_kineticEnergy{parent().newVector("Hits_sTGC_kineticEnergy")}; + VectorBranch& m_NSWsTGC_depositEnergy{parent().newVector("Hits_sTGC_depositEnergy")}; + VectorBranch& m_NSWsTGC_isInsideBounds{parent().newVector("Hits_sTGC_isInsideBounds")}; + VectorBranch& m_NSWsTGC_trackId{parent().newVector("Hits_sTGC_trackId")}; + ScalarBranch& m_NSWsTGC_nSimHits{parent().newScalar("Hits_sTGC_nHits")}; + sTgcIdentifierBranch m_NSWsTGC_Id{parent(), "Hits_sTGC_off"}; + VectorBranch& m_NSWsTGC_globalTime{parent().newVector("Hits_sTGC_globalTime")}; + VectorBranch& m_NSWsTGC_detectorNumber{parent().newVector("Hits_sTGC_detectorNumber")}; + VectorBranch& m_NSWsTGC_wedgeId{parent().newVector("Hits_sTGC_wedgeId")}; + VectorBranch& m_NSWsTGC_wedgeType{parent().newVector("Hits_sTGC_wedgeType")}; + ThreeVectorBranch m_NSWsTGC_detector_globalPosition{parent(), "Hits_sTGC_detector_globalPosition"}; + ThreeVectorBranch m_NSWsTGC_hitToDsurfacePosition{parent(), "Hits_sTGC_hitToDsurfacePosition"}; + ThreeVectorBranch m_NSWsTGC_hitToRsurfacePosition{parent(), "Hits_sTGC_hitToRsurfacePosition"}; + VectorBranch& m_NSWsTGC_FastDigitRsurfacePositionX{parent().newVector("Hits_sTGC_FastDigitRsurfacePositionX")}; + VectorBranch& m_NSWsTGC_FastDigitRsurfacePositionY{parent().newVector("Hits_sTGC_FastDigitRsurfacePositionY")}; + VectorBranch& m_NSWsTGC_stripNumber{parent().newVector("Hits_sTGC_stripNumber")}; + }; +}; + +#endif // sTGCSimHitVariables_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCDigitVariables.cxx index 60b67a966003c646c002a6b3493d36aea7fe367e..39765fe6c3c382aa99622d7d904d50babf937c8c 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCDigitVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCDigitVariables.cxx @@ -16,13 +16,13 @@ namespace MuonPRDTest { if (!MuonDetMgr) { return false; } SG::ReadHandle CscDigitContainer{m_key, ctx}; if (!CscDigitContainer.isValid()) { - ATH_MSG_FATAL("Failed to retrive digit container " << m_key.fullKey()); + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); return false; } ATH_MSG_DEBUG("retrieved CSC Digit Container with size " << CscDigitContainer->digit_size()); - if (CscDigitContainer->size() == 0) ATH_MSG_DEBUG(" CSC Digit Continer empty "); + if (CscDigitContainer->size() == 0) ATH_MSG_DEBUG(" CSC Digit Container empty "); unsigned int n_digits{0}; for (const CscDigitCollection* coll : *CscDigitContainer) { ATH_MSG_DEBUG("processing collection with size " << coll->size()); @@ -33,31 +33,38 @@ namespace MuonPRDTest { ATH_MSG_DEBUG("CSC Digit Offline id: " << idHelperSvc()->toString(Id)); const MuonGM::CscReadoutElement* rdoEl = MuonDetMgr->getCscReadoutElement(Id); - if (!rdoEl) return false; + if (!rdoEl) { + ATH_MSG_ERROR("CSCDigitVariables::fillVariables() - Failed to retrieve CSCReadoutElement for "<cscIdHelper().print_to_string(Id).c_str()); + return false; + } Amg::Vector3D gpos{0., 0., 0.}; Amg::Vector2D lpos(0., 0.); - const bool stripPosition = rdoEl->stripPosition(Id, lpos); - int stripNumber = rdoEl->stripNumber(lpos, Id); - - if (!stripPosition) { - ATH_MSG_WARNING("CSCDigitVariables: failed to associate a valid local position for strip n. " - << stripNumber << "; associated positions will be set to 0.0."); - continue; - } - rdoEl->surface(Id).localToGlobal(lpos, gpos, gpos); m_CSC_dig_globalPos.push_back(gpos); - m_CSC_dig_localPosX.push_back(lpos.x()); - m_CSC_dig_localPosY.push_back(lpos.y()); m_CSC_dig_id.push_back(Id); - m_CSC_dig_stripNumber.push_back(stripNumber); ++n_digits; } - m_CSC_nDigits = n_digits; + // Local digit position information loss after localToGlobal transformation, fill the local positions in another loop for retrieving the local positions + for (unsigned int digitNum = 0; digitNum < coll->size(); digitNum++) { + const CscDigit* digit = coll->at(digitNum); + Identifier Id = digit->identify(); + ATH_MSG_DEBUG("CSC Digit Offline id: " << idHelperSvc()->toString(Id)); + + const MuonGM::CscReadoutElement* rdoEl = MuonDetMgr->getCscReadoutElement(Id); + if (!rdoEl) return false; + + Amg::Vector3D glpos{0., 0., 0.}; + Amg::Vector2D lopos(0., 0.); + + rdoEl->surface(Id).globalToLocal(glpos, glpos, lopos); + m_CSC_dig_localPosX.push_back(lopos.x()); + m_CSC_dig_localPosX.push_back(lopos.y()); + } } + m_CSC_nDigits = n_digits; ATH_MSG_DEBUG(" finished fillCscDigitVariables()"); return true; } diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCPRDVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..76424a1f33412238db509dfe8b935a7d81add4de --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCPRDVariables.cxx @@ -0,0 +1,60 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/CSCPRDVariables.h" + +#include "MuonReadoutGeometry/CscReadoutElement.h" + +namespace MuonPRDTest { + CSCPRDVariables::CSCPRDVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "PRD_CSC", true, msglvl), m_key{container_name} {} + bool CSCPRDVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool CSCPRDVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillCSCPRDVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle cscprdContainer{m_key, ctx}; + if (!cscprdContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve prd container " << m_key.fullKey()); + return false; + } + + ATH_MSG_DEBUG("retrieved CSC PRD Container with size " << cscprdContainer->size()); + + if (cscprdContainer->size() == 0) ATH_MSG_DEBUG(" CSC PRD Container empty "); + unsigned int n_PRD{0}; + for(auto it : *cscprdContainer ) { + const Muon::CscPrepDataCollection*coll = it; + for (auto prd: *coll) { + Identifier Id = prd->identify(); + + const MuonGM::CscReadoutElement* det = MuonDetMgr->getCscReadoutElement(Id); + if (!det) { + ATH_MSG_ERROR("The CSC hit "<toString(Id)<<" does not have a detector element attached. That should actually never happen"); + return false; + } + + m_CSC_PRD_id.push_back(Id); + m_CSC_PRD_charge.push_back(prd->charge()); + m_CSC_PRD_time.push_back(prd->time()); + + Amg::Vector3D pos = prd->globalPosition(); + Amg::Vector2D loc_pos(0., 0.); + + det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); + + m_CSC_PRD_globalPos.push_back(pos); + + m_CSC_PRD_localPosX.push_back(loc_pos[0]); + m_CSC_PRD_localPosY.push_back(loc_pos[1]); + + ++n_PRD; + } + } + m_CSC_nPRD = n_PRD; + ATH_MSG_DEBUG(" finished fillCSCPRDVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCRDOVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..0703b4b40b9f9ee6f7ab15b747a67e4e9a2f6a18 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCRDOVariables.cxx @@ -0,0 +1,73 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/CSCRDOVariables.h" +#include "MuonSimData/MuonSimDataCollection.h" +#include "MuonIdHelpers/CscIdHelper.h" +#include "MuonReadoutGeometry/CscReadoutElement.h" + +using namespace Muon; +namespace MuonPRDTest { + CSCRDOVariables::CSCRDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl, const MuonIdHelper* idhelper, const Muon::ICSC_RDO_Decoder* rdo_decoder) : + PrdTesterModule(tree, "RDO_CSC", true, msglvl), m_key{container_name}, m_rdo_decoder{rdo_decoder} {setHelper(idhelper);} + bool CSCRDOVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool CSCRDOVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillCSCRDOVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle cscrdoContainer{m_key, ctx}; + if (!cscrdoContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve csc rdo container " << m_key.fullKey()); + return false; + } + ATH_MSG_DEBUG("retrieved CSC rdo Container with size " << cscrdoContainer->size()); + + if (cscrdoContainer->size() == 0) ATH_MSG_DEBUG(" CSC rdo Container empty "); + unsigned int n_rdo{0}; + for (const CscRawDataCollection* coll : *cscrdoContainer) { + ATH_MSG_DEBUG("processing collection with size " << coll->size()); + int strip_num{0}; + for (const CscRawData* rdo: *coll) { + const Identifier Id { m_rdo_decoder->channelIdentifier(rdo,m_CscIdHelper,strip_num) }; + ++strip_num; + + const MuonGM::CscReadoutElement* rdoEl = MuonDetMgr->getCscReadoutElement(Id); + if (!rdoEl) { + ATH_MSG_ERROR("The CSC hit "<toString(Id)<<" does not have a detector element attached. That should actually never happen"); + return false; + } + + m_CSC_rdo_time.push_back(rdo->time()); + + Amg::Vector3D gpos{0., 0., 0.}; + Amg::Vector2D lpos(0., 0.); + + rdoEl->surface(Id).localToGlobal(lpos, gpos, gpos); + m_CSC_rdo_globalPos.push_back(gpos); + m_CSC_rdo_id.push_back(Id); + + ++n_rdo; + } + // Local RDO position information loss after localToGlobal transformation, fill the local positions in another loop for retrieving the local positions + for (const CscRawData* rdo: *coll) { + const Identifier Id { m_rdo_decoder->channelIdentifier(rdo,m_CscIdHelper,strip_num) }; + ++strip_num; + + const MuonGM::CscReadoutElement* rdoEl = MuonDetMgr->getCscReadoutElement(Id); + if (!rdoEl) return false; + + Amg::Vector2D loPos(0.,0.); + Amg::Vector3D glPos(0., 0., 0.); + + rdoEl->surface(Id).globalToLocal(glPos,glPos,loPos); + m_CSC_rdo_localPosX.push_back(loPos.x()); + m_CSC_rdo_localPosY.push_back(loPos.y()); + } + } + m_CSC_nRDO = n_rdo; + ATH_MSG_DEBUG(" finished fillCSCRDOVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCSDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCSDOVariables.cxx index 30fd41e361b469f81891ec1359eaefcca15a68f5..89b0d4ec09a32caf48258ae6f94ea452ced68834 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCSDOVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/CSCSDOVariables.cxx @@ -17,7 +17,7 @@ namespace MuonPRDTest { if (!MuonDetMgr) { return false; } SG::ReadHandle cscSdoContainer{m_key, ctx}; if (!cscSdoContainer.isValid()) { - ATH_MSG_FATAL("Failed to retrive digit container " << m_key.fullKey()); + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); return false; } unsigned int n_sdo{0}; @@ -40,7 +40,10 @@ namespace MuonPRDTest { m_csc_sdo_word.push_back( csc_sdo.word() ); const MuonGM::CscReadoutElement* rdoEl = MuonDetMgr->getCscReadoutElement(id); - if (!rdoEl) return false; + if (!rdoEl) { + ATH_MSG_ERROR("CSCSDOVariables::fillVariables() - Failed to retrieve CscReadoutElement for " << idHelperSvc()->toString(id)); + return false; + } Amg::Vector2D hit_on_surface(truth_localPosX, truth_localPosY); Amg::Vector3D hit_gpos(0., 0., 0.); diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MDTDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MDTDigitVariables.cxx index 37844d27375b2e74ce5af59570caa037958de9d3..4b3bf0810dc45ec51a88460affed865ff2868a14 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MDTDigitVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MDTDigitVariables.cxx @@ -16,12 +16,12 @@ namespace MuonPRDTest { if (!MuonDetMgr) { return false; } SG::ReadHandle MdtDigitContainer{m_digitKey, ctx}; if (!MdtDigitContainer.isValid()) { - ATH_MSG_FATAL("Failed to retrive digit container " << m_digitKey.fullKey()); + ATH_MSG_FATAL("Failed to retrieve digit container " << m_digitKey.fullKey()); return false; } ATH_MSG_DEBUG("retrieved MDT Digit Container with size " << MdtDigitContainer->digit_size()); - if (MdtDigitContainer->size() == 0) ATH_MSG_DEBUG(" MDT Digit Continer empty "); + if (MdtDigitContainer->size() == 0) ATH_MSG_DEBUG(" MDT Digit Container empty "); unsigned int n_digits{0}; for (const MdtDigitCollection* coll : *MdtDigitContainer) { @@ -31,7 +31,10 @@ namespace MuonPRDTest { Identifier Id = digit->identify(); const MuonGM::MdtReadoutElement* rdoEl = MuonDetMgr->getMdtReadoutElement(Id); - if (!rdoEl) return false; + if (!rdoEl) { + ATH_MSG_ERROR("MDTDigitVariables::fillVariables() - Failed to retrieve MDTReadoutElement for "<mdtIdHelper().print_to_string(Id).c_str()); + return false; + } const Identifier first_ml = idHelperSvc()->mdtIdHelper().channelID( idHelperSvc()->stationName(Id), idHelperSvc()->stationEta(Id), idHelperSvc()->stationPhi(Id), 1, 1, 1); diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMDigitVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..e931a5baf4695c3e82272421dad75d443691c115 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMDigitVariables.cxx @@ -0,0 +1,163 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/MMDigitVariables.h" + +#include "MuonReadoutGeometry/MMReadoutElement.h" + +namespace MuonPRDTest { + MMDigitVariables::MMDigitVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "Digits_MM", true, msglvl), m_key{container_name} {} + + bool MMDigitVariables::declare_keys() { return m_key.initialize().isSuccess(); } + bool MMDigitVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillMMDigitHitVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle MMDigitContainer{m_key, ctx}; + if (!MMDigitContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); + return false; + } + + ATH_MSG_DEBUG("retrieved MM Digit Container with size " << MMDigitContainer->digit_size()); + + if (MMDigitContainer->size() == 0) ATH_MSG_DEBUG(" MM Digit Container empty "); + unsigned int n_digits{0}; + for (const MmDigitCollection* coll : *MMDigitContainer) { + ATH_MSG_DEBUG("processing collection with size " << coll->size()); + for (unsigned int digitNum = 0; digitNum < coll->size(); digitNum++) { + const MmDigit* digit = coll->at(digitNum); + Identifier Id = digit->identify(); + + const MuonGM::MMReadoutElement* rdoEl = MuonDetMgr->getMMReadoutElement(Id); + if (!rdoEl) { + ATH_MSG_ERROR("MMDigitVariables::fillVariables() - Failed to retrieve MMReadoutElement for "<mmIdHelper().print_to_string(Id).c_str()); + return false; + } + + m_NSWMM_dig_id.push_back(Id); + m_NSWMM_dig_time.push_back(digit->chipResponseTime()); + m_NSWMM_dig_charge.push_back(digit->chipResponseCharge()); + m_NSWMM_dig_stripPosition.push_back(digit->chipResponsePosition()); + + m_NSWMM_dig_sr_time.push_back(digit->stripResponseTime()); + m_NSWMM_dig_sr_charge.push_back(digit->stripResponseCharge()); + m_NSWMM_dig_sr_stripPosition.push_back(digit->stripResponsePosition()); + + m_NSWMM_dig_time_trigger.push_back(digit->stripTimeForTrigger()); + m_NSWMM_dig_charge_trigger.push_back(digit->stripChargeForTrigger()); + m_NSWMM_dig_position_trigger.push_back(digit->stripPositionForTrigger()); + m_NSWMM_dig_MMFE_VMM_id_trigger.push_back(digit->MMFE_VMM_idForTrigger()); + m_NSWMM_dig_VMM_id_trigger.push_back(digit->VMM_idForTrigger()); + + if ( digit->chipResponsePosition().size() != digit->stripResponsePosition().size() ) + ATH_MSG_DEBUG("MicroMegas digitization: number of strip out from the strip response different from that out from the chip response"); + + bool isValid; + // Geant4 hit converted into digit might have fired more than one strip: + // iterating on all strips associated to that digit (from chip response) + for (unsigned int i=0;ichipResponsePosition().size();i++) { + // take strip index form chip information + int cr_strip = digit->chipResponsePosition().at(i); + //retrieve the detailed identifier for the strip form the chip response + Identifier cr_id = idHelperSvc()->mmIdHelper().channelID(idHelperSvc()->mmIdHelper().stationName(Id),idHelperSvc()->mmIdHelper().stationEta(Id), + idHelperSvc()->mmIdHelper().stationPhi(Id),idHelperSvc()->mmIdHelper().multilayer(Id),idHelperSvc()->mmIdHelper().gasGap(Id),cr_strip,isValid); + if (!isValid) { + ATH_MSG_WARNING("MMDigitVariables: failed to create a valid ID for (chip response) strip n. " << cr_strip + << "; associated positions will be set to 0.0."); + continue; + } + + // asking the detector element to get local position of strip + Amg::Vector2D cr_strip_pos(0., 0.); + if ( !rdoEl->stripPosition(cr_id,cr_strip_pos) ) { + ATH_MSG_WARNING("MMDigitVariables: failed to associate a valid local position for (chip response) strip n. " << cr_strip + << "; associated positions will be set to 0.0."); + continue; + } + m_NSWMM_dig_stripLposX.push_back(cr_strip_pos.x()); + m_NSWMM_dig_stripLposY.push_back(cr_strip_pos.y()); + + // asking the detector element to transform this local to the global position + Amg::Vector3D cr_strip_gpos(0., 0., 0.); + rdoEl->surface(cr_id).localToGlobal(cr_strip_pos, Amg::Vector3D(0., 0., 0.), cr_strip_gpos); + m_NSWMM_dig_stripGpos.push_back(cr_strip_gpos); + + // check if local and global position are congruent with the transform + Amg::Vector3D lpos = rdoEl->transform(cr_id).inverse() * cr_strip_gpos; + double dx = cr_strip_pos.x() - lpos.x(); + double dy = cr_strip_pos.y() - lpos.y(); + + if ( std::abs(dx)>0.1 || std::abs(dy)>0.1 ) { + ATH_MSG_WARNING("MicroMegas digitization: inconsistency between local/global position and transform:"); + ATH_MSG_WARNING(" X from stripPosition: " << std::setw(10) << std::setprecision(3) << cr_strip_pos.x() + << ", X from global*transform(id).inverse(): " << lpos.x() ); + ATH_MSG_WARNING(" Y from stripPosition: " << std::setw(10) << std::setprecision(3) << cr_strip_pos.y() + << ", Y from global*transform(Id).inverse(): " << lpos.y() ); + } + } + + // Geant4 hit converted into digit might have fired more than one strip: + // iterating on all strips associated to that digit (from strip response) + for (unsigned int i=0;istripResponsePosition().size();i++) { + int sr_strip = digit->stripResponsePosition().at(i); + + //retrieve the detailed identifier for the strip form the strip response + Identifier sr_id = idHelperSvc()->mmIdHelper().channelID(idHelperSvc()->mmIdHelper().stationName(Id),idHelperSvc()->mmIdHelper().stationEta(Id), + idHelperSvc()->mmIdHelper().stationPhi(Id),idHelperSvc()->mmIdHelper().multilayer(Id),idHelperSvc()->mmIdHelper().gasGap(Id),sr_strip,isValid); + if (!isValid) { + ATH_MSG_WARNING("MMDigitVariables: failed to create a valid ID for (chip response) strip n. " << sr_strip + << "; associated positions will be set to 0.0."); + continue; + } + + // asking the detector element to transform this local to the global position + Amg::Vector2D sr_strip_pos(0., 0.); + if ( !rdoEl->stripPosition(sr_id,sr_strip_pos) ) { + ATH_MSG_WARNING("MMDigitVariables: failed to associate a valid local position for (chip response) strip n. " << sr_strip + << "; associated positions will be set to 0.0."); + continue; + } + m_NSWMM_dig_sr_stripLposX.push_back(sr_strip_pos.x()); + m_NSWMM_dig_sr_stripLposY.push_back(sr_strip_pos.y()); + + // asking the detector element to transform this local to the global position + Amg::Vector3D sr_strip_gpos(0., 0., 0.); + rdoEl->surface(sr_id).localToGlobal(sr_strip_pos, Amg::Vector3D(0., 0., 0.), sr_strip_gpos); + m_NSWMM_dig_stripGpos.push_back(sr_strip_gpos); + + // check if local and global position are congruent with the transform + Amg::Vector3D sr_lpos = rdoEl->transform(sr_id).inverse() * sr_strip_gpos; + double dx = sr_strip_pos.x() - sr_lpos.x(); + double dy = sr_strip_pos.y() - sr_lpos.y(); + + if ( std::abs(dx)>0.1 || std::abs(dy)>0.1 ) { + ATH_MSG_WARNING("MicroMegas digitization: inconsistency between local/global position and transform:"); + ATH_MSG_WARNING(" X from Center(): " << std::setw(10) << std::setprecision(3) << sr_strip_pos.x() + << ", X from local*transform: " << sr_lpos.x() ); + ATH_MSG_WARNING(" Y from Center(): " << std::setw(10) << std::setprecision(3) << sr_strip_pos.y() + << ", Y from local*transform: " << sr_lpos.y() ); + } + + unsigned int cl = (digit->chipResponseTime().size()<=digit->stripResponseTime().size()) ? digit->chipResponseTime().size() : digit->stripResponseTime().size(); + + for (unsigned int i=0;ichipResponseTime().at(i) + << ", strip response time :" << std::setw(6) << std::setprecision(2) << digit->stripResponseTime().at(i)); + ATH_MSG_DEBUG("MicroMegas Digit, chip response charge :" << std::setw(6) << std::setprecision(2) << digit->chipResponseCharge().at(i) + << ", strip response charge :" << std::setw(6) << std::setprecision(2) << digit->stripResponseCharge().at(i)); + ATH_MSG_DEBUG("MicroMegas Digit, chip response position:" << std::setw(6) << std::setprecision(2) << digit->chipResponsePosition().at(i) + << ", strip response position:" << std::setw(6) << std::setprecision(2) << digit->stripResponsePosition().at(i)); + } + + } + ++n_digits; + } + } + m_NSWMM_nDigits = n_digits; + ATH_MSG_DEBUG(" finished fillMMDigitVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMPRDVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..6e2c37d76c939bb1b1cba51161b3409d1ef6b744 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMPRDVariables.cxx @@ -0,0 +1,96 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/MMPRDVariables.h" +#include "MuonPRDTest/MMRDOVariables.h" + +#include "MuonReadoutGeometry/MMReadoutElement.h" + +namespace MuonPRDTest { + MMPRDVariables::MMPRDVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "PRD_MM", true, msglvl), m_key{container_name} {} + bool MMPRDVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool MMPRDVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillMMPRDVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle mmprdContainer{m_key, ctx}; + if (!mmprdContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve prd container " << m_key.fullKey()); + return false; + } + ATH_MSG_DEBUG("retrieved MM PRD Container with size " << mmprdContainer->size()); + + if (mmprdContainer->size() == 0) ATH_MSG_DEBUG(" MM PRD Container empty "); + + SG::ReadHandle mmrdoContainer{m_rdokey, ctx}; + if (!mmrdoContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve rdo container " << m_rdokey.fullKey()); + return false; + } + ATH_MSG_DEBUG("retrieved MM RDO Container with size " << mmrdoContainer->size()); + + if (mmrdoContainer->size() == 0) ATH_MSG_DEBUG(" MM RDO Container empty "); + + unsigned int n_PRD{0}; + for(const Muon::MMPrepDataCollection* coll : *mmprdContainer) { + const Muon::MM_RawDataCollection* rdo_coll = mmrdoContainer->indexFindPtr(coll->identifyHash()); + + if(rdo_coll==nullptr){ + ATH_MSG_ERROR("Did not find rdo collection " << coll->identifyHash()); + return false; + } + ATH_MSG_DEBUG("Found rdo_coll at "<size(); item++) { + const Muon::MMPrepData* prd = coll->at(item); + Identifier Id = prd->identify(); + + m_NSWMM_PRD_time.push_back(prd->time()); + + const MuonGM::MMReadoutElement* det = prd->detectorElement();; + if (!det) { + ATH_MSG_ERROR("The micromega hit "<toString(Id)<<" does not have a detector element attached. That should actually never happen"); + return false; + } + + m_NSWMM_PRD_id.push_back(Id); + Amg::Vector3D pos = prd->globalPosition(); + const Amg::MatrixX & cov = prd->localCovariance(); + Amg::Vector2D loc_pos(0., 0.); + det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); + + ATH_MSG_DEBUG( "MicroMegas PRD local pos.: x=" << std::setw(6) << std::setprecision(2) << loc_pos[0] + << ", ex=" << std::setw(6) << std::setprecision(2) << cov(0,0) + << ", y=" << std::setw(6) << std::setprecision(2) << loc_pos[1] ); + + m_NSWMM_PRD_globalPos.push_back(pos); + + m_NSWMM_PRD_localPosX.push_back(loc_pos[0]); + m_NSWMM_PRD_localPosY.push_back(loc_pos[1]); + m_NSWMM_PRD_covMatrix_1_1.push_back(cov(0,0)); + m_NSWMM_PRD_nRdos.push_back((prd->rdoList()).size()); + + for(const Identifier &id_rdo:prd->rdoList()){ + const Muon::MM_RawData* rdo=nullptr; + for(auto it :*rdo_coll){if(it->identify() == id_rdo) rdo=it;} + if(rdo==nullptr){ + ATH_MSG_ERROR("Did not find rdo for identifier in rdo list"); + return false; + } + m_NSWMM_PRD_rdos_charge.push_back(rdo->charge()); + m_NSWMM_PRD_rdos_time.push_back(rdo->time()); + m_NSWMM_PRD_rdos_channel.push_back(idHelperSvc()->mmIdHelper().channel(id_rdo)); + } + m_NSWMM_PRD_uTPCAngle.push_back(prd->angle()); + m_NSWMM_PRD_uTPCChiSqProb.push_back(prd->chisqProb()); + + ++n_PRD; + } + } + m_NSWMM_nPRD = n_PRD; + ATH_MSG_DEBUG(" finished fillMMPRDVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMRDOVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..6b141e6db41e9f943ecf85dc1da12ee8b6301b5e --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMRDOVariables.cxx @@ -0,0 +1,64 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/MMRDOVariables.h" + +#include "MuonReadoutGeometry/MMReadoutElement.h" + +using namespace Muon; +namespace MuonPRDTest { + MMRDOVariables::MMRDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "RDO_MM", true, msglvl), m_rdokey{container_name} {} + bool MMRDOVariables::declare_keys() { return m_rdokey.initialize().isSuccess(); } + + bool MMRDOVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillMMRDOVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle mmrdoContainer{m_rdokey, ctx}; + if (!mmrdoContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve MM rdo container " << m_rdokey.fullKey()); + return false; + } + ATH_MSG_DEBUG("retrieved MM rdo Container with size " << mmrdoContainer->size()); + + if (mmrdoContainer->size() == 0) ATH_MSG_DEBUG(" MM rdo Container empty "); + unsigned int n_rdo{0}; + for (const MM_RawDataCollection* coll : *mmrdoContainer) { + for (unsigned int item=0; itemsize(); item++) { + const MM_RawData* rdo = coll->at(item); + Identifier Id = rdo->identify(); + + m_NSWMM_rdo_time.push_back(rdo->time()); + m_NSWMM_rdo_relBcid.push_back(rdo->relBcid()); + m_NSWMM_rdo_charge.push_back(rdo->charge()); + + const MuonGM::MMReadoutElement* rdoEl = MuonDetMgr->getMMReadoutElement(Id); + if (!rdoEl) { + ATH_MSG_ERROR("The micromega hit "<toString(Id)<<" does not have a detector element attached. That should actually never happen"); + return false; + } + + m_NSWMM_rdo_id.push_back(Id); + Amg::Vector2D localStripPos(0.,0.); + if ( rdoEl->stripPosition(Id,localStripPos) ) { + m_NSWMM_rdo_localPosX.push_back(localStripPos.x()); + m_NSWMM_rdo_localPosY.push_back(localStripPos.y()); + ATH_MSG_DEBUG("MM RDO: local pos.: x=" << localStripPos[0] << ", y=" << localStripPos[1]); + } else { + ATH_MSG_WARNING("MM RDO: local Strip position not defined"); + } + + Amg::Vector3D globalStripPos(0., 0., 0.); + rdoEl->surface(Id).localToGlobal(localStripPos,Amg::Vector3D(0.,0.,0.),globalStripPos); + m_NSWMM_rdo_globalPos.push_back(globalStripPos); + + ++n_rdo; + } + } + m_NSWMM_nRDO = n_rdo; + ATH_MSG_DEBUG(" finished fillMMRDOVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMSDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMSDOVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..345c0229c1f349d28977d5d41e35131bb51a37eb --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMSDOVariables.cxx @@ -0,0 +1,57 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/MMSDOVariables.h" + +namespace MuonPRDTest { + MMSDOVariables::MMSDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "SDO_MM", false, msglvl), m_key{container_name} {} + + bool MMSDOVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool MMSDOVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fill MMSDOVariables()"); + SG::ReadHandle mmSdoContainer{m_key, ctx}; + if (!mmSdoContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); + return false; + } + unsigned int n_sdo{0}; + for (const auto& coll : *mmSdoContainer) { + const Identifier& id = coll.first; + const MuonSimData& mm_sdo = coll.second; + + m_NSWMM_sdo_globaltime.push_back(mm_sdo.getTime()); + m_NSWMM_sdo_word.push_back(mm_sdo.word()); + + ATH_MSG_DEBUG("Get the truth deposits from the SDO."); + std::vector deposits; + mm_sdo.deposits(deposits); + + m_NSWMM_sdo_id.push_back(id); + const Amg::Vector3D hit_gpos = mm_sdo.globalPosition(); + m_NSWMM_dig_globalPos.push_back(hit_gpos); + + // use the information of the first deposit + int barcode = deposits[0].first.barcode(); + double MuonMCdata_firstentry = deposits[0].second.firstEntry(); + double MuonMCdata_secondentry = deposits[0].second.secondEntry(); + + ATH_MSG_DEBUG("MM SDO barcode=" << barcode); + ATH_MSG_DEBUG("MM SDO local position X=" << std::setw(9) << std::setprecision(2) << MuonMCdata_firstentry + << ", local position Y=" << std::setw(9) << std::setprecision(2) << MuonMCdata_secondentry); + + m_NSWMM_sdo_barcode.push_back(barcode); + + m_NSWMM_sdo_localPosX.push_back(MuonMCdata_firstentry); + m_NSWMM_sdo_localPosY.push_back(MuonMCdata_secondentry); + + ++n_sdo; + } + m_NSWMM_nsdo = n_sdo; + + ATH_MSG_DEBUG("Processed " << n_sdo << "MM SDOs"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMSimHitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMSimHitVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..659b5233154691d583960b8d769fd2086910b8dd --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/MMSimHitVariables.cxx @@ -0,0 +1,164 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ +#include "MuonPRDTest/MMSimHitVariables.h" + +#include "MuonReadoutGeometry/MMReadoutElement.h" +#include "MuonSimEvent/MicromegasHitIdHelper.h" + +namespace MuonPRDTest { + MMSimHitVariables::MMSimHitVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "MM_Sim", false, msglvl), m_key{container_name} {} + + bool MMSimHitVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool MMSimHitVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fill MmSimHitVariables()"); + SG::ReadHandle mmContainer{m_key, ctx}; + if (!mmContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); + return false; + } + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + unsigned int n_hits{0}; + // Get the MM Id hit helper + MicromegasHitIdHelper* mmhhelper = MicromegasHitIdHelper::GetHelper(); + if (!mmContainer->size()) ATH_MSG_DEBUG("MM Sim container is empty"); + for (const MMSimHit& hit : *mmContainer) { + int simId = hit.MMId(); + + if(hit.depositEnergy()==0.) continue; // SimHits without energy loss are not recorded. + + // connect the hit with the MC truth + int barcode = hit.particleLink().barcode(); + m_NSWMM_trackId.push_back(barcode); + m_NSWMM_globalTime.push_back(hit.globalTime()); + + const Amg::Vector3D& globalPosition = hit.globalPosition(); + m_NSWMM_hitGlobalPosition.push_back(globalPosition); + + const Amg::Vector3D& globalDirection = hit.globalDirection(); + m_NSWMM_hitGlobalDirection.push_back(globalDirection); + + m_NSWMM_particleEncoding.push_back(hit.particleEncoding()); + m_NSWMM_kineticEnergy.push_back(hit.kineticEnergy()); + m_NSWMM_depositEnergy.push_back(hit.depositEnergy()); + + std::string stname = mmhhelper->GetStationName(simId); + int steta = mmhhelper->GetZSector(simId); + int stphi = mmhhelper->GetPhiSector(simId); + int multilayer = mmhhelper->GetMultiLayer(simId); + int layer = mmhhelper->GetLayer(simId); + int side = mmhhelper->GetSide(simId); + + if( stphi == 0 ){ + ATH_MSG_ERROR("MicroMegas validation: unexpected phi range " << stphi); + return false; + } + + Identifier offId = idHelperSvc()->mmIdHelper().channelID( stname[2] == 'L' ? "MML" : "MMS", + side == 1 ? steta+1 : -steta-1, + (stphi-1)/2+1,multilayer,layer,1 ); + m_NSWMM_Id.push_back(offId); + + // sanity checks + if( !idHelperSvc()->mmIdHelper().is_mm(offId) ){ + ATH_MSG_WARNING("MM id is not a mm id! " << idHelperSvc()->mmIdHelper().print_to_string(offId)); + } + if( !idHelperSvc()->mmIdHelper().is_muon(offId) ){ + ATH_MSG_WARNING("MM id is not a muon id! " << idHelperSvc()->mmIdHelper().print_to_string(offId)); + } + if( idHelperSvc()->mmIdHelper().is_mdt(offId)||idHelperSvc()->mmIdHelper().is_rpc(offId)||idHelperSvc()->mmIdHelper().is_tgc(offId)||idHelperSvc()->mmIdHelper().is_csc(offId)||idHelperSvc()->mmIdHelper().is_stgc(offId) ){ + ATH_MSG_WARNING("MM id has wrong technology type! " << idHelperSvc()->mmIdHelper().is_mdt(offId) << " " << idHelperSvc()->mmIdHelper().is_rpc(offId) + << " " << idHelperSvc()->mmIdHelper().is_tgc(offId) << " " << idHelperSvc()->mmIdHelper().is_csc(offId) << " " << idHelperSvc()->mmIdHelper().is_stgc(offId) ); + } + if( idHelperSvc()->mmIdHelper().gasGap(offId) != layer ) { + ATH_MSG_WARNING("MM id has bad layer field! " << idHelperSvc()->mmIdHelper().print_to_string(offId) ); + } + + int isSmall = stname[2] == 'S'; + ATH_MSG_DEBUG("MicroMegas geometry, retrieving detector element for: isSmall " << isSmall << " eta " << idHelperSvc()->mmIdHelper().stationEta(offId) + << " phi " << idHelperSvc()->mmIdHelper().stationPhi(offId) << " ml " << idHelperSvc()->mmIdHelper().multilayer(offId) ); + + const MuonGM::MMReadoutElement* detEl = MuonDetMgr->getMMReadoutElement(offId); + if (!detEl) { + ATH_MSG_ERROR("MMSimHitVariables::fillVariables() - Failed to retrieve MMReadoutElement for "<mmIdHelper().print_to_string(offId).c_str()); + return false; + } + + // surface + const Trk::PlaneSurface& surf = detEl->surface(offId); + // compute hit position within the detector element/surfaces + Amg::Transform3D gToL = detEl->absTransform().inverse(); + Amg::Vector3D hpos(hit.globalPosition().x(),hit.globalPosition().y(),hit.globalPosition().z()); + Amg::Vector3D dSurface_pos = gToL*hpos; + + // compute the hit position on the readout plane (same as in MuonFastDigitization) + Amg::Vector3D rSurface_pos = surf.transform().inverse()*hpos; + + Amg::Vector2D posOnSurfUnProjected(rSurface_pos.x(),rSurface_pos.y()); + + // check where the readout plane is located and compute the local direction accordingly + Amg::Vector3D ldir(0., 0., 0.); + ldir = surf.transform().inverse().linear()*Amg::Vector3D(hit.globalDirection().x(), hit.globalDirection().y(), hit.globalDirection().z()); + + double scale, scaletop; + double gasgap = 5.; + + scale = -rSurface_pos.z()/ldir.z(); + scaletop = (gasgap+rSurface_pos.z())/ldir.z(); + + Amg::Vector3D hitOnSurface = rSurface_pos + scale*ldir; + Amg::Vector3D hitOnTopSurface = rSurface_pos + scaletop*ldir; + Amg::Vector2D posOnSurf (hitOnSurface.x(), hitOnSurface.y()); + Amg::Vector2D posOnTopSurf (hitOnTopSurface.x(),hitOnTopSurface.y()); + + + int stripNumber = detEl->stripNumber(posOnSurf,offId); + + // perform bound check (making the call from the detector element to consider edge passivation) + m_NSWMM_isInsideBounds.push_back( detEl->insideActiveBounds(offId, posOnSurf) ); + + if( stripNumber == -1 ){ + ATH_MSG_WARNING("MicroMegas validation: failed to obtain strip number " << idHelperSvc()->mmIdHelper().print_to_string(offId) ); + ATH_MSG_WARNING(" pos " << posOnSurf << " z " << rSurface_pos.z() ); + stripNumber = 1; + } + + Identifier oldId = offId; + offId = idHelperSvc()->mmIdHelper().channelID(offId, idHelperSvc()->mmIdHelper().multilayer(offId), idHelperSvc()->mmIdHelper().gasGap(offId),stripNumber); + if( idHelperSvc()->mmIdHelper().gasGap(offId) != layer ) { + ATH_MSG_WARNING("MicroMegas validation: MM id has bad layer field(2)! " << std::endl << " " << idHelperSvc()->mmIdHelper().print_to_string(offId) << std::endl + << " " << idHelperSvc()->mmIdHelper().print_to_string(oldId) << " stripN " << stripNumber ); + } + + Amg::Vector2D fastDigitPos(0.,0.); + if( !detEl->stripPosition(offId,fastDigitPos ) ){ + ATH_MSG_WARNING("MicroMegas validation: failed to obtain local position for identifier " << idHelperSvc()->mmIdHelper().print_to_string(offId) ); + } + + Amg::Vector3D detpos = detEl->globalPosition(); + ATH_MSG_DEBUG("Global hit : r " << hit.globalPosition().perp() << ", phi " << hit.globalPosition().phi() << ", z " << hit.globalPosition().z() + << "; detEl: r " << detpos.perp() << ", phi " << detpos.phi() << ", z " << detpos.z() + << "; surf z " << surf.center().z() << ", ml " << multilayer << ", l " << layer ); + ATH_MSG_DEBUG(" detEl: x " << dSurface_pos.x() << " y " << dSurface_pos.y() << " z " << dSurface_pos.z()); + ATH_MSG_DEBUG("MM Fast digit: x " << fastDigitPos.x() << " y " << fastDigitPos.y() + << ", gToL: x " << rSurface_pos.x() << " y " << rSurface_pos.y() << " z " << rSurface_pos.z() ); + + // Fill ntuple with the hit/surface/digit positions + m_NSWMM_detector_globalPosition.push_back(detpos); + m_NSWMM_hitToDsurfacePosition.push_back(dSurface_pos); + m_NSWMM_hitToRsurfacePosition.push_back(rSurface_pos); + + m_NSWMM_FastDigitRsurfacePositionX.push_back( posOnSurf.x() ); + m_NSWMM_FastDigitRsurfacePositionY.push_back( posOnSurf.y() ); + + ++n_hits; + } + m_NSWMM_nSimHits = n_hits; + + ATH_MSG_DEBUG("processed " << m_NSWMM_nSimHits << " MM hits"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/RPCDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/RPCDigitVariables.cxx index 1f783e0dc0888d7c87a13691e30faef298723f05..c9f7d1c99f0d78ec1d8185a0cf7df7eef60db87d 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/RPCDigitVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/RPCDigitVariables.cxx @@ -16,13 +16,13 @@ namespace MuonPRDTest { if (!MuonDetMgr) { return false; } SG::ReadHandle RpcDigitContainer{m_key, ctx}; if (!RpcDigitContainer.isValid()) { - ATH_MSG_FATAL("Failed to retrive digit container " << m_key.fullKey()); + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); return false; } ATH_MSG_DEBUG("retrieved RPC Digit Container with size " << RpcDigitContainer->digit_size()); - if (RpcDigitContainer->size() == 0) ATH_MSG_DEBUG(" RPC Digit Continer empty "); + if (RpcDigitContainer->size() == 0) ATH_MSG_DEBUG(" RPC Digit Container empty "); unsigned int n_digits{0}; for (const RpcDigitCollection* coll : *RpcDigitContainer) { ATH_MSG_DEBUG("processing collection with size " << coll->size()); @@ -33,7 +33,10 @@ namespace MuonPRDTest { ATH_MSG_DEBUG("RPC Digit Offline id: " << idHelperSvc()->toString(Id)); const MuonGM::RpcReadoutElement* rdoEl = MuonDetMgr->getRpcReadoutElement(Id); - if (!rdoEl) return false; + if (!rdoEl) { + ATH_MSG_ERROR("RPCDigitVariables::fillVariables() - Failed to retrieve PRCReadoutElement for "<rpcIdHelper().print_to_string(Id).c_str()); + return false; + } Amg::Vector3D gpos{0., 0., 0.}; Amg::Vector2D lpos(0., 0.); diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCDigitVariables.cxx index d353d0a3fa8e028f3034f1c8c650584de108f8e2..2d45f310ffa776f33ac117dfcbbb5410136dbda0 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCDigitVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCDigitVariables.cxx @@ -15,13 +15,13 @@ namespace MuonPRDTest { if (!MuonDetMgr) { return false; } SG::ReadHandle TgcDigitContainer{m_key, ctx}; if (!TgcDigitContainer.isValid()) { - ATH_MSG_FATAL("Failed to retrive digit container " << m_key.fullKey()); + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); return false; } ATH_MSG_DEBUG("retrieved TGC Digit Container with size " << TgcDigitContainer->digit_size()); - if (TgcDigitContainer->size() == 0) ATH_MSG_DEBUG(" TGC Digit Continer empty "); + if (TgcDigitContainer->size() == 0) ATH_MSG_DEBUG(" TGC Digit Container empty "); unsigned int n_digits{0}; for (const TgcDigitCollection* coll : *TgcDigitContainer) { ATH_MSG_DEBUG("processing collection with size " << coll->size()); @@ -32,7 +32,10 @@ namespace MuonPRDTest { ATH_MSG_DEBUG("TGC Digit Offline id: " << idHelperSvc()->toString(Id)); const MuonGM::TgcReadoutElement* rdoEl = MuonDetMgr->getTgcReadoutElement(Id); - if (!rdoEl) return false; + if (!rdoEl) { + ATH_MSG_ERROR("TGCDigitVariables::fillVariables() - Failed to retrieve TGCReadoutElement for "<tgcIdHelper().print_to_string(Id).c_str()); + return false; + } Amg::Vector3D gpos{0., 0., 0.}; Amg::Vector2D lpos(0., 0.); @@ -55,8 +58,8 @@ namespace MuonPRDTest { ++n_digits; } - m_TGC_nDigits = n_digits; } + m_TGC_nDigits = n_digits; ATH_MSG_DEBUG(" finished fillTgcDigitVariables()"); return true; } diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCPRDVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..520c04a5b56848a2206601e235f2313aee9f26e8 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCPRDVariables.cxx @@ -0,0 +1,57 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/TGCPRDVariables.h" + +#include "MuonReadoutGeometry/TgcReadoutElement.h" + +namespace MuonPRDTest { + TGCPRDVariables::TGCPRDVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "PRD_TGC", true, msglvl), m_key{container_name} {} + bool TGCPRDVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool TGCPRDVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillTGCPRDVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle tgcprdContainer{m_key, ctx}; + if (!tgcprdContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve prd container " << m_key.fullKey()); + return false; + } + + ATH_MSG_DEBUG("retrieved TGC PRD Container with size " << tgcprdContainer->size()); + + if (tgcprdContainer->size() == 0) ATH_MSG_DEBUG(" TGC PRD Container empty "); + unsigned int n_PRD{0}; + for(auto it : *tgcprdContainer ) { + const Muon::TgcPrepDataCollection*coll = it; + for (auto prd: *coll) { + Identifier Id = prd->identify(); + + const MuonGM::TgcReadoutElement* det = MuonDetMgr->getTgcReadoutElement(Id); + if (!det) { + ATH_MSG_ERROR("The TGC hit "<toString(Id)<<" does not have a detector element attached. That should actually never happen"); + return false; + } + + m_TGC_PRD_id.push_back(Id); + Amg::Vector3D pos = prd->globalPosition(); + Amg::Vector2D loc_pos(0., 0.); + + det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); + + m_TGC_PRD_globalPos.push_back(pos); + + m_TGC_PRD_localPosX.push_back(loc_pos[0]); + m_TGC_PRD_localPosY.push_back(loc_pos[1]); + + ++n_PRD; + } + } + m_TGC_nPRD = n_PRD; + ATH_MSG_DEBUG(" finished fillTGCPRDVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCRDOVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..f3fe728bd5138bc122c98d0ee1a9af2102ebb027 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/TGCRDOVariables.cxx @@ -0,0 +1,80 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/TGCRDOVariables.h" +#include "MuonSimData/MuonSimDataCollection.h" +#include "MuonReadoutGeometry/TgcReadoutElement.h" +#include "MuonRDO/TgcRdo.h" + +using namespace Muon; +namespace MuonPRDTest { + TGCRDOVariables::TGCRDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl, const ITGCcablingSvc* cabling_svc) : + PrdTesterModule(tree, "RDO_TGC", true, msglvl), m_key{container_name}, m_tgcCabling{cabling_svc} {} + bool TGCRDOVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool TGCRDOVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillTGCRDOVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle tgcrdoContainer{m_key, ctx}; + if (!tgcrdoContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve tgc rdo container " << m_key.fullKey()); + return false; + } + ATH_MSG_DEBUG("retrieved TGC rdo Container with size " << tgcrdoContainer->size()); + + if (tgcrdoContainer->size() == 0) ATH_MSG_DEBUG(" TGC rdo Container empty "); + unsigned int n_rdo{0}; + for (const TgcRdo* coll : *tgcrdoContainer) { + ATH_MSG_DEBUG("processing collection with size " << coll->size()); + for (const TgcRawData* rdo: *coll) { + + bool orFlag = m_tgcCabling->isOredChannel(rdo->subDetectorId(), + rdo->rodId(), + rdo->sswId(), + rdo->slbId(), + rdo->bitpos()); + + Identifier Id; + bool e_found = m_tgcCabling->getElementIDfromReadoutID(Id, + rdo->subDetectorId(), + rdo->rodId(), + rdo->sswId(), + rdo->slbId(), + rdo->bitpos(), + orFlag); + if (!e_found) { + ATH_MSG_ERROR("could not find Identifier from TgcRawData"); + return false; + } + + const MuonGM::TgcReadoutElement* rdoEl = MuonDetMgr->getTgcReadoutElement(Id); + if (!rdoEl) { + ATH_MSG_ERROR("The TGC hit "<toString(Id)<<" does not have a detector element attached. That should actually never happen"); + return false; + } + + m_TGC_rdo_id.push_back(Id); + Amg::Vector2D localStripPos(0.,0.); + if ( rdoEl->stripPosition(Id,localStripPos) ) { + m_TGC_rdo_localPosX.push_back(localStripPos.x()); + m_TGC_rdo_localPosY.push_back(localStripPos.y()); + ATH_MSG_DEBUG("TGC RDO: local pos.: x=" << localStripPos[0] << ", y=" << localStripPos[1]); + } else { + ATH_MSG_WARNING("TGC RDO: local Strip position not defined"); + } + + // asking the detector element to transform this local to the global position + Amg::Vector3D globalStripPos(0., 0., 0.); + rdoEl->surface(Id).localToGlobal(localStripPos,Amg::Vector3D(0.,0.,0.),globalStripPos); + m_TGC_rdo_globalPos.push_back(globalStripPos); + + ++n_rdo; + } + } + m_TGC_nRDO = n_rdo; + ATH_MSG_DEBUG(" finished fillTGCRDOVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCDigitVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c1f4f28d9450427b3987aa785f447fc9dc960a92 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCDigitVariables.cxx @@ -0,0 +1,83 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/sTGCDigitVariables.h" + +#include "MuonReadoutGeometry/sTgcReadoutElement.h" + +namespace MuonPRDTest { + sTgcDigitVariables::sTgcDigitVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "Digits_sTGC", true, msglvl), m_key{container_name} {} + + bool sTgcDigitVariables::declare_keys() { return m_key.initialize().isSuccess(); } + bool sTgcDigitVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillsTGCDigitHitVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle sTgcDigitContainer{m_key, ctx}; + if (!sTgcDigitContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); + return false; + } + + ATH_MSG_DEBUG("retrieved sTGC Digit Container with size " << sTgcDigitContainer->digit_size()); + + if (sTgcDigitContainer->size() == 0) ATH_MSG_DEBUG(" sTGC Digit Container empty "); + unsigned int n_digits{0}; + for (const sTgcDigitCollection* coll : *sTgcDigitContainer) { + ATH_MSG_DEBUG("processing collection with size " << coll->size()); + for (unsigned int digitNum = 0; digitNum < coll->size(); digitNum++) { + const sTgcDigit* digit = coll->at(digitNum); + Identifier Id = digit->identify(); + + const MuonGM::sTgcReadoutElement* rdoEl = MuonDetMgr->getsTgcReadoutElement(Id); + if (!rdoEl) { + ATH_MSG_ERROR("sTGCDigitVariables::fillVariables() - Failed to retrieve sTGCReadoutElement for "<stgcIdHelper().print_to_string(Id).c_str()); + return false; + } + m_NSWsTGC_dig_id.push_back(Id); + Amg::Vector3D gpos{0., 0., 0.}; + Amg::Vector2D lpos(0., 0.); + + rdoEl->stripPosition(Id, lpos); + rdoEl->surface(Id).localToGlobal(lpos, gpos, gpos); + + m_NSWsTGC_dig_globalPos.push_back(gpos); + m_NSWsTGC_dig_localPosX.push_back(lpos.x()); + m_NSWsTGC_dig_localPosY.push_back(lpos.y()); + + m_NSWsTGC_dig_channelNumber.push_back(rdoEl->stripNumber(lpos, Id)); + + std::vector local_pad_corners; + rdoEl->padCorners(Id,local_pad_corners); + std::vector global_pad_corners; + + for(auto& local_corner : local_pad_corners) { + Amg::Vector3D global_corner; + rdoEl->surface(Id).localToGlobal(local_corner, global_corner, global_corner); + global_pad_corners.push_back(global_corner); + } + for(auto corner : global_pad_corners) { + if(idHelperSvc()->stgcIdHelper().channelType(Id) ==0 ) { + m_NSWsTGC_dig_PadglobalCornerPos.push_back(corner); + } + } + + m_NSWsTGC_dig_channelPosX.push_back( lpos.x() ); + m_NSWsTGC_dig_channelPosY.push_back( lpos.y() ); + + m_NSWsTGC_dig_bctag.push_back(digit->bcTag()); + m_NSWsTGC_dig_time.push_back(digit->time()); + m_NSWsTGC_dig_charge.push_back(digit->charge()); + m_NSWsTGC_dig_isDead.push_back(digit->isDead()); + m_NSWsTGC_dig_isPileup.push_back(digit->isPileup()); + + ++n_digits; + } + } + m_NSWsTGC_nDigits = n_digits; + ATH_MSG_DEBUG(" finished fillsTgcDigitVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCPRDVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..029c4c1c20a5699909c66bd16328e1cd2d26a0a5 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCPRDVariables.cxx @@ -0,0 +1,69 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/sTGCPRDVariables.h" + +#include "MuonReadoutGeometry/sTgcReadoutElement.h" + +namespace MuonPRDTest { + sTGCPRDVariables::sTGCPRDVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "PRD_sTGC", true, msglvl), m_key{container_name} {} + bool sTGCPRDVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool sTGCPRDVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillsTGCPRDVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle stgcprdContainer{m_key, ctx}; + if (!stgcprdContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve prd container " << m_key.fullKey()); + return false; + } + + ATH_MSG_DEBUG("retrieved sTGC PRD Container with size " << stgcprdContainer->size()); + + if (stgcprdContainer->size() == 0) ATH_MSG_DEBUG(" sTGC PRD Container empty "); + unsigned int n_PRD{0}; + for(const Muon::sTgcPrepDataCollection* coll : *stgcprdContainer ) { + for (unsigned int item=0; itemsize(); item++) { + const Muon::sTgcPrepData* prd = coll->at(item); + Identifier Id = prd->identify(); + + m_NSWsTGC_PRD_id.push_back(Id); + m_NSWsTGC_PRD_charge.push_back(prd->charge()); + m_NSWsTGC_PRD_bcTag.push_back(prd->getBcBitMap()); + + const MuonGM::sTgcReadoutElement* det = prd->detectorElement(); + if (!det) { + ATH_MSG_ERROR("The sTGC hit "<toString(Id)<<" does not have a detector element attached. That should actually never happen"); + return false; + } + + Amg::Vector3D pos = prd->globalPosition(); + Amg::Vector2D loc_pos(0., 0.); + det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); + + double err_x = prd->localCovariance()(0,0); + double err_y = ( prd->localCovariance().rows()==2)? prd->localCovariance()(1,1) : 0.; + + ATH_MSG_DEBUG( "sTgc PRD local pos.: x=" << std::setw(6) << std::setprecision(2) << loc_pos[0] + << ", ex=" << std::setw(6) << std::setprecision(2) << err_x + << ", y=" << std::setw(6) << std::setprecision(2) << loc_pos[1] + << ", ey=" << std::setw(6) << std::setprecision(2) << err_y ); + + m_NSWsTGC_PRD_globalPos.push_back(pos); + + m_NSWsTGC_PRD_localPosX.push_back(loc_pos[0]); + m_NSWsTGC_PRD_localPosY.push_back(loc_pos[1]); + m_NSWsTGC_PRD_covMatrix_1_1.push_back(err_x); + m_NSWsTGC_PRD_covMatrix_2_2.push_back(err_y); + + ++n_PRD; + } + } + m_NSWsTGC_nPRD = n_PRD; + ATH_MSG_DEBUG(" finished fillsTGCPRDVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCRDOVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7dd217f8838850ea4dc28324abafb5e22e9ded12 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCRDOVariables.cxx @@ -0,0 +1,66 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/sTGCRDOVariables.h" + +#include "MuonReadoutGeometry/sTgcReadoutElement.h" + +using namespace Muon; +namespace MuonPRDTest { + sTGCRDOVariables::sTGCRDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "RDO_sTGC", true, msglvl), m_key{container_name} {} + bool sTGCRDOVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool sTGCRDOVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fillsTGCRDOVariables()"); + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + SG::ReadHandle stgcrdoContainer{m_key, ctx}; + if (!stgcrdoContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve stgc rdo container " << m_key.fullKey()); + return false; + } + ATH_MSG_DEBUG("retrieved sTGC rdo Container with size " << stgcrdoContainer->size()); + + if (stgcrdoContainer->size() == 0) ATH_MSG_DEBUG(" sTGC rdo Container empty "); + unsigned int n_rdo{0}; + for (const STGC_RawDataCollection* coll : *stgcrdoContainer) { + for (unsigned int item=0; itemsize(); item++) { + const STGC_RawData* rdo = coll->at(item); + Identifier Id = rdo->identify(); + + m_NSWsTGC_rdo_time.push_back(rdo->time()); + m_NSWsTGC_rdo_tdo.push_back(rdo->tdo()); + m_NSWsTGC_rdo_charge.push_back(rdo->charge()); + m_NSWsTGC_rdo_bcTag.push_back(rdo->bcTag()); + m_NSWsTGC_rdo_isDead.push_back(rdo->isDead()); + + const MuonGM::sTgcReadoutElement* rdoEl = MuonDetMgr->getsTgcReadoutElement(Id); + if (!rdoEl) { + ATH_MSG_ERROR("The sTGC hit "<toString(Id)<<" does not have a detector element attached. That should actually never happen"); + return false; + } + + m_NSWsTGC_rdo_id.push_back(Id); + Amg::Vector2D localStripPos(0.,0.); + if ( rdoEl->stripPosition(Id,localStripPos) ) { + m_NSWsTGC_rdo_localPosX.push_back(localStripPos.x()); + m_NSWsTGC_rdo_localPosY.push_back(localStripPos.y()); + ATH_MSG_DEBUG("sTGC RDO: local pos.: x=" << localStripPos[0] << ", y=" << localStripPos[1]); + } else { + ATH_MSG_WARNING("sTGC RDO: local Strip position not defined"); + } + + Amg::Vector3D globalStripPos(0., 0., 0.); + rdoEl->surface(Id).localToGlobal(localStripPos,Amg::Vector3D(0.,0.,0.),globalStripPos); + m_NSWsTGC_rdo_globalPos.push_back(globalStripPos); + + ++n_rdo; + } + } + m_NSWsTGC_nRDO = n_rdo; + ATH_MSG_DEBUG(" finished fillsTGCRDOVariables()"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCSDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCSDOVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..20b104c5053046c7b567987f7a75e1217d70768f --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCSDOVariables.cxx @@ -0,0 +1,75 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MuonPRDTest/sTGCSDOVariables.h" +#include "MuonReadoutGeometry/sTgcReadoutElement.h" + +namespace MuonPRDTest { + sTgcSDOVariables::sTgcSDOVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "SDO_sTGC", false, msglvl), m_key{container_name} {} + + bool sTgcSDOVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool sTgcSDOVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fill sTgcSDOVariables()"); + SG::ReadHandle stgcSdoContainer{m_key, ctx}; + if (!stgcSdoContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve digit container " << m_key.fullKey()); + return false; + } + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + unsigned int n_sdo{0}; + for (const auto& coll : *stgcSdoContainer) { + const Identifier& id = coll.first; + const MuonSimData& stgc_sdo = coll.second; + + m_NSWsTGC_sdo_globaltime.push_back(stgc_sdo.getTime()); + m_NSWsTGC_sdo_word.push_back(stgc_sdo.word()); + + ATH_MSG_DEBUG("sTGC SDO: " << idHelperSvc()->toString(id)); + + ATH_MSG_DEBUG("Get the truth deposits from the SDO."); + std::vector deposits; + stgc_sdo.deposits(deposits); + + const Amg::Vector3D hit_gpos = stgc_sdo.globalPosition(); + m_NSWsTGC_dig_globalPos.push_back(hit_gpos); + + // use the information of the first deposit + int barcode = deposits[0].first.barcode(); + double MuonMCdata_firstentry = deposits[0].second.firstEntry(); + double MuonMCdata_secondentry = deposits[0].second.secondEntry(); + + ATH_MSG_DEBUG("sTGC SDO barcode=" << barcode); + ATH_MSG_DEBUG("sTGC SDO energy=" << std::setw(9) << std::setprecision(2) << MuonMCdata_firstentry + << ", tof=" << std::setw(9) << std::setprecision(2) << MuonMCdata_secondentry); + + m_NSWsTGC_sdo_barcode.push_back(barcode); + m_NSWsTGC_sdo_E.push_back(MuonMCdata_firstentry); + m_NSWsTGC_sdo_tof.push_back(MuonMCdata_secondentry); + + // Retrieve the detector element and local SDO coordinates + const MuonGM::sTgcReadoutElement* rdoEl = MuonDetMgr->getsTgcReadoutElement(id); + if (!rdoEl) { + ATH_MSG_ERROR("sTGCSDOVariables::fillVariables() - Failed to retrieve sTgcReadoutElement for " << idHelperSvc()->toString(id)); + return false; + } + + m_NSWsTGC_sdo_id.push_back(id); + Amg::Vector2D loc_pos(0., 0.); + rdoEl->surface(id).globalToLocal(stgc_sdo.globalPosition(), Amg::Vector3D(0., 0., 0.), loc_pos); + ATH_MSG_DEBUG("sTGC SDO local position X=" << std::setw(9) << std::setprecision(2) << loc_pos[0] + << ", local position Y=" << std::setw(9) << std::setprecision(2) << loc_pos[1]); + m_NSWsTGC_sdo_localPosX.push_back( loc_pos[0] ); + m_NSWsTGC_sdo_localPosY.push_back( loc_pos[1] ); + + ++n_sdo; + } + m_NSWsTGC_nsdo = n_sdo; + + ATH_MSG_DEBUG("Processed " << n_sdo << " sTGC SDOs"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCSimHitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCSimHitVariables.cxx new file mode 100644 index 0000000000000000000000000000000000000000..4bacb2f88aec2fcd35407d3882a329af624ca8f9 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/Root/sTGCSimHitVariables.cxx @@ -0,0 +1,186 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ +#include "MuonPRDTest/sTGCSimHitVariables.h" + +#include "MuonReadoutGeometry/sTgcReadoutElement.h" +#include "MuonSimEvent/sTgcHitIdHelper.h" +namespace MuonPRDTest { + sTGCSimHitVariables::sTGCSimHitVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) : + PrdTesterModule(tree, "sTGC_Sim", false, msglvl), m_key{container_name} {} + + bool sTGCSimHitVariables::declare_keys() { return m_key.initialize().isSuccess(); } + + bool sTGCSimHitVariables::fill(const EventContext& ctx) { + ATH_MSG_DEBUG("do fill sTGCSimHitVariables()"); + SG::ReadHandle stgcContainer{m_key, ctx}; + if (!stgcContainer.isValid()) { + ATH_MSG_FATAL("Failed to retrieve SimHit container " << m_key.fullKey()); + return false; + } + const MuonGM::MuonDetectorManager* MuonDetMgr = getDetMgr(ctx); + if (!MuonDetMgr) { return false; } + unsigned int n_hits{0}; + // Get the sTGC Id hit helper + sTgcHitIdHelper* stgchhelper = sTgcHitIdHelper::GetHelper(); + + if (!stgcContainer->size()) ATH_MSG_DEBUG("sTGC Sim container is empty"); + for (const sTGCSimHit& hit : *stgcContainer) { + if(hit.depositEnergy()==0.) continue; // SimHits without energy loss are not recorded. + + for( int type=0;type<=2;++type ){ + int simId = hit.sTGCId(); + std::string stname = stgchhelper->GetStationName(simId); + int steta = stgchhelper->GetZSector(simId); + int stphi = stgchhelper->GetPhiSector(simId); + int multilayer = stgchhelper->GetMultiLayer(simId); + int layer = stgchhelper->GetLayer(simId); + int side = stgchhelper->GetSide(simId); + + if ( stphi==0 ) { + ATH_MSG_ERROR("unexpected phi range: " << stphi); + return false; + } + + // Old [7/12/12] implementation of the Station Name is: T[0-3][L/S][P/C] + // Current implementation of the Station Name is: Q[L/S][1-3][P/C] + int detNumber = -999, wedgeId = -999, wedgeType = -999; + if(stname.length()!=4) { + ATH_MSG_WARNING("sTGC validation: station Name exceeds 4 charactes, filling dummy information for detNumber, wedgeId and wedgeType"); + } + else { + detNumber = atoi(stname.substr(2,1).c_str()); + wedgeId = (stname.substr(1,1).compare("L")) ? 0 : 1; + wedgeType = (stname.substr(3,1).compare("P")) ? 0 : 1; + } + + Identifier offId = idHelperSvc()->stgcIdHelper().channelID(stname[1] == 'L' ? "STL" : "STS", + side == 1 ? steta+1 : -steta-1, + (stphi-1)/2+1,multilayer,layer,1,1 ); + m_NSWsTGC_Id.push_back(offId); + std::string stName = idHelperSvc()->stgcIdHelper().stationNameString(idHelperSvc()->stgcIdHelper().stationName(offId)); + int off_channel = idHelperSvc()->stgcIdHelper().channel(offId); + + int isSmall = stName[2] == 'S'; + + if( type == 2 && off_channel == 63) { + ATH_MSG_DEBUG("Found sTGC Wire Sim Hit with channel number 63 (dead region), skipping this hit"); + continue; + } + + const MuonGM::sTgcReadoutElement* detEl = MuonDetMgr->getsTgcReadoutElement(offId); + if (!detEl) { + ATH_MSG_ERROR("sTGCSimHitVariables::fillVariables() - Failed to retrieve sTgcReadoutElement for "<stgcIdHelper().print_to_string(offId).c_str()); + return false; + } + + if( !idHelperSvc()->stgcIdHelper().is_stgc(offId) ){ + ATH_MSG_WARNING("sTgc id is not a stgc id! " << idHelperSvc()->stgcIdHelper().print_to_string(offId)); + } + if( !idHelperSvc()->stgcIdHelper().is_muon(offId) ){ + ATH_MSG_WARNING("sTgc id is not a muon id! " << idHelperSvc()->stgcIdHelper().print_to_string(offId)); + } + if( idHelperSvc()->stgcIdHelper().is_mdt(offId)||idHelperSvc()->stgcIdHelper().is_rpc(offId)||idHelperSvc()->stgcIdHelper().is_tgc(offId)||idHelperSvc()->stgcIdHelper().is_csc(offId)||idHelperSvc()->stgcIdHelper().is_mm(offId) ){ + ATH_MSG_WARNING("sTgc id has wrong technology type! " << idHelperSvc()->stgcIdHelper().is_mdt(offId) << " " << idHelperSvc()->stgcIdHelper().is_rpc(offId) + << " " << idHelperSvc()->stgcIdHelper().is_tgc(offId) << " " << idHelperSvc()->stgcIdHelper().is_csc(offId) << " " << idHelperSvc()->stgcIdHelper().is_mm(offId) ); + } + if( idHelperSvc()->stgcIdHelper().gasGap(offId) != layer ) { + ATH_MSG_WARNING("sTgc id has bad layer field! " << idHelperSvc()->stgcIdHelper().print_to_string(offId) ); + } + + // connect the hit with the MC truth + int barcode = hit.particleLink().barcode(); + m_NSWsTGC_trackId.push_back(barcode); + m_NSWsTGC_wedgeId.push_back(wedgeId); + m_NSWsTGC_wedgeType.push_back(wedgeType); + m_NSWsTGC_detectorNumber.push_back(detNumber); + + m_NSWsTGC_globalTime.push_back(hit.globalTime()); + const Amg::Vector3D& globalPosition = hit.globalPosition(); + m_NSWsTGC_hitGlobalPosition.push_back(globalPosition); + + const Amg::Vector3D& globalDirection = hit.globalDirection(); + m_NSWsTGC_hitGlobalDirection.push_back(globalDirection); + + m_NSWsTGC_particleEncoding.push_back(hit.particleEncoding()); + m_NSWsTGC_depositEnergy.push_back(hit.depositEnergy()); + m_NSWsTGC_kineticEnergy.push_back(hit.kineticEnergy()); + + const Amg::Vector3D& globalPrePosition = hit.globalPrePosition(); + m_NSWsTGC_hitGlobalPrePosition.push_back(globalPrePosition); + if (hit.kineticEnergy() < 0.0) { + m_NSWsTGC_hitGlobalPrePosition.push_back(-9999.9); + } + + ATH_MSG_DEBUG("sTGC geometry, retrieving detector element for: isSmall " << isSmall << " eta " << idHelperSvc()->stgcIdHelper().stationEta(offId) + << " phi " << idHelperSvc()->stgcIdHelper().stationPhi(offId) << " ml " << idHelperSvc()->stgcIdHelper().multilayer(offId) ); + + Identifier newId = idHelperSvc()->stgcIdHelper().channelID(idHelperSvc()->stgcIdHelper().parentID(offId), idHelperSvc()->stgcIdHelper().multilayer(offId), idHelperSvc()->stgcIdHelper().gasGap(offId),type,1); + + // compute hit position within the detector element/surfaces + const Trk::PlaneSurface& surf = detEl->surface(newId); + Amg::Transform3D gToL = detEl->absTransform().inverse(); + Amg::Vector3D hpos(hit.globalPosition().x(),hit.globalPosition().y(),hit.globalPosition().z()); + Amg::Vector3D dSurface_pos = gToL*hpos; + + // compute the hit position on the readout plane (same as in MuonFastDigitization) + Amg::Vector3D rSurface_pos = surf.transform().inverse()*hpos; + Amg::Vector3D ldir = surf.transform().inverse().linear()*Amg::Vector3D(hit.globalDirection().x(),hit.globalDirection().y(),hit.globalDirection().z()); + + ATH_MSG_DEBUG("sTGC channel type:" << type); + + double scale = -rSurface_pos.z()/ldir.z(); + Amg::Vector3D hitOnSurface = rSurface_pos + scale*ldir; + + // hitOnSurface.x() will be susequent smeared to simulate the detector resolution, here we do not apply any smearing + Amg::Vector2D posOnSurf(hitOnSurface.x(), rSurface_pos.y()); + + // remember whether the given hit is inside the active volume (and produces a valid digit) + m_NSWsTGC_isInsideBounds.push_back( surf.insideBounds(posOnSurf) ); + + int stripNumber = detEl->stripNumber(posOnSurf,newId); + if( stripNumber == -1 ){ + ATH_MSG_WARNING("sTGC validation: failed to obtain strip number " << idHelperSvc()->stgcIdHelper().print_to_string(offId) ); + ATH_MSG_WARNING(" pos " << posOnSurf << " z " << rSurface_pos.z() ); + //stripNumber = 1; + } + Identifier oldId = offId; + offId = idHelperSvc()->stgcIdHelper().channelID(offId, idHelperSvc()->stgcIdHelper().multilayer(offId), idHelperSvc()->stgcIdHelper().gasGap(offId),1,stripNumber); + if( idHelperSvc()->stgcIdHelper().gasGap(offId) != layer ) { + ATH_MSG_WARNING("sTGC validation: sTgc id has bad layer field(2)! " << std::endl << " " << idHelperSvc()->stgcIdHelper().print_to_string(offId) << std::endl + << " " << idHelperSvc()->stgcIdHelper().print_to_string(oldId) << " stripN " << stripNumber ); + } + + Amg::Vector2D fastDigitPos(0,0); + if( !detEl->stripPosition(offId,fastDigitPos) ){ + ATH_MSG_WARNING("sTGC validation: failed to obtain local position for identifier " << idHelperSvc()->stgcIdHelper().print_to_string(offId) ); + } + + Amg::Vector3D detpos = detEl->globalPosition(); + ATH_MSG_DEBUG("sTGC Global hit: r " << hit.globalPosition().perp() << ", phi " << hit.globalPosition().phi() << ", z " << hit.globalPosition().z() + << "; detEl: r " << detpos.perp() << ", phi " << detpos.phi() << ", z " << detpos.z() + << "; surf z " << surf.center().z() << ", ml " << multilayer << ", l " << layer ); + + ATH_MSG_DEBUG(" detEl: x " << dSurface_pos.x() << " y " << dSurface_pos.y() << " z " << dSurface_pos.z()); + ATH_MSG_DEBUG("sTGC Fast digit: x " << fastDigitPos.x() << " y " << fastDigitPos.y() + << ", gToL: x " << rSurface_pos.x() << " y " << rSurface_pos.y() << " z " << rSurface_pos.z() ); + + // Fill ntuple with the hit/surface/digit positions + m_NSWsTGC_detector_globalPosition.push_back(detpos); + + m_NSWsTGC_hitToDsurfacePosition.push_back(dSurface_pos); + + m_NSWsTGC_hitToRsurfacePosition.push_back(rSurface_pos); + + m_NSWsTGC_FastDigitRsurfacePositionX.push_back(posOnSurf.x()); + m_NSWsTGC_FastDigitRsurfacePositionY.push_back(posOnSurf.y()); + m_NSWsTGC_stripNumber.push_back(stripNumber); + } + ++n_hits; + } + m_NSWsTGC_nSimHits = n_hits; + + ATH_MSG_DEBUG("processed " << m_NSWsTGC_nSimHits << " sTgc hits"); + return true; + } +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCPRDVariables.cxx deleted file mode 100644 index 892a6362310f5ae94eab7a28c0bb6efd4b7d5ce1..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCPRDVariables.cxx +++ /dev/null @@ -1,138 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#include "CSCPRDVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonPrepRawData/CscPrepDataContainer.h" - -#include "MuonReadoutGeometry/CscReadoutElement.h" - -#include "TTree.h" - -StatusCode CSCPRDVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillCSCPRDVariables()"); - ATH_MSG_VERBOSE("MuonDetectorManager from Conditions Store accessed" << MuonDetMgr); - CHECK( this->clearVariables() ); - - const Muon::CscPrepDataContainer *Csc_PrepDataContainer = nullptr; - CHECK( m_evtStore->retrieve(Csc_PrepDataContainer, m_ContainerName.c_str()) ); - - if(Csc_PrepDataContainer->size()==0) ATH_MSG_WARNING(" CSC PRD Container empty "); - - for(auto it : *Csc_PrepDataContainer ) { - - const Muon::CscPrepDataCollection* coll = it; - - for (auto prd: *coll) { - - Identifier Id = prd->identify(); - - std::string stName = m_CscIdHelper->stationNameString(m_CscIdHelper->stationName(Id)); - int stationEta = m_CscIdHelper->stationEta(Id); - int stationPhi = m_CscIdHelper->stationPhi(Id); - int channel = m_CscIdHelper->channel(Id); - int chlayer = m_CscIdHelper->chamberLayer(Id); - int wlayer = m_CscIdHelper->wireLayer(Id); - int measuresPhi = m_CscIdHelper->measuresPhi(Id); - int strip = m_CscIdHelper->strip(Id); - int charge = prd->charge(); - int time = prd->time(); - - ATH_MSG_DEBUG( "CSC PRD Offline id: Station Name [" << stName << "]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " ChNr [" << channel << "]" - << " chamber layer [" << chlayer << "]" - << " wire layer [" << wlayer << "]" - << " measures phi [" << measuresPhi << "]" - << " strip [" << strip << "]" ); - - m_CSC_PRD_stationName.push_back(stName); - m_CSC_PRD_stationEta.push_back(stationEta); - m_CSC_PRD_stationPhi.push_back(stationPhi); - m_CSC_PRD_channel.push_back(channel); - m_CSC_PRD_chlayer.push_back(chlayer); - m_CSC_PRD_wlayer.push_back(wlayer); - m_CSC_PRD_measuresPhi.push_back(measuresPhi); - m_CSC_PRD_strip.push_back(strip); - m_CSC_PRD_charge.push_back(charge); - m_CSC_PRD_time.push_back(time); - - const MuonGM::CscReadoutElement* det = prd->detectorElement(); - if (!det) throw std::runtime_error(Form("File: %s, Line: %d\nCSCPRDVariables::fillVariables() - no associated detectorElement", __FILE__, __LINE__)); - Amg::Vector3D pos = prd->globalPosition(); - Amg::Vector2D loc_pos(0., 0.); - - det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); - - m_CSC_PRD_globalPosX.push_back(pos.x()); - m_CSC_PRD_globalPosY.push_back(pos.y()); - m_CSC_PRD_globalPosZ.push_back(pos.z()); - - m_CSC_PRD_localPosX.push_back(loc_pos[0]); - m_CSC_PRD_localPosY.push_back(loc_pos[1]); - - m_CSC_PRD_nPRDs++; - } - } - - ATH_MSG_DEBUG("processed " << m_CSC_PRD_nPRDs << " CSC PRD's"); - - return StatusCode::SUCCESS; -} - -StatusCode CSCPRDVariables::clearVariables() -{ - - m_CSC_PRD_nPRDs = 0; - - m_CSC_PRD_stationName.clear(); - m_CSC_PRD_stationEta.clear(); - m_CSC_PRD_stationPhi.clear(); - m_CSC_PRD_channel.clear(); - m_CSC_PRD_chlayer.clear(); - m_CSC_PRD_wlayer.clear(); - m_CSC_PRD_measuresPhi.clear(); - m_CSC_PRD_strip.clear(); - m_CSC_PRD_charge.clear(); - m_CSC_PRD_time.clear(); - - m_CSC_PRD_globalPosX.clear(); - m_CSC_PRD_globalPosY.clear(); - m_CSC_PRD_globalPosZ.clear(); - - m_CSC_PRD_localPosX.clear(); - m_CSC_PRD_localPosY.clear(); - - return StatusCode::SUCCESS; -} - -StatusCode CSCPRDVariables::initializeVariables() -{ - - if(m_tree) { - m_tree->Branch("PRD_CSC", &m_CSC_PRD_nPRDs, "PRDs_CSC_n/i"); - m_tree->Branch("PRD_CSC_stationName", &m_CSC_PRD_stationName); - m_tree->Branch("PRD_CSC_stationEta", &m_CSC_PRD_stationEta); - m_tree->Branch("PRD_CSC_stationPhi", &m_CSC_PRD_stationPhi); - m_tree->Branch("PRD_CSC_channel", &m_CSC_PRD_channel); - m_tree->Branch("PRD_CSC_chlayer", &m_CSC_PRD_chlayer); - m_tree->Branch("PRD_CSC_wlayer", &m_CSC_PRD_wlayer); - m_tree->Branch("PRD_CSC_measuresPhi", &m_CSC_PRD_measuresPhi); - m_tree->Branch("PRD_CSC_strip", &m_CSC_PRD_strip); - m_tree->Branch("PRD_CSC_charge", &m_CSC_PRD_charge); - m_tree->Branch("PRD_CSC_time", &m_CSC_PRD_time); - - m_tree->Branch("PRD_CSC_globalPosX", &m_CSC_PRD_globalPosX); - m_tree->Branch("PRD_CSC_globalPosY", &m_CSC_PRD_globalPosY); - m_tree->Branch("PRD_CSC_globalPosZ", &m_CSC_PRD_globalPosZ); - - m_tree->Branch("PRD_CSC_localPosX", &m_CSC_PRD_localPosX); - m_tree->Branch("PRD_CSC_localPosY", &m_CSC_PRD_localPosY); - } - - return StatusCode::SUCCESS; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCPRDVariables.h deleted file mode 100644 index 1b864fe77faab945bc9a0d65132226ad67f5b3aa..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCPRDVariables.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef CSCPRDVARIABLES_H -#define CSCPRDVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/CscIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class CSCPRDVariables : public ValAlgVariables -{ - public: - CSCPRDVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl) - { - setHelper(idhelper); - } - - ~CSCPRDVariables() = default; - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_CscIdHelper = dynamic_cast(idhelper); - if(!m_CscIdHelper) { - throw std::runtime_error("casting IdHelper to CscIdHelper failed"); - } - } - - void deleteVariables(){}; - StatusCode clearVariables(); - - const CscIdHelper* m_CscIdHelper{}; - - int m_CSC_PRD_nPRDs{}; - std::vector m_CSC_PRD_stationName; - std::vector m_CSC_PRD_stationEta; - std::vector m_CSC_PRD_stationPhi; - std::vector m_CSC_PRD_channel; - std::vector m_CSC_PRD_chlayer; - std::vector m_CSC_PRD_wlayer; - std::vector m_CSC_PRD_measuresPhi; - std::vector m_CSC_PRD_strip; - std::vector m_CSC_PRD_charge; - std::vector m_CSC_PRD_time; - - std::vector m_CSC_PRD_globalPosX; - std::vector m_CSC_PRD_globalPosY; - std::vector m_CSC_PRD_globalPosZ; - - std::vector m_CSC_PRD_localPosX; - std::vector m_CSC_PRD_localPosY; - -}; - -#endif // CSCPRDVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCRDOVariables.cxx deleted file mode 100644 index 13db0e4261e852ae721c463d150a5e6e8433bc6f..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCRDOVariables.cxx +++ /dev/null @@ -1,190 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#include "CSCRDOVariables.h" -#include "AthenaKernel/errorcheck.h" -#include "MuonSimData/MuonSimDataCollection.h" -#include "MuonRDO/CscRawDataContainer.h" -#include "MuonReadoutGeometry/CscReadoutElement.h" -#include "TTree.h" - -using namespace Muon; - -/** ---------- filling of variables */ -/** ---------- to be called on each evt i.e. execute level of main alg */ - - -CSCRDOVariables::CSCRDOVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string& containername, - MSG::Level msglvl, - const Muon::ICSC_RDO_Decoder* rdo_decoder - ) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_rdo_decoder{rdo_decoder} - { - setHelper(idhelper); - - } - -StatusCode CSCRDOVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillCSCRDOVariables()"); - - // clear variables - CHECK( this->clearVariables() ); - - const CscRawDataContainer* rdo_container = nullptr; - ATH_CHECK( m_evtStore->retrieve(rdo_container, m_ContainerName) ); - - if(rdo_container->size()==0) ATH_MSG_DEBUG(" CSC RDO Container empty "); - - for(const CscRawDataCollection* coll : *rdo_container) { - int strip_num{0}; - for (const CscRawData* rdo: *coll) { - const Identifier Id { m_rdo_decoder->channelIdentifier(rdo, m_CscIdHelper,strip_num)}; - ++strip_num; - - std::string stName = m_CscIdHelper->stationNameString(m_CscIdHelper->stationName(Id)); - int stationEta = m_CscIdHelper->stationEta(Id); - int stationPhi = m_CscIdHelper->stationPhi(Id); - int channel = m_CscIdHelper->channel(Id); - int chamberLayer = m_CscIdHelper->chamberLayer(Id); - int wireLayer = m_CscIdHelper->wireLayer(Id); - int strip = m_CscIdHelper->strip(Id); - bool measuresPhi = m_CscIdHelper->measuresPhi(Id); - - - ATH_MSG_DEBUG( "CSC RDO Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " channel [" << channel << "]" - << " chamberLayer [" << chamberLayer << "]" - << " wireLayer [" << wireLayer << "]" - << " strip [" << strip << "]" - << " measuresPhi [" << measuresPhi << "]" ); - - const MuonGM::CscReadoutElement* rdoEl = nullptr; - try{ - rdoEl = MuonDetMgr->getCscReadoutElement(Id); - } catch (const std::runtime_error&) { - ATH_MSG_WARNING("CSCRDOVariables::fillVariables() - Failed to retrieve CscReadoutElement for" << __FILE__ << __LINE__ <<" "<< m_CscIdHelper->print_to_string(Id)); - continue; - } - if (!rdoEl) { - ATH_MSG_ERROR("CSCRDOVariables::fillVariables() - Failed to retrieve CscReadoutElement for" << __FILE__ << __LINE__ << m_CscIdHelper->print_to_string(Id)); - return StatusCode::FAILURE; - } - /// to be stored in the ntuple - m_Csc_rdo_stationName.push_back(stName); - m_Csc_rdo_stationEta.push_back(stationEta); - m_Csc_rdo_stationPhi.push_back(stationPhi); - m_Csc_rdo_channel.push_back(channel); - m_Csc_rdo_chamberLayer.push_back(chamberLayer); - m_Csc_rdo_wireLayer.push_back(wireLayer); - m_Csc_rdo_strip.push_back(strip); - m_Csc_rdo_measuresPhi.push_back(measuresPhi); - m_Csc_rdo_time.push_back(rdo->time()); - - Amg::Vector2D localPos(0.,0.); - Amg::Vector3D globalPos(0., 0., 0.); - - rdoEl->surface(Id).localToGlobal(localPos,globalPos,globalPos); - m_Csc_rdo_globalPosX.push_back(globalPos.x()); - m_Csc_rdo_globalPosY.push_back(globalPos.y()); - m_Csc_rdo_globalPosZ.push_back(globalPos.z()); - - - // rdo counter for the ntuple - m_Csc_nrdo++; - } - // Local RDO position information loss after localToGlobal transformation, fill the local positions in another loop for retrieving the local positions - for (const CscRawData* rdo: *coll) { - const Identifier Id { m_rdo_decoder->channelIdentifier(rdo, m_CscIdHelper,strip_num)}; - ++strip_num; - - const MuonGM::CscReadoutElement* rdoEl = nullptr; - try{ - rdoEl = MuonDetMgr->getCscReadoutElement(Id); - } catch (const std::runtime_error&) { - ATH_MSG_WARNING("CSCRDOVariables::fillVariables() - Failed to retrieve CscReadoutElement for" << __FILE__ << __LINE__ <<" "<< m_CscIdHelper->print_to_string(Id)); - continue; - } - if (!rdoEl) { - ATH_MSG_ERROR("CSCRDOVariables::fillVariables() - Failed to retrieve CscReadoutElement for" << __FILE__ << __LINE__ << m_CscIdHelper->print_to_string(Id)); - return StatusCode::FAILURE; - } - - Amg::Vector2D lPos(0.,0.); - Amg::Vector3D gPos(0., 0., 0.); - - rdoEl->surface(Id).globalToLocal(gPos,gPos,lPos); - m_Csc_rdo_localPosX.push_back(lPos.x()); - m_Csc_rdo_localPosY.push_back(lPos.y()); - } - - } - - ATH_MSG_DEBUG("processed " << m_Csc_nrdo << " csc rdo"); - return StatusCode::SUCCESS; -} - - -/** ---------- clearing of variables */ -/** ---------- to be called inside filling method before filling starts */ -StatusCode CSCRDOVariables::clearVariables() -{ - m_Csc_nrdo = 0; - - m_Csc_rdo_stationName.clear(); - m_Csc_rdo_stationEta.clear(); - m_Csc_rdo_stationPhi.clear(); - m_Csc_rdo_channel.clear(); - m_Csc_rdo_chamberLayer.clear(); - m_Csc_rdo_wireLayer.clear(); - m_Csc_rdo_strip.clear(); - m_Csc_rdo_measuresPhi.clear(); - m_Csc_rdo_time.clear(); - m_Csc_rdo_localPosX.clear(); - m_Csc_rdo_localPosY.clear(); - m_Csc_rdo_globalPosX.clear(); - m_Csc_rdo_globalPosY.clear(); - m_Csc_rdo_globalPosZ.clear(); - - return StatusCode::SUCCESS; -} - - -/** ---------- creating variables and associate them to branches */ -/** ---------- to be called on initialization level of main alg */ -StatusCode CSCRDOVariables::initializeVariables() -{ - - if(m_tree) { - m_tree->Branch("RDO_CSC_n", &m_Csc_nrdo); - m_tree->Branch("RDO_CSC_stationName", &m_Csc_rdo_stationName); - m_tree->Branch("RDO_CSC_stationEta", &m_Csc_rdo_stationEta); - m_tree->Branch("RDO_CSC_stationPhi", &m_Csc_rdo_stationPhi); - m_tree->Branch("RDO_CSC_channel", &m_Csc_rdo_channel); - m_tree->Branch("RDO_CSC_chamberLayer", &m_Csc_rdo_chamberLayer); - m_tree->Branch("RDO_CSC_wireLayer", &m_Csc_rdo_wireLayer); - m_tree->Branch("RDO_CSC_strip", &m_Csc_rdo_strip); - m_tree->Branch("RDO_CSC_measuresPhi", &m_Csc_rdo_measuresPhi); - m_tree->Branch("RDO_CSC_time", &m_Csc_rdo_time); - m_tree->Branch("RDO_CSC_localPosX", &m_Csc_rdo_localPosX); - m_tree->Branch("RDO_CSC_localPosY", &m_Csc_rdo_localPosY); - m_tree->Branch("RDO_CSC_globalPosX", &m_Csc_rdo_globalPosX); - m_tree->Branch("RDO_CSC_globalPosY", &m_Csc_rdo_globalPosY); - m_tree->Branch("RDO_CSC_globalPosZ", &m_Csc_rdo_globalPosZ); - - } - return StatusCode::SUCCESS; -} - -void CSCRDOVariables::deleteVariables() -{ - return; -} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCRDOVariables.h deleted file mode 100644 index e8d10b678b845999f35ce841b969a365374b9c64..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCRDOVariables.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef CSCRDOVARIABLES_H -#define CSCRDOVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/CscIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include "MuonCSC_CnvTools/ICSC_RDO_Decoder.h" - -#include - -class CSCRDOVariables : public ValAlgVariables -{ - public: - CSCRDOVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string& containername, - MSG::Level msglvl, - const Muon::ICSC_RDO_Decoder* rdo_decoder); - - ~CSCRDOVariables() =default; - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_CscIdHelper = dynamic_cast(idhelper); - if(!m_CscIdHelper) { - throw std::runtime_error("casting IdHelper to CscIdHelper failed"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const CscIdHelper* m_CscIdHelper{nullptr}; - const Muon::ICSC_RDO_Decoder* m_rdo_decoder{nullptr}; - - - int m_Csc_nrdo{0}; - std::vector m_Csc_rdo_stationName; - std::vector m_Csc_rdo_stationEta; - std::vector m_Csc_rdo_stationPhi; - std::vector m_Csc_rdo_channel; - std::vector m_Csc_rdo_chamberLayer; - std::vector m_Csc_rdo_wireLayer; - std::vector m_Csc_rdo_strip; - std::vector m_Csc_rdo_measuresPhi; - std::vector m_Csc_rdo_time; - std::vector m_Csc_rdo_localPosX; - std::vector m_Csc_rdo_localPosY; - std::vector m_Csc_rdo_globalPosX; - std::vector m_Csc_rdo_globalPosY; - std::vector m_Csc_rdo_globalPosZ; - -}; - -#endif // CSCRDOVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.cxx deleted file mode 100644 index fa46218e8cd4a8275061a7521c97752994c8d8c4..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.cxx +++ /dev/null @@ -1,451 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "MMDigitVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonDigitContainer/MmDigitContainer.h" -#include "MuonDigitContainer/MmDigit.h" - -#include "MuonReadoutGeometry/MMReadoutElement.h" - -#include "TTree.h" -#include // for Form - -/** ---------- filling of variables */ -/** ---------- to be called on each evt i.e. execute level of main alg */ -StatusCode MMDigitVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillNSWMMDigitVariables()"); - - // clear variables - CHECK( this->clearVariables() ); - - // get digit container (a container corresponds to a multilayer of a module) - const MmDigitContainer *nsw_MmDigitContainer = nullptr; - CHECK( m_evtStore->retrieve(nsw_MmDigitContainer, m_ContainerName.c_str()) ); - - if(nsw_MmDigitContainer->size()==0) ATH_MSG_WARNING(" MM DigitContainer empty "); - - // iteration on all containers, i.e. all multilayers of all modules - for(auto it : *nsw_MmDigitContainer) { - // a digit collection is instanciated for each container, i.e. holds all digits of a multilayer - const MmDigitCollection* coll = it; - - // loop on all digits inside a collection, i.e. multilayer - for (unsigned int item=0; itemsize(); item++) { - - // get specific digit and identify it - const MmDigit* digit = coll->at(item); - Identifier Id = digit->identify(); - - std::string stName = m_MmIdHelper->stationNameString(m_MmIdHelper->stationName(Id)); - int stationEta = m_MmIdHelper->stationEta(Id); - int stationPhi = m_MmIdHelper->stationPhi(Id); - int multiplet = m_MmIdHelper->multilayer(Id); - int gas_gap = m_MmIdHelper->gasGap(Id); - // channel here seems to be sth like the channel/strip closest to the initial Geant4 hit - // that is entering the digitzation process (probably only of limited use) - int channel = m_MmIdHelper->channel(Id); - - ATH_MSG_DEBUG( "MicroMegas Digit Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " ChNr [" << channel << "]" ); - - // module details down to the level of channel which is closest to the Geant4 hit - // to be stored in the ntuple - m_NSWMM_dig_stationName->push_back(stName); - m_NSWMM_dig_stationEta->push_back(stationEta); - m_NSWMM_dig_stationPhi->push_back(stationPhi); - m_NSWMM_dig_multiplet->push_back(multiplet); - m_NSWMM_dig_gas_gap->push_back(gas_gap); - m_NSWMM_dig_channel->push_back(channel); - - // get the readout element class where the digit is recorded - int isSmall = (stName[2] == 'S'); - const MuonGM::MMReadoutElement* rdoEl = MuonDetMgr->getMMReadoutElement(Id); - if (!rdoEl) throw std::runtime_error(Form("File: %s, Line: %d\nMMDigitVariables::fillVariables() - Failed to retrieve MMReadoutElement for isSmall=%d, stationEta=%d, stationPhi=%d, multiplet=%d", __FILE__, __LINE__, isSmall, stationEta, stationPhi, multiplet)); - - // information from VMM chip - std::vector time = digit->chipResponseTime(); - std::vector charge = digit->chipResponseCharge(); - std::vector stripPosition = digit->chipResponsePosition(); - - std::vector localPosX; - std::vector localPosY; - std::vector globalPosX; - std::vector globalPosY; - std::vector globalPosZ; - - // information from strip - std::vector sr_time = digit->stripResponseTime(); - std::vector sr_charge = digit->stripResponseCharge(); - std::vector sr_stripPosition = digit->stripResponsePosition(); - - std::vector sr_localPosX; - std::vector sr_localPosY; - std::vector sr_globalPosX; - std::vector sr_globalPosY; - std::vector sr_globalPosZ; - - // information for trigger - std::vector time_trigger = digit->stripTimeForTrigger(); - std::vector charge_trigger = digit->stripChargeForTrigger(); - std::vector position_trigger = digit->stripPositionForTrigger(); - std::vector MMFE_VMM_id_trigger = digit->MMFE_VMM_idForTrigger(); - std::vector VMM_id_trigger = digit->VMM_idForTrigger(); - - // check if VMM chip and stirp agree - if ( stripPosition.size() != sr_stripPosition.size() ) - ATH_MSG_DEBUG("MicroMegas digitization: number of strip out from the strip response different from that out from the chip response"); - - bool isValid; - int stationName = m_MmIdHelper->stationName(Id); - - // Geant4 hit converted into digit might have fired more than one strip: - // iterating on all strips associated to that digit (from chip response) - for (unsigned int i=0;ichannelID(stationName, stationEta, stationPhi, multiplet, gas_gap, cr_strip, isValid); - if (!isValid) { - ATH_MSG_WARNING("MMDigitVariables: failed to create a valid ID for (chip response) strip n. " << cr_strip - << "; associated positions will be set to 0.0."); - } else { - // asking the detector element to get local position of strip - Amg::Vector2D cr_strip_pos(0., 0.); - if ( !rdoEl->stripPosition(cr_id,cr_strip_pos) ) { - ATH_MSG_WARNING("MMDigitVariables: failed to associate a valid local position for (chip response) strip n. " << cr_strip - << "; associated positions will be set to 0.0."); - } else { - localPosX.at(i) = cr_strip_pos.x(); - localPosY.at(i) = cr_strip_pos.y(); - } - - // asking the detector element to transform this local to the global position - Amg::Vector3D cr_strip_gpos(0., 0., 0.); - rdoEl->surface(cr_id).localToGlobal(cr_strip_pos, Amg::Vector3D(0., 0., 0.), cr_strip_gpos); - globalPosX.at(i) = cr_strip_gpos[0]; - globalPosY.at(i) = cr_strip_gpos[1]; - globalPosZ.at(i) = cr_strip_gpos[2]; - - // check if local and global position are congruent with the transform - Amg::Vector3D lpos = rdoEl->transform(cr_id).inverse() * cr_strip_gpos; - double dx = cr_strip_pos.x() - lpos.x(); - double dy = cr_strip_pos.y() - lpos.y(); - - if ( fabs(dx)>0.1 || fabs(dy)>0.1 ) { - ATH_MSG_WARNING("MicroMegas digitization: inconsistency between local/global position and transform:"); - ATH_MSG_WARNING(" X from stripPosition: " << std::setw(10) << std::setprecision(3) << cr_strip_pos.x() - << ", X from global*transform(id).inverse(): " << lpos.x() ); - ATH_MSG_WARNING(" Y from stripPosition: " << std::setw(10) << std::setprecision(3) << cr_strip_pos.y() - << ", Y from global*transform(Id).inverse(): " << lpos.y() ); - } - } - } - - // Geant4 hit converted into digit might have fired more than one strip: - // iterating on all strips associated to that digit (from strip response) - for (unsigned int i=0;ichannelID(stationName, stationEta, stationPhi, multiplet, gas_gap, sr_strip, isValid); - if (!isValid) { - ATH_MSG_WARNING("MMDigitVariables: failed to create a valid ID for (chip response) strip n. " << sr_strip - << "; associated positions will be set to 0.0."); - } else { - // asking the detector element to transform this local to the global position - Amg::Vector2D sr_strip_pos(0., 0.); - if ( !rdoEl->stripPosition(sr_id,sr_strip_pos) ) { - ATH_MSG_WARNING("MMDigitVariables: failed to associate a valid local position for (chip response) strip n. " << sr_strip - << "; associated positions will be set to 0.0."); - } else { - sr_localPosX.at(i) = sr_strip_pos.x(); - sr_localPosY.at(i) = sr_strip_pos.y(); - } - - // asking the detector element to transform this local to the global position - Amg::Vector3D sr_strip_gpos(0., 0., 0.); - rdoEl->surface(sr_id).localToGlobal(sr_strip_pos, Amg::Vector3D(0., 0., 0.), sr_strip_gpos); - sr_globalPosX.at(i) = sr_strip_gpos[0]; - sr_globalPosY.at(i) = sr_strip_gpos[1]; - sr_globalPosZ.at(i) = sr_strip_gpos[2]; - - // check if local and global position are congruent with the transform - Amg::Vector3D lpos = rdoEl->transform(sr_id).inverse() * sr_strip_gpos; - double dx = sr_strip_pos.x() - lpos.x(); - double dy = sr_strip_pos.y() - lpos.y(); - - if ( fabs(dx)>0.1 || fabs(dy)>0.1 ) { - ATH_MSG_WARNING("MicroMegas digitization: inconsistency between local/global position and transform:"); - ATH_MSG_WARNING(" X from Center(): " << std::setw(10) << std::setprecision(3) << sr_strip_pos.x() - << ", X from local*transform: " << lpos.x() ); - ATH_MSG_WARNING(" Y from Center(): " << std::setw(10) << std::setprecision(3) << sr_strip_pos.y() - << ", Y from local*transform: " << lpos.y() ); - } - - } - } - - unsigned int cl = (time.size()<=sr_time.size()) ? time.size() : sr_time.size(); - - for (unsigned int i=0;ipush_back(time); - m_NSWMM_dig_charge->push_back(charge); - m_NSWMM_dig_stripPosition->push_back(stripPosition); - m_NSWMM_dig_stripLposX->push_back(localPosX); - m_NSWMM_dig_stripLposY->push_back(localPosY); - m_NSWMM_dig_stripGposX->push_back(globalPosX); - m_NSWMM_dig_stripGposY->push_back(globalPosY); - m_NSWMM_dig_stripGposZ->push_back(globalPosZ); - - // local/global positions (+charge/time/strip index) of the strips from strip response - // to be stored in the ntuple - m_NSWMM_dig_sr_time->push_back(sr_time); - m_NSWMM_dig_sr_charge->push_back(sr_charge); - m_NSWMM_dig_sr_stripPosition->push_back(sr_stripPosition); - m_NSWMM_dig_sr_stripLposX->push_back(sr_localPosX); - m_NSWMM_dig_sr_stripLposY->push_back(sr_localPosY); - m_NSWMM_dig_sr_stripGposX->push_back(sr_globalPosX); - m_NSWMM_dig_sr_stripGposY->push_back(sr_globalPosY); - m_NSWMM_dig_sr_stripGposZ->push_back(sr_globalPosZ); - - // some more information of the digit to be stored in the ntuple - m_NSWMM_dig_time_trigger->push_back(time_trigger); - m_NSWMM_dig_charge_trigger->push_back(charge_trigger); - m_NSWMM_dig_position_trigger->push_back(position_trigger); - m_NSWMM_dig_MMFE_VMM_id_trigger->push_back(MMFE_VMM_id_trigger); - m_NSWMM_dig_VMM_id_trigger->push_back(VMM_id_trigger); - - // digit counter for the ntuple - m_NSWMM_nDigits++; - } - } - - ATH_MSG_DEBUG("processed " << m_NSWMM_nDigits << " MicroMegas hits"); - return StatusCode::SUCCESS; -} - - -/** ---------- clearing of variables */ -/** ---------- to be called inside filling method before filling starts */ -StatusCode MMDigitVariables::clearVariables() -{ - m_NSWMM_nDigits = 0; - - // information of the module down to the channel closest to the initial G4 hit - // size of vector is m_NSWMM_nDigits - m_NSWMM_dig_stationName->clear(); - m_NSWMM_dig_stationEta->clear(); - m_NSWMM_dig_stationPhi->clear(); - m_NSWMM_dig_multiplet->clear(); - m_NSWMM_dig_gas_gap->clear(); - m_NSWMM_dig_channel->clear(); - - // vectors of size m_NSWMM_nDigits that hold vectors in which an entry - // corresponds to a strip that was decided to be fired by the digit - // (information from VMM chip response emulation) - m_NSWMM_dig_time->clear(); - m_NSWMM_dig_charge->clear(); - m_NSWMM_dig_stripPosition->clear(); - m_NSWMM_dig_stripLposX->clear(); - m_NSWMM_dig_stripLposY->clear(); - m_NSWMM_dig_stripGposX->clear(); - m_NSWMM_dig_stripGposY->clear(); - m_NSWMM_dig_stripGposZ->clear(); - - // vectors of size m_NSWMM_nDigits that hold vectors in which an entry - // corresponds to a strip that was decided to be fired by the digit - // (information from VMM chip strip emulation) - m_NSWMM_dig_sr_time->clear(); - m_NSWMM_dig_sr_charge->clear(); - m_NSWMM_dig_sr_stripPosition->clear(); - m_NSWMM_dig_sr_stripLposX->clear(); - m_NSWMM_dig_sr_stripLposY->clear(); - m_NSWMM_dig_sr_stripGposX->clear(); - m_NSWMM_dig_sr_stripGposY->clear(); - m_NSWMM_dig_sr_stripGposZ->clear(); - - // more information for trigger - m_NSWMM_dig_time_trigger->clear(); - m_NSWMM_dig_charge_trigger->clear(); - m_NSWMM_dig_position_trigger->clear(); - m_NSWMM_dig_MMFE_VMM_id_trigger->clear(); - m_NSWMM_dig_VMM_id_trigger->clear(); - - return StatusCode::SUCCESS; -} - - -/** ---------- creating variables and associate them to branches */ -/** ---------- to be called on initialization level of main alg */ -StatusCode MMDigitVariables::initializeVariables() -{ - m_NSWMM_nDigits = 0; - m_NSWMM_dig_stationName = new std::vector(); - m_NSWMM_dig_stationEta = new std::vector(); - m_NSWMM_dig_stationPhi = new std::vector(); - m_NSWMM_dig_multiplet = new std::vector(); - m_NSWMM_dig_gas_gap = new std::vector(); - m_NSWMM_dig_channel = new std::vector(); - - m_NSWMM_dig_time = new std::vector< std::vector >; - m_NSWMM_dig_charge = new std::vector< std::vector >; - m_NSWMM_dig_stripPosition = new std::vector< std::vector >; - m_NSWMM_dig_stripLposX = new std::vector< std::vector >; - m_NSWMM_dig_stripLposY = new std::vector< std::vector >; - m_NSWMM_dig_stripGposX = new std::vector< std::vector >; - m_NSWMM_dig_stripGposY = new std::vector< std::vector >; - m_NSWMM_dig_stripGposZ = new std::vector< std::vector >; - - m_NSWMM_dig_sr_time = new std::vector< std::vector >; - m_NSWMM_dig_sr_charge = new std::vector< std::vector >; - m_NSWMM_dig_sr_stripPosition = new std::vector< std::vector >; - m_NSWMM_dig_sr_stripLposX = new std::vector< std::vector >; - m_NSWMM_dig_sr_stripLposY = new std::vector< std::vector >; - m_NSWMM_dig_sr_stripGposX = new std::vector< std::vector >; - m_NSWMM_dig_sr_stripGposY = new std::vector< std::vector >; - m_NSWMM_dig_sr_stripGposZ = new std::vector< std::vector >; - - m_NSWMM_dig_time_trigger = new std::vector< std::vector >; - m_NSWMM_dig_charge_trigger = new std::vector< std::vector >; - m_NSWMM_dig_position_trigger = new std::vector< std::vector >; - m_NSWMM_dig_MMFE_VMM_id_trigger = new std::vector< std::vector >; - m_NSWMM_dig_VMM_id_trigger = new std::vector< std::vector >; - - if(m_tree) { - m_tree->Branch("Digits_MM", &m_NSWMM_nDigits, "Digits_MM_n/i"); - m_tree->Branch("Digits_MM_stationName", &m_NSWMM_dig_stationName); - m_tree->Branch("Digits_MM_stationEta", &m_NSWMM_dig_stationEta); - m_tree->Branch("Digits_MM_stationPhi", &m_NSWMM_dig_stationPhi); - m_tree->Branch("Digits_MM_multiplet", &m_NSWMM_dig_multiplet); - m_tree->Branch("Digits_MM_gas_gap", &m_NSWMM_dig_gas_gap); - m_tree->Branch("Digits_MM_channel", &m_NSWMM_dig_channel); - - m_tree->Branch("Digits_MM_time", &m_NSWMM_dig_time); - m_tree->Branch("Digits_MM_charge", &m_NSWMM_dig_charge); - m_tree->Branch("Digits_MM_stripPosition", &m_NSWMM_dig_stripPosition); - m_tree->Branch("Digits_MM_stripLposX", &m_NSWMM_dig_stripLposX); - m_tree->Branch("Digits_MM_stripLposY", &m_NSWMM_dig_stripLposY); - m_tree->Branch("Digits_MM_stripGposX", &m_NSWMM_dig_stripGposX); - m_tree->Branch("Digits_MM_stripGposY", &m_NSWMM_dig_stripGposY); - m_tree->Branch("Digits_MM_stripGposZ", &m_NSWMM_dig_stripGposZ); - - m_tree->Branch("Digits_MM_stripResponse_time", &m_NSWMM_dig_sr_time); - m_tree->Branch("Digits_MM_stripResponse_charge", &m_NSWMM_dig_sr_charge); - m_tree->Branch("Digits_MM_stripResponse_stripPosition", &m_NSWMM_dig_sr_stripPosition); - m_tree->Branch("Digits_MM_stripResponse_stripLposX", &m_NSWMM_dig_sr_stripLposX); - m_tree->Branch("Digits_MM_stripResponse_stripLposY", &m_NSWMM_dig_sr_stripLposY); - m_tree->Branch("Digits_MM_stripresponse_stripGposX", &m_NSWMM_dig_sr_stripGposX); - m_tree->Branch("Digits_MM_stripResponse_stripGposY", &m_NSWMM_dig_sr_stripGposY); - m_tree->Branch("Digits_MM_stripResponse_stripGposZ", &m_NSWMM_dig_sr_stripGposZ); - - m_tree->Branch("Digits_MM_time_trigger", &m_NSWMM_dig_time_trigger); - m_tree->Branch("Digits_MM_charge_trigger", &m_NSWMM_dig_charge_trigger); - m_tree->Branch("Digits_MM_position_trigger", &m_NSWMM_dig_position_trigger); - m_tree->Branch("Digits_MM_MMFE_VMM_id_trigger", &m_NSWMM_dig_MMFE_VMM_id_trigger); - m_tree->Branch("Digits_MM_VMM_id_trigger", &m_NSWMM_dig_VMM_id_trigger); - } - - return StatusCode::SUCCESS; -} - - -/** ---------- freeing resources and resetting pointers */ -/** ---------- to be called on finalize level of main alg */ -void MMDigitVariables::deleteVariables() -{ - delete m_NSWMM_dig_stationName; - delete m_NSWMM_dig_stationEta; - delete m_NSWMM_dig_stationPhi; - delete m_NSWMM_dig_multiplet; - delete m_NSWMM_dig_gas_gap; - delete m_NSWMM_dig_channel; - - delete m_NSWMM_dig_time; - delete m_NSWMM_dig_charge; - delete m_NSWMM_dig_stripPosition; - delete m_NSWMM_dig_stripLposX; - delete m_NSWMM_dig_stripLposY; - delete m_NSWMM_dig_stripGposX; - delete m_NSWMM_dig_stripGposY; - delete m_NSWMM_dig_stripGposZ; - - delete m_NSWMM_dig_sr_time; - delete m_NSWMM_dig_sr_charge; - delete m_NSWMM_dig_sr_stripPosition; - delete m_NSWMM_dig_sr_stripLposX; - delete m_NSWMM_dig_sr_stripLposY; - delete m_NSWMM_dig_sr_stripGposX; - delete m_NSWMM_dig_sr_stripGposY; - delete m_NSWMM_dig_sr_stripGposZ; - - delete m_NSWMM_dig_time_trigger; - delete m_NSWMM_dig_charge_trigger; - delete m_NSWMM_dig_position_trigger; - delete m_NSWMM_dig_MMFE_VMM_id_trigger; - delete m_NSWMM_dig_VMM_id_trigger; - - m_NSWMM_nDigits = 0; - m_NSWMM_dig_stationName = nullptr; - m_NSWMM_dig_stationEta = nullptr; - m_NSWMM_dig_stationPhi = nullptr; - m_NSWMM_dig_multiplet = nullptr; - m_NSWMM_dig_gas_gap = nullptr; - m_NSWMM_dig_channel = nullptr; - - m_NSWMM_dig_time = nullptr; - m_NSWMM_dig_charge = nullptr; - m_NSWMM_dig_stripPosition = nullptr; - m_NSWMM_dig_stripLposX = nullptr; - m_NSWMM_dig_stripLposY = nullptr; - m_NSWMM_dig_stripGposX = nullptr; - m_NSWMM_dig_stripGposY = nullptr; - m_NSWMM_dig_stripGposZ = nullptr; - - m_NSWMM_dig_sr_time = nullptr; - m_NSWMM_dig_sr_charge = nullptr; - m_NSWMM_dig_sr_stripPosition = nullptr; - m_NSWMM_dig_sr_stripLposX = nullptr; - m_NSWMM_dig_sr_stripLposY = nullptr; - m_NSWMM_dig_sr_stripGposX = nullptr; - m_NSWMM_dig_sr_stripGposY = nullptr; - m_NSWMM_dig_sr_stripGposZ = nullptr; - - m_NSWMM_dig_time_trigger = nullptr; - m_NSWMM_dig_charge_trigger = nullptr; - m_NSWMM_dig_position_trigger = nullptr; - m_NSWMM_dig_MMFE_VMM_id_trigger = nullptr; - m_NSWMM_dig_VMM_id_trigger = nullptr; - - return; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.h deleted file mode 100644 index 197c7ca8e1726ef9736f4fa5e08e1f6479bedfe8..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMDigitVariables.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef MMDIGITVARIABLES_H -#define MMDIGITVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/MmIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class MMDigitVariables : public ValAlgVariables -{ - public: - MMDigitVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_MmIdHelper(0), - m_NSWMM_nDigits(0), - m_NSWMM_dig_stationName(0), - m_NSWMM_dig_stationEta(0), - m_NSWMM_dig_stationPhi(0), - m_NSWMM_dig_multiplet(0), - m_NSWMM_dig_gas_gap(0), - m_NSWMM_dig_channel(0), - m_NSWMM_dig_time(0), - m_NSWMM_dig_charge(0), - m_NSWMM_dig_stripPosition(0), - m_NSWMM_dig_stripLposX(0), - m_NSWMM_dig_stripLposY(0), - m_NSWMM_dig_stripGposX(0), - m_NSWMM_dig_stripGposY(0), - m_NSWMM_dig_stripGposZ(0), - m_NSWMM_dig_sr_time(0), - m_NSWMM_dig_sr_charge(0), - m_NSWMM_dig_sr_stripPosition(0), - m_NSWMM_dig_sr_stripLposX(0), - m_NSWMM_dig_sr_stripLposY(0), - m_NSWMM_dig_sr_stripGposX(0), - m_NSWMM_dig_sr_stripGposY(0), - m_NSWMM_dig_sr_stripGposZ(0), - m_NSWMM_dig_time_trigger(0), - m_NSWMM_dig_charge_trigger(0), - m_NSWMM_dig_position_trigger(0), - m_NSWMM_dig_MMFE_VMM_id_trigger(0), - m_NSWMM_dig_VMM_id_trigger(0) - - { - setHelper(idhelper); - } - - ~MMDigitVariables() - { - deleteVariables(); - } - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_MmIdHelper = dynamic_cast(idhelper); - if(m_MmIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to MmIdhelper failed"); - throw std::runtime_error("Casting error in MMDigitVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const MmIdHelper* m_MmIdHelper{}; - - int m_NSWMM_nDigits{}; - std::vector *m_NSWMM_dig_stationName; - std::vector *m_NSWMM_dig_stationEta; - std::vector *m_NSWMM_dig_stationPhi; - std::vector *m_NSWMM_dig_multiplet; - std::vector *m_NSWMM_dig_gas_gap; - std::vector *m_NSWMM_dig_channel; - - std::vector< std::vector > *m_NSWMM_dig_time; - std::vector< std::vector > *m_NSWMM_dig_charge; - std::vector< std::vector > *m_NSWMM_dig_stripPosition; - std::vector< std::vector > *m_NSWMM_dig_stripLposX; - std::vector< std::vector > *m_NSWMM_dig_stripLposY; - std::vector< std::vector > *m_NSWMM_dig_stripGposX; - std::vector< std::vector > *m_NSWMM_dig_stripGposY; - std::vector< std::vector > *m_NSWMM_dig_stripGposZ; - std::vector< std::vector > *m_NSWMM_dig_sr_time; - std::vector< std::vector > *m_NSWMM_dig_sr_charge; - std::vector< std::vector > *m_NSWMM_dig_sr_stripPosition; - std::vector< std::vector > *m_NSWMM_dig_sr_stripLposX; - std::vector< std::vector > *m_NSWMM_dig_sr_stripLposY; - std::vector< std::vector > *m_NSWMM_dig_sr_stripGposX; - std::vector< std::vector > *m_NSWMM_dig_sr_stripGposY; - std::vector< std::vector > *m_NSWMM_dig_sr_stripGposZ; - - std::vector< std::vector > *m_NSWMM_dig_time_trigger; - std::vector< std::vector > *m_NSWMM_dig_charge_trigger; - std::vector< std::vector > *m_NSWMM_dig_position_trigger; - std::vector< std::vector > *m_NSWMM_dig_MMFE_VMM_id_trigger; - std::vector< std::vector > *m_NSWMM_dig_VMM_id_trigger; - -}; - -#endif // MMDIGITVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.cxx deleted file mode 100644 index 29b7a3ab85dddf70c094e1fecbca6e4a42724ad6..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.cxx +++ /dev/null @@ -1,290 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "MMPRDVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonPrepRawData/MMPrepDataContainer.h" -#include "MuonPrepRawData/MMPrepData.h" - -#include "MuonRDO/MM_RawDataContainer.h" -#include "MuonSimData/MuonSimDataCollection.h" - -#include "MMRDOVariables.h" - -#include "MuonReadoutGeometry/MMReadoutElement.h" -#include // for Form - -#include "TTree.h" - - -StatusCode MMPRDVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG(" do fillNSWMMPRDVariables()"); - ATH_MSG_VERBOSE("MuonDetectorManager from Conditions Store accessed" << MuonDetMgr); - - CHECK( this->clearVariables() ); - - const Muon::MMPrepDataContainer *nsw_MMPrepDataContainer = nullptr; - CHECK( m_evtStore->retrieve(nsw_MMPrepDataContainer, m_ContainerName.c_str()) ); - - if(nsw_MMPrepDataContainer->size()==0) ATH_MSG_WARNING(" MM PRD Container empty "); - - const Muon::MM_RawDataContainer* rdo_container = nullptr; - CHECK( m_evtStore->retrieve(rdo_container, "MMRDO") ); // retrieve RDOs to get information per strip since PRDs only contain ids of strips - - if(rdo_container->size()==0) ATH_MSG_WARNING(" RDO Container empty "); - - for(const Muon::MMPrepDataCollection* coll : *nsw_MMPrepDataContainer) { - - const Muon::MM_RawDataCollection* rdo_coll = rdo_container->indexFindPtr(coll->identifyHash()); - if(rdo_coll==nullptr){ - ATH_MSG_ERROR("Did not find rdo collection " << coll->identifyHash()); - return StatusCode::FAILURE; - } - ATH_MSG_DEBUG("Found rdo_coll at "<size(); item++) { - const Muon::MMPrepData* prd = coll->at(item); - Identifier Id = prd->identify(); - - std::string stName = m_MmIdHelper->stationNameString(m_MmIdHelper->stationName(Id)); - int stationEta = m_MmIdHelper->stationEta(Id); - int stationPhi = m_MmIdHelper->stationPhi(Id); - int multiplet = m_MmIdHelper->multilayer(Id); - int gas_gap = m_MmIdHelper->gasGap(Id); - int channel = m_MmIdHelper->channel(Id); - - - ATH_MSG_DEBUG( "MicroMegas PRD Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " ChNr [" << channel << "]" ); - - ATH_MSG_DEBUG( " MM channel " << channel << " prd->time() " << prd->time() ); - - m_NSWMM_prd_stationName->push_back(stName); - m_NSWMM_prd_stationEta->push_back(stationEta); - m_NSWMM_prd_stationPhi->push_back(stationPhi); - m_NSWMM_prd_multiplet->push_back(multiplet); - m_NSWMM_prd_gas_gap->push_back(gas_gap); - m_NSWMM_prd_channel->push_back(channel); - m_NSWMM_prd_time->push_back(prd->time()); - - const MuonGM::MMReadoutElement* det = prd->detectorElement(); - if (!det) throw std::runtime_error(Form("File: %s, Line: %d\nMMPRDVariables::fillVariables() - no associated detectorElement", __FILE__, __LINE__)); - Amg::Vector3D pos = prd->globalPosition(); - const Amg::MatrixX & cov = prd->localCovariance(); - Amg::Vector2D loc_pos(0., 0.); - det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); - - ATH_MSG_DEBUG( "MicroMegas PRD local pos.: x=" << std::setw(6) << std::setprecision(2) << loc_pos[0] - << ", ex=" << std::setw(6) << std::setprecision(2) << cov(0,0) - << ", y=" << std::setw(6) << std::setprecision(2) << loc_pos[1] ); - - m_NSWMM_prd_globalPosX->push_back(pos.x()); - m_NSWMM_prd_globalPosY->push_back(pos.y()); - m_NSWMM_prd_globalPosZ->push_back(pos.z()); - - m_NSWMM_prd_localPosX->push_back(loc_pos[0]); - m_NSWMM_prd_localPosY->push_back(loc_pos[1]); - m_NSWMM_prd_covMatrix_1_1->push_back(cov(0,0)); - - m_NSWMM_prd_rdos_charge->push_back(std::vector()); - m_NSWMM_prd_rdos_time->push_back(std::vector()); - m_NSWMM_prd_rdos_channel->push_back(std::vector()); - m_NSWMM_prd_nRdos->push_back((prd->rdoList()).size()); - - for(const Identifier &id_rdo:prd->rdoList()){ - const Muon::MM_RawData* rdo=nullptr; - for(auto it :*rdo_coll){if(it->identify() == id_rdo) rdo=it;} - if(rdo==nullptr){ - ATH_MSG_ERROR("Did not find rdo for identifier in rdo list"); - return StatusCode::FAILURE; - } - m_NSWMM_prd_rdos_charge->back().push_back(rdo->charge()); - m_NSWMM_prd_rdos_time->back().push_back(rdo->time()); - m_NSWMM_prd_rdos_channel->back().push_back(m_MmIdHelper->channel(id_rdo)); - - } - - m_NSWMM_prd_uTPCAngle->push_back(prd->angle()); - m_nsw_prd_uTPCChiSqProb->push_back(prd->chisqProb()); - - - - - - m_NSWMM_nPRDs++; - } - } - - ATH_MSG_DEBUG("processed " << m_NSWMM_nPRDs << " MicroMegas PRD's"); - return StatusCode::SUCCESS; -} - -void MMPRDVariables::deleteVariables() -{ - ATH_MSG_DEBUG("begin of deleteVariables()"); - delete m_NSWMM_prd_stationName; - delete m_NSWMM_prd_stationEta; - delete m_NSWMM_prd_stationPhi; - delete m_NSWMM_prd_multiplet; - delete m_NSWMM_prd_gas_gap; - delete m_NSWMM_prd_channel; - delete m_NSWMM_prd_time; - - delete m_NSWMM_prd_globalPosX; - delete m_NSWMM_prd_globalPosY; - delete m_NSWMM_prd_globalPosZ; - - delete m_NSWMM_prd_localPosX; - delete m_NSWMM_prd_localPosY; - delete m_NSWMM_prd_covMatrix_1_1; - - delete m_NSWMM_prd_rdos_charge; - delete m_NSWMM_prd_rdos_time; - delete m_NSWMM_prd_rdos_channel; - delete m_NSWMM_prd_nRdos; - - delete m_NSWMM_prd_uTPCAngle; - delete m_nsw_prd_uTPCChiSqProb; - - - - m_NSWMM_nPRDs = 0; - - m_NSWMM_prd_stationName= nullptr; - m_NSWMM_prd_stationEta = nullptr; - m_NSWMM_prd_stationPhi = nullptr; - m_NSWMM_prd_multiplet = nullptr; - m_NSWMM_prd_gas_gap = nullptr; - m_NSWMM_prd_channel = nullptr; - m_NSWMM_prd_time = nullptr; - - m_NSWMM_prd_globalPosX = nullptr; - m_NSWMM_prd_globalPosY = nullptr; - m_NSWMM_prd_globalPosZ = nullptr; - - m_NSWMM_prd_localPosX = nullptr; - m_NSWMM_prd_localPosY = nullptr; - m_NSWMM_prd_covMatrix_1_1 = nullptr; - - m_NSWMM_prd_rdos_charge=nullptr; - m_NSWMM_prd_rdos_time=nullptr; - m_NSWMM_prd_rdos_channel=nullptr; - m_NSWMM_prd_nRdos=nullptr; - - m_NSWMM_prd_uTPCAngle=nullptr; - m_nsw_prd_uTPCChiSqProb=nullptr; - - ATH_MSG_DEBUG("end of deleteVariables()"); - - return; -} - - -StatusCode MMPRDVariables::clearVariables() -{ - ATH_MSG_DEBUG("beginninng of clearVariables()"); - m_NSWMM_nPRDs = 0; - m_NSWMM_prd_stationName->clear(); - m_NSWMM_prd_stationEta->clear(); - m_NSWMM_prd_stationPhi->clear(); - m_NSWMM_prd_multiplet->clear(); - m_NSWMM_prd_gas_gap->clear(); - m_NSWMM_prd_channel->clear(); - m_NSWMM_prd_time->clear(); - - m_NSWMM_prd_globalPosX->clear(); - m_NSWMM_prd_globalPosY->clear(); - m_NSWMM_prd_globalPosZ->clear(); - - m_NSWMM_prd_localPosX->clear(); - m_NSWMM_prd_localPosY->clear(); - m_NSWMM_prd_covMatrix_1_1->clear(); - - m_NSWMM_prd_rdos_charge->clear(); - m_NSWMM_prd_rdos_time->clear(); - m_NSWMM_prd_rdos_channel->clear(); - m_NSWMM_prd_nRdos->clear(); - m_NSWMM_prd_uTPCAngle->clear(); - m_nsw_prd_uTPCChiSqProb->clear(); - - - ATH_MSG_DEBUG("end of clearVariables()"); - - return StatusCode::SUCCESS; -} - - -StatusCode MMPRDVariables::initializeVariables() -{ - ATH_MSG_DEBUG("begin initializeVariables()"); - m_NSWMM_nPRDs = 0; - m_NSWMM_prd_stationName = new std::vector(); - m_NSWMM_prd_stationEta = new std::vector(); - m_NSWMM_prd_stationPhi = new std::vector(); - m_NSWMM_prd_multiplet = new std::vector(); - m_NSWMM_prd_gas_gap = new std::vector(); - m_NSWMM_prd_channel = new std::vector(); - m_NSWMM_prd_time = new std::vector(); - - m_NSWMM_prd_globalPosX = new std::vector(); - m_NSWMM_prd_globalPosY = new std::vector(); - m_NSWMM_prd_globalPosZ = new std::vector(); - - m_NSWMM_prd_localPosX = new std::vector(); - m_NSWMM_prd_localPosY = new std::vector(); - m_NSWMM_prd_covMatrix_1_1 = new std::vector(); - - m_NSWMM_prd_rdos_charge = new std::vector>(); - m_NSWMM_prd_rdos_time = new std::vector>(); - m_NSWMM_prd_rdos_channel = new std::vector>(); - m_NSWMM_prd_nRdos = new std::vector(); - - m_NSWMM_prd_uTPCAngle = new std::vector(); - m_nsw_prd_uTPCChiSqProb = new std::vector(); - - - ATH_MSG_DEBUG("did init of vars initializeVariables()"); - - if(m_tree) { - m_tree->Branch("PRD_MM", &m_NSWMM_nPRDs, "PRDs_MM_n/i"); - m_tree->Branch("PRD_MM_stationName", &m_NSWMM_prd_stationName); - m_tree->Branch("PRD_MM_stationEta", &m_NSWMM_prd_stationEta); - m_tree->Branch("PRD_MM_stationPhi", &m_NSWMM_prd_stationPhi); - m_tree->Branch("PRD_MM_multiplet", &m_NSWMM_prd_multiplet); - m_tree->Branch("PRD_MM_gas_gap", &m_NSWMM_prd_gas_gap); - m_tree->Branch("PRD_MM_channel", &m_NSWMM_prd_channel); - m_tree->Branch("PRD_MM_time", &m_NSWMM_prd_time); - - m_tree->Branch("PRD_MM_globalPosX", &m_NSWMM_prd_globalPosX); - m_tree->Branch("PRD_MM_globalPosY", &m_NSWMM_prd_globalPosY); - m_tree->Branch("PRD_MM_globalPosZ", &m_NSWMM_prd_globalPosZ); - - m_tree->Branch("PRD_MM_localPosX", &m_NSWMM_prd_localPosX); - m_tree->Branch("PRD_MM_localPosY", &m_NSWMM_prd_localPosY); - m_tree->Branch("PRD_MM_covMatrix_1_1", &m_NSWMM_prd_covMatrix_1_1); - - - m_tree->Branch("PRD_MM_rdos_charge", &m_NSWMM_prd_rdos_charge); - m_tree->Branch("PRD_MM_rdos_time", &m_NSWMM_prd_rdos_time); - m_tree->Branch("PRD_MM_rdos_channel", &m_NSWMM_prd_rdos_channel); - m_tree->Branch("PRD_MM_nRdos", &m_NSWMM_prd_nRdos); - - m_tree->Branch("PRD_MM_uTPCAngle",&m_NSWMM_prd_uTPCAngle); - m_tree->Branch("PRD_MM_uTPCChiSqProb",&m_nsw_prd_uTPCChiSqProb); - - - ATH_MSG_DEBUG("did init of tree initializeVariables()"); - - } - - ATH_MSG_DEBUG("after init of tree initializeVariables()"); - - return StatusCode::SUCCESS; -} - diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.h deleted file mode 100644 index 98c82dab4d5a5a042a3807040d33955c6d7d2c0e..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMPRDVariables.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef MMPRDVARIABLES_H -#define MMPRDVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/MmIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class MMPRDVariables : public ValAlgVariables -{ - public: - MMPRDVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_MmIdHelper(0), - m_NSWMM_nPRDs(0), - m_NSWMM_prd_stationName(0), - m_NSWMM_prd_stationEta(0), - m_NSWMM_prd_stationPhi(0), - m_NSWMM_prd_multiplet(0), - m_NSWMM_prd_gas_gap(0), - m_NSWMM_prd_channel(0), - m_NSWMM_prd_time(0), - m_NSWMM_prd_globalPosX(0), - m_NSWMM_prd_globalPosY(0), - m_NSWMM_prd_globalPosZ(0), - m_NSWMM_prd_localPosX(0), - m_NSWMM_prd_localPosY(0), - m_NSWMM_prd_covMatrix_1_1(0), - m_NSWMM_prd_rdos_charge(0), - m_NSWMM_prd_rdos_time(0), - m_NSWMM_prd_rdos_channel(0), - m_NSWMM_prd_nRdos(0), - m_NSWMM_prd_uTPCAngle(0), - m_nsw_prd_uTPCChiSqProb(0) - { - setHelper(idhelper); - } - - ~MMPRDVariables() - { - deleteVariables(); - } - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_MmIdHelper = dynamic_cast(idhelper); - if(m_MmIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to MmIdhelper failed"); - throw std::runtime_error("Casting exception in MMPRDVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const MmIdHelper* m_MmIdHelper; - - int m_NSWMM_nPRDs; - std::vector *m_NSWMM_prd_stationName; - std::vector *m_NSWMM_prd_stationEta; - std::vector *m_NSWMM_prd_stationPhi; - std::vector *m_NSWMM_prd_multiplet; - std::vector *m_NSWMM_prd_gas_gap; - std::vector *m_NSWMM_prd_channel; - std::vector *m_NSWMM_prd_time; - - std::vector *m_NSWMM_prd_globalPosX; - std::vector *m_NSWMM_prd_globalPosY; - std::vector *m_NSWMM_prd_globalPosZ; - - std::vector *m_NSWMM_prd_localPosX; - std::vector *m_NSWMM_prd_localPosY; - std::vector *m_NSWMM_prd_covMatrix_1_1; - - std::vector> *m_NSWMM_prd_rdos_charge; - std::vector> *m_NSWMM_prd_rdos_time; - std::vector> *m_NSWMM_prd_rdos_channel; - std::vector *m_NSWMM_prd_nRdos; - - std::vector* m_NSWMM_prd_uTPCAngle; - std::vector* m_nsw_prd_uTPCChiSqProb; - - - -}; - -#endif // MMPRDVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.cxx deleted file mode 100644 index d6c8a523d31f35089e84dc705f6527b7d7d18f41..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.cxx +++ /dev/null @@ -1,218 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -#include "MMRDOVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonSimData/MuonSimDataCollection.h" - -#include "MuonRDO/MM_RawDataContainer.h" - -#include "MuonReadoutGeometry/MMReadoutElement.h" - -#include "TTree.h" -#include // for Form - -using namespace Muon; - -/** ---------- filling of variables */ -/** ---------- to be called on each evt i.e. execute level of main alg */ -StatusCode MMRDOVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillNSWMMRDOVariables()"); - - // clear variables - CHECK( this->clearVariables() ); - - // get the rdo (a container corresponds to a multilayer of a module) - const MM_RawDataContainer* rdo_container = nullptr; - CHECK( m_evtStore->retrieve(rdo_container, m_ContainerName.c_str()) ); - - if(rdo_container->size()==0) ATH_MSG_WARNING(" MM RDO Container empty "); - - // iteration on all containers, i.e. all multilayers of all modules - for(auto it : *rdo_container) { - // a digit collection is instanciated for each container, i.e. holds all digits of a multilayer - const MM_RawDataCollection* coll = it; - - // loop on all digits inside a collection, i.e. multilayer - for (unsigned int item=0; itemsize(); item++) { - - // get specific digit and identify it - const MM_RawData* rdo = coll->at(item); - Identifier Id = rdo->identify(); - - std::string stName = m_MmIdHelper->stationNameString(m_MmIdHelper->stationName(Id)); - int stationEta = m_MmIdHelper->stationEta(Id); - int stationPhi = m_MmIdHelper->stationPhi(Id); - int multiplet = m_MmIdHelper->multilayer(Id); - int gas_gap = m_MmIdHelper->gasGap(Id); - int channel = m_MmIdHelper->channel(Id); - - ATH_MSG_DEBUG( "MicroMegas RDO Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " ChNr [" << channel << "]" ); - - // module details down to the level of channel which is closest to the Geant4 hit - // to be stored in the ntuple - m_NSWMM_rdo_stationName->push_back(stName); - m_NSWMM_rdo_stationEta->push_back(stationEta); - m_NSWMM_rdo_stationPhi->push_back(stationPhi); - m_NSWMM_rdo_multiplet->push_back(multiplet); - m_NSWMM_rdo_gas_gap->push_back(gas_gap); - m_NSWMM_rdo_channel->push_back(channel); - m_NSWMM_rdo_time->push_back(rdo->time()); - m_NSWMM_rdo_relBcid->push_back(rdo->relBcid()); - m_NSWMM_rdo_charge->push_back(rdo->charge()); - - // get the readout element class where the RDO is recorded - int isSmall = (stName[2] == 'S'); - const MuonGM::MMReadoutElement* rdoEl = MuonDetMgr->getMMReadoutElement(Id); - if (!rdoEl) throw std::runtime_error(Form("File: %s, Line: %d\nMMRDOVariables::fillVariables() - Failed to retrieve MMReadoutElement for isSmall=%d, stationEta=%d, stationPhi=%d, multiplet=%d", __FILE__, __LINE__, isSmall, stationEta, stationPhi, multiplet)); - - Amg::Vector2D localStripPos(0.,0.); - if ( rdoEl->stripPosition(Id,localStripPos) ) { - m_NSWMM_rdo_localPosX->push_back(localStripPos.x()); - m_NSWMM_rdo_localPosY->push_back(localStripPos.y()); - ATH_MSG_DEBUG("MM RDO: local pos.: x=" << localStripPos[0] << ", y=" << localStripPos[1]); - } else { - ATH_MSG_WARNING("MM RDO: local Strip position not defined"); - } - - // asking the detector element to transform this local to the global position - Amg::Vector3D globalStripPos(0., 0., 0.); - rdoEl->surface(Id).localToGlobal(localStripPos,Amg::Vector3D(0.,0.,0.),globalStripPos); - m_NSWMM_rdo_globalPosX->push_back(globalStripPos.x()); - m_NSWMM_rdo_globalPosY->push_back(globalStripPos.y()); - m_NSWMM_rdo_globalPosZ->push_back(globalStripPos.z()); - - // rdo counter for the ntuple - m_NSWMM_nrdo++; - } - } - - ATH_MSG_DEBUG("processed " << m_NSWMM_nrdo << " MicroMegas rdo"); - return StatusCode::SUCCESS; -} - - -/** ---------- clearing of variables */ -/** ---------- to be called inside filling method before filling starts */ -StatusCode MMRDOVariables::clearVariables() -{ - m_NSWMM_nrdo = 0; - - // information of the module down to the channel closest to the initial G4 hit - // size of vector is m_NSWMM_rdo - m_NSWMM_rdo_stationName->clear(); - m_NSWMM_rdo_stationEta->clear(); - m_NSWMM_rdo_stationPhi->clear(); - m_NSWMM_rdo_multiplet->clear(); - m_NSWMM_rdo_gas_gap->clear(); - m_NSWMM_rdo_channel->clear(); - m_NSWMM_rdo_time->clear(); - m_NSWMM_rdo_relBcid->clear(); - m_NSWMM_rdo_charge->clear(); - - m_NSWMM_rdo_globalPosX->clear(); - m_NSWMM_rdo_globalPosY->clear(); - m_NSWMM_rdo_globalPosZ->clear(); - - m_NSWMM_rdo_localPosX->clear(); - m_NSWMM_rdo_localPosY->clear(); - - return StatusCode::SUCCESS; -} - - -/** ---------- creating variables and associate them to branches */ -/** ---------- to be called on initialization level of main alg */ -StatusCode MMRDOVariables::initializeVariables() -{ - - m_NSWMM_nrdo = 0; - m_NSWMM_rdo_stationName = new std::vector(); - m_NSWMM_rdo_stationEta = new std::vector(); - m_NSWMM_rdo_stationPhi = new std::vector(); - m_NSWMM_rdo_multiplet = new std::vector(); - m_NSWMM_rdo_gas_gap = new std::vector(); - m_NSWMM_rdo_channel = new std::vector(); - m_NSWMM_rdo_time = new std::vector(); - m_NSWMM_rdo_relBcid = new std::vector(); - m_NSWMM_rdo_charge = new std::vector(); - - m_NSWMM_rdo_localPosX = new std::vector(); - m_NSWMM_rdo_localPosY = new std::vector(); - - m_NSWMM_rdo_globalPosX = new std::vector(); - m_NSWMM_rdo_globalPosY = new std::vector(); - m_NSWMM_rdo_globalPosZ = new std::vector(); - - - if(m_tree) { - m_tree->Branch("RDO_MM_n", &m_NSWMM_nrdo); - m_tree->Branch("RDO_MM_stationName", &m_NSWMM_rdo_stationName); - m_tree->Branch("RDO_MM_stationEta", &m_NSWMM_rdo_stationEta); - m_tree->Branch("RDO_MM_stationPhi", &m_NSWMM_rdo_stationPhi); - m_tree->Branch("RDO_MM_multiplet", &m_NSWMM_rdo_multiplet); - m_tree->Branch("RDO_MM_gas_gap", &m_NSWMM_rdo_gas_gap); - m_tree->Branch("RDO_MM_channel", &m_NSWMM_rdo_channel); - m_tree->Branch("RDO_MM_time", &m_NSWMM_rdo_time); - m_tree->Branch("RDO_MM_relBcid", &m_NSWMM_rdo_relBcid); - m_tree->Branch("RDO_MM_charge", &m_NSWMM_rdo_charge); - - m_tree->Branch("RDO_MM_localPosX", &m_NSWMM_rdo_localPosX); - m_tree->Branch("RDO_MM_localPosY", &m_NSWMM_rdo_localPosY); - - m_tree->Branch("RDO_MM_globalPosX", &m_NSWMM_rdo_globalPosX); - m_tree->Branch("RDO_MM_globalPosY", &m_NSWMM_rdo_globalPosY); - m_tree->Branch("RDO_MM_globalPosZ", &m_NSWMM_rdo_globalPosZ); - - } - - return StatusCode::SUCCESS; -} - - -/** ---------- freeing resources and resetting pointers */ -/** ---------- to be called on finalize level of main alg */ -void MMRDOVariables::deleteVariables() -{ - delete m_NSWMM_rdo_stationName; - delete m_NSWMM_rdo_stationEta; - delete m_NSWMM_rdo_stationPhi; - delete m_NSWMM_rdo_multiplet; - delete m_NSWMM_rdo_gas_gap; - delete m_NSWMM_rdo_channel; - delete m_NSWMM_rdo_time; - delete m_NSWMM_rdo_relBcid; - delete m_NSWMM_rdo_charge; - delete m_NSWMM_rdo_localPosX; - delete m_NSWMM_rdo_localPosY; - delete m_NSWMM_rdo_globalPosX; - delete m_NSWMM_rdo_globalPosY; - delete m_NSWMM_rdo_globalPosZ; - - - m_NSWMM_nrdo = 0; - m_NSWMM_rdo_stationName = nullptr; - m_NSWMM_rdo_stationEta = nullptr; - m_NSWMM_rdo_stationPhi = nullptr; - m_NSWMM_rdo_multiplet = nullptr; - m_NSWMM_rdo_gas_gap = nullptr; - m_NSWMM_rdo_channel = nullptr; - m_NSWMM_rdo_time = nullptr; - m_NSWMM_rdo_relBcid = nullptr; - m_NSWMM_rdo_charge = nullptr; - m_NSWMM_rdo_localPosX = nullptr; - m_NSWMM_rdo_localPosY = nullptr; - m_NSWMM_rdo_globalPosX = nullptr; - m_NSWMM_rdo_globalPosY = nullptr; - m_NSWMM_rdo_globalPosZ = nullptr; - - return; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.h deleted file mode 100644 index 1ac7a1fbe2b68fbec67c70ab2fe453d4d1edf9ff..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMRDOVariables.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef MMRDOVARIABLES_H -#define MMRDOVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/MmIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class MMRDOVariables : public ValAlgVariables -{ - public: - MMRDOVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_MmIdHelper(0), - m_NSWMM_nrdo(0), - m_NSWMM_rdo_stationName(0), - m_NSWMM_rdo_stationEta(0), - m_NSWMM_rdo_stationPhi(0), - m_NSWMM_rdo_multiplet(0), - m_NSWMM_rdo_gas_gap(0), - m_NSWMM_rdo_channel(0), - m_NSWMM_rdo_time(0), - m_NSWMM_rdo_relBcid(0), - m_NSWMM_rdo_charge(0), - m_NSWMM_rdo_localPosX(0), - m_NSWMM_rdo_localPosY(0), - m_NSWMM_rdo_globalPosX(0), - m_NSWMM_rdo_globalPosY(0), - m_NSWMM_rdo_globalPosZ(0) - { - setHelper(idhelper); - } - - ~MMRDOVariables() - { - deleteVariables(); - } - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_MmIdHelper = dynamic_cast(idhelper); - if(m_MmIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to MmIdhelper failed"); - throw std::runtime_error("Casting error in MMRDOVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const MmIdHelper* m_MmIdHelper; - - int m_NSWMM_nrdo; - std::vector *m_NSWMM_rdo_stationName; - std::vector *m_NSWMM_rdo_stationEta; - std::vector *m_NSWMM_rdo_stationPhi; - std::vector *m_NSWMM_rdo_multiplet; - std::vector *m_NSWMM_rdo_gas_gap; - std::vector *m_NSWMM_rdo_channel; - std::vector *m_NSWMM_rdo_time; - std::vector *m_NSWMM_rdo_relBcid; - std::vector *m_NSWMM_rdo_charge; - - std::vector *m_NSWMM_rdo_localPosX; - std::vector *m_NSWMM_rdo_localPosY; - std::vector *m_NSWMM_rdo_globalPosX; - std::vector *m_NSWMM_rdo_globalPosY; - std::vector *m_NSWMM_rdo_globalPosZ; -}; - -#endif // MMRDOVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.cxx deleted file mode 100644 index 9bfbc8faa85f58218ce2a49e8750d9629c07296b..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.cxx +++ /dev/null @@ -1,190 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -#include "MMSDOVariables.h" - -#include "AthenaBaseComps/AthAlgorithm.h" -#include "MuonSimData/MuonSimDataCollection.h" - -#include "TTree.h" - - -StatusCode MMSDOVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG(" do fillNSWMMSDOVariables()"); - ATH_MSG_VERBOSE("MuonDetectorManager from Conditions Store accessed" << MuonDetMgr); - - ATH_CHECK( this->clearVariables() ); - - ATH_MSG_DEBUG( "Retrieve MM SDO container with name = " << m_ContainerName.c_str() ); - const MuonSimDataCollection* nsw_MmSdoContainer = nullptr; - ATH_CHECK( m_evtStore->retrieve(nsw_MmSdoContainer, m_ContainerName.c_str()) ); - - for ( const auto& coll : *nsw_MmSdoContainer ) { - - Identifier Id = coll.first; - const MuonSimData mm_sdo = coll.second; - - // Get information on the SDO - std::string stName = m_MmIdHelper->stationNameString(m_MmIdHelper->stationName(Id)); - int stationEta = m_MmIdHelper->stationEta(Id); - int stationPhi = m_MmIdHelper->stationPhi(Id); - int multiplet = m_MmIdHelper->multilayer(Id); - int gas_gap = m_MmIdHelper->gasGap(Id); - int channel = m_MmIdHelper->channel(Id); - - - ATH_MSG_DEBUG( "MicroMegas SDO: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " ChNr [" << channel << "]" ); - - m_NSWMM_sdo_stationName->push_back(stName); - m_NSWMM_sdo_stationEta->push_back(stationEta); - m_NSWMM_sdo_stationPhi->push_back(stationPhi); - m_NSWMM_sdo_multiplet->push_back(multiplet); - m_NSWMM_sdo_gas_gap->push_back(gas_gap); - m_NSWMM_sdo_channel->push_back(channel); - - ATH_MSG_DEBUG( "Get the truth deposits from the SDO." ); - std::vector deposits; - mm_sdo.deposits(deposits); - - const Amg::Vector3D hit_gpos = mm_sdo.globalPosition(); - m_NSWMM_sdo_globalPosX->push_back( hit_gpos.x() ); - m_NSWMM_sdo_globalPosY->push_back( hit_gpos.y() ); - m_NSWMM_sdo_globalPosZ->push_back( hit_gpos.z() ); - - m_NSWMM_sdo_globaltime->push_back( mm_sdo.getTime() ); - m_NSWMM_sdo_word->push_back( mm_sdo.word() ); - - // use the information of the first deposit - int barcode = deposits[0].first.barcode(); - double MuonMCdata_firstentry = deposits[0].second.firstEntry(); - double MuonMCdata_secondentry = deposits[0].second.secondEntry(); - - ATH_MSG_DEBUG("MicroMegas SDO barcode=" << barcode); - ATH_MSG_DEBUG("MicroMegas SDO localPosX=" << std::setw(9) << std::setprecision(2) << MuonMCdata_firstentry - << ", localPosY=" << std::setw(9) << std::setprecision(2) << MuonMCdata_secondentry); - - m_NSWMM_sdo_barcode->push_back( barcode ); - m_NSWMM_sdo_localPosX->push_back( MuonMCdata_firstentry ); - m_NSWMM_sdo_localPosY->push_back( MuonMCdata_secondentry ); - - m_NSWMM_nsdo++; - } - - ATH_MSG_DEBUG("Processed " << m_NSWMM_nsdo << " MicroMegas SDOs"); - return StatusCode::SUCCESS; -} - - -void MMSDOVariables::deleteVariables() -{ - delete m_NSWMM_sdo_stationName; - delete m_NSWMM_sdo_stationEta; - delete m_NSWMM_sdo_stationPhi; - delete m_NSWMM_sdo_multiplet; - delete m_NSWMM_sdo_gas_gap; - delete m_NSWMM_sdo_channel; - - delete m_NSWMM_sdo_word; - delete m_NSWMM_sdo_barcode; - delete m_NSWMM_sdo_globalPosX; - delete m_NSWMM_sdo_globalPosY; - delete m_NSWMM_sdo_globalPosZ; - delete m_NSWMM_sdo_globaltime; - - delete m_NSWMM_sdo_localPosX; - delete m_NSWMM_sdo_localPosY; - - m_NSWMM_nsdo = 0; - m_NSWMM_sdo_stationName= nullptr; - m_NSWMM_sdo_stationEta = nullptr; - m_NSWMM_sdo_stationPhi = nullptr; - m_NSWMM_sdo_multiplet = nullptr; - m_NSWMM_sdo_gas_gap = nullptr; - m_NSWMM_sdo_channel = nullptr; - - m_NSWMM_sdo_word = nullptr; - m_NSWMM_sdo_barcode = nullptr; - m_NSWMM_sdo_globalPosX = nullptr; - m_NSWMM_sdo_globalPosY = nullptr; - m_NSWMM_sdo_globalPosZ = nullptr; - m_NSWMM_sdo_globaltime = nullptr; - - m_NSWMM_sdo_localPosX = nullptr; - m_NSWMM_sdo_localPosY = nullptr; - - return; -} - - -StatusCode MMSDOVariables::clearVariables() -{ - m_NSWMM_nsdo = 0; - m_NSWMM_sdo_stationName->clear(); - m_NSWMM_sdo_stationEta->clear(); - m_NSWMM_sdo_stationPhi->clear(); - m_NSWMM_sdo_multiplet->clear(); - m_NSWMM_sdo_gas_gap->clear(); - m_NSWMM_sdo_channel->clear(); - - m_NSWMM_sdo_word->clear(); - m_NSWMM_sdo_barcode->clear(); - m_NSWMM_sdo_globalPosX->clear(); - m_NSWMM_sdo_globalPosY->clear(); - m_NSWMM_sdo_globalPosZ->clear(); - m_NSWMM_sdo_globaltime->clear(); - m_NSWMM_sdo_localPosX->clear(); - m_NSWMM_sdo_localPosY->clear(); - - return StatusCode::SUCCESS; -} - - -StatusCode MMSDOVariables::initializeVariables() -{ - m_NSWMM_nsdo = 0; - m_NSWMM_sdo_stationName = new std::vector(); - m_NSWMM_sdo_stationEta = new std::vector(); - m_NSWMM_sdo_stationPhi = new std::vector(); - m_NSWMM_sdo_multiplet = new std::vector(); - m_NSWMM_sdo_gas_gap = new std::vector(); - m_NSWMM_sdo_channel = new std::vector(); - - m_NSWMM_sdo_word = new std::vector(); - m_NSWMM_sdo_barcode = new std::vector(); - m_NSWMM_sdo_globalPosX = new std::vector(); - m_NSWMM_sdo_globalPosY = new std::vector(); - m_NSWMM_sdo_globalPosZ = new std::vector(); - m_NSWMM_sdo_globaltime = new std::vector(); - - m_NSWMM_sdo_localPosX = new std::vector(); - m_NSWMM_sdo_localPosY = new std::vector(); - - if(m_tree) { - m_tree->Branch("SDO_MM", &m_NSWMM_nsdo, "SDOs_MM_n/i"); - m_tree->Branch("SDO_MM_stationName", &m_NSWMM_sdo_stationName); - m_tree->Branch("SDO_MM_stationEta", &m_NSWMM_sdo_stationEta); - m_tree->Branch("SDO_MM_stationPhi", &m_NSWMM_sdo_stationPhi); - m_tree->Branch("SDO_MM_multiplet", &m_NSWMM_sdo_multiplet); - m_tree->Branch("SDO_MM_gas_gap", &m_NSWMM_sdo_gas_gap); - m_tree->Branch("SDO_MM_channel", &m_NSWMM_sdo_channel); - - m_tree->Branch("SDO_MM_word", &m_NSWMM_sdo_word); - m_tree->Branch("SDO_MM_barcode", &m_NSWMM_sdo_barcode); - m_tree->Branch("SDO_MM_globalPosX", &m_NSWMM_sdo_globalPosX); - m_tree->Branch("SDO_MM_globalPosY", &m_NSWMM_sdo_globalPosY); - m_tree->Branch("SDO_MM_globalPosZ", &m_NSWMM_sdo_globalPosZ); - m_tree->Branch("SDO_MM_global_time", &m_NSWMM_sdo_globaltime); - m_tree->Branch("SDO_MM_localPosX", &m_NSWMM_sdo_localPosX); - m_tree->Branch("SDO_MM_localPosY", &m_NSWMM_sdo_localPosY); - - } - - return StatusCode::SUCCESS; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.h deleted file mode 100644 index 240bea977d0b8d010dc538384da9328aeaf027f7..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSDOVariables.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef MMSDOVARIABLES_H -#define MMSDOVARIABLES_H - -#include - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/MmIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" - -class MMSDOVariables : public ValAlgVariables -{ - public: - MMSDOVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_MmIdHelper(0), - m_NSWMM_nsdo(0), - m_NSWMM_sdo_stationName(0), - m_NSWMM_sdo_stationEta(0), - m_NSWMM_sdo_stationPhi(0), - m_NSWMM_sdo_multiplet(0), - m_NSWMM_sdo_gas_gap(0), - m_NSWMM_sdo_channel(0), - m_NSWMM_sdo_word(0), - m_NSWMM_sdo_barcode(0), - m_NSWMM_sdo_globalPosX(0), - m_NSWMM_sdo_globalPosY(0), - m_NSWMM_sdo_globalPosZ(0), - m_NSWMM_sdo_globaltime(0), - m_NSWMM_sdo_localPosX(0), - m_NSWMM_sdo_localPosY(0) - { - setHelper(idhelper); - } - - ~MMSDOVariables() - { - deleteVariables(); - } - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_MmIdHelper = dynamic_cast(idhelper); - if(m_MmIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to MmIdhelper failed"); - throw std::runtime_error("Bad cast in MMSDOVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const MmIdHelper* m_MmIdHelper{}; - - int m_NSWMM_nsdo{}; - std::vector *m_NSWMM_sdo_stationName; - std::vector *m_NSWMM_sdo_stationEta; - std::vector *m_NSWMM_sdo_stationPhi; - std::vector *m_NSWMM_sdo_multiplet; - std::vector *m_NSWMM_sdo_gas_gap; - std::vector *m_NSWMM_sdo_channel; - - std::vector *m_NSWMM_sdo_word; - std::vector *m_NSWMM_sdo_barcode; - std::vector *m_NSWMM_sdo_globalPosX; - std::vector *m_NSWMM_sdo_globalPosY; - std::vector *m_NSWMM_sdo_globalPosZ; - std::vector *m_NSWMM_sdo_globaltime; - - std::vector *m_NSWMM_sdo_localPosX; - std::vector *m_NSWMM_sdo_localPosY; - -}; - -#endif // MMSDOVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.cxx deleted file mode 100644 index c9812093bdb50a1af32190d52aa4e0a6a7f4e7e9..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.cxx +++ /dev/null @@ -1,340 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#include "MMSimHitVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonSimEvent/MMSimHitCollection.h" -#include "MuonSimEvent/MM_SimIdToOfflineId.h" - -#include "MuonReadoutGeometry/MMReadoutElement.h" - -#include "MuonAGDDDescription/MMDetectorDescription.h" -#include "MuonAGDDDescription/MMDetectorHelper.h" - -#include "TTree.h" - -StatusCode MMSimHitVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - - ATH_MSG_DEBUG("do fillNSWMMHitVariables()"); - - CHECK( this->clearVariables() ); - - const MMSimHitCollection *nswContainer = nullptr; - CHECK( m_evtStore->retrieve(nswContainer, m_ContainerName.c_str()) ); - - // Get the MicroMegas Id hit helper - MicromegasHitIdHelper* hitHelper = MicromegasHitIdHelper::GetHelper(); - MM_SimIdToOfflineId simToOffline(m_MmIdHelper); - - if(!nswContainer->size()) ATH_MSG_DEBUG(m_ContainerName<<" container empty"); - for( const MMSimHit& hit : *nswContainer ) { - - if(hit.depositEnergy()==0.) continue; // SimHits without energy loss are not recorded. - - // connect the hit with the MC truth - int barcode = hit.particleLink().barcode(); - m_NSWMM_trackId.push_back(barcode); - - m_NSWMM_globalTime.push_back(hit.globalTime()); - - const Amg::Vector3D& globalPosition = hit.globalPosition(); - m_NSWMM_hitGlobalPositionX.push_back(globalPosition.x()); - m_NSWMM_hitGlobalPositionY.push_back(globalPosition.y()); - m_NSWMM_hitGlobalPositionZ.push_back(globalPosition.z()); - m_NSWMM_hitGlobalPositionR.push_back(globalPosition.perp()); - m_NSWMM_hitGlobalPositionP.push_back(globalPosition.phi()); - const Amg::Vector3D& globalDirection = hit.globalDirection(); - m_NSWMM_hitGlobalDirectionX.push_back(globalDirection.x()); - m_NSWMM_hitGlobalDirectionY.push_back(globalDirection.y()); - m_NSWMM_hitGlobalDirectionZ.push_back(globalDirection.z()); - - m_NSWMM_particleEncoding.push_back(hit.particleEncoding()); - m_NSWMM_kineticEnergy.push_back(hit.kineticEnergy()); - m_NSWMM_depositEnergy.push_back(hit.depositEnergy()); - - - // Read the information about the Micro Megas hit - int simId = hit.MMId(); - std::string sim_stationName = hitHelper->GetStationName(simId); - int sim_stationEta = hitHelper->GetZSector(simId); - int sim_stationPhi = hitHelper->GetPhiSector(simId); - int sim_multilayer = hitHelper->GetMultiLayer(simId); - int sim_layer = hitHelper->GetLayer(simId); - int sim_side = hitHelper->GetSide(simId); - - ATH_MSG_DEBUG( "MicroMegas SimHit id: Station Name [" << sim_stationName << "]" - << " Station Eta [" << sim_stationEta << "]" - << " Station Phi [" << sim_stationPhi << "]" - << " MultiLayer [" << sim_multilayer << "]" - << " Layer [" << sim_layer << "]" - << " Side [" << sim_side << "]" ); - - if( sim_stationPhi == 0 ){ - ATH_MSG_ERROR("MicroMegas validation: unexpected phi range " << sim_stationPhi); - return StatusCode::FAILURE; - } - - // Fill Ntuple with SimId data - m_NSWMM_sim_stationName .push_back(sim_stationName); - m_NSWMM_sim_stationEta .push_back(sim_stationEta); - m_NSWMM_sim_stationPhi .push_back(sim_stationPhi); - m_NSWMM_sim_multilayer .push_back(sim_multilayer); - m_NSWMM_sim_layer .push_back(sim_layer); - m_NSWMM_sim_side .push_back(sim_side); - - - // convert simHit id to offline id; make sanity checks; retrieve the associated detector element. - Identifier offId = simToOffline.convert(hit.MMId()); - - // sanity checks - if( !m_MmIdHelper->is_mm(offId) ){ - ATH_MSG_WARNING("MM id is not a mm id! " << m_MmIdHelper->print_to_string(offId)); - } - if( !m_MmIdHelper->is_muon(offId) ){ - ATH_MSG_WARNING("MM id is not a muon id! " << m_MmIdHelper->print_to_string(offId)); - } - if( m_MmIdHelper->is_mdt(offId)||m_MmIdHelper->is_rpc(offId)||m_MmIdHelper->is_tgc(offId)||m_MmIdHelper->is_csc(offId)||m_MmIdHelper->is_stgc(offId) ){ - ATH_MSG_WARNING("MM id has wrong technology type! " << m_MmIdHelper->is_mdt(offId) << " " << m_MmIdHelper->is_rpc(offId) - << " " << m_MmIdHelper->is_tgc(offId) << " " << m_MmIdHelper->is_csc(offId) << " " << m_MmIdHelper->is_stgc(offId) ); - } - if( m_MmIdHelper->gasGap(offId) != sim_layer ) { - ATH_MSG_WARNING("MM id has bad layer field! " << m_MmIdHelper->print_to_string(offId) ); - } - - - std::string stName = m_MmIdHelper->stationNameString(m_MmIdHelper->stationName(offId)); - int off_stationEta = m_MmIdHelper->stationEta(offId); - int off_stationPhi = m_MmIdHelper->stationPhi(offId); - int off_multiplet = m_MmIdHelper->multilayer(offId); - int off_gas_gap = m_MmIdHelper->gasGap(offId); - int off_channel = m_MmIdHelper->channel(offId); - - // Get MM_READOUT from MMDetectorDescription - char side = off_stationEta < 0 ? 'C' : 'A'; - char sector_l = stName.substr(2,1)=="L" ? 'L' : 'S'; - MMDetectorHelper aHelper; - MMDetectorDescription* mm = aHelper.Get_MMDetector(sector_l, abs(off_stationEta), off_stationPhi, off_multiplet, side); - MMReadoutParameters roParam = mm->GetReadoutParameters(); - - ATH_MSG_DEBUG( "MicroMegas Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << off_stationEta << "]" - << " Station Phi [" << off_stationPhi << "]" - << " Multiplet [" << off_multiplet << "]" - << " GasGap [" << off_gas_gap << "]" - << " ChNr [" << off_channel << "]" ); - - - int isSmall = stName[2] == 'S'; - ATH_MSG_DEBUG("MicroMegas geometry, retrieving detector element for: isSmall " << isSmall << " eta " << m_MmIdHelper->stationEta(offId) - << " phi " << m_MmIdHelper->stationPhi(offId) << " ml " << m_MmIdHelper->multilayer(offId) ); - - const MuonGM::MMReadoutElement* detEl = MuonDetMgr->getMMReadoutElement(offId); - if (!detEl) { - ATH_MSG_ERROR("MMSimHitVariables::fillVariables() - Failed to retrieve MMReadoutElement for "<print_to_string(offId).c_str()); - return StatusCode::FAILURE; - } - - // surface - const Trk::PlaneSurface& surf = detEl->surface(offId); - // compute hit position within the detector element/surfaces - Amg::Transform3D gToL = detEl->absTransform().inverse(); - Amg::Vector3D hpos(hit.globalPosition().x(),hit.globalPosition().y(),hit.globalPosition().z()); - Amg::Vector3D dSurface_pos = gToL*hpos; - - // compute the hit position on the readout plane (same as in MuonFastDigitization) - Amg::Vector3D rSurface_pos = surf.transform().inverse()*hpos; - - Amg::Vector2D posOnSurfUnProjected(rSurface_pos.x(),rSurface_pos.y()); - // double gasGapThickness = detEl->getDesign(offId)->gasGapThickness(); - - // check where the readout plane is located and compute the local direction accordingly - Amg::Vector3D ldir(0., 0., 0.); - ldir = surf.transform().inverse().linear()*Amg::Vector3D(hit.globalDirection().x(), hit.globalDirection().y(), hit.globalDirection().z()); - - double scale, scaletop; - double gasgap = 5.; - - scale = -rSurface_pos.z()/ldir.z(); - scaletop = (gasgap+rSurface_pos.z())/ldir.z(); - // scaletop = (fabs(gasGapThickness) + slpos.z())/locdir.z(); - - Amg::Vector3D hitOnSurface = rSurface_pos + scale*ldir; - Amg::Vector3D hitOnTopSurface = rSurface_pos + scaletop*ldir; - Amg::Vector2D posOnSurf (hitOnSurface.x(), hitOnSurface.y()); - Amg::Vector2D posOnTopSurf (hitOnTopSurface.x(),hitOnTopSurface.y()); - - - int stripNumber = detEl->stripNumber(posOnSurf,offId); - // int LastStripNumber = detEl->stripNumber(posOnTopSurf, offId); - - // perform bound check (making the call from the detector element to consider edge passivation) - //m_NSWMM_isInsideBounds.push_back( surf.insideBounds(posOnSurf) ); - m_NSWMM_isInsideBounds.push_back( detEl->insideActiveBounds(offId, posOnSurf) ); - - if( stripNumber == -1 ){ - ATH_MSG_WARNING("MicroMegas validation: failed to obtain strip number " << m_MmIdHelper->print_to_string(offId) ); - ATH_MSG_WARNING(" pos " << posOnSurf << " z " << rSurface_pos.z() ); - stripNumber = 1; - } - - Identifier oldId = offId; - offId = m_MmIdHelper->channelID(offId, m_MmIdHelper->multilayer(offId), m_MmIdHelper->gasGap(offId),stripNumber); - if( m_MmIdHelper->gasGap(offId) != sim_layer ) { - ATH_MSG_WARNING("MicroMegas validation: MM id has bad layer field(2)! " << std::endl << " " << m_MmIdHelper->print_to_string(offId) << std::endl - << " " << m_MmIdHelper->print_to_string(oldId) << " stripN " << stripNumber ); - } - - Amg::Vector2D fastDigitPos(0.,0.); - if( !detEl->stripPosition(offId,fastDigitPos ) ){ - ATH_MSG_WARNING("MicroMegas validation: failed to obtain local position for identifier " << m_MmIdHelper->print_to_string(offId) ); - } - - Amg::Vector3D detpos = detEl->globalPosition(); - ATH_MSG_DEBUG("Global hit : r " << hit.globalPosition().perp() << ", phi " << hit.globalPosition().phi() << ", z " << hit.globalPosition().z() - << "; detEl: r " << detpos.perp() << ", phi " << detpos.phi() << ", z " << detpos.z() - << "; surf z " << surf.center().z() << ", ml " << sim_multilayer << ", l " << sim_layer ); - ATH_MSG_DEBUG(" detEl: x " << dSurface_pos.x() << " y " << dSurface_pos.y() << " z " << dSurface_pos.z()); - ATH_MSG_DEBUG("MM Fast digit: x " << fastDigitPos.x() << " y " << fastDigitPos.y() - << ", gToL: x " << rSurface_pos.x() << " y " << rSurface_pos.y() << " z " << rSurface_pos.z() ); - - - - // Fill Ntuple with offline ID data - m_NSWMM_off_stationName .push_back(stName); - m_NSWMM_off_stationEta .push_back(off_stationEta); - m_NSWMM_off_stationPhi .push_back(off_stationPhi); - m_NSWMM_off_multiplet .push_back(off_multiplet); - m_NSWMM_off_gas_gap .push_back(off_gas_gap); - // The offline IdHelper class will be updated to assign wiregroup ID to SimHit. - // As a temporary solution stripnumber is used directly (also in sTGC) - off_channel = stripNumber; - m_NSWMM_off_channel .push_back(off_channel); - - - // Fill ntuple with the hit/surface/digit positions - m_NSWMM_detector_globalPositionX.push_back( detpos.x() ); - m_NSWMM_detector_globalPositionY.push_back( detpos.y() ); - m_NSWMM_detector_globalPositionZ.push_back( detpos.z() ); - m_NSWMM_detector_globalPositionR.push_back( detpos.perp() ); - m_NSWMM_detector_globalPositionP.push_back( detpos.phi() ); - - m_NSWMM_hitToDsurfacePositionX.push_back( dSurface_pos.x() ); - m_NSWMM_hitToDsurfacePositionY.push_back( dSurface_pos.y() ); - m_NSWMM_hitToDsurfacePositionZ.push_back( dSurface_pos.z() ); - - m_NSWMM_hitToRsurfacePositionX.push_back( rSurface_pos.x() ); - m_NSWMM_hitToRsurfacePositionY.push_back( rSurface_pos.y() ); - m_NSWMM_hitToRsurfacePositionZ.push_back( rSurface_pos.z() ); - - m_NSWMM_FastDigitRsurfacePositionX.push_back( posOnSurf.x() ); - m_NSWMM_FastDigitRsurfacePositionY.push_back( posOnSurf.y() ); - - ATH_MSG_DEBUG("---------- Hit processing ends!"); - - m_NSWMM_nSimHits++; - } - - ATH_MSG_DEBUG("processed " << m_NSWMM_nSimHits << " MicroMegas hits"); - return StatusCode::SUCCESS; -} - - -StatusCode MMSimHitVariables::clearVariables() -{ - m_NSWMM_nSimHits = 0; - m_NSWMM_trackId.clear(); - m_NSWMM_globalTime.clear(); - m_NSWMM_isInsideBounds.clear(); - m_NSWMM_hitGlobalPositionX.clear(); - m_NSWMM_hitGlobalPositionY.clear(); - m_NSWMM_hitGlobalPositionZ.clear(); - m_NSWMM_hitGlobalPositionR.clear(); - m_NSWMM_hitGlobalPositionP.clear(); - m_NSWMM_hitGlobalDirectionX.clear(); - m_NSWMM_hitGlobalDirectionY.clear(); - m_NSWMM_hitGlobalDirectionZ.clear(); - m_NSWMM_detector_globalPositionX.clear(); - m_NSWMM_detector_globalPositionY.clear(); - m_NSWMM_detector_globalPositionZ.clear(); - m_NSWMM_detector_globalPositionR.clear(); - m_NSWMM_detector_globalPositionP.clear(); - m_NSWMM_hitToDsurfacePositionX.clear(); - m_NSWMM_hitToDsurfacePositionY.clear(); - m_NSWMM_hitToDsurfacePositionZ.clear(); - m_NSWMM_hitToRsurfacePositionX.clear(); - m_NSWMM_hitToRsurfacePositionY.clear(); - m_NSWMM_hitToRsurfacePositionZ.clear(); - m_NSWMM_FastDigitRsurfacePositionX.clear(); - m_NSWMM_FastDigitRsurfacePositionY.clear(); - m_NSWMM_particleEncoding.clear(); - m_NSWMM_kineticEnergy.clear(); - m_NSWMM_depositEnergy.clear(); - m_NSWMM_sim_stationName.clear(); - m_NSWMM_sim_stationEta.clear(); - m_NSWMM_sim_stationPhi.clear(); - m_NSWMM_sim_multilayer.clear(); - m_NSWMM_sim_layer.clear(); - m_NSWMM_sim_side.clear(); - m_NSWMM_off_stationName.clear(); - m_NSWMM_off_stationEta.clear(); - m_NSWMM_off_stationPhi.clear(); - m_NSWMM_off_multiplet.clear(); - m_NSWMM_off_gas_gap.clear(); - m_NSWMM_off_channel.clear(); - return StatusCode::SUCCESS; -} - -void MMSimHitVariables::deleteVariables() -{ - return; -} - -StatusCode MMSimHitVariables::initializeVariables() -{ - if(m_tree) { - m_tree->Branch("Hits_MM_n", &m_NSWMM_nSimHits, "Hits_MM_n/i"); - m_tree->Branch("Hits_MM_trackId", &m_NSWMM_trackId); - m_tree->Branch("Hits_MM_globalTime", &m_NSWMM_globalTime); - m_tree->Branch("Hits_MM_isInsideBounds", &m_NSWMM_isInsideBounds); - m_tree->Branch("Hits_MM_hitGlobalPositionX", &m_NSWMM_hitGlobalPositionX); - m_tree->Branch("Hits_MM_hitGlobalPositionY", &m_NSWMM_hitGlobalPositionY); - m_tree->Branch("Hits_MM_hitGlobalPositionZ", &m_NSWMM_hitGlobalPositionZ); - m_tree->Branch("Hits_MM_hitGlobalPositionR", &m_NSWMM_hitGlobalPositionR); - m_tree->Branch("Hits_MM_hitGlobalPositionP", &m_NSWMM_hitGlobalPositionP); - m_tree->Branch("Hits_MM_hitGlobalDirectionX", &m_NSWMM_hitGlobalDirectionX); - m_tree->Branch("Hits_MM_hitGlobalDirectionY", &m_NSWMM_hitGlobalDirectionY); - m_tree->Branch("Hits_MM_hitGlobalDirectionZ", &m_NSWMM_hitGlobalDirectionZ); - m_tree->Branch("Hits_MM_detector_globalPositionX", &m_NSWMM_detector_globalPositionX); - m_tree->Branch("Hits_MM_detector_globalPositionY", &m_NSWMM_detector_globalPositionY); - m_tree->Branch("Hits_MM_detector_globalPositionZ", &m_NSWMM_detector_globalPositionZ); - m_tree->Branch("Hits_MM_detector_globalPositionR", &m_NSWMM_detector_globalPositionR); - m_tree->Branch("Hits_MM_detector_globalPositionP", &m_NSWMM_detector_globalPositionP); - m_tree->Branch("Hits_MM_hitToDsurfacePositionX", &m_NSWMM_hitToDsurfacePositionX); - m_tree->Branch("Hits_MM_hitToDsurfacePositionY", &m_NSWMM_hitToDsurfacePositionY); - m_tree->Branch("Hits_MM_hitToDsurfacePositionZ", &m_NSWMM_hitToDsurfacePositionZ); - m_tree->Branch("Hits_MM_hitToRsurfacePositionX", &m_NSWMM_hitToRsurfacePositionX); - m_tree->Branch("Hits_MM_hitToRsurfacePositionY", &m_NSWMM_hitToRsurfacePositionY); - m_tree->Branch("Hits_MM_hitToRsurfacePositionZ", &m_NSWMM_hitToRsurfacePositionZ); - m_tree->Branch("Hits_MM_FastDigitRsurfacePositionX", &m_NSWMM_FastDigitRsurfacePositionX); - m_tree->Branch("Hits_MM_FastDigitRsurfacePositionY", &m_NSWMM_FastDigitRsurfacePositionY); - m_tree->Branch("Hits_MM_particleEncoding", &m_NSWMM_particleEncoding); - m_tree->Branch("Hits_MM_kineticEnergy", &m_NSWMM_kineticEnergy); - m_tree->Branch("Hits_MM_depositEnergy", &m_NSWMM_depositEnergy); - m_tree->Branch("Hits_MM_sim_stationName", &m_NSWMM_sim_stationName); - m_tree->Branch("Hits_MM_sim_stationEta", &m_NSWMM_sim_stationEta); - m_tree->Branch("Hits_MM_sim_stationPhi", &m_NSWMM_sim_stationPhi); - m_tree->Branch("Hits_MM_sim_multilayer", &m_NSWMM_sim_multilayer); - m_tree->Branch("Hits_MM_sim_layer", &m_NSWMM_sim_layer); - m_tree->Branch("Hits_MM_sim_side", &m_NSWMM_sim_side); - m_tree->Branch("Hits_MM_off_stationName", &m_NSWMM_off_stationName); - m_tree->Branch("Hits_MM_off_stationEta", &m_NSWMM_off_stationEta); - m_tree->Branch("Hits_MM_off_stationPhi", &m_NSWMM_off_stationPhi); - m_tree->Branch("Hits_MM_off_multiplet", &m_NSWMM_off_multiplet); - m_tree->Branch("Hits_MM_off_gas_gap", &m_NSWMM_off_gas_gap); - m_tree->Branch("Hits_MM_off_channel", &m_NSWMM_off_channel); - } - return StatusCode::SUCCESS; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.h deleted file mode 100644 index b2c4ab2fa20c72b45dad7030ceeffc4bac528cdb..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef MMSIMHITVARIABLES_H -#define MMSIMHITVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/MmIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class MMSimHitVariables : public ValAlgVariables -{ - public: - MMSimHitVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_MmIdHelper(nullptr), - m_NSWMM_nSimHits(0), - m_NSWMM_trackId(), - m_NSWMM_isInsideBounds(), - m_NSWMM_globalTime(), - m_NSWMM_hitGlobalPositionX(), - m_NSWMM_hitGlobalPositionY(), - m_NSWMM_hitGlobalPositionZ(), - m_NSWMM_hitGlobalPositionR(), - m_NSWMM_hitGlobalPositionP(), - m_NSWMM_hitGlobalDirectionX(), - m_NSWMM_hitGlobalDirectionY(), - m_NSWMM_hitGlobalDirectionZ(), - m_NSWMM_detector_globalPositionX(), - m_NSWMM_detector_globalPositionY(), - m_NSWMM_detector_globalPositionZ(), - m_NSWMM_detector_globalPositionR(), - m_NSWMM_detector_globalPositionP(), - m_NSWMM_hitToDsurfacePositionX(), - m_NSWMM_hitToDsurfacePositionY(), - m_NSWMM_hitToDsurfacePositionZ(), - m_NSWMM_hitToRsurfacePositionX(), - m_NSWMM_hitToRsurfacePositionY(), - m_NSWMM_hitToRsurfacePositionZ(), - m_NSWMM_FastDigitRsurfacePositionX(), - m_NSWMM_FastDigitRsurfacePositionY(), - m_NSWMM_particleEncoding(), - m_NSWMM_kineticEnergy(), - m_NSWMM_depositEnergy(), - m_NSWMM_sim_stationName(), - m_NSWMM_sim_stationEta(), - m_NSWMM_sim_stationPhi(), - m_NSWMM_sim_multilayer(), - m_NSWMM_sim_layer(), - m_NSWMM_sim_side(), - m_NSWMM_off_stationName(), - m_NSWMM_off_stationEta(), - m_NSWMM_off_stationPhi(), - m_NSWMM_off_multiplet(), - m_NSWMM_off_gas_gap(), - m_NSWMM_off_channel() - { - setHelper(idhelper); - } - - ~MMSimHitVariables() - { - deleteVariables(); - } - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_MmIdHelper = dynamic_cast(idhelper); - if(!m_MmIdHelper) { - ATH_MSG_ERROR("casting IdHelper to MmIdhelper failed"); - throw std::runtime_error("Casting error in MMSimHitVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const MmIdHelper* m_MmIdHelper{}; - - int m_NSWMM_nSimHits{}; - std::vector m_NSWMM_trackId; - std::vector m_NSWMM_isInsideBounds; - std::vector m_NSWMM_globalTime; - std::vector m_NSWMM_hitGlobalPositionX; - std::vector m_NSWMM_hitGlobalPositionY; - std::vector m_NSWMM_hitGlobalPositionZ; - std::vector m_NSWMM_hitGlobalPositionR; - std::vector m_NSWMM_hitGlobalPositionP; - std::vector m_NSWMM_hitGlobalDirectionX; - std::vector m_NSWMM_hitGlobalDirectionY; - std::vector m_NSWMM_hitGlobalDirectionZ; - - std::vector m_NSWMM_detector_globalPositionX; - std::vector m_NSWMM_detector_globalPositionY; - std::vector m_NSWMM_detector_globalPositionZ; - std::vector m_NSWMM_detector_globalPositionR; - std::vector m_NSWMM_detector_globalPositionP; - - std::vector m_NSWMM_hitToDsurfacePositionX; - std::vector m_NSWMM_hitToDsurfacePositionY; - std::vector m_NSWMM_hitToDsurfacePositionZ; - - std::vector m_NSWMM_hitToRsurfacePositionX; - std::vector m_NSWMM_hitToRsurfacePositionY; - std::vector m_NSWMM_hitToRsurfacePositionZ; - - std::vector m_NSWMM_FastDigitRsurfacePositionX; - std::vector m_NSWMM_FastDigitRsurfacePositionY; - - std::vector m_NSWMM_particleEncoding; - std::vector m_NSWMM_kineticEnergy; - std::vector m_NSWMM_depositEnergy; - - std::vector m_NSWMM_sim_stationName; - std::vector m_NSWMM_sim_stationEta; - std::vector m_NSWMM_sim_stationPhi; - std::vector m_NSWMM_sim_multilayer; - std::vector m_NSWMM_sim_layer; - std::vector m_NSWMM_sim_side; - - std::vector m_NSWMM_off_stationName; - std::vector m_NSWMM_off_stationEta; - std::vector m_NSWMM_off_stationPhi; - std::vector m_NSWMM_off_multiplet; - std::vector m_NSWMM_off_gas_gap; - std::vector m_NSWMM_off_channel; - -}; - -#endif // MMSIMHITVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.cxx index eb9334efb3e5661fafa557d0cbb7a737d550c297..6a731e2d59254cc6fa9fa3f00499ff96e92c054e 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.cxx @@ -38,86 +38,43 @@ StatusCode NSWPRDValAlg::initialize() { std::make_unique(evtStore().get(), m_muonDetMgrDS, m_tree.tree(), m_MuEntry_ContainerName, msgLevel())); } - if (m_doSTGCHit) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->stgcIdHelper(), - m_tree.tree(), m_NSWsTGC_ContainerName, msgLevel())); - } - + if (m_doSTGCHit) { m_tree.addBranch(std::make_unique(m_tree, m_NSWsTGC_ContainerName.value(), msgLevel())); } if (m_doSTGCDigit) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->stgcIdHelper(), - m_tree.tree(), m_NSWsTGC_DigitContainerName, msgLevel())); - + m_tree.addBranch(std::make_unique(m_tree, m_NSWsTGC_DigitContainerName.value(), msgLevel())); // Take SDO conainer - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->stgcIdHelper(), - m_tree.tree(), m_NSWsTGC_SDOContainerName, msgLevel())); - } - - if (m_doSTGCFastDigit) { - // Take the "fast_SDO" instead of the SDOs from full sim - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->stgcIdHelper(), - m_tree.tree(), "sTGCfast_SDO", msgLevel())); - // Fast digits = PRD - } - - if (m_doSTGCRDO) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->stgcIdHelper(), - m_tree.tree(), m_NSWsTGC_RDOContainerName, msgLevel())); - } - - if (m_doSTGCPRD) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->stgcIdHelper(), - m_tree.tree(), m_NSWsTGC_PRDContainerName, msgLevel())); - } - - if (m_doMMHit) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->mmIdHelper(), - m_tree.tree(), m_NSWMM_ContainerName, msgLevel())); + m_tree.addBranch(std::make_unique(m_tree, m_NSWsTGC_SDOContainerName.value(), msgLevel())); } + if (m_doSTGCFastDigit) { m_tree.addBranch(std::make_unique(m_tree, "sTGCfast_SDO", msgLevel())); } + if (m_doSTGCRDO) { m_tree.addBranch(std::make_unique(m_tree, m_NSWsTGC_RDOContainerName.value(), msgLevel())); } + if (m_doSTGCPRD) { m_tree.addBranch(std::make_unique(m_tree, m_NSWsTGC_PRDContainerName.value(), msgLevel())); } + if (m_doMMHit) { m_tree.addBranch(std::make_unique(m_tree, m_NSWMM_ContainerName.value(), msgLevel())); } if (m_doMMDigit) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->mmIdHelper(), - m_tree.tree(), m_NSWMM_DigitContainerName, msgLevel())); - + m_tree.addBranch(std::make_unique(m_tree, m_NSWMM_DigitContainerName.value(), msgLevel())); // Take SDO conainer - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->mmIdHelper(), - m_tree.tree(), m_NSWMM_SDOContainerName, msgLevel())); - } - - if (m_doMMFastDigit) { - // Take the "fast_SDO" instead of the SDOs from full sim - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->mmIdHelper(), - m_tree.tree(), "MMfast_SDO", msgLevel())); - } - - if (m_doMMRDO) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->mmIdHelper(), - m_tree.tree(), m_NSWMM_RDOContainerName, msgLevel())); - } - - if (m_doMMPRD) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->mmIdHelper(), - m_tree.tree(), m_NSWMM_PRDContainerName, msgLevel())); + m_tree.addBranch(std::make_unique(m_tree, m_NSWMM_SDOContainerName.value(), msgLevel())); } + if (m_doMMFastDigit) { m_tree.addBranch(std::make_unique(m_tree, "MMfast_SDO", msgLevel())); } + if (m_doMMRDO) { m_tree.addBranch(std::make_unique(m_tree, m_NSWMM_RDOContainerName.value(), msgLevel())); } + if (m_doMMPRD) { m_tree.addBranch(std::make_unique(m_tree, m_NSWMM_PRDContainerName.value(), msgLevel())); } if (m_doCSCHit) { m_tree.addBranch(std::make_unique(m_tree, m_CSC_SimContainerName.value(), msgLevel())); } if (m_doCSCSDO) { m_tree.addBranch(std::make_unique(m_tree, m_CSC_SDOContainerName.value(), msgLevel())); } if (m_doCSCDigit) { m_tree.addBranch(std::make_unique(m_tree, m_CSC_DigitContainerName.value(), msgLevel())); } - if (m_doCSCRDO) { + if (m_doCSCRDO) { ATH_CHECK(m_csc_decoder.retrieve()); - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->cscIdHelper(), - m_tree.tree(), m_CSC_RDOContainerName, msgLevel(), m_csc_decoder.get())); - } - if (m_doCSCPRD) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->cscIdHelper(), - m_tree.tree(), m_CSC_PRDContainerName, msgLevel())); + m_tree.addBranch(std::make_unique(m_tree, m_CSC_RDOContainerName.value(), msgLevel(), &m_idHelperSvc->cscIdHelper(), m_csc_decoder.get())); } + if (m_doCSCPRD) { m_tree.addBranch(std::make_unique(m_tree, m_CSC_PRDContainerName.value(), msgLevel())); } if (m_doMDTHit) { m_tree.addBranch(std::make_unique(m_tree, m_MDT_SimContainerName.value(), msgLevel())); } if (m_doMDTSDO) { m_tree.addBranch(std::make_unique(m_tree, m_MDT_SDOContainerName.value(), msgLevel())); } if (m_doMDTDigit) { m_tree.addBranch(std::make_unique(m_tree, m_MDT_DigitContainerName.value(), msgLevel())); } + if (m_doRPCHit) { m_tree.addBranch(std::make_unique(m_tree, m_RPC_SimContainerName, msgLevel())); } if (m_doRPCSDO) { m_tree.addBranch(std::make_unique(m_tree, m_RPC_SDOContainerName, msgLevel())); } if (m_doRPCDigit) { m_tree.addBranch(std::make_unique(m_tree, m_RPC_DigitContainerName, msgLevel())); } + if (m_doTGCHit) { m_tree.addBranch(std::make_unique(m_tree, m_TGC_SimContainerName.value(), msgLevel())); } if (m_doTGCSDO) { m_tree.addBranch(std::make_unique(m_tree, m_TGC_SDOContainerName.value(), msgLevel())); } if (m_doTGCDigit) { m_tree.addBranch(std::make_unique(m_tree, m_TGC_DigitContainerName.value(), msgLevel())); } @@ -125,13 +82,10 @@ StatusCode NSWPRDValAlg::initialize() { const ITGCcablingServerSvc* TgcCabGet = nullptr; ATH_CHECK(service("TGCcablingServerSvc", TgcCabGet, true)); ATH_CHECK(TgcCabGet->giveCabling(m_tgcCabling)); - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->tgcIdHelper(), - m_tgcCabling, m_tree.tree(), m_TGC_RDOContainerName, msgLevel())); - } - if (m_doTGCPRD) { - m_testers.emplace_back(std::make_unique(evtStore().get(), m_muonDetMgrDS, &m_idHelperSvc->tgcIdHelper(), - m_tree.tree(), m_TGC_PRDContainerName, msgLevel())); + m_tree.addBranch(std::make_unique(m_tree, m_TGC_RDOContainerName.value(), msgLevel(), m_tgcCabling)); } + if (m_doTGCPRD) { m_tree.addBranch(std::make_unique(m_tree, m_TGC_PRDContainerName.value(), msgLevel())); } + for (std::unique_ptr& tester : m_testers) { ATH_CHECK(tester->initializeVariables()); } ATH_CHECK(m_tree.init(histSvc())); diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h index d77c9ece4a75a8b7cdd15b849210b5a066bc77c9..f71125ddb3530d776f39682eedcd46ba30c6c236 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h @@ -9,28 +9,15 @@ #include #include "AthenaBaseComps/AthHistogramAlgorithm.h" -#include "CSCPRDVariables.h" -#include "CSCRDOVariables.h" #include "EDM_object.h" #include "GaudiKernel/ServiceHandle.h" -#include "MMDigitVariables.h" -#include "MMPRDVariables.h" -#include "MMRDOVariables.h" -#include "MMSDOVariables.h" -#include "MMSimHitVariables.h" #include "MuEntryVariables.h" #include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonTesterTree/MuonTesterTree.h" -#include "TGCPRDVariables.h" -#include "TGCRDOVariables.h" #include "TGCcablingInterface/ITGCcablingSvc.h" +#include "MuonCSC_CnvTools/ICSC_RDO_Decoder.h" #include "TTree.h" -#include "sTGCDigitVariables.h" -#include "sTGCPRDVariables.h" -#include "sTGCRDOVariables.h" -#include "sTGCSDOVariables.h" -#include "sTGCSimHitVariables.h" class ITHistSvc; @@ -112,7 +99,7 @@ private: Gaudi::Property m_NSWMM_PRDContainerName{this, "NSWMM_PRDContainerName", "MM_Measurements"}; Gaudi::Property m_CSC_SimContainerName{this, "CSC_SimContainerName", "CSC_Hits"}; - Gaudi::Property m_CSC_SDOContainerName{this, "CSC_SDOContainerName", "CSCSDO"}; + Gaudi::Property m_CSC_SDOContainerName{this, "CSC_SDOContainerName", "CSC_SDO"}; Gaudi::Property m_CSC_DigitContainerName{this, "CSC_DigitContainerName", "CSC_DIGITS"}; Gaudi::Property m_CSC_RDOContainerName{this, "CSC_RDOContainerName", "CSCRDO"}; Gaudi::Property m_CSC_PRDContainerName{this, "CSC_PRDContainerName", "CSC_Clusters"}; diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCPRDVariables.cxx deleted file mode 100644 index 187af1154a155057ec93afa7144ef671099e55c6..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCPRDVariables.cxx +++ /dev/null @@ -1,119 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#include "TGCPRDVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonPrepRawData/TgcPrepDataContainer.h" -#include "MuonReadoutGeometry/TgcReadoutElement.h" - -#include "TTree.h" - -StatusCode TGCPRDVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillTGCPRDVariables()"); - ATH_MSG_VERBOSE("MuonDetectorManager from Conditions Store accessed" << MuonDetMgr); - CHECK( this->clearVariables() ); - - const Muon::TgcPrepDataContainer *Tgc_PrepDataContainer = nullptr; - CHECK( m_evtStore->retrieve(Tgc_PrepDataContainer, m_ContainerName.c_str()) ); - - if(Tgc_PrepDataContainer->size()==0){ - ATH_MSG_DEBUG(" TGC PRD Container empty "); - - } - for(const Muon::TgcPrepDataCollection* coll: *Tgc_PrepDataContainer ) { - - for (auto prd: *coll) { - - Identifier Id = prd->identify(); - - std::string stName = m_TgcIdHelper->stationNameString(m_TgcIdHelper->stationName(Id)); - int stationEta = m_TgcIdHelper->stationEta(Id); - int stationPhi = m_TgcIdHelper->stationPhi(Id); - int channel = m_TgcIdHelper->channel(Id); - int gasgap = m_TgcIdHelper->gasGap(Id); - int isStrip = m_TgcIdHelper->isStrip(Id); - - ATH_MSG_DEBUG( "TGC PRD Offline id: Station Name [" << stName << "]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " ChNr [" << channel << "]" - << " gasGap [" << gasgap << "]" - << " isStrip [" << isStrip << "]" ); - - m_TGC_PRD_stationName.push_back(stName); - m_TGC_PRD_stationEta.push_back(stationEta); - m_TGC_PRD_stationPhi.push_back(stationPhi); - m_TGC_PRD_channel.push_back(channel); - m_TGC_PRD_gasGap.push_back(gasgap); - m_TGC_PRD_isStrip.push_back(isStrip); - - const MuonGM::TgcReadoutElement* det = prd->detectorElement(); - if (!det) throw std::runtime_error(Form("File: %s, Line: %d\nTGCPRDVariables::fillVariables() - no associated detectorElement", __FILE__, __LINE__)); - Amg::Vector3D pos = prd->globalPosition(); - Amg::Vector2D loc_pos(0., 0.); - - det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); - - m_TGC_PRD_globalPosX.push_back(pos.x()); - m_TGC_PRD_globalPosY.push_back(pos.y()); - m_TGC_PRD_globalPosZ.push_back(pos.z()); - - m_TGC_PRD_localPosX.push_back(loc_pos[0]); - m_TGC_PRD_localPosY.push_back(loc_pos[1]); - - m_TGC_PRD_nPRDs++; - } - } - - ATH_MSG_DEBUG("processed " << m_TGC_PRD_nPRDs << " TGC PRD's"); - - return StatusCode::SUCCESS; -} - -StatusCode TGCPRDVariables::clearVariables() -{ - - m_TGC_PRD_nPRDs = 0; - - m_TGC_PRD_stationName.clear(); - m_TGC_PRD_stationEta.clear(); - m_TGC_PRD_stationPhi.clear(); - m_TGC_PRD_channel.clear(); - m_TGC_PRD_gasGap.clear(); - m_TGC_PRD_isStrip.clear(); - - m_TGC_PRD_globalPosX.clear(); - m_TGC_PRD_globalPosY.clear(); - m_TGC_PRD_globalPosZ.clear(); - - m_TGC_PRD_localPosX.clear(); - m_TGC_PRD_localPosY.clear(); - - return StatusCode::SUCCESS; -} - -StatusCode TGCPRDVariables::initializeVariables() -{ - - if(m_tree) { - m_tree->Branch("PRD_TGC", &m_TGC_PRD_nPRDs, "PRDs_TGC_n/i"); - m_tree->Branch("PRD_TGC_stationName", &m_TGC_PRD_stationName); - m_tree->Branch("PRD_TGC_stationEta", &m_TGC_PRD_stationEta); - m_tree->Branch("PRD_TGC_stationPhi", &m_TGC_PRD_stationPhi); - m_tree->Branch("PRD_TGC_channel", &m_TGC_PRD_channel); - m_tree->Branch("PRD_TGC_gasGap", &m_TGC_PRD_gasGap); - m_tree->Branch("PRD_TGC_isStrip", &m_TGC_PRD_isStrip); - - m_tree->Branch("PRD_TGC_globalPosX", &m_TGC_PRD_globalPosX); - m_tree->Branch("PRD_TGC_globalPosY", &m_TGC_PRD_globalPosY); - m_tree->Branch("PRD_TGC_globalPosZ", &m_TGC_PRD_globalPosZ); - - m_tree->Branch("PRD_TGC_localPosX", &m_TGC_PRD_localPosX); - m_tree->Branch("PRD_TGC_localPosY", &m_TGC_PRD_localPosY); - } - - return StatusCode::SUCCESS; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCPRDVariables.h deleted file mode 100644 index 0590544388b769aef47c42c0918bb0e99ef3d401..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCPRDVariables.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef TGCPRDVARIABLES_H -#define TGCPRDVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/TgcIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class TGCPRDVariables : public ValAlgVariables -{ - public: - TGCPRDVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl) - { - setHelper(idhelper); - } - - ~TGCPRDVariables() = default; - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_TgcIdHelper = dynamic_cast(idhelper); - if(!m_TgcIdHelper) { - throw std::runtime_error("casting IdHelper to TgcIdHelper failed"); - } - } - - void deleteVariables(){}; - StatusCode clearVariables(); - - const TgcIdHelper* m_TgcIdHelper{}; - - int m_TGC_PRD_nPRDs{}; - std::vector m_TGC_PRD_stationName; - std::vector m_TGC_PRD_stationEta; - std::vector m_TGC_PRD_stationPhi; - std::vector m_TGC_PRD_channel; - std::vector m_TGC_PRD_gasGap; - std::vector m_TGC_PRD_isStrip; - - std::vector m_TGC_PRD_globalPosX; - std::vector m_TGC_PRD_globalPosY; - std::vector m_TGC_PRD_globalPosZ; - - std::vector m_TGC_PRD_localPosX; - std::vector m_TGC_PRD_localPosY; - -}; - -#endif // TGCPRDVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCRDOVariables.cxx deleted file mode 100644 index d681258e84ff540f5d5dc217d888a28e60d31f44..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCRDOVariables.cxx +++ /dev/null @@ -1,169 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#include "TGCRDOVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonSimData/MuonSimDataCollection.h" - -#include "MuonRDO/TgcRdoContainer.h" - -#include "MuonReadoutGeometry/TgcReadoutElement.h" - -#include "TTree.h" - -using namespace Muon; - -/** ---------- filling of variables */ -/** ---------- to be called on each evt i.e. execute level of main alg */ -StatusCode TGCRDOVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillTGCRDOVariables()"); - - // clear variables - CHECK( this->clearVariables() ); - - const TgcRdoContainer* rdo_container = nullptr; - - CHECK( m_evtStore->retrieve(rdo_container, m_ContainerName.c_str()) ); - - if(rdo_container->size()==0) ATH_MSG_WARNING(" TGC RDO Container empty "); - - for(const TgcRdo* coll : *rdo_container) { - - for (const TgcRawData* rdo: *coll) { - - bool orFlag = m_tgcCabling->isOredChannel(rdo->subDetectorId(), - rdo->rodId(), - rdo->sswId(), - rdo->slbId(), - rdo->bitpos()); - - Identifier Id; - - bool e_found = m_tgcCabling->getElementIDfromReadoutID(Id, - rdo->subDetectorId(), - rdo->rodId(), - rdo->sswId(), - rdo->slbId(), - rdo->bitpos(), - orFlag); - - if (!e_found) { - ATH_MSG_ERROR("could not find Identifier from TgcRawData"); - return StatusCode::FAILURE; - } - - std::string stName = m_TgcIdHelper->stationNameString(m_TgcIdHelper->stationName(Id)); - int stationEta = m_TgcIdHelper->stationEta(Id); - int stationPhi = m_TgcIdHelper->stationPhi(Id); - int gas_gap = m_TgcIdHelper->gasGap(Id); - int isStrip = m_TgcIdHelper->isStrip(Id); - int channel = m_TgcIdHelper->channel(Id); - - - ATH_MSG_DEBUG( "MicroMegas RDO Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " GasGap [" << gas_gap << "]" - << " isStrip [" << isStrip << "]" - << " ChNr [" << channel << "]" ); - - // to be stored in the ntuple - m_TGC_rdo_stationName.push_back(stName); - m_TGC_rdo_stationEta.push_back(stationEta); - m_TGC_rdo_stationPhi.push_back(stationPhi); - m_TGC_rdo_gas_gap.push_back(gas_gap); - m_TGC_rdo_isStrip.push_back(isStrip); - m_TGC_rdo_channel.push_back(channel); - - const MuonGM::TgcReadoutElement* rdoEl = MuonDetMgr->getTgcReadoutElement(Id); - if (!rdoEl) { - ATH_MSG_ERROR("TGCRDOVariables::fillVariables() - Failed to retrieve TgcReadoutElement for" << __FILE__ << __LINE__ << m_TgcIdHelper->print_to_string(Id).c_str()); - return StatusCode::FAILURE; - } - - Amg::Vector2D localStripPos(0.,0.); - if ( rdoEl->stripPosition(Id,localStripPos) ) { - m_TGC_rdo_localPosX.push_back(localStripPos.x()); - m_TGC_rdo_localPosY.push_back(localStripPos.y()); - ATH_MSG_DEBUG("TGC RDO: local pos.: x=" << localStripPos[0] << ", y=" << localStripPos[1]); - } else { - ATH_MSG_WARNING("TGC RDO: local Strip position not defined"); - } - - // asking the detector element to transform this local to the global position - Amg::Vector3D globalStripPos(0., 0., 0.); - rdoEl->surface(Id).localToGlobal(localStripPos,Amg::Vector3D(0.,0.,0.),globalStripPos); - m_TGC_rdo_globalPosX.push_back(globalStripPos.x()); - m_TGC_rdo_globalPosY.push_back(globalStripPos.y()); - m_TGC_rdo_globalPosZ.push_back(globalStripPos.z()); - - // rdo counter for the ntuple - m_TGC_nrdo++; - } - } - - ATH_MSG_DEBUG("processed " << m_TGC_nrdo << " MicroMegas rdo"); - return StatusCode::SUCCESS; -} - - -/** ---------- clearing of variables */ -/** ---------- to be called inside filling method before filling starts */ -StatusCode TGCRDOVariables::clearVariables() -{ - m_TGC_nrdo = 0; - - m_TGC_rdo_stationName.clear(); - m_TGC_rdo_stationEta.clear(); - m_TGC_rdo_stationPhi.clear(); - m_TGC_rdo_gas_gap.clear(); - m_TGC_rdo_isStrip.clear(); - m_TGC_rdo_channel.clear(); - m_TGC_rdo_localPosX.clear(); - m_TGC_rdo_localPosY.clear(); - m_TGC_rdo_globalPosX.clear(); - m_TGC_rdo_globalPosY.clear(); - m_TGC_rdo_globalPosZ.clear(); - - return StatusCode::SUCCESS; -} - - -/** ---------- creating variables and associate them to branches */ -/** ---------- to be called on initialization level of main alg */ -StatusCode TGCRDOVariables::initializeVariables() -{ - - if(m_tree) { - m_tree->Branch("RDO_TGC_n", &m_TGC_nrdo); - m_tree->Branch("RDO_TGC_stationName", &m_TGC_rdo_stationName); - m_tree->Branch("RDO_TGC_stationEta", &m_TGC_rdo_stationEta); - m_tree->Branch("RDO_TGC_stationPhi", &m_TGC_rdo_stationPhi); - m_tree->Branch("RDO_TGC_gas_gap", &m_TGC_rdo_gas_gap); - m_tree->Branch("RDO_TGC_isStrip", &m_TGC_rdo_isStrip); - m_tree->Branch("RDO_TGC_channel", &m_TGC_rdo_channel); - m_tree->Branch("RDO_TGC_localPosX", &m_TGC_rdo_localPosX); - m_tree->Branch("RDO_TGC_localPosY", &m_TGC_rdo_localPosY); - m_tree->Branch("RDO_TGC_globalPosX", &m_TGC_rdo_globalPosX); - m_tree->Branch("RDO_TGC_globalPosY", &m_TGC_rdo_globalPosY); - m_tree->Branch("RDO_TGC_globalPosZ", &m_TGC_rdo_globalPosZ); - - } - return StatusCode::SUCCESS; -} - -TGCRDOVariables::TGCRDOVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - const ITGCcablingSvc* cabling_svc, - TTree* tree, - const std::string& containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_tgcCabling{cabling_svc} { - setHelper(idhelper); - - } \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCRDOVariables.h deleted file mode 100644 index 9df4710f69de3f4e1dbcbb17602041d95dcecb60..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCRDOVariables.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef TGCRDOVARIABLES_H -#define TGCRDOVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/TgcIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include "TGCcablingInterface/ITGCcablingSvc.h" - -#include - -class TGCRDOVariables : public ValAlgVariables -{ - public: - TGCRDOVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - const ITGCcablingSvc* cabling_svc, - TTree* tree, - const std::string& containername, - MSG::Level msglvl); - - ~TGCRDOVariables() = default; - - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - void deleteVariables(){} - void setHelper(const MuonIdHelper* idhelper){ - m_TgcIdHelper = dynamic_cast(idhelper); - if(!m_TgcIdHelper) { - throw std::runtime_error("Casting IdHelper to TgcIdHelper failed"); - } - } - - - StatusCode clearVariables(); - - const TgcIdHelper* m_TgcIdHelper{nullptr}; - const ITGCcablingSvc* m_tgcCabling{nullptr}; - - int m_TGC_nrdo{0}; - std::vector m_TGC_rdo_stationName{}; - std::vector m_TGC_rdo_stationEta{}; - std::vector m_TGC_rdo_stationPhi{}; - std::vector m_TGC_rdo_gas_gap{}; - std::vector m_TGC_rdo_isStrip{}; - std::vector m_TGC_rdo_channel{}; - std::vector m_TGC_rdo_localPosX{}; - std::vector m_TGC_rdo_localPosY{}; - std::vector m_TGC_rdo_globalPosX{}; - std::vector m_TGC_rdo_globalPosY{}; - std::vector m_TGC_rdo_globalPosZ{}; - - -}; - -#endif // TGCRDOVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx deleted file mode 100644 index ea0e102be3c345f7ec67f53efa2097d2fba756bf..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx +++ /dev/null @@ -1,386 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "sTGCDigitVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonDigitContainer/sTgcDigitContainer.h" -#include "MuonDigitContainer/sTgcDigit.h" - -#include "MuonReadoutGeometry/sTgcReadoutElement.h" - -#include "MuonDigitContainer/sTgcDigitCollection.h" - -#include "TTree.h" -#include // for Form - -/** ---------- filling of variables */ -/** ---------- to be called on each evt i.e. execute level of main alg */ -StatusCode sTGCDigitVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG(" do fillNSWsTGCDigitVariables()"); - CHECK( this->clearVariables() ); - - const sTgcDigitContainer* nsw_sTgcDigitContainer = nullptr; - CHECK( m_evtStore->retrieve(nsw_sTgcDigitContainer, m_ContainerName.c_str()) ); - - sTgcDigitContainer::const_iterator it = nsw_sTgcDigitContainer->begin(); - sTgcDigitContainer::const_iterator it_e = nsw_sTgcDigitContainer->end(); - ATH_MSG_DEBUG("retrieved sTGC Digit Container with size "<digit_size()); - - if(nsw_sTgcDigitContainer->size()==0) ATH_MSG_WARNING(" sTGC Digit Continer empty "); - for(; it!=it_e; ++it) { - const sTgcDigitCollection* coll = *it; - ATH_MSG_DEBUG( "processing collection with size " << coll->size() ); - for (unsigned int digitNum=0; digitNumsize(); digitNum++) { - const sTgcDigit* digit = coll->at(digitNum); - Identifier Id = digit->identify(); - - std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(Id)); - int stationEta = m_sTgcIdHelper->stationEta(Id); - int stationPhi = m_sTgcIdHelper->stationPhi(Id); - int multiplet = m_sTgcIdHelper->multilayer(Id); - int gas_gap = m_sTgcIdHelper->gasGap(Id); - int channel = m_sTgcIdHelper->channel(Id); - int stationEtaMin = m_sTgcIdHelper->stationEtaMin(Id); - int stationEtaMax = m_sTgcIdHelper->stationEtaMax(Id); - int stationPhiMin = m_sTgcIdHelper->stationPhiMin(Id); - int stationPhiMax = m_sTgcIdHelper->stationPhiMax(Id); - int gas_gapMin = m_sTgcIdHelper->gasGapMin(Id); - int gas_gapMax = m_sTgcIdHelper->gasGapMax(Id); - int padEta = m_sTgcIdHelper->padEta(Id); - int padPhi = m_sTgcIdHelper->padPhi(Id); - int NofMultilayers = m_sTgcIdHelper->numberOfMultilayers(Id); - int multilayerMin = m_sTgcIdHelper->multilayerMin(Id); - int multilayerMax = m_sTgcIdHelper->multilayerMax(Id); - int channelTypeMin = m_sTgcIdHelper->channelTypeMin(Id); - int channelTypeMax = m_sTgcIdHelper->channelTypeMax(Id); - int channelMin = m_sTgcIdHelper->channelMin(Id); - int channelMax = m_sTgcIdHelper->channelMax(Id); - int channelType = m_sTgcIdHelper->channelType(Id); - - ATH_MSG_DEBUG( "sTGC Digit Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " ChNr [" << channel << "]" - << " Station EtaMin [" << stationEtaMin << "]" - << " Station EtaMax [" << stationEtaMax << "]" - << " Station PhiMin [" << stationPhiMin << "]" - << " Station PhiMax [" << stationPhiMax << "]"); - - int isSmall = stName[2] == 'S'; - const MuonGM::sTgcReadoutElement* rdoEl = MuonDetMgr->getsTgcReadoutElement(Id); - if (!rdoEl) throw std::runtime_error(Form("File: %s, Line: %d\nsTGCDigitVariables::fillVariables() - Failed to retrieve sTgcReadoutElement for isSmall=%d, stationEta=%d, stationPhi=%d, multiplet=%d", __FILE__, __LINE__, isSmall, stationEta, stationPhi, multiplet)); - int channelNumber = 0; - Amg::Vector3D gpos(0.,0.,0.); - Amg::Vector2D lpos(0.,0.); - - rdoEl->stripPosition(Id,lpos); - rdoEl->surface(Id).localToGlobal(lpos, gpos,gpos); - - std::vector local_pad_corners; - rdoEl->padCorners(Id,local_pad_corners); - std::vector global_pad_corners; - - for(auto& local_corner : local_pad_corners) { - Amg::Vector3D global_corner; - rdoEl->surface(Id).localToGlobal(local_corner, global_corner, global_corner); - global_pad_corners.push_back(global_corner); - } - - - m_NSWsTGC_dig_globalPosX->push_back( gpos.x() ); - m_NSWsTGC_dig_globalPosY->push_back( gpos.y() ); - m_NSWsTGC_dig_globalPosZ->push_back( gpos.z() ); - m_NSWsTGC_dig_localPosX->push_back( lpos.x() ); - m_NSWsTGC_dig_localPosY->push_back( lpos.y() ); - for(auto corner : global_pad_corners) { - if(channelType ==0 ) { - m_NSWsTGC_dig_PadglobalCornerPosX->push_back(corner.x()); - m_NSWsTGC_dig_PadglobalCornerPosY->push_back(corner.y()); - m_NSWsTGC_dig_PadglobalCornerPosZ->push_back(corner.z()); - } - } - channelNumber = rdoEl->stripNumber(lpos,Id); - m_NSWsTGC_dig_channelPosX->push_back( lpos.x() ); - m_NSWsTGC_dig_channelPosY->push_back( lpos.y() ); - - m_NSWsTGC_dig_channel_type->push_back(channelType); - m_NSWsTGC_dig_stationName->push_back(stName); - m_NSWsTGC_dig_stationEta->push_back(stationEta); - m_NSWsTGC_dig_stationPhi->push_back(stationPhi); - m_NSWsTGC_dig_multiplet->push_back(multiplet); - m_NSWsTGC_dig_gas_gap->push_back(gas_gap); - m_NSWsTGC_dig_channel->push_back(channel); - m_NSWsTGC_dig_stationEtaMin->push_back(stationEtaMin); - m_NSWsTGC_dig_stationEtaMax->push_back(stationEtaMax); - m_NSWsTGC_dig_stationPhiMin->push_back(stationPhiMin); - m_NSWsTGC_dig_stationPhiMax->push_back(stationPhiMax); - m_NSWsTGC_dig_gas_gapMin->push_back(gas_gapMin); - m_NSWsTGC_dig_gas_gapMax->push_back(gas_gapMax); - m_NSWsTGC_dig_padEta->push_back(padEta); - m_NSWsTGC_dig_padPhi->push_back(padPhi); - m_NSWsTGC_dig_numberOfMultilayers->push_back(NofMultilayers); - m_NSWsTGC_dig_multilayerMin->push_back(multilayerMin); - m_NSWsTGC_dig_multilayerMax->push_back(multilayerMax); - m_NSWsTGC_dig_channelTypeMin->push_back(channelTypeMin); - m_NSWsTGC_dig_channelTypeMax->push_back(channelTypeMax); - m_NSWsTGC_dig_channelMin->push_back(channelMin); - m_NSWsTGC_dig_channelMax->push_back(channelMax); - m_NSWsTGC_dig_channelNumber->push_back(channelNumber); - - m_NSWsTGC_dig_bctag->push_back(digit->bcTag()); - m_NSWsTGC_dig_time->push_back(digit->time()); - m_NSWsTGC_dig_charge->push_back(digit->charge()); - m_NSWsTGC_dig_isDead->push_back(digit->isDead()); - m_NSWsTGC_dig_isPileup->push_back(digit->isPileup()); - - if(channelType == 0) m_NSWsTGC_nPadDigits++; - m_NSWsTGC_nDigits++; - } - } - ATH_MSG_DEBUG(" finished fillNSWsTGCDigitVariables()"); - return StatusCode::SUCCESS; -} - -/** ---------- clearing of variables */ -/** ---------- to be called inside filling method before filling starts */ -StatusCode sTGCDigitVariables::clearVariables() -{ - - m_NSWsTGC_nDigits = 0; - m_NSWsTGC_nPadDigits = 0; - m_NSWsTGC_dig_time->clear(); - m_NSWsTGC_dig_bctag->clear(); - m_NSWsTGC_dig_charge->clear(); - m_NSWsTGC_dig_isDead->clear(); - m_NSWsTGC_dig_isPileup->clear(); - m_NSWsTGC_dig_stationName->clear(); - m_NSWsTGC_dig_stationEta->clear(); - m_NSWsTGC_dig_stationPhi->clear(); - m_NSWsTGC_dig_multiplet->clear(); - m_NSWsTGC_dig_gas_gap->clear(); - m_NSWsTGC_dig_channel_type->clear(); - m_NSWsTGC_dig_channel->clear(); - m_NSWsTGC_dig_stationEtaMin->clear(); - m_NSWsTGC_dig_stationEtaMax->clear(); - m_NSWsTGC_dig_stationPhiMin->clear(); - m_NSWsTGC_dig_stationPhiMax->clear(); - m_NSWsTGC_dig_gas_gapMin->clear(); - m_NSWsTGC_dig_gas_gapMax->clear(); - m_NSWsTGC_dig_padEta->clear(); - m_NSWsTGC_dig_padPhi->clear(); - m_NSWsTGC_dig_numberOfMultilayers->clear(); - m_NSWsTGC_dig_multilayerMin->clear(); - m_NSWsTGC_dig_multilayerMax->clear(); - m_NSWsTGC_dig_channelTypeMin->clear(); - m_NSWsTGC_dig_channelTypeMax->clear(); - m_NSWsTGC_dig_channelMin->clear(); - m_NSWsTGC_dig_channelMax->clear(); - m_NSWsTGC_dig_channelNumber->clear(); - m_NSWsTGC_dig_channelPosX->clear(); - m_NSWsTGC_dig_channelPosY->clear(); - m_NSWsTGC_dig_localPosX->clear(); - m_NSWsTGC_dig_localPosY->clear(); - m_NSWsTGC_dig_globalPosX->clear(); - m_NSWsTGC_dig_globalPosY->clear(); - m_NSWsTGC_dig_globalPosZ->clear(); - m_NSWsTGC_dig_PadglobalCornerPosX->clear(); - m_NSWsTGC_dig_PadglobalCornerPosY->clear(); - m_NSWsTGC_dig_PadglobalCornerPosZ->clear(); - - return StatusCode::SUCCESS; -} - - -/** ---------- creating variables and associate them to branches */ -/** ---------- to be called on initialization level of main alg */ -StatusCode sTGCDigitVariables::initializeVariables() -{ - - m_NSWsTGC_nDigits = 0; - m_NSWsTGC_nPadDigits = 0; - m_NSWsTGC_dig_time = new std::vector(); - m_NSWsTGC_dig_bctag = new std::vector(); - m_NSWsTGC_dig_charge = new std::vector(); - m_NSWsTGC_dig_isDead = new std::vector(); - m_NSWsTGC_dig_isPileup = new std::vector(); - - m_NSWsTGC_dig_stationName = new std::vector(); - m_NSWsTGC_dig_stationEta = new std::vector(); - m_NSWsTGC_dig_stationPhi = new std::vector(); - m_NSWsTGC_dig_multiplet = new std::vector(); - m_NSWsTGC_dig_gas_gap = new std::vector(); - m_NSWsTGC_dig_channel_type = new std::vector(); - m_NSWsTGC_dig_channel = new std::vector(); - - m_NSWsTGC_dig_stationEtaMin = new std::vector(); - m_NSWsTGC_dig_stationEtaMax = new std::vector(); - m_NSWsTGC_dig_stationPhiMin = new std::vector(); - m_NSWsTGC_dig_stationPhiMax = new std::vector(); - m_NSWsTGC_dig_gas_gapMin = new std::vector(); - m_NSWsTGC_dig_gas_gapMax = new std::vector(); - m_NSWsTGC_dig_padEta = new std::vector(); - m_NSWsTGC_dig_padPhi = new std::vector(); - - m_NSWsTGC_dig_numberOfMultilayers = new std::vector(); - m_NSWsTGC_dig_multilayerMin = new std::vector(); - m_NSWsTGC_dig_multilayerMax = new std::vector(); - m_NSWsTGC_dig_channelTypeMin = new std::vector(); - m_NSWsTGC_dig_channelTypeMax = new std::vector(); - m_NSWsTGC_dig_channelMin = new std::vector(); - m_NSWsTGC_dig_channelMax = new std::vector(); - m_NSWsTGC_dig_channelNumber = new std::vector(); - - m_NSWsTGC_dig_channelPosX = new std::vector(); - m_NSWsTGC_dig_channelPosY = new std::vector(); - m_NSWsTGC_dig_localPosX = new std::vector(); - m_NSWsTGC_dig_localPosY = new std::vector(); - m_NSWsTGC_dig_globalPosX = new std::vector(); - m_NSWsTGC_dig_globalPosY = new std::vector(); - m_NSWsTGC_dig_globalPosZ = new std::vector(); - m_NSWsTGC_dig_PadglobalCornerPosX = new std::vector(); - m_NSWsTGC_dig_PadglobalCornerPosY = new std::vector(); - m_NSWsTGC_dig_PadglobalCornerPosZ = new std::vector(); - - if(m_tree) { - ATH_MSG_DEBUG("sTGC digit: init m_tree "); - m_tree->Branch("Digits_sTGC", &m_NSWsTGC_nDigits, "Digits_sTGC_n/i"); - m_tree->Branch("Digits_sTGC_Pad_Digits", &m_NSWsTGC_nPadDigits, "Digits_sTGC_Pad_Digits_n/i"); - m_tree->Branch("Digits_sTGC_time", "std::vector< double >", &m_NSWsTGC_dig_time); - m_tree->Branch("Digits_sTGC_bctag", "std::vector< int >", &m_NSWsTGC_dig_bctag); - m_tree->Branch("Digits_sTGC_charge", "std::vector< double >", &m_NSWsTGC_dig_charge); - m_tree->Branch("Digits_sTGC_isDead", "std::vector< bool >", &m_NSWsTGC_dig_isDead); - m_tree->Branch("Digits_sTGC_isPileup", "std::vector< bool >", &m_NSWsTGC_dig_isPileup); - m_tree->Branch("Digits_sTGC_stationName", &m_NSWsTGC_dig_stationName); - m_tree->Branch("Digits_sTGC_stationEta", &m_NSWsTGC_dig_stationEta); - m_tree->Branch("Digits_sTGC_stationPhi", &m_NSWsTGC_dig_stationPhi); - m_tree->Branch("Digits_sTGC_multiplet", &m_NSWsTGC_dig_multiplet); - m_tree->Branch("Digits_sTGC_gas_gap", &m_NSWsTGC_dig_gas_gap); - m_tree->Branch("Digits_sTGC_channel_type",&m_NSWsTGC_dig_channel_type); - m_tree->Branch("Digits_sTGC_channel", &m_NSWsTGC_dig_channel); - m_tree->Branch("Digits_sTGC_stationEtaMin", &m_NSWsTGC_dig_stationEtaMin); - m_tree->Branch("Digits_sTGC_stationEtaMax", &m_NSWsTGC_dig_stationEtaMax); - m_tree->Branch("Digits_sTGC_stationPhiMin", &m_NSWsTGC_dig_stationPhiMin); - m_tree->Branch("Digits_sTGC_stationPhiMax", &m_NSWsTGC_dig_stationPhiMax); - m_tree->Branch("Digits_sTGC_gas_gapMin", &m_NSWsTGC_dig_gas_gapMin); - m_tree->Branch("Digits_sTGC_gas_gapMax", &m_NSWsTGC_dig_gas_gapMax); - m_tree->Branch("Digits_sTGC_padEta", &m_NSWsTGC_dig_padEta); - m_tree->Branch("Digits_sTGC_padPhi", &m_NSWsTGC_dig_padPhi); - m_tree->Branch("Digits_sTGC_numberOfMultilayers", &m_NSWsTGC_dig_numberOfMultilayers); - m_tree->Branch("Digits_sTGC_multilayerMin", &m_NSWsTGC_dig_multilayerMin); - m_tree->Branch("Digits_sTGC_multilayerMax", &m_NSWsTGC_dig_multilayerMax); - m_tree->Branch("Digits_sTGC_channelTypeMin", &m_NSWsTGC_dig_channelTypeMin); - m_tree->Branch("Digits_sTGC_channelTypeMax", &m_NSWsTGC_dig_channelTypeMax); - m_tree->Branch("Digits_sTGC_channelMin", &m_NSWsTGC_dig_channelMin); - m_tree->Branch("Digits_sTGC_channelMax", &m_NSWsTGC_dig_channelMax); - m_tree->Branch("Digits_sTGC_channelNumber", &m_NSWsTGC_dig_channelNumber); - - m_tree->Branch("Digits_sTGC_channelPosX", "std::vector< double >", &m_NSWsTGC_dig_channelPosX); - m_tree->Branch("Digits_sTGC_channelPosY", "std::vector< double >", &m_NSWsTGC_dig_channelPosY); - m_tree->Branch("Digits_sTGC_localPosX", "std::vector< double >", &m_NSWsTGC_dig_localPosX); - m_tree->Branch("Digits_sTGC_localPosY", "std::vector< double >", &m_NSWsTGC_dig_localPosY); - m_tree->Branch("Digits_sTGC_globalPosX", "std::vector< double >", &m_NSWsTGC_dig_globalPosX); - m_tree->Branch("Digits_sTGC_globalPosY", "std::vector< double >", &m_NSWsTGC_dig_globalPosY); - m_tree->Branch("Digits_sTGC_globalPosZ", "std::vector< double >", &m_NSWsTGC_dig_globalPosZ); - m_tree->Branch("Digits_sTGC_PadglobalCornerPosX", "std::vector< double >", &m_NSWsTGC_dig_PadglobalCornerPosX); - m_tree->Branch("Digits_sTGC_PadglobalCornerPosY", "std::vector< double >", &m_NSWsTGC_dig_PadglobalCornerPosY); - m_tree->Branch("Digits_sTGC_PadglobalCornerPosZ", "std::vector< double >", &m_NSWsTGC_dig_PadglobalCornerPosZ); - } - - return StatusCode::SUCCESS; -} - - -/** ---------- freeing resources and resetting pointers */ -/** ---------- to be called on finalize level of main alg */ -void sTGCDigitVariables::deleteVariables() -{ - - delete m_NSWsTGC_dig_stationName; - delete m_NSWsTGC_dig_stationEta; - delete m_NSWsTGC_dig_stationPhi; - delete m_NSWsTGC_dig_multiplet; - delete m_NSWsTGC_dig_gas_gap; - delete m_NSWsTGC_dig_channel_type; - delete m_NSWsTGC_dig_channel; - delete m_NSWsTGC_dig_stationEtaMin; - delete m_NSWsTGC_dig_stationEtaMax; - delete m_NSWsTGC_dig_stationPhiMin; - delete m_NSWsTGC_dig_stationPhiMax; - delete m_NSWsTGC_dig_gas_gapMin; - delete m_NSWsTGC_dig_gas_gapMax; - delete m_NSWsTGC_dig_padEta; - delete m_NSWsTGC_dig_padPhi; - delete m_NSWsTGC_dig_numberOfMultilayers; - delete m_NSWsTGC_dig_multilayerMin; - delete m_NSWsTGC_dig_multilayerMax; - delete m_NSWsTGC_dig_channelTypeMin; - delete m_NSWsTGC_dig_channelTypeMax; - delete m_NSWsTGC_dig_channelMin; - delete m_NSWsTGC_dig_channelMax; - delete m_NSWsTGC_dig_channelNumber; - delete m_NSWsTGC_dig_channelPosX; - delete m_NSWsTGC_dig_channelPosY; - delete m_NSWsTGC_dig_localPosX; - delete m_NSWsTGC_dig_localPosY; - delete m_NSWsTGC_dig_globalPosX; - delete m_NSWsTGC_dig_globalPosY; - delete m_NSWsTGC_dig_globalPosZ; - delete m_NSWsTGC_dig_PadglobalCornerPosX; - delete m_NSWsTGC_dig_PadglobalCornerPosY; - delete m_NSWsTGC_dig_PadglobalCornerPosZ; - - delete m_NSWsTGC_dig_time; - delete m_NSWsTGC_dig_bctag; - delete m_NSWsTGC_dig_charge; - delete m_NSWsTGC_dig_isDead; - delete m_NSWsTGC_dig_isPileup; - - - m_NSWsTGC_nDigits = 0; - m_NSWsTGC_nPadDigits = 0; - m_NSWsTGC_dig_time = nullptr; - m_NSWsTGC_dig_bctag = nullptr; - m_NSWsTGC_dig_charge = nullptr; - m_NSWsTGC_dig_isDead = nullptr; - m_NSWsTGC_dig_isPileup = nullptr; - m_NSWsTGC_dig_stationName = nullptr; - m_NSWsTGC_dig_stationEta = nullptr; - m_NSWsTGC_dig_stationPhi = nullptr; - m_NSWsTGC_dig_multiplet = nullptr; - m_NSWsTGC_dig_gas_gap = nullptr; - m_NSWsTGC_dig_channel_type = nullptr; - m_NSWsTGC_dig_channel = nullptr; - m_NSWsTGC_dig_stationEtaMin = nullptr; - m_NSWsTGC_dig_stationEtaMax = nullptr; - m_NSWsTGC_dig_stationPhiMin = nullptr; - m_NSWsTGC_dig_stationPhiMax = nullptr; - m_NSWsTGC_dig_gas_gapMin = nullptr; - m_NSWsTGC_dig_gas_gapMax = nullptr; - m_NSWsTGC_dig_padEta = nullptr; - m_NSWsTGC_dig_padPhi = nullptr; - m_NSWsTGC_dig_numberOfMultilayers = nullptr; - m_NSWsTGC_dig_multilayerMin = nullptr; - m_NSWsTGC_dig_multilayerMax = nullptr; - m_NSWsTGC_dig_channelTypeMin = nullptr; - m_NSWsTGC_dig_channelTypeMax = nullptr; - m_NSWsTGC_dig_channelMin = nullptr; - m_NSWsTGC_dig_channelMax = nullptr; - m_NSWsTGC_dig_channelNumber = nullptr; - m_NSWsTGC_dig_channelPosX = nullptr; - m_NSWsTGC_dig_channelPosY = nullptr; - m_NSWsTGC_dig_localPosX = nullptr; - m_NSWsTGC_dig_localPosY = nullptr; - m_NSWsTGC_dig_globalPosX = nullptr; - m_NSWsTGC_dig_globalPosY = nullptr; - m_NSWsTGC_dig_globalPosZ = nullptr; - m_NSWsTGC_dig_PadglobalCornerPosX = nullptr; - m_NSWsTGC_dig_PadglobalCornerPosY = nullptr; - m_NSWsTGC_dig_PadglobalCornerPosZ = nullptr; - - return; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.h deleted file mode 100644 index 07dbab23a59bf2775b3c08c8108f78e903477bf6..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef STGCDIGITVARIABLES_H -#define STGCDIGITVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/sTgcIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class sTGCDigitVariables : public ValAlgVariables -{ - public: - sTGCDigitVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_NSWsTGC_nDigits(0), - m_NSWsTGC_nPadDigits(0), - m_NSWsTGC_dig_time(0), - m_NSWsTGC_dig_bctag(0), - m_NSWsTGC_dig_charge(0), - m_NSWsTGC_dig_isDead(0), - m_NSWsTGC_dig_isPileup(0), - m_NSWsTGC_dig_stationName(0), - m_NSWsTGC_dig_stationEta(0), - m_NSWsTGC_dig_stationPhi(0), - m_NSWsTGC_dig_multiplet(0), - m_NSWsTGC_dig_gas_gap(0), - m_NSWsTGC_dig_channel_type(0), - m_NSWsTGC_dig_channel(0), - m_NSWsTGC_dig_stationEtaMin(0), - m_NSWsTGC_dig_stationEtaMax(0), - m_NSWsTGC_dig_stationPhiMin(0), - m_NSWsTGC_dig_stationPhiMax(0), - m_NSWsTGC_dig_gas_gapMin(0), - m_NSWsTGC_dig_gas_gapMax(0), - m_NSWsTGC_dig_padEta(0), - m_NSWsTGC_dig_padPhi(0), - m_NSWsTGC_dig_numberOfMultilayers(0), - m_NSWsTGC_dig_multilayerMin(0), - m_NSWsTGC_dig_multilayerMax(0), - m_NSWsTGC_dig_channelTypeMin(0), - m_NSWsTGC_dig_channelTypeMax(0), - m_NSWsTGC_dig_channelMin(0), - m_NSWsTGC_dig_channelMax(0), - m_NSWsTGC_dig_channelNumber(0), - m_NSWsTGC_dig_channelPosX(0), - m_NSWsTGC_dig_channelPosY(0), - m_NSWsTGC_dig_localPosX(0), - m_NSWsTGC_dig_localPosY(0), - m_NSWsTGC_dig_globalPosX(0), - m_NSWsTGC_dig_globalPosY(0), - m_NSWsTGC_dig_globalPosZ(0), - m_NSWsTGC_dig_PadglobalCornerPosX(0), - m_NSWsTGC_dig_PadglobalCornerPosY(0), - m_NSWsTGC_dig_PadglobalCornerPosZ(0) - { - setHelper(idhelper); - } - - ~sTGCDigitVariables() - { - deleteVariables(); - } - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_sTgcIdHelper = dynamic_cast(idhelper); - if(m_sTgcIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to sTgcIdhelper failed"); - throw std::runtime_error("Casting error in sTGCDigitVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const sTgcIdHelper* m_sTgcIdHelper{}; - - int m_NSWsTGC_nDigits{}; - int m_NSWsTGC_nPadDigits{}; - std::vector *m_NSWsTGC_dig_time; - std::vector *m_NSWsTGC_dig_bctag; - std::vector *m_NSWsTGC_dig_charge; - std::vector *m_NSWsTGC_dig_isDead; - std::vector *m_NSWsTGC_dig_isPileup; - std::vector *m_NSWsTGC_dig_stationName; - std::vector *m_NSWsTGC_dig_stationEta; - std::vector *m_NSWsTGC_dig_stationPhi; - std::vector *m_NSWsTGC_dig_multiplet; - std::vector *m_NSWsTGC_dig_gas_gap; - std::vector *m_NSWsTGC_dig_channel_type; - std::vector *m_NSWsTGC_dig_channel; - std::vector *m_NSWsTGC_dig_stationEtaMin; - std::vector *m_NSWsTGC_dig_stationEtaMax; - std::vector *m_NSWsTGC_dig_stationPhiMin; - std::vector *m_NSWsTGC_dig_stationPhiMax; - std::vector *m_NSWsTGC_dig_gas_gapMin; - std::vector *m_NSWsTGC_dig_gas_gapMax; - std::vector *m_NSWsTGC_dig_padEta; - std::vector *m_NSWsTGC_dig_padPhi; - std::vector *m_NSWsTGC_dig_numberOfMultilayers; - std::vector *m_NSWsTGC_dig_multilayerMin; - std::vector *m_NSWsTGC_dig_multilayerMax; - std::vector *m_NSWsTGC_dig_channelTypeMin; - std::vector *m_NSWsTGC_dig_channelTypeMax; - std::vector *m_NSWsTGC_dig_channelMin; - std::vector *m_NSWsTGC_dig_channelMax; - std::vector *m_NSWsTGC_dig_channelNumber; - - std::vector< double > *m_NSWsTGC_dig_channelPosX; - std::vector< double > *m_NSWsTGC_dig_channelPosY; - std::vector< double > *m_NSWsTGC_dig_localPosX; - std::vector< double > *m_NSWsTGC_dig_localPosY; - std::vector< double > *m_NSWsTGC_dig_globalPosX; - std::vector< double > *m_NSWsTGC_dig_globalPosY; - std::vector< double > *m_NSWsTGC_dig_globalPosZ; - std::vector< double > *m_NSWsTGC_dig_PadglobalCornerPosX; - std::vector< double > *m_NSWsTGC_dig_PadglobalCornerPosY; - std::vector< double > *m_NSWsTGC_dig_PadglobalCornerPosZ; - - -}; - -#endif // STGCDIGITVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.cxx deleted file mode 100644 index db22c4ab3776f4f2cac2bfd7aabec5db084ab9c3..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.cxx +++ /dev/null @@ -1,209 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "sTGCPRDVariables.h" -#include "AthenaKernel/errorcheck.h" -#include "MuonSimData/MuonSimDataCollection.h" -#include "MuonPrepRawData/sTgcPrepDataContainer.h" - -#include "TTree.h" -#include // for Form - -StatusCode sTGCPRDVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillNSWsTGCPRDVariables()"); - ATH_MSG_VERBOSE("MuonDetectorManager from Conditions Store accessed" << MuonDetMgr); - CHECK( this->clearVariables() ); - - const Muon::sTgcPrepDataContainer *nsw_sTgcPrepDataContainer = nullptr; - CHECK( m_evtStore->retrieve(nsw_sTgcPrepDataContainer, m_ContainerName.c_str()) ); - - if(nsw_sTgcPrepDataContainer->size()==0) ATH_MSG_WARNING(" sTgc PRD Container empty "); - - for(const Muon::sTgcPrepDataCollection* coll : *nsw_sTgcPrepDataContainer ) { - - for (unsigned int item=0; itemsize(); item++) { - const Muon::sTgcPrepData* prd = coll->at(item); - Identifier Id = prd->identify(); - - std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(Id)); - int stationEta = m_sTgcIdHelper->stationEta(Id); - int stationPhi = m_sTgcIdHelper->stationPhi(Id); - int multiplet = m_sTgcIdHelper->multilayer(Id); - int gas_gap = m_sTgcIdHelper->gasGap(Id); - int channel_type = m_sTgcIdHelper->channelType(Id); - int channel = m_sTgcIdHelper->channel(Id); - int charge = prd->charge(); - uint16_t bcTag = prd->getBcBitMap(); - - ATH_MSG_DEBUG( "sTGC PRD Offline id: Station Name [" << stName << "]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " Type [" << channel_type << "]" - << " ChNr [" << channel << "]" ); - - m_NSWsTGC_prd_stationName->push_back(stName); - m_NSWsTGC_prd_stationEta->push_back(stationEta); - m_NSWsTGC_prd_stationPhi->push_back(stationPhi); - m_NSWsTGC_prd_multiplet->push_back(multiplet); - m_NSWsTGC_prd_gas_gap->push_back(gas_gap); - m_NSWsTGC_prd_channel_type->push_back(channel_type); - m_NSWsTGC_prd_channel->push_back(channel); - m_NSWsTGC_prd_charge->push_back(charge); - m_NSWsTGC_prd_bcTag->push_back(bcTag); - - const MuonGM::sTgcReadoutElement* det = prd->detectorElement(); - if (!det) throw std::runtime_error(Form("File: %s, Line: %d\nsTGCPRDVariables::fillVariables() - no associated detectorElement", __FILE__, __LINE__)); - Amg::Vector3D pos = prd->globalPosition(); - Amg::Vector2D loc_pos(0., 0.); - det->surface(Id).globalToLocal(pos, Amg::Vector3D(0., 0., 0.), loc_pos); - - double err_x = prd->localCovariance()(0,0); - double err_y = ( prd->localCovariance().rows()==2)? prd->localCovariance()(1,1) : 0.; - - ATH_MSG_DEBUG( "sTgc PRD local pos.: x=" << std::setw(6) << std::setprecision(2) << loc_pos[0] - << ", ex=" << std::setw(6) << std::setprecision(2) << err_x - << ", y=" << std::setw(6) << std::setprecision(2) << loc_pos[1] - << ", ey=" << std::setw(6) << std::setprecision(2) << err_y ); - - m_NSWsTGC_prd_globalPosX->push_back(pos.x()); - m_NSWsTGC_prd_globalPosY->push_back(pos.y()); - m_NSWsTGC_prd_globalPosZ->push_back(pos.z()); - - m_NSWsTGC_prd_localPosX->push_back(loc_pos[0]); - m_NSWsTGC_prd_localPosY->push_back(loc_pos[1]); - m_NSWsTGC_prd_covMatrix_1_1->push_back(err_x); - m_NSWsTGC_prd_covMatrix_2_2->push_back(err_y); - - m_NSWsTGC_nPRDs++; - } - } - - ATH_MSG_DEBUG("processed " << m_NSWsTGC_nPRDs << " sTGC PRD's"); - - return StatusCode::SUCCESS; -} - -void sTGCPRDVariables::deleteVariables() -{ - delete m_NSWsTGC_prd_stationName; - delete m_NSWsTGC_prd_stationEta; - delete m_NSWsTGC_prd_stationPhi; - delete m_NSWsTGC_prd_multiplet; - delete m_NSWsTGC_prd_gas_gap; - delete m_NSWsTGC_prd_channel_type; - delete m_NSWsTGC_prd_channel; - delete m_NSWsTGC_prd_charge; - delete m_NSWsTGC_prd_bcTag; - - delete m_NSWsTGC_prd_globalPosX; - delete m_NSWsTGC_prd_globalPosY; - delete m_NSWsTGC_prd_globalPosZ; - - delete m_NSWsTGC_prd_localPosX; - delete m_NSWsTGC_prd_localPosY; - delete m_NSWsTGC_prd_covMatrix_1_1; - delete m_NSWsTGC_prd_covMatrix_2_2; - - m_NSWsTGC_nPRDs = 0; - m_NSWsTGC_prd_stationName = nullptr; - m_NSWsTGC_prd_stationEta = nullptr; - m_NSWsTGC_prd_stationPhi = nullptr; - m_NSWsTGC_prd_multiplet = nullptr; - m_NSWsTGC_prd_gas_gap = nullptr; - m_NSWsTGC_prd_channel_type = nullptr; - m_NSWsTGC_prd_channel = nullptr; - m_NSWsTGC_prd_charge = nullptr; - m_NSWsTGC_prd_bcTag = nullptr; - - m_NSWsTGC_prd_globalPosX = nullptr; - m_NSWsTGC_prd_globalPosY = nullptr; - m_NSWsTGC_prd_globalPosZ = nullptr; - - m_NSWsTGC_prd_localPosX = nullptr; - m_NSWsTGC_prd_localPosY = nullptr; - m_NSWsTGC_prd_covMatrix_1_1 = nullptr; - m_NSWsTGC_prd_covMatrix_2_2 = nullptr; - - return; -} - - -StatusCode sTGCPRDVariables::clearVariables() -{ - - m_NSWsTGC_nPRDs = 0; - m_NSWsTGC_prd_stationName->clear(); - m_NSWsTGC_prd_stationEta ->clear(); - m_NSWsTGC_prd_stationPhi ->clear(); - m_NSWsTGC_prd_multiplet ->clear(); - m_NSWsTGC_prd_gas_gap ->clear(); - m_NSWsTGC_prd_channel_type->clear(); - m_NSWsTGC_prd_channel ->clear(); - m_NSWsTGC_prd_charge ->clear(); - m_NSWsTGC_prd_bcTag ->clear(); - - m_NSWsTGC_prd_globalPosX ->clear(); - m_NSWsTGC_prd_globalPosY ->clear(); - m_NSWsTGC_prd_globalPosZ ->clear(); - - m_NSWsTGC_prd_localPosX ->clear(); - m_NSWsTGC_prd_localPosY ->clear(); - m_NSWsTGC_prd_covMatrix_1_1 ->clear(); - m_NSWsTGC_prd_covMatrix_2_2 ->clear(); - - return StatusCode::SUCCESS; -} - - -StatusCode sTGCPRDVariables::initializeVariables() -{ - m_NSWsTGC_nPRDs = 0; - m_NSWsTGC_prd_stationName = new std::vector; - m_NSWsTGC_prd_stationEta = new std::vector; - m_NSWsTGC_prd_stationPhi = new std::vector; - m_NSWsTGC_prd_multiplet = new std::vector; - m_NSWsTGC_prd_gas_gap = new std::vector; - m_NSWsTGC_prd_channel_type = new std::vector; - m_NSWsTGC_prd_channel = new std::vector; - m_NSWsTGC_prd_charge = new std::vector; - m_NSWsTGC_prd_bcTag = new std::vector; - - m_NSWsTGC_prd_globalPosX = new std::vector; - m_NSWsTGC_prd_globalPosY = new std::vector; - m_NSWsTGC_prd_globalPosZ = new std::vector; - - m_NSWsTGC_prd_localPosX = new std::vector; - m_NSWsTGC_prd_localPosY = new std::vector; - m_NSWsTGC_prd_covMatrix_1_1 = new std::vector; - m_NSWsTGC_prd_covMatrix_2_2 = new std::vector; - - if(m_tree) { - m_tree->Branch("PRD_sTGC", &m_NSWsTGC_nPRDs, "PRDs_sTGC_n/i"); - m_tree->Branch("PRD_sTGC_stationName", &m_NSWsTGC_prd_stationName); - m_tree->Branch("PRD_sTGC_stationEta", &m_NSWsTGC_prd_stationEta); - m_tree->Branch("PRD_sTGC_stationPhi", &m_NSWsTGC_prd_stationPhi); - m_tree->Branch("PRD_sTGC_multiplet", &m_NSWsTGC_prd_multiplet); - m_tree->Branch("PRD_sTGC_gas_gap", &m_NSWsTGC_prd_gas_gap); - m_tree->Branch("PRD_sTGC_channel_type",&m_NSWsTGC_prd_channel_type); - m_tree->Branch("PRD_sTGC_channel", &m_NSWsTGC_prd_channel); - m_tree->Branch("PRD_sTGC_charge", &m_NSWsTGC_prd_charge); - m_tree->Branch("PRD_sTGC_bcTag", &m_NSWsTGC_prd_bcTag); - - m_tree->Branch("PRD_sTGC_globalPosX", &m_NSWsTGC_prd_globalPosX); - m_tree->Branch("PRD_sTGC_globalPosY", &m_NSWsTGC_prd_globalPosY); - m_tree->Branch("PRD_sTGC_globalPosZ", &m_NSWsTGC_prd_globalPosZ); - - m_tree->Branch("PRD_sTGC_localPosX", &m_NSWsTGC_prd_localPosX); - m_tree->Branch("PRD_sTGC_localPosY", &m_NSWsTGC_prd_localPosY); - m_tree->Branch("PRD_sTGC_covMatrix_1_1", &m_NSWsTGC_prd_covMatrix_1_1); - m_tree->Branch("PRD_sTGC_covMatrix_2_2", &m_NSWsTGC_prd_covMatrix_2_2); - - } - - return StatusCode::SUCCESS; -} - diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.h deleted file mode 100644 index 5352cd701cee9cd7f2f18f8532898043b6fba50e..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef STGCPRDVARIABLES_H -#define STGCPRDVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/sTgcIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class sTGCPRDVariables : public ValAlgVariables -{ - public: - sTGCPRDVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_sTgcIdHelper(0), - m_NSWsTGC_nPRDs(0), - m_NSWsTGC_prd_stationName(0), - m_NSWsTGC_prd_stationEta(0), - m_NSWsTGC_prd_stationPhi(0), - m_NSWsTGC_prd_multiplet(0), - m_NSWsTGC_prd_gas_gap(0), - m_NSWsTGC_prd_channel_type(0), - m_NSWsTGC_prd_channel(0), - m_NSWsTGC_prd_charge(0), - m_NSWsTGC_prd_bcTag(0), - m_NSWsTGC_prd_globalPosX(0), - m_NSWsTGC_prd_globalPosY(0), - m_NSWsTGC_prd_globalPosZ(0), - m_NSWsTGC_prd_localPosX(0), - m_NSWsTGC_prd_localPosY(0), - m_NSWsTGC_prd_covMatrix_1_1(0), - m_NSWsTGC_prd_covMatrix_2_2(0) - { - setHelper(idhelper); - } - - ~sTGCPRDVariables() - { - deleteVariables(); - } - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_sTgcIdHelper = dynamic_cast(idhelper); - if(m_sTgcIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to sTgcIdhelper failed"); - throw std::runtime_error("Casting error in sTGCPRDVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const sTgcIdHelper* m_sTgcIdHelper{}; - - int m_NSWsTGC_nPRDs{}; - std::vector *m_NSWsTGC_prd_stationName; - std::vector *m_NSWsTGC_prd_stationEta; - std::vector *m_NSWsTGC_prd_stationPhi; - std::vector *m_NSWsTGC_prd_multiplet; - std::vector *m_NSWsTGC_prd_gas_gap; - std::vector *m_NSWsTGC_prd_channel_type; - std::vector *m_NSWsTGC_prd_channel; - std::vector *m_NSWsTGC_prd_charge; - std::vector *m_NSWsTGC_prd_bcTag; - - std::vector *m_NSWsTGC_prd_globalPosX; - std::vector *m_NSWsTGC_prd_globalPosY; - std::vector *m_NSWsTGC_prd_globalPosZ; - - std::vector *m_NSWsTGC_prd_localPosX; - std::vector *m_NSWsTGC_prd_localPosY; - std::vector *m_NSWsTGC_prd_covMatrix_1_1; - std::vector *m_NSWsTGC_prd_covMatrix_2_2; - -}; - -#endif // STGCPRDVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.cxx deleted file mode 100644 index de25756d7611d5a5d0270d5e94532f283953024f..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.cxx +++ /dev/null @@ -1,234 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#include "sTGCRDOVariables.h" -#include "AthenaBaseComps/AthAlgorithm.h" - -#include "MuonReadoutGeometry/sTgcReadoutElement.h" -#include "MuonSimData/MuonSimDataCollection.h" - -#include "MuonRDO/STGC_RawDataContainer.h" - -#include "TTree.h" -#include // for Form - -using namespace Muon; - -/** ---------- filling of variables */ -/** ---------- to be called on each evt i.e. execute level of main alg */ -StatusCode sTGCRDOVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillNSWsTGCRDOVariables()"); - - // clear variables - ATH_CHECK( this->clearVariables() ); - - ATH_MSG_DEBUG("Retrieve RDO container with name " << m_ContainerName); - // get the rdo (a container corresponds to a multilayer of a module) - const STGC_RawDataContainer* rdo_container = nullptr; - ATH_CHECK( m_evtStore->retrieve(rdo_container, m_ContainerName.c_str()) ); - - if(rdo_container->size()==0) ATH_MSG_WARNING(" sTGC RDO Container empty "); - - // iteration on all containers, i.e. all multilayers of all modules - for(const STGC_RawDataCollection* coll : *rdo_container) { - - // a digit collection is instanciated for each container, i.e. holds all digits of a multilayer - // loop on all digits inside a collection, i.e. multilayer - for (unsigned int item=0; itemsize(); item++) { - - // get specific digit and identify it - const STGC_RawData* rdo = coll->at(item); - Identifier Id = rdo->identify(); - - std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(Id)); - int stationEta = m_sTgcIdHelper->stationEta(Id); - int stationPhi = m_sTgcIdHelper->stationPhi(Id); - int multiplet = m_sTgcIdHelper->multilayer(Id); - int gas_gap = m_sTgcIdHelper->gasGap(Id); - int channel = m_sTgcIdHelper->channel(Id); - int channel_type = m_sTgcIdHelper->channelType(Id); - - ATH_MSG_DEBUG( "small TGC RDO Offline id: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " ChNr [" << channel << "]" - << " ChType [" << channel_type << "]" ); - - // module details down to the level of channel which is closest to the Geant4 hit - // to be stored in the ntuple - m_NSWsTGC_rdo_stationName->push_back(stName); - m_NSWsTGC_rdo_stationEta->push_back(stationEta); - m_NSWsTGC_rdo_stationPhi->push_back(stationPhi); - m_NSWsTGC_rdo_multiplet->push_back(multiplet); - m_NSWsTGC_rdo_gas_gap->push_back(gas_gap); - m_NSWsTGC_rdo_channel->push_back(channel); - m_NSWsTGC_rdo_channel_type->push_back(channel_type); - m_NSWsTGC_rdo_time->push_back(rdo->time()); - m_NSWsTGC_rdo_tdo->push_back(rdo->tdo()); - m_NSWsTGC_rdo_charge->push_back(rdo->charge()); - m_NSWsTGC_rdo_bcTag->push_back(rdo->bcTag()); - m_NSWsTGC_rdo_isDead->push_back(rdo->isDead()); - - // get the readout element class where the RDO is recorded - int isSmall = stName[2] == 'S'; - const MuonGM::sTgcReadoutElement* rdoEl = MuonDetMgr->getsTgcReadoutElement(Id); - if (!rdoEl) throw std::runtime_error(Form("File: %s, Line: %d\nsTGCRDOVariables::fillVariables() - Failed to retrieve sTgcReadoutElement for isSmall=%d, stationEta=%d, stationPhi=%d, multiplet=%d", __FILE__, __LINE__, isSmall, stationEta, stationPhi, multiplet)); - - Amg::Vector2D localStripPos(0.,0.); - if ( rdoEl->stripPosition(Id,localStripPos) ) { - m_NSWsTGC_rdo_localPosX->push_back(localStripPos.x()); - m_NSWsTGC_rdo_localPosY->push_back(localStripPos.y()); - ATH_MSG_DEBUG("sTGC RDO: local pos.: x=" << localStripPos[0] << ", y=" << localStripPos[1]); - } else { - ATH_MSG_WARNING("sTGC RDO: local Strip position not defined"); - } - - // asking the detector element to transform this local to the global position - Amg::Vector3D globalStripPos(0., 0., 0.); - rdoEl->surface(Id).localToGlobal(localStripPos,Amg::Vector3D(0.,0.,0.),globalStripPos); - m_NSWsTGC_rdo_globalPosX->push_back(globalStripPos.x()); - m_NSWsTGC_rdo_globalPosY->push_back(globalStripPos.y()); - m_NSWsTGC_rdo_globalPosZ->push_back(globalStripPos.z()); - - // rdo counter for the ntuple - m_NSWsTGC_nrdo++; - } - } - - ATH_MSG_DEBUG("processed " << m_NSWsTGC_nrdo << " sTGC RDOs"); - return StatusCode::SUCCESS; -} - - -/** ---------- clearing of variables */ -/** ---------- to be called inside filling method before filling starts */ -StatusCode sTGCRDOVariables::clearVariables() -{ - m_NSWsTGC_nrdo = 0; - - // information of the module down to the channel closest to the initial G4 hit - // size of vector is m_NSWsTGC_rdo - m_NSWsTGC_rdo_stationName->clear(); - m_NSWsTGC_rdo_stationEta->clear(); - m_NSWsTGC_rdo_stationPhi->clear(); - m_NSWsTGC_rdo_multiplet->clear(); - m_NSWsTGC_rdo_gas_gap->clear(); - m_NSWsTGC_rdo_channel->clear(); - m_NSWsTGC_rdo_channel_type->clear(); - m_NSWsTGC_rdo_time->clear(); - m_NSWsTGC_rdo_tdo->clear(); - m_NSWsTGC_rdo_charge->clear(); - m_NSWsTGC_rdo_bcTag->clear(); - m_NSWsTGC_rdo_isDead->clear(); - - m_NSWsTGC_rdo_globalPosX->clear(); - m_NSWsTGC_rdo_globalPosY->clear(); - m_NSWsTGC_rdo_globalPosZ->clear(); - - m_NSWsTGC_rdo_localPosX->clear(); - m_NSWsTGC_rdo_localPosY->clear(); - - return StatusCode::SUCCESS; -} - - -/** ---------- creating variables and associate them to branches */ -/** ---------- to be called on initialization level of main alg */ -StatusCode sTGCRDOVariables::initializeVariables() -{ - - m_NSWsTGC_nrdo = 0; - m_NSWsTGC_rdo_stationName = new std::vector(); - m_NSWsTGC_rdo_stationEta = new std::vector(); - m_NSWsTGC_rdo_stationPhi = new std::vector(); - m_NSWsTGC_rdo_multiplet = new std::vector(); - m_NSWsTGC_rdo_gas_gap = new std::vector(); - m_NSWsTGC_rdo_channel = new std::vector(); - m_NSWsTGC_rdo_channel_type= new std::vector(); - m_NSWsTGC_rdo_time = new std::vector(); - m_NSWsTGC_rdo_tdo = new std::vector(); - m_NSWsTGC_rdo_charge = new std::vector(); - m_NSWsTGC_rdo_bcTag = new std::vector(); - m_NSWsTGC_rdo_isDead = new std::vector(); - - m_NSWsTGC_rdo_localPosX = new std::vector(); - m_NSWsTGC_rdo_localPosY = new std::vector(); - - m_NSWsTGC_rdo_globalPosX = new std::vector(); - m_NSWsTGC_rdo_globalPosY = new std::vector(); - m_NSWsTGC_rdo_globalPosZ = new std::vector(); - - if(m_tree) { - m_tree->Branch("RDO_sTGC_n", &m_NSWsTGC_nrdo); - m_tree->Branch("RDO_sTGC_stationName", &m_NSWsTGC_rdo_stationName); - m_tree->Branch("RDO_sTGC_stationEta", &m_NSWsTGC_rdo_stationEta); - m_tree->Branch("RDO_sTGC_stationPhi", &m_NSWsTGC_rdo_stationPhi); - m_tree->Branch("RDO_sTGC_multiplet", &m_NSWsTGC_rdo_multiplet); - m_tree->Branch("RDO_sTGC_gas_gap", &m_NSWsTGC_rdo_gas_gap); - m_tree->Branch("RDO_sTGC_channel", &m_NSWsTGC_rdo_channel); - m_tree->Branch("RDO_sTGC_channel_type", &m_NSWsTGC_rdo_channel_type); - m_tree->Branch("RDO_sTGC_time", &m_NSWsTGC_rdo_time); - m_tree->Branch("RDO_sTGC_tdo", &m_NSWsTGC_rdo_tdo); - m_tree->Branch("RDO_sTGC_charge", &m_NSWsTGC_rdo_charge); - m_tree->Branch("RDO_sTGC_bcTag", &m_NSWsTGC_rdo_bcTag); - m_tree->Branch("RDO_sTGC_isDead", &m_NSWsTGC_rdo_isDead); - - m_tree->Branch("RDO_sTGC_localPosX", &m_NSWsTGC_rdo_localPosX); - m_tree->Branch("RDO_sTGC_localPosY", &m_NSWsTGC_rdo_localPosY); - - m_tree->Branch("RDO_sTGC_globalPosX", &m_NSWsTGC_rdo_globalPosX); - m_tree->Branch("RDO_sTGC_globalPosY", &m_NSWsTGC_rdo_globalPosY); - m_tree->Branch("RDO_sTGC_globalPosZ", &m_NSWsTGC_rdo_globalPosZ); - } - - return StatusCode::SUCCESS; -} - - -/** ---------- freeing resources and resetting pointers */ -/** ---------- to be called on finalize level of main alg */ -void sTGCRDOVariables::deleteVariables() -{ - delete m_NSWsTGC_rdo_stationName; - delete m_NSWsTGC_rdo_stationEta; - delete m_NSWsTGC_rdo_stationPhi; - delete m_NSWsTGC_rdo_multiplet; - delete m_NSWsTGC_rdo_gas_gap; - delete m_NSWsTGC_rdo_channel; - delete m_NSWsTGC_rdo_channel_type; - delete m_NSWsTGC_rdo_time; - delete m_NSWsTGC_rdo_tdo; - delete m_NSWsTGC_rdo_charge; - delete m_NSWsTGC_rdo_bcTag; - delete m_NSWsTGC_rdo_isDead; - delete m_NSWsTGC_rdo_localPosX; - delete m_NSWsTGC_rdo_localPosY; - delete m_NSWsTGC_rdo_globalPosX; - delete m_NSWsTGC_rdo_globalPosY; - delete m_NSWsTGC_rdo_globalPosZ; - - m_NSWsTGC_nrdo = 0; - m_NSWsTGC_rdo_stationName = nullptr; - m_NSWsTGC_rdo_stationEta = nullptr; - m_NSWsTGC_rdo_stationPhi = nullptr; - m_NSWsTGC_rdo_multiplet = nullptr; - m_NSWsTGC_rdo_gas_gap = nullptr; - m_NSWsTGC_rdo_channel = nullptr; - m_NSWsTGC_rdo_channel_type = nullptr; - m_NSWsTGC_rdo_time = nullptr; - m_NSWsTGC_rdo_tdo = nullptr; - m_NSWsTGC_rdo_charge = nullptr; - m_NSWsTGC_rdo_bcTag = nullptr; - m_NSWsTGC_rdo_isDead = nullptr; - m_NSWsTGC_rdo_localPosX = nullptr; - m_NSWsTGC_rdo_localPosY = nullptr; - m_NSWsTGC_rdo_globalPosX = nullptr; - m_NSWsTGC_rdo_globalPosY = nullptr; - m_NSWsTGC_rdo_globalPosZ = nullptr; - - return; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.h deleted file mode 100644 index fd520f9556fe1d56ba2518b601fd61747c3450c6..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef STGCRDOVARIABLES_H -#define STGCRDOVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/sTgcIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class sTGCRDOVariables final : public ValAlgVariables -{ - public: - sTGCRDOVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_sTgcIdHelper(0), - m_NSWsTGC_nrdo(0), - m_NSWsTGC_rdo_stationName(0), - m_NSWsTGC_rdo_stationEta(0), - m_NSWsTGC_rdo_stationPhi(0), - m_NSWsTGC_rdo_multiplet(0), - m_NSWsTGC_rdo_gas_gap(0), - m_NSWsTGC_rdo_channel(0), - m_NSWsTGC_rdo_channel_type(0), - m_NSWsTGC_rdo_time(0), - m_NSWsTGC_rdo_tdo(0), - m_NSWsTGC_rdo_charge(0), - m_NSWsTGC_rdo_bcTag(0), - m_NSWsTGC_rdo_isDead(0), - m_NSWsTGC_rdo_localPosX(0), - m_NSWsTGC_rdo_localPosY(0), - m_NSWsTGC_rdo_globalPosX(0), - m_NSWsTGC_rdo_globalPosY(0), - m_NSWsTGC_rdo_globalPosZ(0) - { - setHelper(idhelper); - } - - ~sTGCRDOVariables() override final { deleteVariables(); } - - StatusCode initializeVariables() override final; - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) override final; - - private: - - void setHelper(const MuonIdHelper* idhelper) override final{ - m_sTgcIdHelper = dynamic_cast(idhelper); - if(m_sTgcIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to sTgcIdHelper failed"); - throw std::runtime_error(" casting error in sTGCRDOVariables::setHelper"); - } - } - - void deleteVariables() override final; - StatusCode clearVariables() override final; - - const sTgcIdHelper* m_sTgcIdHelper{}; - - int m_NSWsTGC_nrdo{}; - std::vector *m_NSWsTGC_rdo_stationName; - std::vector *m_NSWsTGC_rdo_stationEta; - std::vector *m_NSWsTGC_rdo_stationPhi; - std::vector *m_NSWsTGC_rdo_multiplet; - std::vector *m_NSWsTGC_rdo_gas_gap; - std::vector *m_NSWsTGC_rdo_channel; - std::vector *m_NSWsTGC_rdo_channel_type; - std::vector *m_NSWsTGC_rdo_time; - std::vector *m_NSWsTGC_rdo_tdo; - std::vector *m_NSWsTGC_rdo_charge; - std::vector *m_NSWsTGC_rdo_bcTag; - std::vector *m_NSWsTGC_rdo_isDead; - - std::vector *m_NSWsTGC_rdo_localPosX; - std::vector *m_NSWsTGC_rdo_localPosY; - - std::vector *m_NSWsTGC_rdo_globalPosX; - std::vector *m_NSWsTGC_rdo_globalPosY; - std::vector *m_NSWsTGC_rdo_globalPosZ; -}; - -#endif // STGCRDOVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.cxx deleted file mode 100644 index ed4860dab892db40d56b897eab4a195684f6d9e4..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.cxx +++ /dev/null @@ -1,228 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "sTGCSDOVariables.h" - -#include "AthenaBaseComps/AthAlgorithm.h" -#include "MuonSimData/MuonSimDataCollection.h" -#include "MuonReadoutGeometry/sTgcReadoutElement.h" - -#include "TTree.h" -#include // for Form - -StatusCode sTGCSDOVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG(" do fillNSWsTGCSDOVariables()"); - ATH_MSG_VERBOSE("MuonDetectorManager from Conditions Store accessed" << MuonDetMgr); - - ATH_CHECK( this->clearVariables() ); - - ATH_MSG_DEBUG( "Retrieve sTGC SDO container with name = " << m_ContainerName.c_str() ); - const MuonSimDataCollection* nsw_sTgcSdoContainer = nullptr; - ATH_CHECK( m_evtStore->retrieve(nsw_sTgcSdoContainer, m_ContainerName.c_str()) ); - - for ( const auto& coll : *nsw_sTgcSdoContainer ) { - - Identifier Id = coll.first; - const MuonSimData mm_sdo = coll.second; - - // Get information on the SDO - std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(Id)); - int stationEta = m_sTgcIdHelper->stationEta(Id); - int stationPhi = m_sTgcIdHelper->stationPhi(Id); - int multiplet = m_sTgcIdHelper->multilayer(Id); - int gas_gap = m_sTgcIdHelper->gasGap(Id); - int channel = m_sTgcIdHelper->channel(Id); - int channel_type = m_sTgcIdHelper->channelType(Id); - - - ATH_MSG_DEBUG( "sTGC SDO: Station Name [" << stName << " ]" - << " Station Eta [" << stationEta << "]" - << " Station Phi [" << stationPhi << "]" - << " Multiplet [" << multiplet << "]" - << " GasGap [" << gas_gap << "]" - << " ChNr [" << channel << "]" - << " ChType [" << channel_type << "]" ); - - m_NSWsTGC_sdo_stationName->push_back(stName); - m_NSWsTGC_sdo_stationEta->push_back(stationEta); - m_NSWsTGC_sdo_stationPhi->push_back(stationPhi); - m_NSWsTGC_sdo_multiplet->push_back(multiplet); - m_NSWsTGC_sdo_gas_gap->push_back(gas_gap); - m_NSWsTGC_sdo_channel->push_back(channel); - m_NSWsTGC_sdo_channel_type->push_back(channel_type); - - ATH_MSG_DEBUG( "Get the truth deposits from the SDO." ); - std::vector deposits; - mm_sdo.deposits(deposits); - - const Amg::Vector3D hit_gpos = mm_sdo.globalPosition(); - m_NSWsTGC_sdo_globalPosX->push_back( hit_gpos.x() ); - m_NSWsTGC_sdo_globalPosY->push_back( hit_gpos.y() ); - m_NSWsTGC_sdo_globalPosZ->push_back( hit_gpos.z() ); - - m_NSWsTGC_sdo_globaltime->push_back( mm_sdo.getTime() ); - m_NSWsTGC_sdo_word->push_back( mm_sdo.word() ); - - // use the information of the first deposit - int barcode = deposits[0].first.barcode(); - double MuonMCdata_firstentry = deposits[0].second.firstEntry(); - double MuonMCdata_secondentry = deposits[0].second.secondEntry(); - - ATH_MSG_DEBUG("sTGC SDO barcode=" << barcode); - ATH_MSG_DEBUG("sTGC SDO energy=" << std::setw(9) << std::setprecision(2) << MuonMCdata_firstentry - << ", tof=" << std::setw(9) << std::setprecision(2) << MuonMCdata_secondentry); - - m_NSWsTGC_sdo_barcode->push_back( barcode ); - m_NSWsTGC_sdo_E->push_back( MuonMCdata_firstentry ); - m_NSWsTGC_sdo_tof->push_back( MuonMCdata_secondentry ); - - // Retrive the detector element and local SDO coordinates - bool isSmall = stName[2] == 'S'; - const MuonGM::sTgcReadoutElement* rdoEl = MuonDetMgr->getsTgcReadoutElement(Id); - if (!rdoEl) throw std::runtime_error(Form("File: %s, Line: %d\nsTGCSDOVariables::fillVariables() - Failed to retrieve sTgcReadoutElement for isSmall=%d, stationEta=%d, stationPhi=%d, multiplet=%d", __FILE__, __LINE__, isSmall, stationEta, stationPhi, multiplet)); - - Amg::Vector2D loc_pos(0., 0.); - rdoEl->surface(Id).globalToLocal(hit_gpos, Amg::Vector3D(0., 0., 0.), loc_pos); - - ATH_MSG_DEBUG("sTGC SDO local position X=" << std::setw(9) << std::setprecision(2) << loc_pos[0] - << ", local position Y=" << std::setw(9) << std::setprecision(2) << loc_pos[1]); - - m_NSWsTGC_sdo_localPosX->push_back( loc_pos[0] ); - m_NSWsTGC_sdo_localPosY->push_back( loc_pos[1] ); - - m_NSWsTGC_nsdo++; - } - - ATH_MSG_DEBUG("Processed " << m_NSWsTGC_nsdo << " sTGC SDOs"); - return StatusCode::SUCCESS; -} - - -void sTGCSDOVariables::deleteVariables() -{ - delete m_NSWsTGC_sdo_stationName; - delete m_NSWsTGC_sdo_stationEta; - delete m_NSWsTGC_sdo_stationPhi; - delete m_NSWsTGC_sdo_multiplet; - delete m_NSWsTGC_sdo_gas_gap; - delete m_NSWsTGC_sdo_channel; - delete m_NSWsTGC_sdo_channel_type; - - delete m_NSWsTGC_sdo_word; - delete m_NSWsTGC_sdo_barcode; - delete m_NSWsTGC_sdo_globalPosX; - delete m_NSWsTGC_sdo_globalPosY; - delete m_NSWsTGC_sdo_globalPosZ; - delete m_NSWsTGC_sdo_globaltime; - - delete m_NSWsTGC_sdo_E; - delete m_NSWsTGC_sdo_tof; - - delete m_NSWsTGC_sdo_localPosX; - delete m_NSWsTGC_sdo_localPosY; - - m_NSWsTGC_nsdo = 0; - m_NSWsTGC_sdo_stationName = nullptr; - m_NSWsTGC_sdo_stationEta = nullptr; - m_NSWsTGC_sdo_stationPhi = nullptr; - m_NSWsTGC_sdo_multiplet = nullptr; - m_NSWsTGC_sdo_gas_gap = nullptr; - m_NSWsTGC_sdo_channel = nullptr; - m_NSWsTGC_sdo_channel_type = nullptr; - - m_NSWsTGC_sdo_word = nullptr; - m_NSWsTGC_sdo_barcode = nullptr; - m_NSWsTGC_sdo_globalPosX = nullptr; - m_NSWsTGC_sdo_globalPosY = nullptr; - m_NSWsTGC_sdo_globalPosZ = nullptr; - m_NSWsTGC_sdo_globaltime = nullptr; - - m_NSWsTGC_sdo_E = nullptr; - m_NSWsTGC_sdo_tof = nullptr; - - m_NSWsTGC_sdo_localPosX = nullptr; - m_NSWsTGC_sdo_localPosY = nullptr; - - return; -} - - -StatusCode sTGCSDOVariables::clearVariables() -{ - m_NSWsTGC_nsdo = 0; - m_NSWsTGC_sdo_stationName->clear(); - m_NSWsTGC_sdo_stationEta->clear(); - m_NSWsTGC_sdo_stationPhi->clear(); - m_NSWsTGC_sdo_multiplet->clear(); - m_NSWsTGC_sdo_gas_gap->clear(); - m_NSWsTGC_sdo_channel->clear(); - m_NSWsTGC_sdo_channel_type->clear(); - - m_NSWsTGC_sdo_word->clear(); - m_NSWsTGC_sdo_barcode->clear(); - m_NSWsTGC_sdo_globalPosX->clear(); - m_NSWsTGC_sdo_globalPosY->clear(); - m_NSWsTGC_sdo_globalPosZ->clear(); - m_NSWsTGC_sdo_globaltime->clear(); - m_NSWsTGC_sdo_E->clear(); - m_NSWsTGC_sdo_tof->clear(); - m_NSWsTGC_sdo_localPosX->clear(); - m_NSWsTGC_sdo_localPosY->clear(); - - return StatusCode::SUCCESS; -} - - -StatusCode sTGCSDOVariables::initializeVariables() -{ - m_NSWsTGC_nsdo = 0; - m_NSWsTGC_sdo_stationName = new std::vector(); - m_NSWsTGC_sdo_stationEta = new std::vector(); - m_NSWsTGC_sdo_stationPhi = new std::vector(); - m_NSWsTGC_sdo_multiplet = new std::vector(); - m_NSWsTGC_sdo_gas_gap = new std::vector(); - m_NSWsTGC_sdo_channel = new std::vector(); - m_NSWsTGC_sdo_channel_type = new std::vector(); - - m_NSWsTGC_sdo_word = new std::vector(); - m_NSWsTGC_sdo_barcode = new std::vector(); - m_NSWsTGC_sdo_globalPosX = new std::vector(); - m_NSWsTGC_sdo_globalPosY = new std::vector(); - m_NSWsTGC_sdo_globalPosZ = new std::vector(); - m_NSWsTGC_sdo_globaltime = new std::vector(); - - m_NSWsTGC_sdo_E = new std::vector(); - m_NSWsTGC_sdo_tof = new std::vector(); - - m_NSWsTGC_sdo_localPosX = new std::vector; - m_NSWsTGC_sdo_localPosY = new std::vector; - - if(m_tree) { - - m_tree->Branch("SDO_sTGC", &m_NSWsTGC_nsdo, "SDOs_sTGC_n/i"); - m_tree->Branch("SDO_sTGC_stationName", &m_NSWsTGC_sdo_stationName); - m_tree->Branch("SDO_sTGC_stationEta", &m_NSWsTGC_sdo_stationEta); - m_tree->Branch("SDO_sTGC_stationPhi", &m_NSWsTGC_sdo_stationPhi); - m_tree->Branch("SDO_sTGC_multiplet", &m_NSWsTGC_sdo_multiplet); - m_tree->Branch("SDO_sTGC_gas_gap", &m_NSWsTGC_sdo_gas_gap); - m_tree->Branch("SDO_sTGC_channel", &m_NSWsTGC_sdo_channel); - m_tree->Branch("SDO_sTGC_channel_type", &m_NSWsTGC_sdo_channel_type); - - m_tree->Branch("SDO_sTGC_word", &m_NSWsTGC_sdo_word); - m_tree->Branch("SDO_sTGC_barcode", &m_NSWsTGC_sdo_barcode); - m_tree->Branch("SDO_sTGC_globalPosX", &m_NSWsTGC_sdo_globalPosX); - m_tree->Branch("SDO_sTGC_globalPosY", &m_NSWsTGC_sdo_globalPosY); - m_tree->Branch("SDO_sTGC_globalPosZ", &m_NSWsTGC_sdo_globalPosZ); - m_tree->Branch("SDO_sTGC_global_time", &m_NSWsTGC_sdo_globaltime); - m_tree->Branch("SDO_sTGC_Energy", &m_NSWsTGC_sdo_E); - m_tree->Branch("SDO_sTGC_tof", &m_NSWsTGC_sdo_tof); - - m_tree->Branch("SDO_sTGC_localPosX", &m_NSWsTGC_sdo_localPosX); - m_tree->Branch("SDO_sTGC_localPosY", &m_NSWsTGC_sdo_localPosY); - - } - - return StatusCode::SUCCESS; -} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.h deleted file mode 100644 index b0faa4eaa905c0e1f2304633b5004f46d123d54f..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef STGCSDOVARIABLES_H -#define STGCSDOVARIABLES_H - -#include - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/sTgcIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" - -class sTGCSDOVariables : public ValAlgVariables -{ - public: - sTGCSDOVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_sTgcIdHelper(0), - m_NSWsTGC_nsdo(0), - m_NSWsTGC_sdo_stationName(0), - m_NSWsTGC_sdo_stationEta(0), - m_NSWsTGC_sdo_stationPhi(0), - m_NSWsTGC_sdo_multiplet(0), - m_NSWsTGC_sdo_gas_gap(0), - m_NSWsTGC_sdo_channel(0), - m_NSWsTGC_sdo_channel_type(0), - m_NSWsTGC_sdo_word(0), - m_NSWsTGC_sdo_barcode(0), - m_NSWsTGC_sdo_globalPosX(0), - m_NSWsTGC_sdo_globalPosY(0), - m_NSWsTGC_sdo_globalPosZ(0), - m_NSWsTGC_sdo_globaltime(0), - m_NSWsTGC_sdo_E(0), - m_NSWsTGC_sdo_tof(0), - m_NSWsTGC_sdo_localPosX(0), - m_NSWsTGC_sdo_localPosY(0) - { - setHelper(idhelper); - } - - ~sTGCSDOVariables() - { - deleteVariables(); - } - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_sTgcIdHelper = dynamic_cast(idhelper); - if(m_sTgcIdHelper == 0) { - ATH_MSG_ERROR("casting IdHelper to MmIdhelper failed"); - throw std::runtime_error("Casting error in sTGCSDOVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const sTgcIdHelper* m_sTgcIdHelper{}; - - int m_NSWsTGC_nsdo{}; - std::vector *m_NSWsTGC_sdo_stationName; - std::vector *m_NSWsTGC_sdo_stationEta; - std::vector *m_NSWsTGC_sdo_stationPhi; - std::vector *m_NSWsTGC_sdo_multiplet; - std::vector *m_NSWsTGC_sdo_gas_gap; - std::vector *m_NSWsTGC_sdo_channel; - std::vector *m_NSWsTGC_sdo_channel_type; - - std::vector *m_NSWsTGC_sdo_word; - std::vector *m_NSWsTGC_sdo_barcode; - std::vector *m_NSWsTGC_sdo_globalPosX; - std::vector *m_NSWsTGC_sdo_globalPosY; - std::vector *m_NSWsTGC_sdo_globalPosZ; - std::vector *m_NSWsTGC_sdo_globaltime; - - std::vector *m_NSWsTGC_sdo_E; - std::vector *m_NSWsTGC_sdo_tof; - - std::vector *m_NSWsTGC_sdo_localPosX; - std::vector *m_NSWsTGC_sdo_localPosY; - -}; - -#endif // STGCSDOVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.cxx deleted file mode 100644 index 28df0d2eb2be78854be0b38b307833f37583222f..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.cxx +++ /dev/null @@ -1,390 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#include "sTGCSimHitVariables.h" -#include "AthenaKernel/errorcheck.h" - -#include "MuonSimEvent/sTGCSimHitCollection.h" -#include "MuonSimEvent/sTgcSimIdToOfflineId.h" - -#include "MuonReadoutGeometry/sTgcReadoutElement.h" - -#include "TTree.h" - -StatusCode sTGCSimHitVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr) -{ - ATH_MSG_DEBUG("do fillNSWsTGCHitVariables()"); - - CHECK( this->clearVariables() ); - - const sTGCSimHitCollection *nswContainer = nullptr; - CHECK( m_evtStore->retrieve(nswContainer, m_ContainerName.c_str()) ); - - ATH_MSG_DEBUG("ReadMuonSimHits: Retrieved " << nswContainer->size() << " sTGC hits!" ); - - // Get sTGC Helper - sTgcHitIdHelper* hitHelper = sTgcHitIdHelper::GetHelper(); - sTgcSimIdToOfflineId simToOffline(m_sTgcIdHelper); - - if(!nswContainer->size()) ATH_MSG_DEBUG(m_ContainerName<<" container empty"); - for(const sTGCSimHit& hit : *nswContainer) { - if(hit.depositEnergy()==0.) continue; // SimHits without energy loss are not recorded. - - // SimHits do not have channel type. - // Compute channel type in Val Alg to be able to validate - for( int type=0;type<=2;++type ){ - - // Read information about the sTGC hits; make sanity checks and printout - int simId = hit.sTGCId(); - std::string sim_stationName = hitHelper->GetStationName(simId); - int sim_stationEta = hitHelper->GetZSector(simId); - int sim_stationPhi = hitHelper->GetPhiSector(simId); - int sim_multilayer = hitHelper->GetMultiLayer(simId); - int sim_layer = hitHelper->GetLayer(simId); - int sim_side = hitHelper->GetSide(simId); - - ATH_MSG_DEBUG( "sTGC SimHit id: Station Name [" << sim_stationName << " ]" - << " Station Eta [" << sim_stationEta << "]" - << " Station Phi [" << sim_stationPhi << "]" - << " MultiLayer [" << sim_multilayer << "]" - << " Layer [" << sim_layer << "]" - << " Side [" << sim_side << "]" ); - - if ( sim_stationPhi==0 ) { - ATH_MSG_ERROR("unexpected phi range: " << sim_stationPhi); - return StatusCode::FAILURE; - } - // Old [7/12/12] implementation of the Station Name is: T[0-3][L/S][P/C] - // Current implementation of the Station Name is: Q[L/S][1-3][P/C] - int detNumber = -999, wedgeId = -999, wedgeType = -999; - if(sim_stationName.length()!=4) { - ATH_MSG_WARNING("sTGC validation: station Name exceeds 4 charactes, filling dummy information for detNumber, wedgeId and wedgeType"); - } - else { - detNumber = atoi(sim_stationName.substr(2,1).c_str()); - wedgeId = (sim_stationName.substr(1,1).compare("L")) ? 0 : 1; - wedgeType = (sim_stationName.substr(3,1).compare("P")) ? 0 : 1; - } - - - // convert simHit id to offline id; make sanity checks; retrieve the associated detector element. - // For offline identifier, station Name is: STS or STL - Identifier offId = simToOffline.convert(hit.sTGCId()); - - - std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(offId)); - int off_stationEta = m_sTgcIdHelper->stationEta(offId); - int off_stationPhi = m_sTgcIdHelper->stationPhi(offId); - int off_multiplet = m_sTgcIdHelper->multilayer(offId); - int off_gas_gap = m_sTgcIdHelper->gasGap(offId); - int off_channel_type = m_sTgcIdHelper->channelType(offId); - int off_channel = m_sTgcIdHelper->channel(offId); - - int isSmall = stName[2] == 'S'; - - if( type == 2 && off_channel == 63) { - ATH_MSG_DEBUG("Found sTGC Wire Sim Hit with channel number 63 (dead region), skipping this hit"); - continue; - } - - const MuonGM::sTgcReadoutElement* detEl = MuonDetMgr->getsTgcReadoutElement(offId); - if (!detEl) { - ATH_MSG_ERROR("sTGCSimHitVariables::fillVariables() - Failed to retrieve sTgcReadoutElement for "<print_to_string(offId).c_str()); - return StatusCode::FAILURE; - } - - if( !m_sTgcIdHelper->is_stgc(offId) ){ - ATH_MSG_WARNING("sTgc id is not a stgc id! " << m_sTgcIdHelper->print_to_string(offId)); - } - if( !m_sTgcIdHelper->is_muon(offId) ){ - ATH_MSG_WARNING("sTgc id is not a muon id! " << m_sTgcIdHelper->print_to_string(offId)); - } - if( m_sTgcIdHelper->is_mdt(offId)||m_sTgcIdHelper->is_rpc(offId)||m_sTgcIdHelper->is_tgc(offId)||m_sTgcIdHelper->is_csc(offId)||m_sTgcIdHelper->is_mm(offId) ){ - ATH_MSG_WARNING("sTgc id has wrong technology type! " << m_sTgcIdHelper->is_mdt(offId) << " " << m_sTgcIdHelper->is_rpc(offId) - << " " << m_sTgcIdHelper->is_tgc(offId) << " " << m_sTgcIdHelper->is_csc(offId) << " " << m_sTgcIdHelper->is_mm(offId) ); - } - if( m_sTgcIdHelper->gasGap(offId) != sim_layer ) { - ATH_MSG_WARNING("sTgc id has bad layer field! " << m_sTgcIdHelper->print_to_string(offId) ); - } - // connect the hit with the MC truth - int barcode = hit.particleLink().barcode(); - m_NSWsTGC_trackId.push_back(barcode); - - m_NSWsTGC_globalTime.push_back(hit.globalTime()); - const Amg::Vector3D& globalPosition = hit.globalPosition(); - m_NSWsTGC_hitGlobalPositionX.push_back(globalPosition.x()); - m_NSWsTGC_hitGlobalPositionY.push_back(globalPosition.y()); - m_NSWsTGC_hitGlobalPositionZ.push_back(globalPosition.z()); - m_NSWsTGC_hitGlobalPositionR.push_back(globalPosition.perp()); - m_NSWsTGC_hitGlobalPositionP.push_back(globalPosition.phi()); - const Amg::Vector3D& globalDirection = hit.globalDirection(); - m_NSWsTGC_hitGlobalDirectionX.push_back(globalDirection.x()); - m_NSWsTGC_hitGlobalDirectionY.push_back(globalDirection.y()); - m_NSWsTGC_hitGlobalDirectionZ.push_back(globalDirection.z()); - - m_NSWsTGC_particleEncoding.push_back(hit.particleEncoding()); - m_NSWsTGC_depositEnergy.push_back(hit.depositEnergy()); - m_NSWsTGC_kineticEnergy.push_back(hit.kineticEnergy()); - - const Amg::Vector3D& globalPrePosition = hit.globalPrePosition(); - m_NSWsTGC_hitGlobalPrePositionX.push_back(globalPrePosition.x()); - m_NSWsTGC_hitGlobalPrePositionY.push_back(globalPrePosition.y()); - m_NSWsTGC_hitGlobalPrePositionZ.push_back(globalPrePosition.z()); - m_NSWsTGC_hitGlobalPrePositionR.push_back(globalPrePosition.perp()); - m_NSWsTGC_hitGlobalPrePositionP.push_back(globalPrePosition.phi()); - if (hit.kineticEnergy() < 0.0) { - m_NSWsTGC_hitGlobalPrePositionX.push_back(-9999.9); - m_NSWsTGC_hitGlobalPrePositionY.push_back(-9999.9); - m_NSWsTGC_hitGlobalPrePositionZ.push_back(-9999.9); - m_NSWsTGC_hitGlobalPrePositionR.push_back(-9999.9); - m_NSWsTGC_hitGlobalPrePositionP.push_back(-9999.9); - } - - - // Fill Ntuple with SimId data - m_NSWsTGC_sim_stationName .push_back(sim_stationName); - m_NSWsTGC_sim_stationEta .push_back(sim_stationEta); - m_NSWsTGC_sim_stationPhi .push_back(sim_stationPhi); - m_NSWsTGC_wedgeId .push_back(wedgeId); - m_NSWsTGC_wedgeType .push_back(wedgeType); - m_NSWsTGC_detectorNumber .push_back(detNumber); - m_NSWsTGC_sim_multilayer .push_back(sim_multilayer); - m_NSWsTGC_sim_layer .push_back(sim_layer); - m_NSWsTGC_sim_side .push_back(sim_side); - - ATH_MSG_DEBUG( "sTGC Offline id: Station Name [" << stName << "]" - << " Station Eta [" << off_stationEta << "]" - << " Station Phi [" << off_stationPhi << "]" - << " Multiplet [" << off_multiplet << "]" - << " GasGap [" << off_gas_gap << "]" - << " Type [" << off_channel_type << "]" - << " ChNr [" << off_channel << "]" ); - - ATH_MSG_DEBUG("sTGC geometry, retrieving detector element for: isSmall " << isSmall << " eta " << m_sTgcIdHelper->stationEta(offId) - << " phi " << m_sTgcIdHelper->stationPhi(offId) << " ml " << m_sTgcIdHelper->multilayer(offId) ); - - - Identifier newId = m_sTgcIdHelper->channelID(m_sTgcIdHelper->parentID(offId), m_sTgcIdHelper->multilayer(offId), m_sTgcIdHelper->gasGap(offId),type,1); - - // compute hit position within the detector element/surfaces - const Trk::PlaneSurface& surf = detEl->surface(newId); - Amg::Transform3D gToL = detEl->absTransform().inverse(); - Amg::Vector3D hpos(hit.globalPosition().x(),hit.globalPosition().y(),hit.globalPosition().z()); - Amg::Vector3D dSurface_pos = gToL*hpos; - - // compute the hit position on the readout plane (same as in MuonFastDigitization) - Amg::Vector3D rSurface_pos = surf.transform().inverse()*hpos; - Amg::Vector3D ldir = surf.transform().inverse().linear()*Amg::Vector3D(hit.globalDirection().x(),hit.globalDirection().y(),hit.globalDirection().z()); - - ATH_MSG_DEBUG("sTGC channel type:" << type); - - double scale = -rSurface_pos.z()/ldir.z(); - Amg::Vector3D hitOnSurface = rSurface_pos + scale*ldir; - - // hitOnSurface.x() will be susequent smeared to simulate the detector resolution, here we do not apply any smearing - Amg::Vector2D posOnSurf(hitOnSurface.x(), rSurface_pos.y()); - - // remember whether the given hit is inside the active volume (and produces a valid digit) - m_NSWsTGC_isInsideBounds.push_back( surf.insideBounds(posOnSurf) ); - - int stripNumber = detEl->stripNumber(posOnSurf,newId); - if( stripNumber == -1 ){ - ATH_MSG_WARNING("sTGC validation: failed to obtain strip number " << m_sTgcIdHelper->print_to_string(offId) ); - ATH_MSG_WARNING(" pos " << posOnSurf << " z " << rSurface_pos.z() ); - //stripNumber = 1; - } - Identifier oldId = offId; - offId = m_sTgcIdHelper->channelID(offId, m_sTgcIdHelper->multilayer(offId), m_sTgcIdHelper->gasGap(offId),1,stripNumber); - if( m_sTgcIdHelper->gasGap(offId) != sim_layer ) { - ATH_MSG_WARNING("sTGC validation: sTgc id has bad layer field(2)! " << std::endl << " " << m_sTgcIdHelper->print_to_string(offId) << std::endl - << " " << m_sTgcIdHelper->print_to_string(oldId) << " stripN " << stripNumber ); - } - - Amg::Vector2D fastDigitPos(0,0); - if( !detEl->stripPosition(offId,fastDigitPos) ){ - ATH_MSG_WARNING("sTGC validation: failed to obtain local position for identifier " << m_sTgcIdHelper->print_to_string(offId) ); - } - - Amg::Vector3D detpos = detEl->globalPosition(); - ATH_MSG_DEBUG("sTGC Global hit: r " << hit.globalPosition().perp() << ", phi " << hit.globalPosition().phi() << ", z " << hit.globalPosition().z() - << "; detEl: r " << detpos.perp() << ", phi " << detpos.phi() << ", z " << detpos.z() - << "; surf z " << surf.center().z() << ", ml " << sim_multilayer << ", l " << sim_layer ); - - ATH_MSG_DEBUG(" detEl: x " << dSurface_pos.x() << " y " << dSurface_pos.y() << " z " << dSurface_pos.z()); - ATH_MSG_DEBUG("sTGC Fast digit: x " << fastDigitPos.x() << " y " << fastDigitPos.y() - << ", gToL: x " << rSurface_pos.x() << " y " << rSurface_pos.y() << " z " << rSurface_pos.z() ); - - - - // Fill Ntuple with offline ID data - m_NSWsTGC_off_stationName .push_back(stName); - m_NSWsTGC_off_stationEta .push_back(off_stationEta); - m_NSWsTGC_off_stationPhi .push_back(off_stationPhi); - m_NSWsTGC_off_multiplet .push_back(off_multiplet); - m_NSWsTGC_off_gas_gap .push_back(off_gas_gap); - m_NSWsTGC_off_channel_type .push_back(type); - // The offline IdHelper class will be updated to assign wiregroup ID to SimHit. - // As a temporary solution stripnumber is used directly (also in MM) - off_channel = stripNumber; - m_NSWsTGC_off_channel .push_back(off_channel); - - - // Fill ntuple with the hit/surface/digit positions - m_NSWsTGC_detector_globalPositionX.push_back( detpos.x() ); - m_NSWsTGC_detector_globalPositionY.push_back( detpos.y() ); - m_NSWsTGC_detector_globalPositionZ.push_back( detpos.z() ); - m_NSWsTGC_detector_globalPositionR.push_back( detpos.perp() ); - m_NSWsTGC_detector_globalPositionP.push_back( detpos.phi() ); - - m_NSWsTGC_hitToDsurfacePositionX.push_back( dSurface_pos.x() ); - m_NSWsTGC_hitToDsurfacePositionY.push_back( dSurface_pos.y() ); - m_NSWsTGC_hitToDsurfacePositionZ.push_back( dSurface_pos.z() ); - - m_NSWsTGC_hitToRsurfacePositionX.push_back( rSurface_pos.x() ); - m_NSWsTGC_hitToRsurfacePositionY.push_back( rSurface_pos.y() ); - m_NSWsTGC_hitToRsurfacePositionZ.push_back( rSurface_pos.z() ); - - m_NSWsTGC_FastDigitRsurfacePositionX.push_back( posOnSurf.x() ); - m_NSWsTGC_FastDigitRsurfacePositionY.push_back( posOnSurf.y() ); - - - - m_NSWsTGC_stripNumber.push_back(stripNumber); - m_NSWsTGC_wireNumber.push_back(-999); - - ATH_MSG_DEBUG("---------- Hit processing ends!"); - /* - ATH_MSG_DEBUG( " NSW Hits E = " << hit.depositEnergy() - << ", Global X sTGC = " << globalPosition.x() - << ", Global Y sTGC = " << globalPosition.y() - << ", Global Z sTGC = " << globalPosition.z() - << ", time = " << hit.globalTime() - */ - m_NSWsTGC_nSimHits++; - } - } - - ATH_MSG_DEBUG("processed " << m_NSWsTGC_nSimHits << " sTGC sim hits"); - return StatusCode::SUCCESS; -} - - -StatusCode sTGCSimHitVariables::clearVariables() -{ - m_NSWsTGC_nSimHits = 0; - m_NSWsTGC_trackId.clear(); - m_NSWsTGC_isInsideBounds.clear(); - m_NSWsTGC_globalTime.clear(); - m_NSWsTGC_hitGlobalPositionX.clear(); - m_NSWsTGC_hitGlobalPositionY.clear(); - m_NSWsTGC_hitGlobalPositionZ.clear(); - m_NSWsTGC_hitGlobalPositionR.clear(); - m_NSWsTGC_hitGlobalPositionP.clear(); - m_NSWsTGC_hitGlobalDirectionX.clear(); - m_NSWsTGC_hitGlobalDirectionY.clear(); - m_NSWsTGC_hitGlobalDirectionZ.clear(); - m_NSWsTGC_hitGlobalPrePositionX.clear(); - m_NSWsTGC_hitGlobalPrePositionY.clear(); - m_NSWsTGC_hitGlobalPrePositionZ.clear(); - m_NSWsTGC_hitGlobalPrePositionR.clear(); - m_NSWsTGC_hitGlobalPrePositionP.clear(); - m_NSWsTGC_detector_globalPositionX.clear(); - m_NSWsTGC_detector_globalPositionY.clear(); - m_NSWsTGC_detector_globalPositionZ.clear(); - m_NSWsTGC_detector_globalPositionR.clear(); - m_NSWsTGC_detector_globalPositionP.clear(); - m_NSWsTGC_hitToDsurfacePositionX.clear(); - m_NSWsTGC_hitToDsurfacePositionY.clear(); - m_NSWsTGC_hitToDsurfacePositionZ.clear(); - m_NSWsTGC_hitToRsurfacePositionX.clear(); - m_NSWsTGC_hitToRsurfacePositionY.clear(); - m_NSWsTGC_hitToRsurfacePositionZ.clear(); - m_NSWsTGC_FastDigitRsurfacePositionX.clear(); - m_NSWsTGC_FastDigitRsurfacePositionY.clear(); - m_NSWsTGC_particleEncoding.clear(); - m_NSWsTGC_depositEnergy.clear(); - m_NSWsTGC_kineticEnergy.clear(); - m_NSWsTGC_sim_stationName.clear(); - m_NSWsTGC_wedgeId.clear(); - m_NSWsTGC_wedgeType.clear(); - m_NSWsTGC_detectorNumber.clear(); - m_NSWsTGC_sim_stationEta.clear(); - m_NSWsTGC_sim_stationPhi.clear(); - m_NSWsTGC_sim_multilayer.clear(); - m_NSWsTGC_sim_layer.clear(); - m_NSWsTGC_sim_side.clear(); - m_NSWsTGC_stripNumber.clear(); - m_NSWsTGC_wireNumber.clear(); - m_NSWsTGC_off_stationName.clear(); - m_NSWsTGC_off_stationEta.clear(); - m_NSWsTGC_off_stationPhi.clear(); - m_NSWsTGC_off_multiplet.clear(); - m_NSWsTGC_off_gas_gap.clear(); - m_NSWsTGC_off_channel_type.clear(); - m_NSWsTGC_off_channel.clear(); - return StatusCode::SUCCESS; -} - -void sTGCSimHitVariables::deleteVariables() -{ - return; -} - -StatusCode sTGCSimHitVariables::initializeVariables() -{ - if(m_tree) { - m_tree->Branch("Hits_sTGC_n", &m_NSWsTGC_nSimHits, "Hits_sTGC_nSimHits/i"); - m_tree->Branch("Hits_sTGC_trackId", &m_NSWsTGC_trackId); - m_tree->Branch("Hits_sTGC_isInsideBounds", &m_NSWsTGC_isInsideBounds); - m_tree->Branch("Hits_sTGC_globalTime", &m_NSWsTGC_globalTime); - m_tree->Branch("Hits_sTGC_hitGlobalPositionX", &m_NSWsTGC_hitGlobalPositionX); - m_tree->Branch("Hits_sTGC_hitGlobalPositionY", &m_NSWsTGC_hitGlobalPositionY); - m_tree->Branch("Hits_sTGC_hitGlobalPositionZ", &m_NSWsTGC_hitGlobalPositionZ); - m_tree->Branch("Hits_sTGC_hitGlobalPositionR", &m_NSWsTGC_hitGlobalPositionR); - m_tree->Branch("Hits_sTGC_hitGlobalPositionP", &m_NSWsTGC_hitGlobalPositionP); - m_tree->Branch("Hits_sTGC_hitGlobalDirectionX", &m_NSWsTGC_hitGlobalDirectionX); - m_tree->Branch("Hits_sTGC_hitGlobalDirectionY", &m_NSWsTGC_hitGlobalDirectionY); - m_tree->Branch("Hits_sTGC_hitGlobalDirectionZ", &m_NSWsTGC_hitGlobalDirectionZ); - m_tree->Branch("Hits_sTGC_hitGlobalPrePositionX", &m_NSWsTGC_hitGlobalPrePositionX); - m_tree->Branch("Hits_sTGC_hitGlobalPrePositionY", &m_NSWsTGC_hitGlobalPrePositionY); - m_tree->Branch("Hits_sTGC_hitGlobalPrePositionZ", &m_NSWsTGC_hitGlobalPrePositionZ); - m_tree->Branch("Hits_sTGC_hitGlobalPrePositionR", &m_NSWsTGC_hitGlobalPrePositionR); - m_tree->Branch("Hits_sTGC_hitGlobalPrePositionP", &m_NSWsTGC_hitGlobalPrePositionP); - m_tree->Branch("Hits_sTGC_detector_globalPositionX", &m_NSWsTGC_detector_globalPositionX); - m_tree->Branch("Hits_sTGC_detector_globalPositionY", &m_NSWsTGC_detector_globalPositionY); - m_tree->Branch("Hits_sTGC_detector_globalPositionZ", &m_NSWsTGC_detector_globalPositionZ); - m_tree->Branch("Hits_sTGC_detector_globalPositionR", &m_NSWsTGC_detector_globalPositionR); - m_tree->Branch("Hits_sTGC_detector_globalPositionP", &m_NSWsTGC_detector_globalPositionP); - m_tree->Branch("Hits_sTGC_hitToDsurfacePositionX", &m_NSWsTGC_hitToDsurfacePositionX); - m_tree->Branch("Hits_sTGC_hitToDsurfacePositionY", &m_NSWsTGC_hitToDsurfacePositionY); - m_tree->Branch("Hits_sTGC_hitToDsurfacePositionZ", &m_NSWsTGC_hitToDsurfacePositionZ); - m_tree->Branch("Hits_sTGC_hitToRsurfacePositionX", &m_NSWsTGC_hitToRsurfacePositionX); - m_tree->Branch("Hits_sTGC_hitToRsurfacePositionY", &m_NSWsTGC_hitToRsurfacePositionY); - m_tree->Branch("Hits_sTGC_hitToRsurfacePositionZ", &m_NSWsTGC_hitToRsurfacePositionZ); - m_tree->Branch("Hits_sTGC_FastDigitRsurfacePositionX", &m_NSWsTGC_FastDigitRsurfacePositionX); - m_tree->Branch("Hits_sTGC_FastDigitRsurfacePositionY", &m_NSWsTGC_FastDigitRsurfacePositionY); - m_tree->Branch("Hits_sTGC_particleEncoding", &m_NSWsTGC_particleEncoding); - m_tree->Branch("Hits_sTGC_depositEnergy", &m_NSWsTGC_depositEnergy); - m_tree->Branch("Hits_sTGC_kineticEnergy", &m_NSWsTGC_kineticEnergy); - m_tree->Branch("Hits_sTGC_sim_stationName", &m_NSWsTGC_sim_stationName); - m_tree->Branch("Hits_sTGC_wedgeId", &m_NSWsTGC_wedgeId); - m_tree->Branch("Hits_sTGC_wedgeType", &m_NSWsTGC_wedgeType); - m_tree->Branch("Hits_sTGC_detectorNumber", &m_NSWsTGC_detectorNumber); - m_tree->Branch("Hits_sTGC_sim_stationEta", &m_NSWsTGC_sim_stationEta); - m_tree->Branch("Hits_sTGC_sim_stationPhi", &m_NSWsTGC_sim_stationPhi); - m_tree->Branch("Hits_sTGC_sim_multilayer", &m_NSWsTGC_sim_multilayer); - m_tree->Branch("Hits_sTGC_sim_layer", &m_NSWsTGC_sim_layer); - m_tree->Branch("Hits_sTGC_sim_side", &m_NSWsTGC_sim_side); - m_tree->Branch("Hits_sTGC_stripNumber", &m_NSWsTGC_stripNumber); - m_tree->Branch("Hits_sTGC_wireNumber", &m_NSWsTGC_wireNumber); - m_tree->Branch("Hits_sTGC_off_stationName", &m_NSWsTGC_off_stationName); - m_tree->Branch("Hits_sTGC_off_stationEta", &m_NSWsTGC_off_stationEta); - m_tree->Branch("Hits_sTGC_off_stationPhi", &m_NSWsTGC_off_stationPhi); - m_tree->Branch("Hits_sTGC_off_multiplet", &m_NSWsTGC_off_multiplet); - m_tree->Branch("Hits_sTGC_off_gas_gap", &m_NSWsTGC_off_gas_gap); - m_tree->Branch("Hits_sTGC_off_channel_type", &m_NSWsTGC_off_channel_type); - m_tree->Branch("Hits_sTGC_off_channel", &m_NSWsTGC_off_channel); - } - return StatusCode::SUCCESS; -} diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.h deleted file mode 100644 index f41fa1fc5e74243ede17745eaf768ad02d84d9ec..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef STGCSIMHITVARIABLES_H -#define STGCSIMHITVARIABLES_H - -#include "ValAlgVariables.h" -#include "MuonIdHelpers/sTgcIdHelper.h" -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#include - -class sTGCSimHitVariables : public ValAlgVariables -{ - public: - sTGCSimHitVariables(StoreGateSvc* evtStore, - const MuonGM::MuonDetectorManager* detManager, - const MuonIdHelper* idhelper, - TTree* tree, - const std::string & containername, - MSG::Level msglvl) : - ValAlgVariables(evtStore, detManager, tree, containername, msglvl), - m_sTgcIdHelper(nullptr), - m_NSWsTGC_nSimHits(0), - m_NSWsTGC_trackId(), - m_NSWsTGC_isInsideBounds(), - m_NSWsTGC_globalTime(), - m_NSWsTGC_hitGlobalPositionX(), - m_NSWsTGC_hitGlobalPositionY(), - m_NSWsTGC_hitGlobalPositionZ(), - m_NSWsTGC_hitGlobalPositionR(), - m_NSWsTGC_hitGlobalPositionP(), - m_NSWsTGC_hitGlobalDirectionX(), - m_NSWsTGC_hitGlobalDirectionY(), - m_NSWsTGC_hitGlobalDirectionZ(), - m_NSWsTGC_hitGlobalPrePositionX(), - m_NSWsTGC_hitGlobalPrePositionY(), - m_NSWsTGC_hitGlobalPrePositionZ(), - m_NSWsTGC_hitGlobalPrePositionR(), - m_NSWsTGC_hitGlobalPrePositionP(), - m_NSWsTGC_detector_globalPositionX(), - m_NSWsTGC_detector_globalPositionY(), - m_NSWsTGC_detector_globalPositionZ(), - m_NSWsTGC_detector_globalPositionR(), - m_NSWsTGC_detector_globalPositionP(), - m_NSWsTGC_hitToDsurfacePositionX(), - m_NSWsTGC_hitToDsurfacePositionY(), - m_NSWsTGC_hitToDsurfacePositionZ(), - m_NSWsTGC_hitToRsurfacePositionX(), - m_NSWsTGC_hitToRsurfacePositionY(), - m_NSWsTGC_hitToRsurfacePositionZ(), - m_NSWsTGC_FastDigitRsurfacePositionX(), - m_NSWsTGC_FastDigitRsurfacePositionY(), - m_NSWsTGC_particleEncoding(), - m_NSWsTGC_depositEnergy(), - m_NSWsTGC_kineticEnergy(), - m_NSWsTGC_sim_stationName(), - m_NSWsTGC_wedgeId(), - m_NSWsTGC_wedgeType(), - m_NSWsTGC_detectorNumber(), - m_NSWsTGC_sim_stationEta(), - m_NSWsTGC_sim_stationPhi(), - m_NSWsTGC_sim_multilayer(), - m_NSWsTGC_sim_layer(), - m_NSWsTGC_sim_side(), - m_NSWsTGC_stripNumber(), - m_NSWsTGC_wireNumber(), - m_NSWsTGC_off_stationName(), - m_NSWsTGC_off_stationEta(), - m_NSWsTGC_off_stationPhi(), - m_NSWsTGC_off_multiplet(), - m_NSWsTGC_off_gas_gap(), - m_NSWsTGC_off_channel_type(), - m_NSWsTGC_off_channel() - { - setHelper(idhelper); - } - - ~sTGCSimHitVariables() - { - this->deleteVariables(); - } - - - StatusCode initializeVariables(); - StatusCode fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr); - - private: - - void setHelper(const MuonIdHelper* idhelper){ - m_sTgcIdHelper = dynamic_cast(idhelper); - if(!m_sTgcIdHelper) { - ATH_MSG_ERROR("casting IdHelper to sTgcIdhelper failed"); - throw std::runtime_error("Casting error in sTGCSimHitVariables::setHelper"); - } - } - - void deleteVariables(); - StatusCode clearVariables(); - - const sTgcIdHelper* m_sTgcIdHelper{}; - - int m_NSWsTGC_nSimHits{}; - std::vector m_NSWsTGC_trackId; - - std::vector m_NSWsTGC_isInsideBounds; - - std::vector m_NSWsTGC_globalTime; - std::vector m_NSWsTGC_hitGlobalPositionX; - std::vector m_NSWsTGC_hitGlobalPositionY; - std::vector m_NSWsTGC_hitGlobalPositionZ; - std::vector m_NSWsTGC_hitGlobalPositionR; - std::vector m_NSWsTGC_hitGlobalPositionP; - std::vector m_NSWsTGC_hitGlobalDirectionX; - std::vector m_NSWsTGC_hitGlobalDirectionY; - std::vector m_NSWsTGC_hitGlobalDirectionZ; - std::vector m_NSWsTGC_hitGlobalPrePositionX; - std::vector m_NSWsTGC_hitGlobalPrePositionY; - std::vector m_NSWsTGC_hitGlobalPrePositionZ; - std::vector m_NSWsTGC_hitGlobalPrePositionR; - std::vector m_NSWsTGC_hitGlobalPrePositionP; - - std::vector m_NSWsTGC_detector_globalPositionX; - std::vector m_NSWsTGC_detector_globalPositionY; - std::vector m_NSWsTGC_detector_globalPositionZ; - std::vector m_NSWsTGC_detector_globalPositionR; - std::vector m_NSWsTGC_detector_globalPositionP; - - std::vector m_NSWsTGC_hitToDsurfacePositionX; - std::vector m_NSWsTGC_hitToDsurfacePositionY; - std::vector m_NSWsTGC_hitToDsurfacePositionZ; - - std::vector m_NSWsTGC_hitToRsurfacePositionX; - std::vector m_NSWsTGC_hitToRsurfacePositionY; - std::vector m_NSWsTGC_hitToRsurfacePositionZ; - - std::vector m_NSWsTGC_FastDigitRsurfacePositionX; - std::vector m_NSWsTGC_FastDigitRsurfacePositionY; - - std::vector m_NSWsTGC_particleEncoding; - std::vector m_NSWsTGC_depositEnergy; - std::vector m_NSWsTGC_kineticEnergy; - - std::vector m_NSWsTGC_sim_stationName; - std::vector m_NSWsTGC_wedgeId; // large=0, small=1 - std::vector m_NSWsTGC_wedgeType; // pivot 0, confirmation 1 - std::vector m_NSWsTGC_detectorNumber; // quad [1-3] - std::vector m_NSWsTGC_sim_stationEta; - std::vector m_NSWsTGC_sim_stationPhi; // [1-16] - std::vector m_NSWsTGC_sim_multilayer; // [1-2] - std::vector m_NSWsTGC_sim_layer; // [1-4] - std::vector m_NSWsTGC_sim_side; // -1 or 1 - std::vector m_NSWsTGC_stripNumber; - std::vector m_NSWsTGC_wireNumber; // wire groups 0-31 in increasing phi - - std::vector m_NSWsTGC_off_stationName; - std::vector m_NSWsTGC_off_stationEta; - std::vector m_NSWsTGC_off_stationPhi; - std::vector m_NSWsTGC_off_multiplet; - std::vector m_NSWsTGC_off_gas_gap; - std::vector m_NSWsTGC_off_channel_type; - std::vector m_NSWsTGC_off_channel; - - -}; - -#endif // STGCSIMHITVARIABLES_H diff --git a/MuonSpectrometer/MuonValidation/MuonTesterTree/MuonTesterTree/IdentifierBranch.h b/MuonSpectrometer/MuonValidation/MuonTesterTree/MuonTesterTree/IdentifierBranch.h index edde97602ccb3f4e959ad933a1e18eef62de751a..397de702928e2345536223be7f247087ec213ebf 100644 --- a/MuonSpectrometer/MuonValidation/MuonTesterTree/MuonTesterTree/IdentifierBranch.h +++ b/MuonSpectrometer/MuonValidation/MuonTesterTree/MuonTesterTree/IdentifierBranch.h @@ -88,4 +88,31 @@ private: VectorBranch& m_channel{parent().newVector(name() + "_channel")}; }; -#endif +/// Branch to store all information of the sTgcIdentifier +class sTgcIdentifierBranch : public MuonIdentifierBranch { +public: + sTgcIdentifierBranch(MuonTesterTree& tree, const std::string& grp_name); + + void push_back(const Identifier& id) override final; + +private: + VectorBranch& m_gas_gap{parent().newVector(name() + "_gas_gap")}; + VectorBranch& m_multiplet{parent().newVector(name() + "_multiplet")}; + VectorBranch& m_channel_type{parent().newVector(name() + "_channel_type")}; + VectorBranch& m_channel{parent().newVector(name() + "_channel")}; +}; + +/// Branch to store all information of the MmIdentifier +class MmIdentifierBranch : public MuonIdentifierBranch { +public: + MmIdentifierBranch(MuonTesterTree& tree, const std::string& grp_name); + + void push_back(const Identifier& id) override final; + +private: + VectorBranch& m_gas_gap{parent().newVector(name() + "_gas_gap")}; + VectorBranch& m_multiplet{parent().newVector(name() + "_multiplet")}; + VectorBranch& m_channel{parent().newVector(name() + "_channel")}; +}; + +#endif \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonTesterTree/Root/IdentifierBranch.cxx b/MuonSpectrometer/MuonValidation/MuonTesterTree/Root/IdentifierBranch.cxx index be4a9568037f658f8f0634d6a1c91faa25feab7f..4c9324114c648fb5a26f852040171d0983aaa3a8 100644 --- a/MuonSpectrometer/MuonValidation/MuonTesterTree/Root/IdentifierBranch.cxx +++ b/MuonSpectrometer/MuonValidation/MuonTesterTree/Root/IdentifierBranch.cxx @@ -79,4 +79,29 @@ void TgcIdentifierBranch::push_back(const Identifier& id) { m_gasgap.push_back(idHelperSvc()->tgcIdHelper().gasGap(id)); m_measuresPhi.push_back(idHelperSvc()->tgcIdHelper().measuresPhi(id)); m_channel.push_back(idHelperSvc()->tgcIdHelper().channel(id)); +} + +///############################################################### +/// sTgcIdentifierBranch +///############################################################### +sTgcIdentifierBranch::sTgcIdentifierBranch(MuonTesterTree& tree, const std::string& grp_name) : MuonIdentifierBranch(tree, grp_name) {} + +void sTgcIdentifierBranch::push_back(const Identifier& id) { + MuonIdentifierBranch::push_back(id); + m_gas_gap.push_back(idHelperSvc()->stgcIdHelper().gasGap(id)); + m_multiplet.push_back(idHelperSvc()->stgcIdHelper().multilayer(id)); + m_channel_type.push_back(idHelperSvc()->stgcIdHelper().channelType(id)); + m_channel.push_back(idHelperSvc()->stgcIdHelper().channel(id)); +} + +///############################################################### +/// MmIdentifierBranch +///############################################################### +MmIdentifierBranch::MmIdentifierBranch(MuonTesterTree& tree, const std::string& grp_name) : MuonIdentifierBranch(tree, grp_name) {} + +void MmIdentifierBranch::push_back(const Identifier& id) { + MuonIdentifierBranch::push_back(id); + m_gas_gap.push_back(idHelperSvc()->mmIdHelper().gasGap(id)); + m_multiplet.push_back(idHelperSvc()->mmIdHelper().multilayer(id)); + m_channel.push_back(idHelperSvc()->mmIdHelper().channel(id)); } \ No newline at end of file diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCalo/python/DerivationFrameworkCaloConfig.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCalo/python/DerivationFrameworkCaloConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..592080a4f2762ef51efd4cbd26c1f14c80199a01 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCalo/python/DerivationFrameworkCaloConfig.py @@ -0,0 +1,42 @@ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +#!/usr/bin/env python + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + + +def MaxCellDecoratorCfg(ConfigFlags,**kwargs): + acc = ComponentAccumulator() + kwargs.setdefault("SGKey_electrons", ConfigFlags.Egamma.Keys.Output.Electrons) + kwargs.setdefault("SGKey_photons", ConfigFlags.Egamma.Keys.Output.Photons) + acc.setPrivateTools(CompFactory.DerivationFramework.MaxCellDecorator(**kwargs)) + return acc + +def GainDecoratorCfg(ConfigFlags,**kwargs): + acc = ComponentAccumulator() + kwargs.setdefault("SGKey_electrons", ConfigFlags.Egamma.Keys.Output.Electrons) + kwargs.setdefault("SGKey_photons", ConfigFlags.Egamma.Keys.Output.Photons) + kwargs.setdefault("name", "GainDecor") + acc.setPrivateTools(CompFactory.DerivationFramework.GainDecorator(**kwargs)) + return acc + +def CaloFillRectangularClusterCfg(ConfigFlags,**kwargs): + acc = ComponentAccumulator() + kwargs.setdefault("cells_name", ConfigFlags.Egamma.Keys.Input.CaloCells) + kwargs.setdefault("fill_cluster", True) + acc.setPrivateTools(CompFactory.CaloFillRectangularCluster(**kwargs)) + return acc + +def ClusterEnergyPerLayerDecoratorCfg(ConfigFlags,**kwargs): + acc = ComponentAccumulator() + kwargs.setdefault("SGKey_electrons", ConfigFlags.Egamma.Keys.Output.Electrons) + kwargs.setdefault("SGKey_photons", ConfigFlags.Egamma.Keys.Output.Photons) + kwargs.setdefault("SGKey_caloCells", ConfigFlags.Egamma.Keys.Input.CaloCells) + kwargs.setdefault("neta", 5) + kwargs.setdefault("nphi", 5) + toolArgs = {} + toolArgs.update({"eta_size": kwargs["neta"]}) + toolArgs.update({"phi_size": kwargs["nphi"]}) + kwargs.setdefault("CaloFillRectangularClusterTool", acc.popToolsAndMerge(CaloFillRectangularClusterCfg(ConfigFlags,**toolArgs) ) ) + acc.setPrivateTools(CompFactory.DerivationFramework.ClusterEnergyPerLayerDecorator(**kwargs)) + return acc \ No newline at end of file diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG1D1.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG1D1.py index 9f0b0f14cc0dd8d613a96a28257f3f6948c8e790..cd70a39ab5e7887f8b5e2e34e2a8d3e684770df3 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG1D1.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG1D1.py @@ -18,7 +18,7 @@ def HIGG1D1KernelCfg(ConfigFlags, name='HIGG1D1Kernel', **kwargs): # Common augmentations from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg - acc.merge(PhysCommonAugmentationsCfg(ConfigFlags)) + acc.merge(PhysCommonAugmentationsCfg(ConfigFlags, TriggerListsHelper = kwargs['TriggerListsHelper'])) # Diphoton Vertex creation from DerivationFrameworkHiggs.HIGG1D1CustomVertexConfig import ZeeVertexRefitterCfg, DiPhotonVertexCfg @@ -28,13 +28,15 @@ def HIGG1D1KernelCfg(ConfigFlags, name='HIGG1D1Kernel', **kwargs): #CustomJetsConfig acc.merge(HIGG1D1CustomJetsCfg(ConfigFlags)) - - # MET and Btagging - #TODO + + from DerivationFrameworkFlavourTag.FtagRun3DerivationConfig import FtagJetCollectionsCfg + acc.merge(FtagJetCollectionsCfg(ConfigFlags,['AntiKt4EMPFlowCustomVtxJets'])) + # + #TODO MET # Thinning tools... - from DerivationFrameworkInDet.InDetToolsConfig import TrackParticleThinningCfg, MuonTrackParticleThinningCfg, TauTrackParticleThinningCfg, DiTauTrackParticleThinningCfg - #from DerivationFrameworkTools.DerivationFrameworkToolsConfig import GenericObjectThinningCfg + from DerivationFrameworkInDet.InDetToolsConfig import TrackParticleThinningCfg, MuonTrackParticleThinningCfg, TauTrackParticleThinningCfg, DiTauTrackParticleThinningCfg + from DerivationFrameworkTools.DerivationFrameworkToolsConfig import GenericObjectThinningCfg # Inner detector group recommendations for indet tracks in analysis # https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/DaodRecommendations @@ -73,35 +75,97 @@ def HIGG1D1KernelCfg(ConfigFlags, name='HIGG1D1Kernel', **kwargs): InDetTrackParticlesKey = "InDetTrackParticles")) ## Low-pt di-tau thinning - #HIGG1D1DiTauLowPtThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(name = "HIGG1D1DiTauLowPtThinningTool", - # StreamName = kwargs['StreamName'], - # ContainerName = "DiTauJetsLowPt", - # SelectionString = "DiTauJetsLowPt.nSubjets > 1")) - # - ## ID tracks associated with low-pt ditau - #HIGG1D1DiTauLowPtTPThinningTool = acc.getPrimaryAndMerge(DiTauTrackParticleThinningCfg(name = "HIGG1D1DiTauLowPtTPThinningTool", - # StreamName = kwargs['StreamName'], - # DiTauKey = "DiTauJetsLowPt", - # InDetTrackParticlesKey = "InDetTrackParticles", - # SelectionString = "DiTauJetsLowPt.nSubjets > 1")) + HIGG1D1DiTauLowPtThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(ConfigFlags, + name = "PHYSDiTauLowPtThinningTool", + StreamName = kwargs['StreamName'], + ContainerName = "DiTauJetsLowPt", + SelectionString = "DiTauJetsLowPt.nSubjets > 1")) + + # ID tracks associated with low-pt ditau + HIGG1D1DiTauLowPtTPThinningTool = acc.getPrimaryAndMerge(DiTauTrackParticleThinningCfg(ConfigFlags, + name = "PHYSDiTauLowPtTPThinningTool", + StreamName = kwargs['StreamName'], + DiTauKey = "DiTauJetsLowPt", + InDetTrackParticlesKey = "InDetTrackParticles", + SelectionString = "DiTauJetsLowPt.nSubjets > 1")) + + + # SkimmingTool + from DerivationFrameworkHiggs.SkimmingToolHIGG1Config import SkimmingToolHIGG1Cfg + + # Requires something in this list of triggers + SkipTriggerRequirement= ConfigFlags.Input.isMC and ConfigFlags.Beam.Energy==4000000.0 + # 8 TeV MC does not have trigger information + print( "HIGG1D1.py SkipTriggerRequirement", SkipTriggerRequirement) + TriggerExp = [] + if not SkipTriggerRequirement: + if ConfigFlags.Beam.Energy==4000000.0: + # 8 TeV data + TriggerExp = ["EF_g35_loose_g25_loose"] + if ConfigFlags.Beam.Energy==6500000.0: + # 13 TeV MC + TriggerExp = ["HLT_2g50_loose_L12EM20VH","HLT_2g25_loose_g15_loose","HLT_g35_medium_g25_medium_L12EM20VH","HLT_2g25_tight_L12EM20VH","HLT_2g22_tight_L12EM15VHI","HLT_g35_loose_g25_loose","HLT_g35_medium_g25_medium","HLT_2g50_loose","HLT_2g20_tight","HLT_2g22_tight","HLT_2g20_tight_icalovloose_L12EM15VHI","HLT_2g20_tight_icalotight_L12EM15VHI","HLT_2g22_tight_L12EM15VHI","HLT_2g22_tight_icalovloose_L12EM15VHI","HLT_2g22_tight_icalotight_L12EM15VHI","HLT_2g22_tight_icalovloose","HLT_2g25_tight_L12EM20VH","HLT_2g20_loose","HLT_2g20_loose_L12EM15","HLT_g35_medium_g25_medium","HLT_g35_medium_g25_medium_L12EM15VH","HLT_g35_loose_g25_loose","HLT_g35_loose_g25_loose_L12EM15VH", "HLT_2g20_loose_g15_loose", "HLT_3g20_loose", "HLT_3g15_loose", "HLT_2g6_tight_icalotight_L1J100", "HLT_2g6_loose_L1J100", "HLT_2g6_tight_icalotight_L1J50", "HLT_2g6_loose_L1J50","HLT_g120_loose","HLT_g140_loose"] + + skimmingTool = acc.popToolsAndMerge( SkimmingToolHIGG1Cfg(ConfigFlags,RequireTrigger=not SkipTriggerRequirement,Triggers=TriggerExp) ) + acc.addPublicTool(skimmingTool) + # Finally the kernel itself thinningTools = [HIGG1D1TrackParticleThinningTool, HIGG1D1MuonTPThinningTool, HIGG1D1TauTPThinningTool, - HIGG1D1DiTauTPThinningTool] - #HIGG1D1DiTauLowPtThinningTool, - #HIGG1D1DiTauLowPtTPThinningTool ] + HIGG1D1DiTauTPThinningTool, + HIGG1D1DiTauLowPtThinningTool, + HIGG1D1DiTauLowPtTPThinningTool ] + + #==================================================================== + # Max Cell sum decoration tool + #==================================================================== + from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg + acc.merge(LArOnOffIdMappingCfg(ConfigFlags)) + + augmentationTools = [] + from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import MaxCellDecoratorCfg + MaxCellDecorator = acc.popToolsAndMerge(MaxCellDecoratorCfg(ConfigFlags)) + acc.addPublicTool(MaxCellDecorator) + augmentationTools.append(MaxCellDecorator) + #==================================================================== + # Gain and cluster energies per layer decoration tool + #==================================================================== + + from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import GainDecoratorCfg, ClusterEnergyPerLayerDecoratorCfg + GainDecoratorTool = acc.popToolsAndMerge(GainDecoratorCfg(ConfigFlags)) + acc.addPublicTool(GainDecoratorTool) + augmentationTools.append(GainDecoratorTool) + + + cluster_sizes = (3,5), (5,7), (7,7), (7,11) + for neta, nphi in cluster_sizes: + cename = "ClusterEnergyPerLayerDecorator_%sx%s" % (neta, nphi) + ClusterEnergyPerLayerDecorator = acc.popToolsAndMerge( ClusterEnergyPerLayerDecoratorCfg(ConfigFlags, neta = neta, nphi=nphi, name=cename )) + acc.addPublicTool(ClusterEnergyPerLayerDecorator) + augmentationTools.append(ClusterEnergyPerLayerDecorator) + + + DerivationKernel = CompFactory.DerivationFramework.DerivationKernel - acc.addEventAlgo(DerivationKernel(name, ThinningTools = thinningTools)) + acc.addEventAlgo(DerivationKernel(name, + SkimmingTools = [skimmingTool], + ThinningTools = thinningTools, + AugmentationTools = augmentationTools)) return acc def HIGG1D1Cfg(ConfigFlags): acc = ComponentAccumulator() - acc.merge(HIGG1D1KernelCfg(ConfigFlags, name="HIGG1D1Kernel", StreamName = 'StreamDAOD_HIGG1D1')) - + + from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper + HIGG1D1TriggerListsHelper = TriggerListsHelper() + + acc.merge(HIGG1D1KernelCfg(ConfigFlags, name="HIGG1D1Kernel", StreamName = 'StreamDAOD_HIGG1D1', TriggerListsHelper = HIGG1D1TriggerListsHelper)) + + # ============================ # Define contents of the format # ============================= @@ -191,17 +255,91 @@ def HIGG1D1Cfg(ConfigFlags): "TauJets.dRmax.etOverPtLeadTrk", "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET.ex.ey", "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht.ex.ey"] - - HIGG1D1SlimmingHelper.AppendToDictionary.update({ "AntiKt4EMPFlowJetsCustomVtx": "xAOD::JetContainer", "AntiKt4EMPFlowCustomVtxJetsAux":"xAOD::JetAuxContainer", + + # Additional content for HIGG1D1 + HIGG1D1SlimmingHelper.AppendToDictionary.update({ "AntiKt4EMPFlowCustomVtxJets": "xAOD::JetContainer", "AntiKt4EMPFlowCustomVtxJetsAux":"xAOD::JetAuxContainer", "HggPrimaryVertices":"xAOD::VertexContainer", "HggPrimaryVerticesAux":"xAOD::ShallowAuxContainer", "Kt4EMPFlowCustomVtxEventShape":"xAOD::EventShape", "Kt4EMPFlowCustomVtxEventShapeAux":"xAOD::EventShapeAuxInfo", "Kt4EMPFlowEventShape":"xAOD::EventShape", "Kt4EMPFlowEventShapeAux":"xAOD::EventShapeAuxInfo", - "ZeeRefittedPrimaryVertices":"xAOD::VertexContainer","ZeeRefittedPrimaryVerticesAux":"xAOD:VertexAuxContainer" + "ZeeRefittedPrimaryVertices":"xAOD::VertexContainer","ZeeRefittedPrimaryVerticesAux":"xAOD:VertexAuxContainer", + "AFPSiHitContainer":"xAOD::AFPSiHitContainer","AFPSiHitContainerAux":"xAOD::AFPSiHitAuxContainer", + "AFPToFHitContainer":"xAOD::AFPToFHitContainer","AFPToFHitContainerAux":"xAOD::AFPToFHitAuxContainer", + "BTagging_AntiKt4EMPFlowCustomVtx":"xAOD::BTaggingContainer","BTagging_AntiKt4EMPFlowCustomVtxAux":"xAOD:BTaggingAuxContainer" }) - HIGG1D1SlimmingHelper.AllVariables += ["HggPrimaryVertices","ZeeRefittedPrimaryVertices","AntiKt4EMPFlowCustomVtxJets","Kt4PFlowCustomVtxEventShape","Kt4EMPFlowEventShape"] + HIGG1D1SlimmingHelper.AllVariables += ["HggPrimaryVertices","ZeeRefittedPrimaryVertices","AntiKt4EMPFlowCustomVtxJets","Kt4EMPFlowCustomVtxEventShape","Kt4EMPFlowEventShape"] + + # Add AFP information + HIGG1D1SlimmingHelper.AllVariables += ["AFPSiHitContainer","AFPToFHitContainer"] + + # Add Btagging information + from DerivationFrameworkFlavourTag.BTaggingContent import BTaggingStandardContent,BTaggingXbbContent + HIGG1D1SlimmingHelper.ExtraVariables += BTaggingStandardContent("AntiKt4EMPFlowCustomVtxJets") + HIGG1D1SlimmingHelper.ExtraVariables += BTaggingStandardContent("AntiKt4EMPFlowJets") + HIGG1D1SlimmingHelper.ExtraVariables += BTaggingXbbContent("AntiKt4EMPFlowCustomVtxJets") + HIGG1D1SlimmingHelper.ExtraVariables += BTaggingXbbContent("AntiKt4EMPFlowJets") + + # is this really needed given Photons are in the AllVariables list ? + from DerivationFrameworkEGamma.PhotonsCPDetailedContent import PhotonsCPDetailedContent + HIGG1D1SlimmingHelper.ExtraVariables += PhotonsCPDetailedContent + + + # Add the variables for Gain adn Cluster energy -- need to get the tools first to use existing functions + from DerivationFrameworkCalo.DerivationFrameworkCaloFactories import getGainDecorations, getClusterEnergyPerLayerDecorations + GainDecoratorTool = None + ClusterEnergyPerLayerDecorators = [] + for toolStr in acc.getEventAlgo("HIGG1D1Kernel").AugmentationTools: + toolStr = f"{toolStr}" + splitStr = toolStr.split('/') + tool = acc.getPublicTool(splitStr[1]) + if splitStr[0]== "DerivationFramework::GainDecorator": + GainDecoratorTool = tool + elif splitStr[0] == "DerivationFramework::ClusterEnergyPerLayerDecorator": + ClusterEnergyPerLayerDecorators.append( tool ) + if GainDecoratorTool : + HIGG1D1SlimmingHelper.ExtraVariables.extend( getGainDecorations(GainDecoratorTool) ) + for tool in ClusterEnergyPerLayerDecorators: + HIGG1D1SlimmingHelper.ExtraVariables.extend( getClusterEnergyPerLayerDecorations( tool ) ) + + + + # Trigger content + HIGG1D1SlimmingHelper.IncludeTriggerNavigation = False + HIGG1D1SlimmingHelper.IncludeJetTriggerContent = False + HIGG1D1SlimmingHelper.IncludeMuonTriggerContent = False + HIGG1D1SlimmingHelper.IncludeEGammaTriggerContent = False + HIGG1D1SlimmingHelper.IncludeJetTauEtMissTriggerContent = False + HIGG1D1SlimmingHelper.IncludeTauTriggerContent = False + HIGG1D1SlimmingHelper.IncludeEtMissTriggerContent = False + HIGG1D1SlimmingHelper.IncludeBJetTriggerContent = False + HIGG1D1SlimmingHelper.IncludeBPhysTriggerContent = False + HIGG1D1SlimmingHelper.IncludeMinBiasTriggerContent = False + + # Trigger matching + # Run 2 + if ConfigFlags.Trigger.EDMVersion == 2: + from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper + AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = HIGG1D1SlimmingHelper, + OutputContainerPrefix = "PhysCommonTau", + TriggerList = HIGG1D1TriggerListsHelper.Run2TriggerNamesTau) + AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = HIGG1D1SlimmingHelper, + OutputContainerPrefix = "PhysCommonNoTau", + TriggerList = HIGG1D1TriggerListsHelper.Run2TriggerNamesNoTau) + # Run 3 + if ConfigFlags.Trigger.EDMVersion == 3: + from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper + AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(HIGG1D1SlimmingHelper) + # Run 2 is added here temporarily to allow testing/comparison/debugging + from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper + AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = HIGG1D1SlimmingHelper, + OutputContainerPrefix = "PhysCommonTau", + TriggerList = HIGG1D1TriggerListsHelper.Run3TriggerNamesTau) + AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = HIGG1D1SlimmingHelper, + OutputContainerPrefix = "PhysCommonNoTau", + TriggerList = HIGG1D1TriggerListsHelper.Run3TriggerNamesNoTau) + # Output stream HIGG1D1ItemList = HIGG1D1SlimmingHelper.GetItemList() acc.merge(OutputStreamCfg(ConfigFlags, "DAOD_HIGG1D1", ItemList=HIGG1D1ItemList, AcceptAlgs=["HIGG1D1Kernel"])) @@ -209,10 +347,4 @@ def HIGG1D1Cfg(ConfigFlags): return acc -# Add trigger matching -# Run 2 -#PhysCommonTrigger.trigmatching_helper_notau.add_to_slimming(HIGG1D1SlimmingHelper) -#PhysCommonTrigger.trigmatching_helper_tau.add_to_slimming(HIGG1D1SlimmingHelper) -# Run 3 -#from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToEDM -#AddRun3TrigNavSlimmingCollectionsToEDM(HIGG1D1Stream) + diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG1D1CustomJetsConfig.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG1D1CustomJetsConfig.py index 98215d2a4a0a081835c5d7fb2486909e409f3770..0b6c5264a4b59c0532be76f214cc6da851c4bcdc 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG1D1CustomJetsConfig.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/HIGG1D1CustomJetsConfig.py @@ -51,11 +51,30 @@ def HIGG1D1CustomJetsCfg(ConfigFlags): return tuple(newList) print( "Failed to update ", orgName, " to ", newName ) return tuple(newList) - + + def updateCalibSequence(tup): + newList = list(tup) + for i, item in enumerate(newList): + if "Calib" in item: + calibspecs = item.split(":") + calib, calibcontext, data_type = calibspecs[:3] + calibseq="" + if len(calibspecs)>3: + calibseq = calibspecs[3] + rhoname = "Kt4EMPFlowCustomVtxEventShape" + pvname = HggVertexContainerName + finalCalibString = f"CalibCustomVtx:{calibcontext}:{data_type}:{calibseq}:{rhoname}:{pvname}" + if len(calibspecs)>6: finalCalibString = f"{finalCalibString}:{calibspecs[6]}" + newList[i] = finalCalibString + print(finalCalibString) + return tuple(newList) + print( "Failed to update calib sequence" ) + return tuple(newList) + # Create modifier list and JetDefinition modsCustomVtx = AntiKt4EMPFlow.modifiers - modsCustomVtx = replaceItems(modsCustomVtx,"Calib","CalibCustomVtx") + modsCustomVtx = updateCalibSequence(modsCustomVtx) modsCustomVtx = replaceItems(modsCustomVtx,"TrackMoments","TrackMomentsCustomVtx") modsCustomVtx = replaceItems(modsCustomVtx,"TrackSumMoments","TrackSumMomentsCustomVtx") modsCustomVtx = replaceItems(modsCustomVtx,"JVF","JVFCustomVtx") @@ -141,7 +160,6 @@ def HIGG1D1CustomJetsCfg(ConfigFlags): stdJetModifiers.update( - #TODO calibration is still picking up the wrong energy density as it set in a config file CalibCustomVtx = JetModifier("JetCalibrationTool","jetcalib_jetcoll_calibseqCustomVtx", createfn=JetCalibToolsConfig.getJetCalibToolFromString, prereqs=lambda mod,jetdef : JetCalibToolsConfig.getJetCalibToolPrereqs(mod,jetdef)+[f"input:{context['Vertices']}"]), diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/SkimmingToolHIGG1Config.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/SkimmingToolHIGG1Config.py new file mode 100644 index 0000000000000000000000000000000000000000..d22844f1a9edfa02eff4f756c5219465d9aa8f4c --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkHiggs/python/SkimmingToolHIGG1Config.py @@ -0,0 +1,28 @@ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +def SkimmingToolHIGG1Cfg(ConfigFlags, **kwargs): + + """ Skimming Tool for HIGG1 derivations""" + + kwargs.setdefault("RequireGRL", True) + kwargs.setdefault("ReqireLArError", True) + kwargs.setdefault("RequireTrigger", False) + kwargs.setdefault("RequirePreselection",False) + kwargs.setdefault("RequireKinematic", False) + kwargs.setdefault("RequireQuality", False) + kwargs.setdefault("RequireIsolation", False) + kwargs.setdefault("RequireInvariantMass", False) + kwargs.setdefault("Triggers" , []) + kwargs.setdefault("IncludeSingleElectronPreselection", False) + kwargs.setdefault("IncludeDoubleElectronPreselection", False) + kwargs.setdefault("IncludeSingleMuonPreselection", False) + + acc = ComponentAccumulator() + + acc.setPrivateTools( CompFactory.DerivationFramework.SkimmingToolHIGG1(**kwargs) ) + + return acc \ No newline at end of file diff --git a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrection.cxx b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrection.cxx index 6833821188a54444b06d2f96a59bff99e2f7df0f..31240ab692bbfac587b547c436590c63db8d6941 100644 --- a/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrection.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/IsolationCorrections/Root/IsolationCorrection.cxx @@ -305,8 +305,6 @@ StatusCode IsolationCorrection::setupDD(const std::string& year) { << " dR = 0.2, conv " << m_graph_dd_cone20_conv_photon_shift->at(ieta)->GetName()); } - file_ptleakagecorr->Close(); - m_corrInitialized[ii][jj] = true; } @@ -600,8 +598,6 @@ StatusCode IsolationCorrection::setupDD(const std::string& year) { m_graph_cone20_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_electron_etabin8_extrap") ); m_graph_cone20_electron.push_back( (TGraph*) file_ptleakagecorr->Get("graph_cone20_electron_etabin9_extrap") ); } - - file_ptleakagecorr->Close(); } void IsolationCorrection::set2015Corr() { @@ -764,16 +760,13 @@ StatusCode IsolationCorrection::setupDD(const std::string& year) { } // root file : no good format } // root file not found - - file_ptleakagecorr->Close(); - } void IsolationCorrection::setDDCorr() { if( !m_corr_ddshift_file.empty() && !m_corr_ddsmearing_file.empty()){ loadDDCorr(); }else{ - ATH_MSG_WARNING("Data-driven correction files not specified, tool not initialized for data-driven corrections\n"); + ATH_MSG_WARNING("Data-driven correction files not specified, tool not initialized for data-driven corrections\n"); } } @@ -787,93 +780,38 @@ StatusCode IsolationCorrection::setupDD(const std::string& year) { m_corr_ddsmearing_file = ""; }else{ - // ********************************** - // Data driven corrections ********** - // https://cds.cern.ch/record/2008664 - // ********************************** - - // Photon shift corrections - std::vector< std::shared_ptr > graph_shift; - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_0"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_1"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_2"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_3"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_4"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_5"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_6"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_7"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_8"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_9"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_10"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_11"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_12"))) ); - graph_shift.push_back( std::shared_ptr(dynamic_cast(file_ddshift_corr->Get("graph_13"))) ); - - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(0)->GetFunction("f") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(1)->GetFunction("f") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(2)->GetFunction("f") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(3)->GetFunction("f") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(4)->GetFunction("f") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(5)->GetFunction("f") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(6)->GetFunction("f") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(7)->GetFunction("f") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(8)->GetFunction("f_2") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(9)->GetFunction("f_2") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(10)->GetFunction("f_2") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(11)->GetFunction("f_2") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(12)->GetFunction("f_2") ); - m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(13)->GetFunction("f_2") ); - - // Photon smearing corrections (to be applied in end caps only) + // ********************************** + // Data driven corrections ********** + // https://cds.cern.ch/record/2008664 + // ********************************** + + // Photon shift corrections + std::vector< std::shared_ptr > graph_shift; + // Photon smearing corrections (to be applied in end caps only) std::vector< std::shared_ptr > graph_smearing; - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_0"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_1"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_2"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_3"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_4"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_5"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_6"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_7"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_8"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_9"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_10"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_11"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_12"))) ); - graph_smearing.push_back( std::shared_ptr(dynamic_cast(file_ddsmearingcorr->Get("graph_13"))) ); - - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(0)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(1)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(2)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(3)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(4)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(5)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(6)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(7)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(8)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(9)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(10)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(11)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(12)->GetFunction("f_3") ); - m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(13)->GetFunction("f_3") ); - - for (const auto& gr : graph_shift) { + for (int ig = 0; ig <= 13; ig++) { + graph_shift.emplace_back( dynamic_cast(file_ddshift_corr->Get(Form("graph_%i",ig))) ); + graph_smearing.emplace_back( dynamic_cast(file_ddsmearingcorr->Get(Form("graph_%i",ig))) ); + } + for (int ig = 0; ig <= 13; ig++) { + if (ig <= 7) + m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(ig)->GetFunction("f") ); + else + m_graph_dd_cone40_photon_shift.push_back( graph_shift.at(ig)->GetFunction("f_2") ); + m_graph_dd_cone40_photon_smearing.push_back( graph_smearing.at(ig)->GetFunction("f_3") ); + } + + for (const auto& gr : graph_shift) { if (gr == nullptr) - ATH_MSG_ERROR("Null pointer for one of the DD correction graphs"); + ATH_MSG_ERROR("Null pointer for one of the DD correction graphs"); } for (const auto& gr : graph_smearing) { if (gr == nullptr) - ATH_MSG_ERROR("Null pointer for one of the smearing graphs"); + ATH_MSG_ERROR("Null pointer for one of the smearing graphs"); } - } - - file_ddshift_corr->Close(); - file_ddsmearingcorr->Close(); - } - - template void IsolationCorrection::FreeClear( T & cntr ) { ATH_MSG_DEBUG("FreeClearing the container " << cntr.size()); for ( typename T::iterator it = cntr.begin(); diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt index 26eb7f42bde9e5710c3c7e43e261053625c3fd02..7e185362669a83739503a2e619f4a40575517731 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/CMakeLists.txt @@ -27,6 +27,7 @@ atlas_add_library( FlavorTagDiscriminants Root/DL2Tool.cxx Root/DataPrepUtilities.cxx Root/OnnxUtil.cxx + Root/GNN.cxx Root/GNNTool.cxx Root/customGetter.cxx Root/FlipTagEnums.cxx diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DL2HighLevel.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DL2HighLevel.h index 8724497ad21ce186f5dbb46d6de2681bed6aa7ab..06d49acb8f473c311dcaff0269f1f95afd44df98 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DL2HighLevel.h +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DL2HighLevel.h @@ -31,13 +31,14 @@ namespace FlavorTagDiscriminants { TrackLinkType = TrackLinkType::TRACK_PARTICLE, float default_output_value = NAN); DL2HighLevel(DL2HighLevel&&); + DL2HighLevel(const DL2HighLevel&); ~DL2HighLevel(); void decorate(const xAOD::BTagging& btag) const; void decorate(const xAOD::Jet& jet) const; void decorateWithDefaults(const xAOD::Jet& jet) const; FTagDataDependencyNames getDataDependencyNames() const; private: - std::unique_ptr m_dl2; + std::shared_ptr m_dl2; }; } diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DataPrepUtilities.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DataPrepUtilities.h index b9d478da21c9d48824c6034fd0b36644896366a2..6ad1693f9d84f12a86892dcde7c6ed79a2176c07 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DataPrepUtilities.h +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/DataPrepUtilities.h @@ -6,7 +6,6 @@ #define DATA_PREP_UTILITIES_H // local includes -#include "FlavorTagDiscriminants/customGetter.h" #include "FlavorTagDiscriminants/FlipTagEnums.h" #include "FlavorTagDiscriminants/AssociationEnums.h" #include "FlavorTagDiscriminants/FTagDataDependencyNames.h" diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/GNN.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/GNN.h new file mode 100644 index 0000000000000000000000000000000000000000..ceb934e0b55ffbfcde4a528f49e7b74ae7f21d78 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/GNN.h @@ -0,0 +1,65 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef GNN_H +#define GNN_H + +// Tool includes +#include "FlavorTagDiscriminants/FlipTagEnums.h" +#include "FlavorTagDiscriminants/AssociationEnums.h" +#include "FlavorTagDiscriminants/FTagDataDependencyNames.h" + +#include "FlavorTagDiscriminants/DataPrepUtilities.h" + +// EDM includes +#include "xAODBTagging/BTaggingFwd.h" +#include "xAODJet/JetContainer.h" + +#include +#include +#include + +namespace FlavorTagDiscriminants { + + class OnnxUtil; + // + // Tool to to flavor tag jet/btagging object + // using GNN based taggers + class GNN + { + public: + GNN(const std::string& nnFile, + const FlipTagConfig& flip_config = FlipTagConfig::STANDARD, + const std::map& variableRemapping = {}, + const TrackLinkType trackLinkType = TrackLinkType::TRACK_PARTICLE, + float defaultOutputValue = NAN); + GNN(GNN&&); + GNN(const GNN&); + ~GNN(); + + virtual void decorate(const xAOD::BTagging& btag) const; + virtual void decorate(const xAOD::Jet& jet) const; + virtual void decorateWithDefaults(const xAOD::Jet& jet) const; + void decorate(const xAOD::Jet& jet, const SG::AuxElement& decorated) const; + + virtual std::set getDecoratorKeys() const; + virtual std::set getAuxInputKeys() const; + virtual std::set getConstituentAuxInputKeys() const; + + private: + + std::shared_ptr m_onnxUtil; + + SG::AuxElement::ConstAccessor> m_jetLink; + std::string m_input_node_name; + std::vector m_varsFromBTag; + std::vector m_varsFromJet; + std::vector m_trackSequenceBuilders; + std::map m_decorators; + float m_defaultValue; + + FTagDataDependencyNames m_dataDependencyNames; + }; +} +#endif diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/GNNTool.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/GNNTool.h index 7b4684cf5198304eb7b435ecd7b94a1e1bb5cb18..ae9f3562d29d97dda24086b061a554e74fd5321a 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/GNNTool.h +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/GNNTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef GNN_TOOL_H @@ -15,19 +15,16 @@ // EDM includes #include "xAODBTagging/BTaggingFwd.h" -#include "xAODJet/Jet.h" -#include "xAODBTagging/BTagging.h" +#include "xAODJet/JetFwd.h" #include #include #include -#include "FlavorTagDiscriminants/DataPrepUtilities.h" -#include "FlavorTagDiscriminants/OnnxUtil.h" +namespace FlavorTagDiscriminants { + class GNN; -namespace FlavorTagDiscriminants { - struct GNNToolProperties { std::string nnFile; std::string flipTagConfig; @@ -56,27 +53,14 @@ namespace FlavorTagDiscriminants { virtual void decorateWithDefaults(const xAOD::Jet& jet) const override; void decorate(const xAOD::Jet& jet, const SG::AuxElement& decorated) const; - - virtual std::set getDecoratorKeys() const override; virtual std::set getAuxInputKeys() const override; virtual std::set getConstituentAuxInputKeys() const override; private: - GNNToolProperties m_props; //! - - std::unique_ptr m_onnxUtil; - lwt::GraphConfig m_config; - - SG::AuxElement::ConstAccessor> m_jetLink; - std::string m_input_node_name; - std::vector m_varsFromBTag; - std::vector m_varsFromJet; - std::vector m_trackSequenceBuilders; - std::map m_decorators; - - FTagDataDependencyNames m_dataDependencyNames; + GNNToolProperties m_props; + std::unique_ptr m_gnn; }; } #endif diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/OnnxUtil.h b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/OnnxUtil.h index b020923e22886f42497e66fcfc914ac1db30375b..9e8cccb55ea82e2a84ecb86176af9e3e64ec8ce2 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/OnnxUtil.h +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/FlavorTagDiscriminants/OnnxUtil.h @@ -11,7 +11,7 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration namespace FlavorTagDiscriminants { typedef std::pair, std::vector> input_pair; - + // // Utility class that loads the onnx model from the given path // and runs inference based on the user given inputs @@ -30,7 +30,7 @@ namespace FlavorTagDiscriminants { std::map& output ) const; - std::string getMetaData(const std::string& key); + std::string getMetaData(const std::string& key) const; private: diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DL2HighLevel.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DL2HighLevel.cxx index ebc1b7c1f87dae88e5cd397fea02fd8116f977af..20abbab7d0d0f1ba8b773198878e6452d6300652 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DL2HighLevel.cxx +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DL2HighLevel.cxx @@ -55,6 +55,7 @@ namespace FlavorTagDiscriminants { DL2HighLevel::~DL2HighLevel() = default; DL2HighLevel::DL2HighLevel(DL2HighLevel&&) = default; + DL2HighLevel::DL2HighLevel(const DL2HighLevel&) = default; void DL2HighLevel::decorate(const xAOD::BTagging& btag) const { m_dl2->decorate(btag); diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DataPrepUtilities.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DataPrepUtilities.cxx index 0cb41f923df97b33ece2c5e38c50ed83ff79784d..f6576b560a3efa1b0d3823c9945056a4836abfca 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DataPrepUtilities.cxx +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/DataPrepUtilities.cxx @@ -4,6 +4,7 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration #include "FlavorTagDiscriminants/DataPrepUtilities.h" #include "FlavorTagDiscriminants/BTagTrackIpAccessor.h" +#include "FlavorTagDiscriminants/customGetter.h" #include "xAODBTagging/BTaggingUtilities.h" diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/GNN.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/GNN.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7e668e4f5f5249ceec008e38d29d939dd2e0b2e8 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/GNN.cxx @@ -0,0 +1,152 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "FlavorTagDiscriminants/GNN.h" +#include "FlavorTagDiscriminants/BTagTrackIpAccessor.h" +#include "FlavorTagDiscriminants/OnnxUtil.h" + +#include "xAODBTagging/BTagging.h" +#include "xAODJet/JetContainer.h" + +#include "PathResolver/PathResolver.h" +#include "lwtnn/parse_json.hh" + +#include + +namespace { + const std::string jetLinkName = "jetLink"; +} + +namespace FlavorTagDiscriminants { + + GNN::GNN(const std::string& nnFile, + const FlipTagConfig& flip_config, + const std::map& variableRemapping, + const TrackLinkType trackLinkType, + float defaultOutputValue): + m_onnxUtil(nullptr), + m_jetLink(jetLinkName), + m_defaultValue(defaultOutputValue) + { + std::string fullPathToOnnxFile = PathResolverFindCalibFile(nnFile); + m_onnxUtil = std::make_shared(fullPathToOnnxFile); + + std::string gnn_config_str = m_onnxUtil->getMetaData("gnn_config"); + std::stringstream gnn_config_stream; + gnn_config_stream << gnn_config_str; + + auto config = lwt::parse_json_graph(gnn_config_stream); + + auto [inputs, track_sequences, options] = dataprep::createGetterConfig( + config, flip_config, variableRemapping, trackLinkType); + + auto [vb, vj, ds] = dataprep::createBvarGetters(inputs); + m_varsFromBTag = vb; + m_varsFromJet = vj; + m_dataDependencyNames = ds; + + auto [tsb, td] = dataprep::createTrackGetters( + track_sequences, options); + m_trackSequenceBuilders = tsb; + m_dataDependencyNames += td; + + auto [decorators, dd] = dataprep::createDecorators( + config, options); + m_decorators = decorators; + m_dataDependencyNames += dd; + + } + GNN::GNN(GNN&&) = default; + GNN::GNN(const GNN&) = default; + GNN::~GNN() = default; + + void GNN::decorate(const xAOD::BTagging& btag) const { + auto jetLink = m_jetLink(btag); + if (!jetLink.isValid()) { + throw std::runtime_error("invalid jetLink"); + } + const xAOD::Jet& jet = **jetLink; + decorate(jet, btag); + } + void GNN::decorate(const xAOD::Jet& jet) const { + decorate(jet, jet); + } + void GNN::decorateWithDefaults(const xAOD::Jet& jet) const { + for (const auto& dec: m_decorators) { + for (const auto& node: dec.second) { + node.second(jet) = m_defaultValue; + } + } + } + + void GNN::decorate(const xAOD::Jet& jet, const SG::AuxElement& btag) const { + + using namespace internal; + + std::map gnn_input; + + std::vector jet_feat; + for (const auto& getter: m_varsFromBTag) { + jet_feat.push_back(getter(btag).second); + } + for (const auto& getter: m_varsFromJet) { + jet_feat.push_back(getter(jet).second); + } + std::vector jet_feat_dim = {1, static_cast(jet_feat.size())}; + + input_pair jet_info (jet_feat, jet_feat_dim); + gnn_input.insert({"jet_features", jet_info}); + + for (const auto& builder: m_trackSequenceBuilders) { + std::vector track_feat; // (#tracks, #feats).flatten + int num_track_vars = static_cast(builder.sequencesFromTracks.size()); + int num_tracks = 0; + + Tracks sorted_tracks = builder.tracksFromJet(jet, btag); + Tracks flipped_tracks = builder.flipFilter(sorted_tracks, jet); + + int track_var_idx=0; + for (const auto& seq_builder: builder.sequencesFromTracks) { + auto double_vec = seq_builder(jet, flipped_tracks).second; + + if (track_var_idx==0){ + num_tracks = static_cast(double_vec.size()); + track_feat.resize(num_tracks * num_track_vars); + } + + // need to transpose + flatten + for (unsigned int track_idx=0; track_idx track_feat_dim = {num_tracks, num_track_vars}; + + input_pair track_info (track_feat, track_feat_dim); + gnn_input.insert({"track_features", track_info}); + } + + std::map outputs; + m_onnxUtil->runInference(gnn_input, outputs); + + for (const auto& dec: m_decorators) { + for (const auto& node: dec.second) { + node.second(btag) = outputs.at(node.first); + } + } + } // end of decorate() + + // Dependencies + std::set GNN::getDecoratorKeys() const { + return m_dataDependencyNames.bTagOutputs; + } + std::set GNN::getAuxInputKeys() const { + return m_dataDependencyNames.bTagInputs; + } + std::set GNN::getConstituentAuxInputKeys() const { + return m_dataDependencyNames.trackInputs; + } + +} diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/GNNTool.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/GNNTool.cxx index 0736036aab14231f3f42389c1cfd81aa0f8fb8a6..c59f9e067d5f093717932592e00746abcd676284 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/GNNTool.cxx +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/GNNTool.cxx @@ -1,28 +1,15 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "FlavorTagDiscriminants/GNNTool.h" -#include "FlavorTagDiscriminants/BTagTrackIpAccessor.h" - -#include "xAODBTagging/BTaggingUtilities.h" -#include "PathResolver/PathResolver.h" - -#include "lwtnn/parse_json.hh" - -#include - - -namespace { - const std::string jetLinkName = "jetLink"; -} +#include "FlavorTagDiscriminants/GNN.h" namespace FlavorTagDiscriminants { GNNTool::GNNTool(const std::string& name): asg::AsgTool(name), - m_props(), - m_jetLink(jetLinkName) + m_props() { declareProperty("nnFile", m_props.nnFile, "the path to the netowrk file used to run inference"); @@ -49,126 +36,41 @@ namespace FlavorTagDiscriminants { if (m_props.trackLinkType.size() > 0) { trackLinkType = trackLinkTypeFromString(m_props.trackLinkType); } - - std::string fullPathToOnnxFile = PathResolverFindCalibFile(m_props.nnFile); - - m_onnxUtil = std::make_unique (fullPathToOnnxFile); - m_onnxUtil->initialize(); - - std::string gnn_config_str = m_onnxUtil->getMetaData("gnn_config"); - - std::stringstream gnn_config_stream; - gnn_config_stream << gnn_config_str; - - m_config = lwt::parse_json_graph(gnn_config_stream); - - auto [inputs, track_sequences, options] = dataprep::createGetterConfig( - m_config, flip_config, m_props.variableRemapping, trackLinkType); - - auto [vb, vj, ds] = dataprep::createBvarGetters(inputs); - m_varsFromBTag = vb; - m_varsFromJet = vj; - m_dataDependencyNames = ds; - - auto [tsb, td] = dataprep::createTrackGetters( - track_sequences, options); - m_trackSequenceBuilders = tsb; - m_dataDependencyNames += td; - - auto [decorators, dd] = dataprep::createDecorators( - m_config, options); - m_decorators = decorators; - m_dataDependencyNames += dd; + m_gnn.reset( + new GNN( + m_props.nnFile, + flip_config, + m_props.variableRemapping, + trackLinkType, + m_props.default_output_value)); return StatusCode::SUCCESS; } void GNNTool::decorate(const xAOD::BTagging& btag) const { - auto jetLink = m_jetLink(btag); - if (!jetLink.isValid()) { - throw std::runtime_error("invalid jetLink"); - } - const xAOD::Jet& jet = **jetLink; - decorate(jet, btag); + m_gnn->decorate(btag); } void GNNTool::decorate(const xAOD::Jet& jet) const { - decorate(jet, jet); + m_gnn->decorate(jet, jet); } void GNNTool::decorateWithDefaults(const xAOD::Jet& jet) const { - for (const auto& dec: m_decorators) { - for (const auto& node: dec.second) { - node.second(jet) = m_props.default_output_value; - } - } + m_gnn->decorateWithDefaults(jet); } - void GNNTool::decorate(const xAOD::Jet& jet, const SG::AuxElement& btag) const { - - using namespace internal; - - std::map gnn_input; - - std::vector jet_feat; - for (const auto& getter: m_varsFromBTag) { - jet_feat.push_back(getter(btag).second); - } - for (const auto& getter: m_varsFromJet) { - jet_feat.push_back(getter(jet).second); - } - std::vector jet_feat_dim = {1, static_cast(jet_feat.size())}; - - input_pair jet_info (jet_feat, jet_feat_dim); - gnn_input.insert({"jet_features", jet_info}); - - for (const auto& builder: m_trackSequenceBuilders) { - std::vector track_feat; // (#tracks, #feats).flatten - int num_track_vars = static_cast(builder.sequencesFromTracks.size()); - int num_tracks = 0; - - Tracks sorted_tracks = builder.tracksFromJet(jet, btag); - Tracks flipped_tracks = builder.flipFilter(sorted_tracks, jet); - - int track_var_idx=0; - for (const auto& seq_builder: builder.sequencesFromTracks) { - auto double_vec = seq_builder(jet, flipped_tracks).second; - - if (track_var_idx==0){ - num_tracks = static_cast(double_vec.size()); - track_feat.resize(num_tracks * num_track_vars); - } - - // need to transpose + flatten - for (unsigned int track_idx=0; track_idx track_feat_dim = {num_tracks, num_track_vars}; - - input_pair track_info (track_feat, track_feat_dim); - gnn_input.insert({"track_features", track_info}); - } - - std::map outputs; - m_onnxUtil->runInference(gnn_input, outputs); - - for (const auto& dec: m_decorators) { - for (const auto& node: dec.second) { - node.second(btag) = outputs.at(node.first); - } - } - } // end of decorate() + void GNNTool::decorate(const xAOD::Jet& jet, const SG::AuxElement& btag) const + { + m_gnn->decorate(jet, btag); + } // Dependencies std::set GNNTool::getDecoratorKeys() const { - return m_dataDependencyNames.bTagOutputs; + return m_gnn->getDecoratorKeys(); } std::set GNNTool::getAuxInputKeys() const { - return m_dataDependencyNames.bTagInputs; + return m_gnn->getAuxInputKeys(); } std::set GNNTool::getConstituentAuxInputKeys() const { - return m_dataDependencyNames.trackInputs; + return m_gnn->getConstituentAuxInputKeys(); } } diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/OnnxUtil.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/OnnxUtil.cxx index 8d21ec942557243fcc041130510b1e7d879e66c8..0a69a1af9204349a6e2d6a3c25bf098aa6aeccf1 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/OnnxUtil.cxx +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/Root/OnnxUtil.cxx @@ -13,17 +13,9 @@ namespace FlavorTagDiscriminants { // Constructor OnnxUtil::OnnxUtil(const std::string& path_to_onnx){ - m_path_to_onnx = path_to_onnx; - } - - // Destructor - OnnxUtil::~OnnxUtil(){ - } - - void OnnxUtil::initialize(){ //load the onnx model to memory using the path m_path_to_onnx - m_env = std::make_unique< Ort::Env >(ORT_LOGGING_LEVEL_ERROR, ""); + m_env = std::make_unique< Ort::Env >(ORT_LOGGING_LEVEL_FATAL, ""); // initialize session options if needed Ort::SessionOptions session_options; @@ -32,13 +24,13 @@ namespace FlavorTagDiscriminants { GraphOptimizationLevel::ORT_ENABLE_EXTENDED); // create session and load model into memory - m_session = std::make_unique< Ort::Session >(*m_env, m_path_to_onnx.c_str(), + m_session = std::make_unique< Ort::Session >(*m_env, path_to_onnx.c_str(), session_options); Ort::AllocatorWithDefaultOptions allocator; // get the input nodes size_t num_input_nodes = m_session->GetInputCount(); - + // iterate over all input nodes for (std::size_t i = 0; i < num_input_nodes; i++) { char* input_name = m_session->GetInputName(i, allocator); @@ -56,8 +48,10 @@ namespace FlavorTagDiscriminants { } } + // Destructor + OnnxUtil::~OnnxUtil() = default; - std::string OnnxUtil::getMetaData(const std::string& key){ + std::string OnnxUtil::getMetaData(const std::string& key) const { Ort::AllocatorWithDefaultOptions allocator; Ort::ModelMetadata metadata = m_session->GetModelMetadata(); @@ -71,8 +65,8 @@ namespace FlavorTagDiscriminants { std::map& output) const { // Args: - // gnn_inputs : {string: input_pair} - // outputs : {string: float} + // gnn_inputs : {string: input_pair} + // outputs : {string: float} std::vector input_tensor_values; diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/src/components/FlavorTagDiscriminants_entries.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/src/components/FlavorTagDiscriminants_entries.cxx index 83ba50be460fa7d47ff4ca7dc64dff38d5a45d97..6b1d9189add9423c3839736f7c34a9aef6bcaead 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/src/components/FlavorTagDiscriminants_entries.cxx +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/src/components/FlavorTagDiscriminants_entries.cxx @@ -38,4 +38,4 @@ DECLARE_COMPONENT(BTaggingBuilderAlg) DECLARE_COMPONENT(PoorMansIpAugmenterAlg) DECLARE_COMPONENT(TrackLeptonDecoratorAlg) DECLARE_COMPONENT(TrackTruthDecoratorAlg) -DECLARE_COMPONENT (TrackClassifier) +DECLARE_COMPONENT(TrackClassifier) diff --git a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/util/get-onnx-metadata.cxx b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/util/get-onnx-metadata.cxx index 5ca33d97ecd707decc0a37d853f928176d72fd24..87bb64d1edc06702d2a609548089c2cda26be3d5 100644 --- a/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/util/get-onnx-metadata.cxx +++ b/PhysicsAnalysis/JetTagging/FlavorTagDiscriminants/util/get-onnx-metadata.cxx @@ -2,8 +2,8 @@ #include int main(int narg, char* argv[]) { - if (narg != 3) { - std::cout << "usage: " << argv[0] << " " << std::endl; + if (narg != 3 && narg != 2) { + std::cout << "usage: " << argv[0] << " [key]" << std::endl; return 1; } @@ -14,7 +14,7 @@ int main(int narg, char* argv[]) { Ort::SessionOptions session_options; session_options.SetIntraOpNumThreads(1); session_options.SetGraphOptimizationLevel( - GraphOptimizationLevel::ORT_ENABLE_EXTENDED); + GraphOptimizationLevel::ORT_DISABLE_ALL); // create session and load model into memory auto session = std::make_unique< Ort::Session >(*env, argv[1], @@ -23,8 +23,19 @@ int main(int narg, char* argv[]) { // get metadata Ort::AllocatorWithDefaultOptions allocator; Ort::ModelMetadata metadata = session->GetModelMetadata(); + if (narg == 2) { + std::cout << "keys: "; + int64_t nkeys = 0; + char** keys = metadata.GetCustomMetadataMapKeys(allocator, nkeys); + for (int64_t i = 0; i < nkeys; i++) { + std::cout << keys[i]; + if (i+1 < nkeys) std::cout << ", "; + } + std::cout << std::endl; + return 2; + } std::string val = metadata.LookupCustomMetadataMap(argv[2], allocator); std::cout << val << std::endl; - + return 0; } diff --git a/Projects/AthSimulation/version.txt b/Projects/AthSimulation/version.txt index 25ddf3ab9c676463f604689f556be5f8dc76662b..84b76f4d1c529b62d5806a3696b62eb6d5559c1e 100644 --- a/Projects/AthSimulation/version.txt +++ b/Projects/AthSimulation/version.txt @@ -1 +1 @@ -22.0.68 +23.0.0 diff --git a/Projects/Athena/version.txt b/Projects/Athena/version.txt index 25ddf3ab9c676463f604689f556be5f8dc76662b..84b76f4d1c529b62d5806a3696b62eb6d5559c1e 100644 --- a/Projects/Athena/version.txt +++ b/Projects/Athena/version.txt @@ -1 +1 @@ -22.0.68 +23.0.0 diff --git a/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h b/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h index 18f0256bfb21d42ca80b96c61516ad822c81a4cf..5d4106873cbad9f8302d7438bd3718f8edf07324 100644 --- a/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h +++ b/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h @@ -85,7 +85,6 @@ private: std::vector m_timeDependentInsituConfigs; std::vector m_runBins; bool m_doSetDetectorEta; - std::string m_vertexContainerName; bool m_insituCombMassCalib; std::vector m_insituCombMassConfig; diff --git a/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx b/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx index bc50eb30e7f4568003bfd67d8df957db65bff761..4c71bcc86be3b6cfd7d809eecab6cb096f8e73f3 100644 --- a/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx +++ b/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx @@ -98,10 +98,7 @@ StatusCode JetCalibrationTool::initialize() { // Rho key specified in the config file? std::string rhoKey_config = m_globalConfig->GetValue("RhoKey", "None"); - - // Get name of vertex container - m_vertexContainerName = m_globalConfig->GetValue("VertexContainerName","PrimaryVertices"); - + bool requireRhoInput = false; //Make sure the residual correction is turned on if requested diff --git a/Reconstruction/Jet/JetMomentTools/python/JetMomentToolsConfig.py b/Reconstruction/Jet/JetMomentTools/python/JetMomentToolsConfig.py index f3e4ab357642a8b18180f65c10f8bb993f38eb11..8a0c95d934f57c9895653e8ee45956668157b50a 100644 --- a/Reconstruction/Jet/JetMomentTools/python/JetMomentToolsConfig.py +++ b/Reconstruction/Jet/JetMomentTools/python/JetMomentToolsConfig.py @@ -189,20 +189,23 @@ def getQGTaggingTool(jetdef, modspec): def getPFlowfJVTTool(jetdef, modspec): from JetCalibTools import JetCalibToolsConfig - jetCalibrationTool = JetCalibToolsConfig.getJetCalibToolFromString(jetdef, "AnalysisLatest:mc:JetArea_Residual_EtaJES") + calibString = "AnalysisLatest:mc:JetArea_Residual_EtaJES" + if( modspec and modspec == "CustomVtx" ) : + calibString = "AnalysisLatest:mc:JetArea_Residual_EtaJES:Kt4EMPFlowCustomVtxEventShape:HggPrimaryVertices" + jetCalibrationTool = JetCalibToolsConfig.getJetCalibToolFromString(jetdef, calibString) wPFOTool = CompFactory.getComp('CP::WeightPFOTool')("fJVT__wPFO") trackingKeys = jetContextDic[modspec or jetdef.context] - fJVTTool = CompFactory.JetForwardPFlowJvtTool('fJVT', + fJVTTool = CompFactory.JetForwardPFlowJvtTool("fJVT", verticesName = trackingKeys["Vertices"], TrackVertexAssociation = trackingKeys["TVA"], WeightPFOTool = wPFOTool, JetCalibrationTool = jetCalibrationTool, FEName = jetdef.inputdef.containername, ORName = "", - FjvtRawName = 'DFCommonJets_fJvt', + FjvtRawName = "DFCommonJets_fJvt", includePV = True) return fJVTTool diff --git a/Reconstruction/RecJobTransforms/test/RecoSteeringTest.py b/Reconstruction/RecJobTransforms/test/RecoSteeringTest.py index 92a8cfb7031eebdd3727da8824869fe7c4ecfa2e..912c409f0aeb138963159a371ece0d01f05d2e04 100755 --- a/Reconstruction/RecJobTransforms/test/RecoSteeringTest.py +++ b/Reconstruction/RecJobTransforms/test/RecoSteeringTest.py @@ -35,7 +35,7 @@ def _run(input): flags.Common.ProductionStep=ProductionStep.Reconstruction # Enable PerfMon - flags.PerfMon.doFullMonMT = True + flags.PerfMon.doFastMonMT = True flags.PerfMon.OutputJSON = f"perfmonmt_{input}.json" flags.lock() diff --git a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.cxx b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.cxx index 0d3942eee6830c5d3e42cbc78b3e50d44301030b..d4b3b3206aaa465e4025d9dc7b51cad680892793 100644 --- a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.cxx +++ b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.cxx @@ -208,55 +208,28 @@ ParticleCaloExtensionTool::caloExtension( const xAOD::TrackParticle& particle) const { /* - * In principle we will extrapolate either from the perigee or - * from the last measurement of the trackParticle. - * - * For electrons the extrapolation will be done as a muon since this - * is the closest to non-interacting in the calorimeter - * while still providing intersections. + * The following are tuned mainly for + * the strategy we want to follow for muons. + * But should also work well as a generic + * strategy. * - * Also for electrons track Particles (GSF) - * we retain the perigee,first,last. - * even in AOD. + * For electrons the extrapolation will be done as + * a muon (we want close to non-interacting) */ // Start with what the user opted as strategy ParticleHypothesis particleType = m_particleStrategy; + // special treatment when we want an electron strategy if (m_particleStrategy == electron) { particleType = muon; - if (m_startFromPerigee) { - return caloExtension( - ctx, particle.perigeeParameters(), alongMomentum, particleType); - } else { - unsigned int index(0); - if (particle.indexOfParameterAtPosition(index, xAOD::LastMeasurement)) { - const Trk::CurvilinearParameters& lastParams = - particle.curvilinearParameters(index); - const Amg::Vector3D& position = lastParams.position(); - // Muon Entry is around z 6783 and r 4255 - if (position.perp() > 4200. || std::abs(position.z()) > 6700.) { - ATH_MSG_WARNING("Can extrapolate to calo along momentum if already " - "past it. Probematic parameters : " - << lastParams); - return nullptr; - } - return caloExtension(ctx, lastParams, alongMomentum, particleType); - } - } } - /* - * The following are tuned mainly for - * the strategy we want to follow for muons. - * But should also work well as a generic - * strategy. So is the default/fallback. - */ - - // Check if the fitter has used electron hypo - // and force using the muon strategy if (particle.particleHypothesis() == xAOD::electron) { particleType = muon; } + + // In principle we will extrapolate either from the perigee or + // from the last measurement. if (m_startFromPerigee || !particle.track()) { bool idExit = true; // Muon Entry is around z 6783 and r 4255 @@ -419,7 +392,7 @@ ParticleCaloExtensionTool::caloExtension(const EventContext& ctx, } if (!muonEntry && propDir == Trk::oppositeMomentum && - fabs(startPars.position().perp() - 4255.) < 1.) { + std::abs(startPars.position().perp() - 4255.) < 1.) { // muonEntry is right at the startPars position muonEntry = startPars.clone(); } diff --git a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.h b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.h index 0d5cf38a300cfd1856fcbbbedc1e1fbe77a031d3..79545fc2071e3b13927c2a9b4fb407611fe93e13 100644 --- a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.h +++ b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloExtensionTool.h @@ -1,11 +1,12 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /* * ParticleCaloExtensionTool.h - implements the IParticleCaloExtenions - * Interface begin : Summer 2014 updated : 2018-2019 for AthenaMT authors : - * Niels van Eldik (CERN PH-ATC),Christos Anastopoulos + * Interface begin : Summer 2014 + * updated : 2018-2019 for AthenaMT + * authors : Niels van Eldik (CERN PH-ATC),Christos Anastopoulos */ #ifndef TRKPARTICLECREATOR_PARTICLECALOEXTENSIONTOOL_H diff --git a/Reconstruction/eflowRec/eflowRec/PFOChargedCreatorAlgorithm.h b/Reconstruction/eflowRec/eflowRec/PFOChargedCreatorAlgorithm.h deleted file mode 100644 index dadc61d49eb38482889c043090e91a54099d598e..0000000000000000000000000000000000000000 --- a/Reconstruction/eflowRec/eflowRec/PFOChargedCreatorAlgorithm.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ -#ifndef PFOCHARGEDCREATORALGORITHM_H -#define PFOCHARGEDCREATORALGORITHM_H - -#include "eflowRec/eflowCaloObject.h" - -#include "AthenaBaseComps/AthReentrantAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" -#include "StoreGate/DataHandle.h" - -#include "xAODPFlow/PFOContainer.h" - -class PFOChargedCreatorAlgorithm : public AthReentrantAlgorithm { - -public: - - PFOChargedCreatorAlgorithm(const std::string& name, ISvcLocator* pSvcLocator); - - ~PFOChargedCreatorAlgorithm() {} - - StatusCode initialize(); - StatusCode execute(const EventContext&) const; - StatusCode finalize(); - -private: - /** Create the charged PFO */ - void createChargedPFO(const eflowCaloObject& energyFlowCaloObject, bool addClusters, SG::WriteHandle& chargedPFOContainerWriteHandle) const; - - /** Toggle EOverP algorithm mode, whereby no charged shower subtraction is performed */ - Gaudi::Property m_eOverPMode{this,"EOverPMode",false,"Toggle EOverP algorithm mode, whereby no charged shower subtraction is performed"}; - - /** ReadHandleKey for eflowCaloObjectContainer */ - SG::ReadHandleKey m_eflowCaloObjectContainerReadHandleKey{this,"eflowCaloObjectContainerName","eflowCaloObjects","ReadHandleKey for eflowCaloObjectContainer"}; - - /** WriteHandleKey for charged PFO */ - SG::WriteHandleKey m_chargedPFOContainerWriteHandleKey{this,"PFOOutputName","JetETMissChargedParticleFlowObjects","WriteHandleKey for charged PFO"}; - -}; -#endif diff --git a/Reconstruction/eflowRec/eflowRec/PFONeutralCreatorAlgorithm.h b/Reconstruction/eflowRec/eflowRec/PFONeutralCreatorAlgorithm.h deleted file mode 100644 index 27c8181d8e3adad9b568cfb18ae8479472f452dd..0000000000000000000000000000000000000000 --- a/Reconstruction/eflowRec/eflowRec/PFONeutralCreatorAlgorithm.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ -#ifndef PFONEUTRALCREATORALGORITHM_H -#define PFONEUTRALCREATORALGORITHM_H - -#include "eflowRec/eflowCaloObject.h" - -#include "AthenaBaseComps/AthReentrantAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" -#include "StoreGate/DataHandle.h" - -#include "xAODCaloEvent/CaloCluster.h" -#include "xAODPFlow/PFO.h" -#include "xAODPFlow/PFOContainer.h" - -class PFONeutralCreatorAlgorithm : public AthReentrantAlgorithm { - -public: - - PFONeutralCreatorAlgorithm(const std::string& name,ISvcLocator* pSvcLocator); - - ~PFONeutralCreatorAlgorithm() {} - - static const InterfaceID& interfaceID(); - - StatusCode initialize(); - StatusCode execute(const EventContext& ctx) const; - StatusCode finalize(); - -private: - - /** Create the chargedneutral PFO */ - StatusCode createNeutralPFO(const eflowCaloObject& energyFlowCaloObject, xAOD::PFOContainer* neutralPFOContainer, xAOD::PFOContainer* neutralPFOContainer_nonModified) const; - - /** Function to add cluster moments onto PFO */ - void addMoment(const xAOD::CaloCluster::MomentType& momentType, const xAOD::PFODetails::PFOAttributes& pfoAttribute, const xAOD::CaloCluster& theCluster, xAOD::PFO& thePFO) const; - - /** Toggle EOverP algorithm mode, whereby no charged shower subtraction is performed */ - Gaudi::Property m_eOverPMode{this,"EOverPMode",false,"Toggle EOverP algorithm mode, whereby no charged shower subtraction is performed"}; - - /** Bool to toggle which jetetmiss configuration we are in - EM cluster input or LC cluster input */ - Gaudi::Property m_LCMode{this,"LCMode",false,"Bool to toggle which jetetmiss configuration we are in - EM cluster input or LC cluster input"}; - - /** Bool to toggle which jetetmiss configuration we are in - EM cluster input or LC cluster input */ - Gaudi::Property m_doClusterMoments{this,"DoClusterMoments",true,"Bool to toggle whether cluster moments are added to the PFOs"}; - - /** Toggle usage of calibration hit truth - false by default */ - Gaudi::Property m_useCalibHitTruth{this,"UseCalibHitTruth",false,"Toggle usage of calibration hit truth - false by default"}; - - /** Toggle addition of charged shower subtracted CaloCluster links to neutral PFO - false by default */ - Gaudi::Property m_addShowerSubtractedClusters{this,"AddShowerSubtractedClusters",false,"Toggle addition of charged shower subtracted CaloCluster links to neutral PFO - false by default"}; - - /** ReadHandleKey for eflowCaloObjectContainer */ - SG::ReadHandleKey m_eflowCaloObjectContainerReadHandleKey{this,"eflowCaloObjectContainerName","eflowCaloObjects","ReadHandleKey for eflowCaloObjectContainer"}; - - /** WriteHandleKey for neutral PFO */ - SG::WriteHandleKey m_neutralPFOContainerWriteHandleKey{this,"PFOOutputName","JetETMissNeutralParticleFlowObjects","WriteHandleKey for neutral PFO"}; - - /** WriteHandleKey for non-modified neutral PFO - only used in LC mode */ - SG::WriteHandleKey m_neutralPFOContainerWriteHandleKey_nonModified{this,"PFOOutputName_nonModified","JetETMissNeutralParticleFlowObjects_nonModified"," WriteHandleKey for non-modified neutral PFO - only used in LC mode"}; - -}; -#endif diff --git a/Reconstruction/eflowRec/python/PFCfg.py b/Reconstruction/eflowRec/python/PFCfg.py index 21ade3f3ef43b50362408ff9bd2cadb36cdfed7b..809a3374d6ac23241e7b5149a9a31577debc5866 100644 --- a/Reconstruction/eflowRec/python/PFCfg.py +++ b/Reconstruction/eflowRec/python/PFCfg.py @@ -137,34 +137,6 @@ def getPFLCCalibTool(inputFlags): return PFLCCalibTool -def getChargedPFOCreatorAlgorithm(inputFlags,chargedPFOOutputName,eflowObjectsInputName=None): - PFOChargedCreatorAlgorithmFactory = CompFactory.PFOChargedCreatorAlgorithm - PFOChargedCreatorAlgorithm = PFOChargedCreatorAlgorithmFactory("PFOChargedCreatorAlgorithm") - if chargedPFOOutputName: - PFOChargedCreatorAlgorithm.PFOOutputName = chargedPFOOutputName - if(inputFlags.PF.EOverPMode): - PFOChargedCreatorAlgorithm.PFOOutputName="EOverPChargedParticleFlowObjects" - if eflowObjectsInputName is not None: - PFOChargedCreatorAlgorithm.eflowCaloObjectContainerName = eflowObjectsInputName - - return PFOChargedCreatorAlgorithm - -def getNeutralPFOCreatorAlgorithm(inputFlags,neutralPFOOutputName,eflowObjectsInputName=None): - PFONeutralCreatorAlgorithmFactory = CompFactory.PFONeutralCreatorAlgorithm - PFONeutralCreatorAlgorithm = PFONeutralCreatorAlgorithmFactory("PFONeutralCreatorAlgorithm") - if neutralPFOOutputName: - PFONeutralCreatorAlgorithm.PFOOutputName = neutralPFOOutputName - if(inputFlags.PF.EOverPMode): - PFONeutralCreatorAlgorithm.PFOOutputName="EOverPNeutralParticleFlowObjects" - if(inputFlags.PF.useCalibHitTruthClusterMoments and inputFlags.PF.addClusterMoments): - PFONeutralCreatorAlgorithm.UseCalibHitTruth=True - if eflowObjectsInputName is not None: - PFONeutralCreatorAlgorithm.eflowCaloObjectContainerName = eflowObjectsInputName - - PFONeutralCreatorAlgorithm.DoClusterMoments=inputFlags.PF.addClusterMoments - - return PFONeutralCreatorAlgorithm - def getChargedFlowElementCreatorAlgorithm(inputFlags,chargedFlowElementOutputName,eflowCaloObjectContainerName="eflowCaloObjects"): FlowElementChargedCreatorAlgorithmFactory = CompFactory.PFChargedFlowElementCreatorAlgorithm FlowElementChargedCreatorAlgorithm = FlowElementChargedCreatorAlgorithmFactory("PFChargedFlowElementCreatorAlgorithm") diff --git a/Reconstruction/eflowRec/src/PFOChargedCreatorAlgorithm.cxx b/Reconstruction/eflowRec/src/PFOChargedCreatorAlgorithm.cxx deleted file mode 100644 index abb9a14a4ca8cff66b8fddf287b0ab9c3b0fe897..0000000000000000000000000000000000000000 --- a/Reconstruction/eflowRec/src/PFOChargedCreatorAlgorithm.cxx +++ /dev/null @@ -1,178 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#include "eflowRec/PFOChargedCreatorAlgorithm.h" - -#include - -#include "eflowRec/eflowRecCluster.h" -#include "eflowRec/eflowRecTrack.h" -#include "eflowRec/eflowTrackClusterLink.h" - -#include "xAODPFlow/PFOAuxContainer.h" - -PFOChargedCreatorAlgorithm::PFOChargedCreatorAlgorithm(const std::string& name, ISvcLocator* pSvcLocator) : - AthReentrantAlgorithm(name,pSvcLocator) -{ -} - -StatusCode PFOChargedCreatorAlgorithm::initialize(){ - - ATH_CHECK(m_eflowCaloObjectContainerReadHandleKey.initialize()); - - ATH_CHECK(m_chargedPFOContainerWriteHandleKey.initialize()); - - return StatusCode::SUCCESS; -} - -StatusCode PFOChargedCreatorAlgorithm::execute(const EventContext& ctx) const { - - ATH_MSG_DEBUG("Processing eflowCaloObjectContainer"); - - SG::WriteHandle chargedPFOContainerWriteHandle(m_chargedPFOContainerWriteHandleKey,ctx); - ATH_CHECK(chargedPFOContainerWriteHandle.record(std::make_unique(),std::make_unique())); - - /* Create Charged PFOs from all eflowCaloObjects */ - SG::ReadHandle eflowCaloObjectContainerReadHandle(m_eflowCaloObjectContainerReadHandleKey,ctx); - for (const auto *thisEflowCaloObject : *eflowCaloObjectContainerReadHandle) createChargedPFO(*thisEflowCaloObject,true,chargedPFOContainerWriteHandle); - - std::sort(chargedPFOContainerWriteHandle->begin(), chargedPFOContainerWriteHandle->end(), [] (const xAOD::PFO* pfo1, const xAOD::PFO* pfo2) {return pfo1->pt()>pfo2->pt();}); - - return StatusCode::SUCCESS; -} - -StatusCode PFOChargedCreatorAlgorithm::finalize(){ return StatusCode::SUCCESS; } - -void PFOChargedCreatorAlgorithm::createChargedPFO(const eflowCaloObject& energyFlowCaloObject, bool addClusters, SG::WriteHandle& chargedPFOContainerWriteHandle) const { - - /* Loop over all tracks in the eflowCaloObject */ - int nTracks = energyFlowCaloObject.nTracks(); - for (int iTrack = 0; iTrack < nTracks; ++iTrack) { - - eflowRecTrack* efRecTrack = energyFlowCaloObject.efRecTrack(iTrack); - - /* Skip tracks that haven't been subtracted */ - if (false == m_eOverPMode){ - if (!efRecTrack->isSubtracted()){ continue; } - } - - /* Create new xAOD::PFO */ - xAOD::PFO* thisPFO = new xAOD::PFO(); - chargedPFOContainerWriteHandle->push_back(thisPFO); - - /* Get the track elementLink and add it to the xAOD:PFO */ - ElementLink theTrackLink = efRecTrack->getTrackElemLink(); - bool isSet = thisPFO->setTrackLink(theTrackLink); - if (!isSet) ATH_MSG_WARNING("Could not set Track B in PFO "); - thisPFO->setCharge(efRecTrack->getTrack()->charge()); - - std::pair etaPhi(0.0,0.0); - - if (m_eOverPMode){ - /* In EOverPMode want charged eflowObjects to have extrapolated eta,phi as coordinates - * (needed for analysis of EOverP Data) */ - etaPhi = efRecTrack->getTrackCaloPoints().getEM2etaPhi(); - - /*add information to xAOD*/ - xAOD::PFODetails::PFOAttributes myAttribute_layerHED = xAOD::PFODetails::PFOAttributes::eflowRec_layerHED; - thisPFO->setAttribute(myAttribute_layerHED,efRecTrack->getLayerHED() ); - - xAOD::PFODetails::PFOAttributes myAttribute_layerVectorCellOrdering = xAOD::PFODetails::PFOAttributes::eflowRec_layerVectorCellOrdering; - thisPFO->setAttribute >(myAttribute_layerVectorCellOrdering,efRecTrack->getLayerCellOrderVector() ); - - xAOD::PFODetails::PFOAttributes myAttribute_radiusVectorCellOrdering = xAOD::PFODetails::PFOAttributes::eflowRec_radiusVectorCellOrdering; - thisPFO->setAttribute >(myAttribute_radiusVectorCellOrdering,efRecTrack->getRadiusCellOrderVector() ); - - xAOD::PFODetails::PFOAttributes myAttribute_avgEdensityVectorCellOrdering = xAOD::PFODetails::PFOAttributes::eflowRec_avgEdensityVectorCellOrdering; - thisPFO->setAttribute >(myAttribute_avgEdensityVectorCellOrdering,efRecTrack->getAvgEDensityCellOrderVector() ); - } else { - /* In normal mode we want the track eta,phi at the perigee */ - etaPhi.first = efRecTrack->getTrack()->eta(); - etaPhi.second = efRecTrack->getTrack()->phi(); - } - /* Set the 4-vector of the xAOD::PFO */ - thisPFO->setP4(efRecTrack->getTrack()->pt(), etaPhi.first, etaPhi.second, efRecTrack->getTrack()->m()); - - ATH_MSG_DEBUG("Created charged PFO with E, pt, eta and phi of " << thisPFO->e() << ", " << thisPFO->pt() << ", " << thisPFO->eta() << " and " << thisPFO->phi()); - - /* Add the amount of energy the track was expected to deposit in the calorimeter - this is needed to calculate the charged weight in the jet finding */ - xAOD::PFODetails::PFOAttributes myAttribute_tracksExpectedEnergyDeposit = xAOD::PFODetails::PFOAttributes::eflowRec_tracksExpectedEnergyDeposit; - thisPFO->setAttribute(myAttribute_tracksExpectedEnergyDeposit,efRecTrack->getEExpect() ); - ATH_MSG_DEBUG("Have set that PFO's expected energy deposit to be " << efRecTrack->getEExpect()); - - /* Flag if this track was in a dense environment for later checking */ - xAOD::PFODetails::PFOAttributes myAttribute_isInDenseEnvironment = xAOD::PFODetails::PFOAttributes::eflowRec_isInDenseEnvironment; - //There is some issue using bools - when written to disk they convert to chars. So lets store the bool as an int. - thisPFO->setAttribute(myAttribute_isInDenseEnvironment, (efRecTrack->isInDenseEnvironment())); - - /* Optionally we add the links to clusters to the xAOD::PFO */ - if (addClusters){ - - std::vector > > trackClusterLinkPairs = energyFlowCaloObject.efRecLink(); - - std::vector thisTracks_trackClusterLinks = efRecTrack->getClusterMatches(); - - ATH_MSG_DEBUG("Have retrieved " << thisTracks_trackClusterLinks.size() << " cluster matches"); - - /** Each eflowCaloObject has a list of clusters for all the tracks it represents. - * We only want the subset of the clusters matched to this track, and collect these in thisTracks_trackClusterLinksSubtracted. - */ - - std::vector thisTracks_trackClusterLinksSubtracted; - - //Create vector of pairs which map each CaloCluster to the ratio of its new energy to unstracted energy - std::vector, double> > vectorClusterToSubtractedEnergies; - - for (auto *trackClusterLink : thisTracks_trackClusterLinks){ - for (auto trackClusterLinkPair : trackClusterLinkPairs){ - if (!m_eOverPMode && trackClusterLinkPair.first == trackClusterLink && !std::isnan(trackClusterLinkPair.second.first)) { - thisTracks_trackClusterLinksSubtracted.push_back(trackClusterLink); - eflowRecCluster* efRecCluster = trackClusterLinkPair.first->getCluster(); - ElementLink theOriginalClusterLink = efRecCluster->getOriginalClusElementLink(); - ElementLink theSisterClusterLink = (*theOriginalClusterLink)->getSisterClusterLink(); - if (theSisterClusterLink.isValid()) vectorClusterToSubtractedEnergies.emplace_back(std::pair(theSisterClusterLink,trackClusterLinkPair.second.first)); - else vectorClusterToSubtractedEnergies.emplace_back(std::pair(theOriginalClusterLink,trackClusterLinkPair.second.first)); - } - else if (m_eOverPMode && trackClusterLinkPair.first == trackClusterLink) thisTracks_trackClusterLinksSubtracted.push_back(trackClusterLink); - } - } - - ATH_MSG_DEBUG("Have found " << thisTracks_trackClusterLinksSubtracted.size() << " subtracted and matched clusters"); - - //sort the vectorClusterToSubtractedEnergies in order of subtracted energy ratio from low (most subtracted) to high (least subtracted) - std::sort(vectorClusterToSubtractedEnergies.begin(),vectorClusterToSubtractedEnergies.end(), [](auto const& a, auto const&b){return a.second < b.second;}); - thisPFO->setAttribute("PF_vectorClusterToSubtractedEnergies",vectorClusterToSubtractedEnergies); - - //Now loop over the list of eflowTrackClusterLink which correspond to subtracted clusters matched to this track. - bool isFirstCluster = true; - for (auto *trackClusterLink : thisTracks_trackClusterLinksSubtracted){ - - eflowRecCluster* efRecCluster = trackClusterLink->getCluster(); - ElementLink theOriginalClusterLink = efRecCluster->getOriginalClusElementLink(); - - ElementLink theSisterClusterLink = (*theOriginalClusterLink)->getSisterClusterLink(); - if(theSisterClusterLink.isValid()) { - ATH_MSG_DEBUG("PFO with e and eta of " << thisPFO->e() << " and " << thisPFO->eta() << " is adding cluster with e, eta of " << (*theSisterClusterLink)->e() << " and " << (*theSisterClusterLink)->eta() << " an sistser has " << (*theOriginalClusterLink)->e() << " and " << (*theOriginalClusterLink)->eta()); - bool isSet = false; - if (isFirstCluster){ - isSet = thisPFO->setClusterLink(theSisterClusterLink); - isFirstCluster = false; - } - else isSet = thisPFO->addClusterLink(theSisterClusterLink); - if (!isSet) { ATH_MSG_WARNING( "Could not set Cluster in PFO " ); } - } else { - ATH_MSG_DEBUG("PFO with e and eta of " << thisPFO->e() << " and " << thisPFO->eta() << " is adding cluster with e, eta of " << (*theOriginalClusterLink)->e() << " and " << (*theOriginalClusterLink)->eta()); - bool isSet = false; - if (isFirstCluster){ - isSet = thisPFO->setClusterLink(theOriginalClusterLink); - isFirstCluster = false; - } - else isSet = thisPFO->addClusterLink(theOriginalClusterLink); - if (!isSet) { ATH_MSG_WARNING( "Could not set Cluster in PFO " ); } - } - }//track-cluster link loop - }//addClusters is set to true - so we added the clusters to the xAOD::PFO - - }//loop over the tracks on the eflowCaloObject -} diff --git a/Reconstruction/eflowRec/src/PFONeutralCreatorAlgorithm.cxx b/Reconstruction/eflowRec/src/PFONeutralCreatorAlgorithm.cxx deleted file mode 100644 index 793dc8a095563cc0b978a4e79d70e0b38f5eaa90..0000000000000000000000000000000000000000 --- a/Reconstruction/eflowRec/src/PFONeutralCreatorAlgorithm.cxx +++ /dev/null @@ -1,263 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#include "eflowRec/PFONeutralCreatorAlgorithm.h" - - - -#include "eflowRec/eflowCaloObject.h" -#include "eflowRec/eflowRecCluster.h" -#include "eflowRec/eflowTrackClusterLink.h" - -#include "xAODPFlow/PFOAuxContainer.h" -#include -#include -#include -#include //for std::pair - - -PFONeutralCreatorAlgorithm::PFONeutralCreatorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator) : - AthReentrantAlgorithm(name, pSvcLocator){ -} - -StatusCode PFONeutralCreatorAlgorithm::initialize(){ - ATH_CHECK(m_eflowCaloObjectContainerReadHandleKey.initialize()); - ATH_CHECK(m_neutralPFOContainerWriteHandleKey.initialize()); - if(!m_LCMode) { - ATH_CHECK(m_neutralPFOContainerWriteHandleKey_nonModified.initialize()); - } - return StatusCode::SUCCESS; -} - -StatusCode PFONeutralCreatorAlgorithm::execute(const EventContext& ctx) const { - ATH_MSG_DEBUG("Executing"); - /* Create Neutral PFOs from all eflowCaloObjects */ - SG::ReadHandle eflowCaloObjectContainerReadHandle(m_eflowCaloObjectContainerReadHandleKey,ctx); - // Always create at least one PFO container & aux - auto neutralPFOContainer = std::make_unique(); - auto neutralPFOContainerAux = std::make_unique(); - neutralPFOContainer->setStore(neutralPFOContainerAux.get()); - // The non-modified container is only used for LC PFOs - std::unique_ptr neutralPFOContainer_nonModified(nullptr); - std::unique_ptr neutralPFOContainerAux_nonModified(nullptr); - if(m_LCMode) { - neutralPFOContainer_nonModified = std::make_unique(); - neutralPFOContainerAux_nonModified = std::make_unique(); - neutralPFOContainer->setStore(neutralPFOContainerAux_nonModified.get()); - } - ATH_MSG_DEBUG("Looping over eflowCaloObjects"); - // Create PFOs and fill the containers - for (const auto *thisEflowCaloObject : *eflowCaloObjectContainerReadHandle) { - if( createNeutralPFO(*thisEflowCaloObject, neutralPFOContainer.get(), neutralPFOContainer_nonModified.get()).isFailure() ) { - ATH_MSG_WARNING("Problem encountered while creating neutral PFOs"); - return StatusCode::SUCCESS; - } - } - // Record the output containers - SG::WriteHandle neutralPFOContainerWriteHandle(m_neutralPFOContainerWriteHandleKey,ctx); - std::sort(neutralPFOContainer->begin(), neutralPFOContainer->end(), [] (const xAOD::PFO* pfo1, const xAOD::PFO* pfo2) {return pfo1->pt()>pfo2->pt();}); - ATH_CHECK( neutralPFOContainerWriteHandle.record(std::move(neutralPFOContainer),std::move(neutralPFOContainerAux)) ); - if(m_LCMode) { - std::sort(neutralPFOContainer_nonModified->begin(), neutralPFOContainer_nonModified->end(), [] (const xAOD::PFO* pfo1, const xAOD::PFO* pfo2) {return pfo1->pt()>pfo2->pt();}); - SG::WriteHandle neutralPFOContainerWriteHandle_nonModified(m_neutralPFOContainerWriteHandleKey,ctx); - ATH_CHECK( neutralPFOContainerWriteHandle_nonModified.record(std::move(neutralPFOContainer_nonModified),std::move(neutralPFOContainerAux_nonModified)) ); - } - return StatusCode::SUCCESS; -} - -StatusCode PFONeutralCreatorAlgorithm::finalize(){ return StatusCode::SUCCESS; } - -StatusCode PFONeutralCreatorAlgorithm::createNeutralPFO(const eflowCaloObject& energyFlowCaloObject, xAOD::PFOContainer* neutralPFOContainer, xAOD::PFOContainer* neutralPFOContainer_nonModified) const { - unsigned int nClusters = energyFlowCaloObject.nClusters(); - ATH_MSG_VERBOSE(" eflowCaloObject with " << nClusters << " clusters"); - for (unsigned int iCluster = 0; iCluster < nClusters; ++iCluster){ - eflowRecCluster* thisEfRecCluster = energyFlowCaloObject.efRecCluster(iCluster); - /* Skip empty clusters (presumably subtraction remnants) */ - const CaloClusterCellLink* theCellLink = energyFlowCaloObject.efRecCluster(iCluster)->getCluster()->getCellLinks(); - CaloClusterCellLink::const_iterator it=theCellLink->begin(); - CaloClusterCellLink::const_iterator it_e=theCellLink->end(); - if (it == it_e) { - continue; - } - //this vetoes rare examples where only two cells are left, and they have equal and opposite energy - if (0.0 == energyFlowCaloObject.efRecCluster(iCluster)->getCluster()->e() ) continue; - /* Create the efo, add the cluster and set the four-momentum, charge and type */ - ATH_MSG_VERBOSE(" Creating PFO"); - xAOD::PFO* thisPFO = new xAOD::PFO(); - if (m_LCMode) { - if (thisEfRecCluster->isTouchable()) { - neutralPFOContainer->push_back(thisPFO); - } else { - if(neutralPFOContainer_nonModified) { - neutralPFOContainer_nonModified->push_back(thisPFO); - } else { - ATH_MSG_WARNING("Got a nullptr for non-modified nPFO container!"); - return StatusCode::FAILURE; - } - } - } else { - neutralPFOContainer->push_back(thisPFO); - } - ATH_MSG_VERBOSE(" Get original cluster link"); - ElementLink theOriginalClusterLink = thisEfRecCluster->getOriginalClusElementLink(); - ATH_MSG_VERBOSE(" Get sister cluster link"); - ElementLink theSisterClusterLink = (*theOriginalClusterLink)->getSisterClusterLink(); - if(theSisterClusterLink.isValid()) { - bool isSet = thisPFO->setClusterLink(theSisterClusterLink); - if (!isSet) { ATH_MSG_WARNING( "Could not set Cluster in PFO " ); } - } else { - bool isSet = thisPFO->setClusterLink(theOriginalClusterLink); - if (!isSet) { ATH_MSG_WARNING( "Could not set Cluster in PFO " ); } - } - if (m_addShowerSubtractedClusters) thisPFO->setAttribute("PFOShowerSubtractedClusterLink",thisEfRecCluster->getClusElementLink()); - ATH_MSG_VERBOSE(" Sucessfully set cluster link"); - const xAOD::CaloCluster* cluster = thisEfRecCluster->getCluster(); - ATH_MSG_VERBOSE(" Got CaloCluster from EfRecCluster"); - //be careful here - cluster p4 methods do not store sign. Thus -ve energy clusters have +ve pt and hence +ve energy - if (!m_LCMode) { - //in EM->EM/LC mode we use eta,phi at EM scale for both 4-vectors - thisPFO->setP4(cluster->pt(), cluster->rawEta(), cluster->rawPhi(), cluster->m()); - thisPFO->setP4EM(cluster->rawE()/std::cosh(cluster->rawEta()), cluster->rawEta(),cluster->rawPhi(),cluster->rawM()); - } else { - //in LC-> mode we use the LC 4-vector for the LC scale - thisPFO->setP4(cluster->pt(), cluster->eta(), cluster->phi(), cluster->m()); - //we cannot access geometric weights for LC clusters, so we make an approximation of the EM energy by looping over the calocells - //Then the EM 4-vector uses the energy/pt at this EM scale + eta,phi from LC 4-vector - const CaloClusterCellLink* theCellLink = cluster->getCellLinks(); - float emPt = 0.0; - for (const auto *thisCaloCell : *theCellLink) emPt += thisCaloCell->e()/std::cosh(thisCaloCell->eta()); - thisPFO->setP4EM(emPt,cluster->eta(),cluster->phi(),0.0);//mass is always zero at EM scale - } - ATH_MSG_DEBUG("Created neutral PFO with E, pt, eta and phi of " << thisPFO->e() << ", " << thisPFO->pt() << ", " << thisPFO->eta() << " and " << thisPFO->phi()); - thisPFO->setCharge(0); - //Set the CENTER_MAG moment. This has its own dedicated getter in the PFO EDM, and so is not dealt with by the generic addMoment function. - double center_mag = 0.0; - bool isRetrieved = cluster->retrieveMoment(xAOD::CaloCluster::CENTER_MAG, center_mag ); - if (isRetrieved) thisPFO->setCenterMag(center_mag); - else ATH_MSG_WARNING("Could not retreve CENTER_MAG from xAOD::CaloCluster"); - //definitions to reduce verbosity - using Cluster = xAOD::CaloCluster; - using Attributes = xAOD::PFODetails::PFOAttributes; - if(m_doClusterMoments) { - //now set the moments for touchable clusters (i.e. ones we modify) in LC mode or all clusters in EM mode - if ( (m_LCMode && thisEfRecCluster->isTouchable()) || !m_LCMode) { - //Block of code to set moments/attributes - auto conciseAddMoment = [&cluster, &thisPFO, this](const Cluster::MomentType & c, const Attributes & a){ - return this->addMoment(c, a, *cluster, *thisPFO); - }; - const std::array< std::pair, 11> momentAttributePairs{{ //tricky: one more brace than expected, and is necessary - {Cluster::SECOND_R, Attributes::eflowRec_SECOND_R}, - {Cluster::CENTER_LAMBDA, Attributes::eflowRec_CENTER_LAMBDA}, - {Cluster::ENG_BAD_CELLS, Attributes::eflowRec_ENG_BAD_CELLS}, - {Cluster::N_BAD_CELLS, Attributes::eflowRec_N_BAD_CELLS}, - {Cluster::BADLARQ_FRAC, Attributes::eflowRec_BADLARQ_FRAC}, - {Cluster::ENG_POS, Attributes::eflowRec_ENG_POS}, - {Cluster::AVG_LAR_Q, Attributes::eflowRec_AVG_LAR_Q}, - {Cluster::AVG_TILE_Q, Attributes::eflowRec_AVG_TILE_Q}, - {Cluster::ISOLATION, Attributes::eflowRec_ISOLATION}, - {Cluster::SECOND_LAMBDA, Attributes::eflowRec_SECOND_LAMBDA}, - {Cluster::EM_PROBABILITY, Attributes::eflowRec_EM_PROBABILITY} - }}; - for (const auto & [moment,attribute]:momentAttributePairs) conciseAddMoment(moment, attribute); - if (m_useCalibHitTruth){ - const std::array< std::pair, 4> momentAttributeTruthPairs{{ - {Cluster::ENG_CALIB_TOT, Attributes::eflowRec_ENG_CALIB_TOT}, - {Cluster::ENG_CALIB_FRAC_EM, Attributes::eflowRec_ENG_CALIB_FRAC_EM}, - {Cluster::ENG_CALIB_FRAC_HAD, Attributes::eflowRec_ENG_CALIB_FRAC_HAD}, - {Cluster::ENG_CALIB_FRAC_REST, Attributes::eflowRec_ENG_CALIB_FRAC_REST} - }}; - for (const auto & [moment,attribute]:momentAttributeTruthPairs) conciseAddMoment(moment, attribute); - } - } - } - // - //block of code to calculate and set the layer energies - auto setLayerEnergy = [&cluster, &thisPFO](const Cluster::CaloSample &layer, const Attributes & a){ - const auto layerEnergy{cluster->eSample(layer)}; - thisPFO->setAttribute(a, layerEnergy); - return layerEnergy; - }; - enum LayerEnergyIndices{preSamplerB, EMB1, EMB2, EMB3, preSamplerE, EME1, EME2, EME3, HEC0, HEC1, HEC2, HEC3,FCAL0, NumberOfLayerEnergies}; - std::array layerEnergies{}; - const std::array< std::pair, NumberOfLayerEnergies> sampleAttributePairs{{ - {Cluster::CaloSample::PreSamplerB, Attributes::eflowRec_LAYERENERGY_PreSamplerB}, - {Cluster::CaloSample::EMB1, Attributes::eflowRec_LAYERENERGY_EMB1}, - {Cluster::CaloSample::EMB2, Attributes::eflowRec_LAYERENERGY_EMB2}, - {Cluster::CaloSample::EMB3, Attributes::eflowRec_LAYERENERGY_EMB3}, - {Cluster::CaloSample::PreSamplerE, Attributes::eflowRec_LAYERENERGY_PreSamplerE}, - {Cluster::CaloSample::EME1, Attributes::eflowRec_LAYERENERGY_EME1}, - {Cluster::CaloSample::EME2, Attributes::eflowRec_LAYERENERGY_EME2}, - {Cluster::CaloSample::EME3, Attributes::eflowRec_LAYERENERGY_EME3}, - {Cluster::CaloSample::HEC0, Attributes::eflowRec_LAYERENERGY_HEC0}, - {Cluster::CaloSample::HEC1, Attributes::eflowRec_LAYERENERGY_HEC1}, - {Cluster::CaloSample::HEC2, Attributes::eflowRec_LAYERENERGY_HEC2}, - {Cluster::CaloSample::HEC3, Attributes::eflowRec_LAYERENERGY_HEC3}, - {Cluster::CaloSample::FCAL0, Attributes::eflowRec_LAYERENERGY_FCAL0} - }}; - size_t layerIndex{0}; - for (const auto & [sample, attribute]: sampleAttributePairs) { - layerEnergies[layerIndex++] = setLayerEnergy(sample, attribute); - } - // - //block of code purely to set attributes of the PFO - auto setPfoAttribute = [&thisPFO, &cluster](const Cluster::CaloSample &layer, const Attributes & a){ - thisPFO->setAttribute( a, cluster->eSample(layer)); - }; - // - constexpr size_t numberOfSampleAttributePairs{15}; - const std::array< std::pair, numberOfSampleAttributePairs> sampleAttributePairsTileFcal{{ - {Cluster::CaloSample::TileBar0, Attributes::eflowRec_LAYERENERGY_TileBar0}, - {Cluster::CaloSample::TileBar1, Attributes::eflowRec_LAYERENERGY_TileBar1}, - {Cluster::CaloSample::TileBar2, Attributes::eflowRec_LAYERENERGY_TileBar2}, - {Cluster::CaloSample::TileGap1, Attributes::eflowRec_LAYERENERGY_TileGap1}, - {Cluster::CaloSample::TileGap2, Attributes::eflowRec_LAYERENERGY_TileGap2}, - {Cluster::CaloSample::TileGap3, Attributes::eflowRec_LAYERENERGY_TileGap3}, - {Cluster::CaloSample::TileExt0, Attributes::eflowRec_LAYERENERGY_TileExt0}, - {Cluster::CaloSample::TileExt1, Attributes::eflowRec_LAYERENERGY_TileExt1}, - {Cluster::CaloSample::TileExt2, Attributes::eflowRec_LAYERENERGY_TileExt2}, - {Cluster::CaloSample::FCAL1, Attributes::eflowRec_LAYERENERGY_FCAL1}, - {Cluster::CaloSample::FCAL2, Attributes::eflowRec_LAYERENERGY_FCAL2}, - {Cluster::CaloSample::MINIFCAL0, Attributes::eflowRec_LAYERENERGY_MINIFCAL0}, - {Cluster::CaloSample::MINIFCAL1, Attributes::eflowRec_LAYERENERGY_MINIFCAL1}, - {Cluster::CaloSample::MINIFCAL2, Attributes::eflowRec_LAYERENERGY_MINIFCAL2}, - {Cluster::CaloSample::MINIFCAL3, Attributes::eflowRec_LAYERENERGY_MINIFCAL3} - }}; - for (const auto & [sample, attribute]: sampleAttributePairsTileFcal){ - setPfoAttribute(sample, attribute); - } - // - //now set the layer energies for EMB3 and Tile0 - these are needed if we want to run a GSC style jet calibration, which is binned in EMB3 and Tile0 layer energies - float layerEnergy_EM3 = layerEnergies[EMB3] + layerEnergies[EME3]; - thisPFO->setAttribute( Attributes::eflowRec_LAYERENERGY_EM3, layerEnergy_EM3); - // - float layerEnergy_TileBar0 = cluster->eSample(Cluster::CaloSample::TileBar0); - float layerEnergy_TileExt0 = cluster->eSample(Cluster::CaloSample::TileExt0); - float layerEnergy_Tile0 = layerEnergy_TileBar0 + layerEnergy_TileExt0; - thisPFO->setAttribute(Attributes::eflowRec_LAYERENERGY_Tile0, layerEnergy_Tile0); - // - //now set properties that are required for jet cleaning - const float layerEnergy_HEC = layerEnergies[HEC0] + layerEnergies[HEC1] + layerEnergies[HEC2] + layerEnergies[HEC3]; - thisPFO->setAttribute(Attributes::eflowRec_LAYERENERGY_HEC, layerEnergy_HEC); - // - const float layerEnergy_EM = layerEnergies[preSamplerB] + layerEnergies[preSamplerE] + layerEnergies[EMB1] + layerEnergies[EMB2] + layerEnergies[EMB3] + layerEnergies[EME1] + layerEnergies[EME2] + layerEnergies[EME3] + layerEnergies[FCAL0]; - thisPFO->setAttribute(Attributes::eflowRec_LAYERENERGY_EM, layerEnergy_EM); - // - const float clusterTiming = cluster->time(); - thisPFO->setAttribute(Attributes::eflowRec_TIMING, clusterTiming); - } - return StatusCode::SUCCESS; -} - -void PFONeutralCreatorAlgorithm::addMoment(const xAOD::CaloCluster::MomentType& momentType, const xAOD::PFODetails::PFOAttributes& pfoAttribute, const xAOD::CaloCluster& theCluster, xAOD::PFO& thePFO) const { - - double moment = 0.0; - bool isRetrieved = theCluster.retrieveMoment(momentType, moment); - if (isRetrieved) { - xAOD::PFODetails::PFOAttributes myAttribute = pfoAttribute; - float float_moment = static_cast(moment); - thePFO.setAttribute(myAttribute, float_moment); - } - else ATH_MSG_WARNING(" Could not retrieve moment from the CaloCluster"); - -} diff --git a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx index 214a5321a47884f9f9970751933ebe9ee1b17244..50e90fd166d0e6804280ed87c699301c47a82fa5 100644 --- a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx +++ b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx @@ -20,8 +20,6 @@ #include "eflowRec/PFMomentCalculatorTool.h" #include "eflowRec/PFClusterCollectionTool.h" #include "eflowRec/PFLCCalibTool.h" -#include "eflowRec/PFOChargedCreatorAlgorithm.h" -#include "eflowRec/PFONeutralCreatorAlgorithm.h" #include "eflowRec/PFMuonFlowElementAssoc.h" #include "eflowRec/PFEGamFlowElementAssoc.h" #include "eflowRec/PFTauFlowElementAssoc.h" @@ -36,8 +34,6 @@ DECLARE_COMPONENT( PFAlgorithm ) DECLARE_COMPONENT( PFChargedFlowElementCreatorAlgorithm) DECLARE_COMPONENT( PFNeutralFlowElementCreatorAlgorithm) DECLARE_COMPONENT( PFLCNeutralFlowElementCreatorAlgorithm) -DECLARE_COMPONENT( PFOChargedCreatorAlgorithm ) -DECLARE_COMPONENT( PFONeutralCreatorAlgorithm ) DECLARE_COMPONENT( PFSubtractionTool ) DECLARE_COMPONENT( PFMomentCalculatorTool ) DECLARE_COMPONENT( PFClusterCollectionTool ) diff --git a/Reconstruction/egamma/egammaValidation/share/egamma_art_checker_joboptions.py b/Reconstruction/egamma/egammaValidation/share/egamma_art_checker_joboptions.py index 34be1bcddf411cc67a5d90bf61c36d0e2aba2f8a..e05eb269ee2e1649b50a45fe09ea541f763c44e1 100644 --- a/Reconstruction/egamma/egammaValidation/share/egamma_art_checker_joboptions.py +++ b/Reconstruction/egamma/egammaValidation/share/egamma_art_checker_joboptions.py @@ -40,7 +40,7 @@ Tight_Photon = CfgMgr.AsgPhotonIsEMSelector( PhIsoTight = CfgMgr.CP__IsolationSelectionTool( name="PhIsoTight", - PhotonWP="Tight") + PhotonWP="FixedCutTight") PhIsoTightCaloOnly = CfgMgr.CP__IsolationSelectionTool( name="PhIsoTightCaloOnly", @@ -48,7 +48,7 @@ PhIsoTightCaloOnly = CfgMgr.CP__IsolationSelectionTool( PhIsoLoose = CfgMgr.CP__IsolationSelectionTool( name="PhIsoLoose", - PhotonWP="Loose") + PhotonWP="FixedCutLoose") # Ouput Message Level svcMgr.MessageSvc.OutputLevel = INFO diff --git a/Reconstruction/egamma/egammaValidation/test/test_electron.sh b/Reconstruction/egamma/egammaValidation/test/test_electron.sh index 303cbec00fbedd7edaf5df890797ee2dd6e65f41..88414747ad4a2c073dd8324731a7be4494569270 100755 --- a/Reconstruction/egamma/egammaValidation/test/test_electron.sh +++ b/Reconstruction/egamma/egammaValidation/test/test_electron.sh @@ -51,7 +51,6 @@ case $ArtProcess in $ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py -p -x dcube -c /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/egammaValidation/DCube_Config/electron.xml -r /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/egammaValidation/Nightly_Files/Nightly-monitoring_electron.hist.root Nightly-monitoring_electron.hist.root echo "art-result: $? plot" - ;; *) @@ -67,9 +66,8 @@ case $ArtProcess in echo "Unsetting ATHENA_NUM_PROC=${ATHENA_NUM_PROC}" unset ATHENA_NUM_PROC - Reco_tf.py --steering doRAWtoALL --inputRDOFile=$x --outputAODFile=Nightly_AOD_electron.pool.root --maxEvents=2000 --autoConfiguration="everything" --conditionsTag="OFLCOND-MC16-SDR-RUN2-09" --preExec="from egammaValidation.egammaOnlyPreExec import setRunEgammaOnlyRecoFlags; setRunEgammaOnlyRecoFlags()" --postInclude "RAWtoALL:egammaValidation/egammaArtCaloCalPostInclude.py" "POOLMergeAthenaMPAOD0:egammaValidation/egammaArtCaloCalPostInclude.py" + Reco_tf.py --steering doRAWtoALL --inputRDOFile=$x --outputAODFile=Nightly_AOD_electron.pool.root --maxEvents=2000 --autoConfiguration="everything" --conditionsTag="OFLCOND-MC16-SDR-RUN2-09" --preExec="from egammaValidation.egammaOnlyPreExec import setRunEgammaOnlyRecoFlags; setRunEgammaOnlyRecoFlags()" --postInclude "RAWtoALL:egammaValidation/egammaArtCaloCalPostInclude.py" "POOLMergeAthenaMPAOD0:egammaValidation/egammaArtCaloCalPostInclude.py" - echo "art-result: $? reconstruction" ;; diff --git a/Reconstruction/egamma/egammaValidation/test/test_electron_pileup.sh b/Reconstruction/egamma/egammaValidation/test/test_electron_pileup.sh index cd58a943be920c9aee3b4fde9a9f698f9280c8d0..a4a83ed71bbe61789b28547a30b84a79e44e7b31 100755 --- a/Reconstruction/egamma/egammaValidation/test/test_electron_pileup.sh +++ b/Reconstruction/egamma/egammaValidation/test/test_electron_pileup.sh @@ -30,6 +30,7 @@ case $ArtProcess in unset ATHENA_NUM_PROC AODMerge_tf.py --inputAODFile=art_core_*/Nightly_AOD_electron.pool.root --outputAOD_MRGFile=Nightly_AOD_electron.pool.root --preExec "from egammaValidation.egammaOnlyPreExec import setRunEgammaOnlyMergeFlags; setRunEgammaOnlyMergeFlags()" --postInclude "all:egammaValidation/egammaArtCaloCalPostInclude.py" + echo "art-result: $? AODMerge" set +e diff --git a/Reconstruction/egamma/egammaValidation/test/ut_egammaARTJob_test.sh b/Reconstruction/egamma/egammaValidation/test/ut_egammaARTJob_test.sh index 2ec1f5a6fc8ce0998f4958822ea9f8c34bac1e96..d06243eee67d3cd52bb54a9de7594e26a768b2fa 100755 --- a/Reconstruction/egamma/egammaValidation/test/ut_egammaARTJob_test.sh +++ b/Reconstruction/egamma/egammaValidation/test/ut_egammaARTJob_test.sh @@ -2,7 +2,7 @@ # Reco stage -Reco_tf.py --steering doRAWtoALL --inputRDOFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/WorkflowReferences/master/q443/v1/myRDO.pool.root --outputAODFile=Nightly_AOD_electron.pool.root --maxEvents=1 --autoConfiguration="everything" --preExec="from egammaValidation.egammaOnlyPreExec import setRunEgammaOnlyRecoFlags; setRunEgammaOnlyRecoFlags()" --postInclude "RAWtoALL:egammaValidation/egammaArtCaloCalPostInclude.py" "POOLMergeAthenaMPAOD0:egammaValidation/egammaArtCaloCalPostInclude.py" >>/dev/null 2>&1 +Reco_tf.py --steering doRAWtoALL --inputRDOFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/WorkflowReferences/master/q443/v1/myRDO.pool.root --outputAODFile=Nightly_AOD.pool.root --maxEvents=1 --autoConfiguration="everything" --preExec="from egammaValidation.egammaOnlyPreExec import setRunEgammaOnlyRecoFlags; setRunEgammaOnlyRecoFlags()" --postInclude "RAWtoALL:egammaValidation/egammaArtCaloCalPostInclude.py" "POOLMergeAthenaMPAOD0:egammaValidation/egammaArtCaloCalPostInclude.py" >>/dev/null 2>&1 stat=$? if [ $stat -eq 0 ] @@ -15,13 +15,10 @@ else exit $stat fi # rm files not needed anymore -rm tmp.ESD >> /dev/null 2>&1 -rm log.RAWtoESD >> /dev/null 2>&1 -rm log.ESDtoAOD >> /dev/null 2>&1 - +rm log.RAWtoALL >> /dev/null 2>&1 # Merge stage -AODMerge_tf.py --inputAODFile=Nightly_AOD_electron.pool.root --outputAOD_MRGFile=Nightly_AOD_electron.pool.root --preExec "from egammaValidation.egammaOnlyPreExec import setRunEgammaOnlyMergeFlags; setRunEgammaOnlyMergeFlags()" --postInclude "all:egammaValidation/egammaArtCaloCalPostInclude.py">>/dev/null 2>&1 +AODMerge_tf.py --inputAODFile=Nightly_AOD.pool.root --outputAOD_MRGFile=Nightly_AOD.pool.root --preExec "from egammaValidation.egammaOnlyPreExec import setRunEgammaOnlyMergeFlags; setRunEgammaOnlyMergeFlags()" --postInclude "all:egammaValidation/egammaArtCaloCalPostInclude.py">>/dev/null 2>&1 stat=$? if [ $stat -eq 0 ] @@ -36,45 +33,52 @@ fi # rm files not needed anymore rm log.AODMerge >> /dev/null 2>&1 - -# Histo stage +# Histo stage +rm -f PoolFileCatalog.xml +ln -fs Nightly_AOD.pool.root Nightly_AOD_electron.pool.root get_files -jo egamma_art_checker_joboptions.py >> /dev/null 2>&1 athena -c "particleType='electron'" egamma_art_checker_joboptions.py >> histo.log 2>&1 +state=$? +rm -f PoolFileCatalog.xml +ln -fs Nightly_AOD.pool.root Nightly_AOD_gamma.pool.root +athena -c "particleType='gamma'" egamma_art_checker_joboptions.py >> histo.log 2>&1 +statg=$? -stat=$? -if [ $stat -eq 0 ] +if [ $state -eq 0 -a $statg -eq 0 ] then echo "=== HISTO MAKER SUCCESS === " else - echo "==== HISTO MAKER FAILURE" + echo "==== HISTO MAKER FAILURE" $state $statg echo " HISTO MAKER log ===> " cat histo.log - exit $stat + exit 1 fi # rm files not needed anymore -rm Nightly_AOD_electron.pool.root >> /dev/null 2>&1 +rm -f Nightly_AOD*.pool.root >> /dev/null 2>&1 rm histo.log >> /dev/null 2>&1 # Final plot stage EgammaARTmonitoring_plotsMaker.py Nightly-monitoring_electron.hist.root Nightly-monitoring_electron.hist.root electron >> plot.log 2>&1 +state=$? +EgammaARTmonitoring_plotsMaker.py Nightly-monitoring_gamma.hist.root Nightly-monitoring_gamma.hist.root gamma >> plot.log 2>&1 +statg=$? -stat=$? -if [ $stat -eq 0 ] +if [ $state -eq 0 -a $statg -eq 0 ] then echo "=== PLOT MAKER SUCCESS === " else - echo "=== PLOT MAKER SUCCESS === " + echo "=== PLOT MAKER FAILURE === " $state $statg echo " PLOT MAKER log ===> " cat plot.log - exit $stat + exit 1 fi # rm files not needed anymore rm *.png >> /dev/null 2>&1 -rm Nightly-monitoring_electron.hist.root >> /dev/null 2>&1 -rm BN_ComparisonPlots_electron.hist.root >> /dev/null 2>&1 +rm Nightly-monitoring_*.hist.root >> /dev/null 2>&1 +rm BN_ComparisonPlots_*.hist.root >> /dev/null 2>&1 rm plot.log >> /dev/null 2>&1 diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationBase.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationBase.h index 1934837fcc38b601cb2b186b3d55d8818b881800..f481deb6ba5c28c00b7c7d020578be3314cb4f78 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationBase.h +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSParametrizationBase.h @@ -59,7 +59,8 @@ class TFCSExtrapolationState; if (this->msgLvl(MSG::lvl)) this->msg(MSG::lvl) << std::setw(45) << std::left << this->GetName() << " " << MSG::LevelNames[MSG::lvl] << " " #else - #include "AthenaBaseComps/AthMessaging.h" + #include "GaudiKernel/MsgStream.h" + #include "AthenaBaseComps/AthMsgStreamMacros.h" #endif /** Base class for all FastCaloSim parametrizations @@ -82,11 +83,7 @@ enum FCSReturnCode { #define FCS_RETRY_COUNT 3 -class TFCSParametrizationBase : public TNamed -#if !defined(__FastCaloSimStandAlone__) - , public AthMessaging -#endif -{ +class TFCSParametrizationBase:public TNamed { public: TFCSParametrizationBase(const char* name=nullptr, const char* title=nullptr); @@ -204,7 +201,31 @@ private: MSG::Level m_level;//! Do not persistify! MsgStream* m_msg;//! Do not persistify! -#endif +#else +public: + /// Update outputlevel + void setLevel(int level) {s_msg->setLevel(level);} + + /// Retrieve output level + MSG::Level level() const {return s_msg->level();} + + /// Log a message using the Athena controlled logging system + MsgStream& msg() const { return *s_msg; } + + /// Log a message using the Athena controlled logging system + MsgStream& msg( MSG::Level lvl ) const { return *s_msg << lvl; } + + /// Check whether the logging system is active at the provided verbosity level + bool msgLvl( MSG::Level lvl ) const { return s_msg->level() <= lvl; } + +private: + /** Static private message stream member. + We don't want this to take memory for every instance of this object created. + Note that we also cannot use AthMessaging as a base class as this creates problems + when storing these objects in ROOT files (ATLASSIM-5854). + */ + inline static std::unique_ptr s_msg;//! Do not persistify! +#endif private: static std::set< int > s_no_pdgid; diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationFluctChain.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationFluctChain.cxx index c259c940d0bb374efeb7455e719dc8d35566e090..c200bfe77358aecf7fabea461a492f05e51751f4 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationFluctChain.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationFluctChain.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "ISF_FastCaloSimEvent/TFCSLateralShapeParametrizationFluctChain.h" @@ -35,7 +35,7 @@ float TFCSLateralShapeParametrizationFluctChain::get_E_hit(TFCSSimulationState& FCSReturnCode TFCSLateralShapeParametrizationFluctChain::simulate(TFCSSimulationState& simulstate,const TFCSTruthState* truth, const TFCSExtrapolationState* extrapol) const { - MSG::Level old_level=msg().level(); + MSG::Level old_level=level(); const bool debug = msgLvl(MSG::DEBUG); //Execute the first get_nr_of_init() simulate calls only once. Used for example to initialize the center position diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationHitChain.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationHitChain.cxx index 5face6ce8ee9cd994e7ace3ef647f08da8eae4e0..1603245d9fc57c5e515d81bb8b5bf4156356fbf7 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationHitChain.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSLateralShapeParametrizationHitChain.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "ISF_FastCaloSimEvent/TFCSLateralShapeParametrizationHitChain.h" @@ -196,7 +196,7 @@ FCSReturnCode TFCSLateralShapeParametrizationHitChain::init_hit(TFCSLateralShape FCSReturnCode TFCSLateralShapeParametrizationHitChain::simulate(TFCSSimulationState& simulstate,const TFCSTruthState* truth, const TFCSExtrapolationState* extrapol) const { - MSG::Level old_level=msg().level(); + MSG::Level old_level=level(); const bool debug = msgLvl(MSG::DEBUG); const bool verbose = msgLvl(MSG::VERBOSE); diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationBase.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationBase.cxx index 085b84c3a79b41a889c364984fa336891ccbc4ac..8292cef189adafa403c4eb4930af092606adb4f1 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationBase.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationBase.cxx @@ -13,6 +13,10 @@ #include "TString.h" #endif +#ifndef __FastCaloSimStandAlone__ +#include "AthenaKernel/getMessageSvc.h" +#endif + //============================================= //======= TFCSParametrizationBase ========= //============================================= @@ -28,10 +32,12 @@ TFCSParametrizationBase::TFCSParametrizationBase(const char* name, const char* t { } #else + TFCSParametrizationBase::TFCSParametrizationBase(const char* name, const char* title) - : TNamed(name,title), - AthMessaging("FastCaloSimParametrization") + : TNamed(name,title) { + // Initialize only in constructor to make sure the needed services are ready + if (!s_msg) s_msg = std::make_unique(Athena::getMessageSvc(), "FastCaloSimParametrization"); } #endif diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/ISF_HitAnalysis.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/ISF_HitAnalysis.cxx index dc4fbb09389d25cec6e6fab3e8908bf8fdca7490..2960e6e7b73a7310b8dfeff51b8e6b7d44c549e0 100755 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/ISF_HitAnalysis.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/ISF_HitAnalysis.cxx @@ -794,7 +794,7 @@ StatusCode ISF_HitAnalysis::execute() if(loopEnd==-1) { loopEnd = particles_size; //is this the correct thing? } - for (const auto& part: *(*mcEvent->begin())) { + for (const auto part: *(*mcEvent->begin())) { ATH_MSG_DEBUG("Number truth particles="< m_birk2{this, "birk2",9.6e-6 * CLHEP::g / (CLHEP::MeV * CLHEP::cm2) * CLHEP::g / (CLHEP::MeV * CLHEP::cm2), "exp. values from NIM 80 (1970) 239-244"}; + Gaudi::Property m_birk1{this, "birk1",0.02002 * CLHEP::g / (CLHEP::MeV * CLHEP::cm2), "value updated for G4 10.6.p03"}; + Gaudi::Property m_birk2{this, "birk2",0.0 * CLHEP::g / (CLHEP::MeV * CLHEP::cm2) * CLHEP::g / (CLHEP::MeV * CLHEP::cm2), "value updated for G4 10.6.p03"}; /** @brief Keep hit time */ bool m_keepHitTime{}; diff --git a/Tools/Campaigns/python/MC21.py b/Tools/Campaigns/python/MC21.py index 4a44bf74bc0c72c215eac95a3f4f4dab67ff41fe..87ce55015b1ec79e523bfc2a77fe2c41cbb912ee 100644 --- a/Tools/Campaigns/python/MC21.py +++ b/Tools/Campaigns/python/MC21.py @@ -73,12 +73,11 @@ def MC21SimulationBase(flags): flags.Sim.TRTRangeCut = 30.0 flags.Sim.TightMuonStepping = True - from SimuJobTransforms.SimulationHelpers import enableBeamPipeKill #, enableFrozenShowersFCalOnly + from SimuJobTransforms.SimulationHelpers import enableBeamPipeKill, enableFrozenShowersFCalOnly enableBeamPipeKill(flags) if flags.Sim.ISF.Simulator in [SimulationFlavour.FullG4MT, SimulationFlavour.FullG4MT_QS]: - # Not tuned yet for G4 10.6 - # enableFrozenShowersFCalOnly(flags) - pass + enableFrozenShowersFCalOnly(flags) + from SimuJobTransforms.G4Optimizations import enableG4Optimizations enableG4Optimizations(flags) diff --git a/Tools/Campaigns/share/MC21Simulation.py b/Tools/Campaigns/share/MC21Simulation.py index de04995bbf6a1a41f5d18b632b87b74f49354298..6a105f99864b85286f08f095c31d59d9c83eabde 100644 --- a/Tools/Campaigns/share/MC21Simulation.py +++ b/Tools/Campaigns/share/MC21Simulation.py @@ -17,8 +17,7 @@ if "ATLFAST" in ISF_Flags.Simulator() or "G4FastCalo" in ISF_Flags.Simulator(): from IOVDbSvc.CondDB import conddb conddb.addOverride("/TILE/OFL02/CALIB/SFR","TileOfl02CalibSfr-SIM-07") if "FullG4" in ISF_Flags.Simulator(): - # Not tuned yet for G4 10.6 - # protectedInclude("SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py") - pass + protectedInclude("SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py") + # enable G4 optimisations protectedInclude("SimulationJobOptions/preInclude.G4Optimizations.py") diff --git a/Tools/Campaigns/share/MC21SimulationMultiBeamSpot.py b/Tools/Campaigns/share/MC21SimulationMultiBeamSpot.py index 359e8b1309ec785dac42374dc6fff97c14dd9914..512a1fdf62d991fac03c0bae0a0b21e1f60f133f 100644 --- a/Tools/Campaigns/share/MC21SimulationMultiBeamSpot.py +++ b/Tools/Campaigns/share/MC21SimulationMultiBeamSpot.py @@ -18,8 +18,7 @@ if "ATLFAST" in ISF_Flags.Simulator() or "G4FastCalo" in ISF_Flags.Simulator(): from IOVDbSvc.CondDB import conddb conddb.addOverride("/TILE/OFL02/CALIB/SFR","TileOfl02CalibSfr-SIM-07") if "FullG4" in ISF_Flags.Simulator(): - # Not tuned yet for G4 10.6 - # protectedInclude("SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py") - pass + protectedInclude("SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py") + # enable G4 optimisations protectedInclude("SimulationJobOptions/preInclude.G4Optimizations.py") diff --git a/Tools/WorkflowTestRunner/python/References.py b/Tools/WorkflowTestRunner/python/References.py index 0336b7a31297cb2a61593fec0e6a918f53f131f9..46ee631d29d8b67fdd31f6ae8a5e3e47bc34f28f 100644 --- a/Tools/WorkflowTestRunner/python/References.py +++ b/Tools/WorkflowTestRunner/python/References.py @@ -11,8 +11,8 @@ # Format is "test-branch" : "version" references_map = { # Simulation - "s3759": "v8", - "s3760": "v6", + "s3759": "v9", + "s3760": "v7", "s3779": "v4", # Overlay "d1590": "v9", diff --git a/Tracking/TrkDetDescr/TrkVolumes/CMakeLists.txt b/Tracking/TrkDetDescr/TrkVolumes/CMakeLists.txt index 1ff205ad9a78cbde5ca6187891c5bce0bef35cb7..b998587965e776f46c63e2313611c0b990b567e4 100644 --- a/Tracking/TrkDetDescr/TrkVolumes/CMakeLists.txt +++ b/Tracking/TrkDetDescr/TrkVolumes/CMakeLists.txt @@ -19,6 +19,5 @@ if ( "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" ) set_source_files_properties( ${CMAKE_CURRENT_SOURCE_DIR}/src/Volume.cxx PROPERTIES - COMPILE_FLAGS "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" - COMPILE_DEFINITIONS "FLATTEN" ) + COMPILE_FLAGS "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") endif() diff --git a/Tracking/TrkDetDescr/TrkVolumes/src/Volume.cxx b/Tracking/TrkDetDescr/TrkVolumes/src/Volume.cxx index db362eec623eae2c0c8d567d695caca1fcc1a0b9..38825c984d827b5b014eaa106ec3e32f7881f0e2 100644 --- a/Tracking/TrkDetDescr/TrkVolumes/src/Volume.cxx +++ b/Tracking/TrkDetDescr/TrkVolumes/src/Volume.cxx @@ -78,13 +78,13 @@ Trk::Volume::clone() const return new Trk::Volume(*this); } -#if defined(FLATTEN) && defined(__GNUC__) +#if defined(__GNUC__) // We compile this package with optimization, even in debug builds; otherwise, // the heavy use of Eigen makes it too slow. However, from here we may call // to out-of-line Eigen code that is linked from other DSOs; in that case, // it would not be optimized. Avoid this by forcing all Eigen code // to be inlined here if possible. -__attribute__((flatten)) +[[gnu::flatten]] #endif bool Trk::Volume::inside(const Amg::Vector3D& gp, double tol) const diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/PRD_MultiTruthCollectionCnv_p1.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/PRD_MultiTruthCollectionCnv_p1.cxx index 43f341d6803428da06329db1d7961398819f3cf6..6078f8e1074b4b47e36ccf713e3191fb02ab21cc 100755 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/PRD_MultiTruthCollectionCnv_p1.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/PRD_MultiTruthCollectionCnv_p1.cxx @@ -25,10 +25,9 @@ void PRD_MultiTruthCollectionCnv_p1::persToTrans( const Trk::PRD_MultiTruthColle { msg<m_entries.begin(); i!=pers->m_entries.end(); i++) { + for (const Trk::PRD_MultiTruthCollection_p1::Entry& ent : pers->m_entries) { HepMcParticleLink link; - particleLinkConverter.persToTrans(&i->particle, &link, msg); - //trans->insert(trans->end(), std::make_pair(Identifier(i->id), link) ); + particleLinkConverter.persToTrans(&ent.particle, &link, msg); if(!m_isInitialized) { if (this->initialize(msg) != StatusCode::SUCCESS) { @@ -37,11 +36,11 @@ void PRD_MultiTruthCollectionCnv_p1::persToTrans( const Trk::PRD_MultiTruthColle } Identifier chanId; - if (m_pixId->is_shortened_pixel_id(i->id)) { - chanId = m_pixId->pixel_id_from_shortened(i->id); + if (m_pixId->is_shortened_pixel_id(ent.id)) { + chanId = m_pixId->pixel_id_from_shortened(ent.id); } else { - chanId = i->id; + chanId = ent.id; } trans->insert(trans->end(), std::make_pair(chanId, link) ); } @@ -57,10 +56,10 @@ void PRD_MultiTruthCollectionCnv_p1::transToPers( const PRD_MultiTruthCollection pers->m_entries.reserve(trans->size()); - for(PRD_MultiTruthCollection::const_iterator i=trans->begin(); i!=trans->end(); i++) { + for (const auto& p : *trans) { HepMcParticleLink_p1 link; - particleLinkConverter.transToPers(&i->second, &link, msg); - pers->m_entries.push_back(Trk::PRD_MultiTruthCollection_p1::Entry(i->first.get_compact(), link)); + particleLinkConverter.transToPers(&p.second, &link, msg); + pers->m_entries.push_back(Trk::PRD_MultiTruthCollection_p1::Entry(p.first.get_compact(), link)); } msg<m_entries.begin(); i!=pers->m_entries.end(); i++) { + + for (const Trk::PRD_MultiTruthCollection_p2::Entry& ent : pers->m_entries) { HepMcParticleLink link; - particleLinkConverter.persToTrans(&i->particle, &link, msg); - trans->insert(trans->end(), std::make_pair(Identifier(i->id), link) ); + particleLinkConverter.persToTrans(&ent.particle, &link, msg); + trans->insert(trans->end(), std::make_pair(Identifier(ent.id), link) ); } msg<m_entries.reserve(trans->size()); - for(PRD_MultiTruthCollection::const_iterator i=trans->begin(); i!=trans->end(); i++) { + for (const auto& p : *trans) { HepMcParticleLink_p1 link; - particleLinkConverter.transToPers(&i->second, &link, msg); - pers->m_entries.push_back(Trk::PRD_MultiTruthCollection_p2::Entry(i->first.get_compact(), link)); + particleLinkConverter.transToPers(&p.second, &link, msg); + pers->m_entries.push_back(Trk::PRD_MultiTruthCollection_p2::Entry(p.first.get_compact(), link)); } msg<m_entries.begin(); i!=pers->m_entries.end(); i++) { + for (const Trk::PRD_MultiTruthCollection_p3::Entry& ent : pers->m_entries) { HepMcParticleLink link; - particleLinkConverter.persToTrans(&i->particle, &link, msg); - trans->insert(trans->end(), std::make_pair(Identifier(i->id), link) ); + particleLinkConverter.persToTrans(&ent.particle, &link, msg); + trans->insert(trans->end(), std::make_pair(Identifier(ent.id), link) ); } msg<m_entries.reserve(trans->size()); - for(PRD_MultiTruthCollection::const_iterator i=trans->begin(); i!=trans->end(); i++) { + for (const auto& p : *trans) { HepMcParticleLink_p2 link; - particleLinkConverter.transToPers(&i->second, &link, msg); - pers->m_entries.push_back(Trk::PRD_MultiTruthCollection_p3::Entry(i->first.get_compact(), link)); + particleLinkConverter.transToPers(&p.second, &link, msg); + pers->m_entries.push_back(Trk::PRD_MultiTruthCollection_p3::Entry(p.first.get_compact(), link)); } msg< & thresholdVectors, std::vector & weightMatrices); - Int_t getnInput() const {return mnInput;}; + Int_t getnInput() const {return m_nInput;}; - Int_t getnHidden() const {return mnHidden;}; + Int_t getnHidden() const {return m_nHidden;}; - Int_t getnOutput() const {return mnOutput;}; + Int_t getnOutput() const {return m_nOutput;}; const std::vector & getnHiddenLayerSize() const { - return mnHiddenLayerSize; + return m_nHiddenLayerSize; }; - Int_t getActivationFunction() const {return mActivationFunction;}; + Int_t getActivationFunction() const {return m_ActivationFunction;}; const std::vector & getThresholdVectors() const { - return mThresholdVectors; + return m_ThresholdVectors; }; const std::vector & weightMatrices() const { - return mWeightMatrices; + return m_WeightMatrices; }; // these methods should be optimized. @@ -114,16 +114,16 @@ public: // optimized code. DVec calculateNormalized(const DMap & input) const; - bool getIfLinearOutput() const { return mLinearOutput; }; + bool getIfLinearOutput() const { return m_LinearOutput; }; - bool getIfNormalizeOutput() const { return mNormalizeOutput; }; + bool getIfNormalizeOutput() const { return m_NormalizeOutput; }; private: - unsigned mnInput; - unsigned mnHidden; - unsigned mnOutput; + unsigned m_nInput; + unsigned m_nHidden; + unsigned m_nOutput; // in an ideal world these would be one object in a vector, but // storing classes within classes in root is ugly @@ -132,20 +132,20 @@ private: std::map m_inputStringToNode; - std::vector mnHiddenLayerSize; + std::vector m_nHiddenLayerSize; - std::vector mThresholdVectors; - std::vector mWeightMatrices; + std::vector m_ThresholdVectors; + std::vector m_WeightMatrices; unsigned int m_bufferSizeMax; //! cache of the maximum needed size, not persisitified - Int_t mActivationFunction; + Int_t m_ActivationFunction; - bool mLinearOutput; + bool m_LinearOutput; - bool mNormalizeOutput; + bool m_NormalizeOutput; - double maxExpValue; + double m_maxExpValue; Double_t sigmoid(Double_t x) const; diff --git a/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/src/TTrainedNetwork.cxx b/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/src/TTrainedNetwork.cxx index 7db6d1caf5f30f1c1b64aab85c9877003672b3af..2dc058a164b869d45df010e0daf57114b0c0bcb4 100644 --- a/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/src/TTrainedNetwork.cxx +++ b/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/src/TTrainedNetwork.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrkNeuralNetworkUtils/TTrainedNetwork.h" @@ -15,15 +15,15 @@ #include "TargetBuffer_t.icc" TTrainedNetwork::TTrainedNetwork() + : m_nInput(0), + m_nHidden(0), + m_nOutput(0), + m_bufferSizeMax(0), + m_ActivationFunction(1), + m_LinearOutput(false), + m_NormalizeOutput(false), + m_maxExpValue(log(std::numeric_limits::max())) { - mnInput=0; - mnHidden=0; - mnOutput=0; - mActivationFunction=1; - mLinearOutput=false; - mNormalizeOutput=false; - maxExpValue=log(std::numeric_limits::max()); - m_bufferSizeMax=0; } TTrainedNetwork::TTrainedNetwork(Int_t nInput, @@ -39,24 +39,24 @@ TTrainedNetwork::TTrainedNetwork(Int_t nInput, assert(nInput >= 0); assert(nOutput >= 0); assert(nHidden >= 0); - mnInput = nInput; - mnHidden = nHidden; - mnOutput = nOutput; - mnHiddenLayerSize = nHiddenLayerSize; - mThresholdVectors = thresholdVectors; - mWeightMatrices = weightMatrices; - mActivationFunction = activationFunction; - mLinearOutput = linearOutput; - mNormalizeOutput = normalizeOutput; - maxExpValue = log(std::numeric_limits::max()); - - auto maxElement = *(std::max_element(mnHiddenLayerSize.begin(), mnHiddenLayerSize.end())); - int nlayer_max = std::max(static_cast(mnOutput), maxElement); + m_nInput = nInput; + m_nHidden = nHidden; + m_nOutput = nOutput; + m_nHiddenLayerSize = nHiddenLayerSize; + m_ThresholdVectors = thresholdVectors; + m_WeightMatrices = weightMatrices; + m_ActivationFunction = activationFunction; + m_LinearOutput = linearOutput; + m_NormalizeOutput = normalizeOutput; + m_maxExpValue = log(std::numeric_limits::max()); + + auto maxElement = *(std::max_element(m_nHiddenLayerSize.begin(), m_nHiddenLayerSize.end())); + int nlayer_max = std::max(static_cast(m_nOutput), maxElement); // - std::vector::const_iterator hidden_layer_threshold_vector_end = mThresholdVectors.end(); + std::vector::const_iterator hidden_layer_threshold_vector_end = m_ThresholdVectors.end(); --hidden_layer_threshold_vector_end; // - for (std::vector::const_iterator tr_itr= mThresholdVectors.begin(); tr_itr != hidden_layer_threshold_vector_end; ++tr_itr){ + for (std::vector::const_iterator tr_itr= m_ThresholdVectors.begin(); tr_itr != hidden_layer_threshold_vector_end; ++tr_itr){ nlayer_max = std::max(nlayer_max, (*tr_itr)->GetNrows()); } m_bufferSizeMax=nlayer_max; @@ -80,25 +80,25 @@ TTrainedNetwork::TTrainedNetwork(std::vector inputs, ActivationFunction activationFunction, unsigned options) { - mnInput = inputs.size(); - mnHidden = thresholdVectors.size() - 1; - mnOutput = nOutput; - mThresholdVectors = thresholdVectors; - mWeightMatrices = weightMatrices; - mActivationFunction = activationFunction; - mLinearOutput = options & linearOutput; - mNormalizeOutput = options & normalizeOutput; - maxExpValue = log(std::numeric_limits::max()); + m_nInput = inputs.size(); + m_nHidden = thresholdVectors.size() - 1; + m_nOutput = nOutput; + m_ThresholdVectors = thresholdVectors; + m_WeightMatrices = weightMatrices; + m_ActivationFunction = activationFunction; + m_LinearOutput = options & linearOutput; + m_NormalizeOutput = options & normalizeOutput; + m_maxExpValue = log(std::numeric_limits::max()); std::vector::const_iterator hidden_layer_threshold_vector_end = - mThresholdVectors.end(); + m_ThresholdVectors.end(); --hidden_layer_threshold_vector_end; for (std::vector::const_iterator tr_itr - = mThresholdVectors.begin(); + = m_ThresholdVectors.begin(); tr_itr != hidden_layer_threshold_vector_end; ++tr_itr){ - mnHiddenLayerSize.push_back((*tr_itr)->GetNrows()); + m_nHiddenLayerSize.push_back((*tr_itr)->GetNrows()); } unsigned node_n = 0; @@ -123,9 +123,9 @@ TTrainedNetwork::TTrainedNetwork(std::vector inputs, throw std::runtime_error("Names for NN inputs must be unique (if given)"); } - int nlayer_max(mnOutput); - for (unsigned i = 0; i < mnHiddenLayerSize.size(); ++i) - nlayer_max = std::max(nlayer_max, mnHiddenLayerSize[i]); + int nlayer_max(m_nOutput); + for (unsigned i = 0; i < m_nHiddenLayerSize.size(); ++i) + nlayer_max = std::max(nlayer_max, m_nHiddenLayerSize[i]); m_bufferSizeMax=nlayer_max; unsigned n_zero = std::count(m_input_node_scale.begin(), @@ -140,8 +140,8 @@ TTrainedNetwork::TTrainedNetwork(std::vector inputs, TTrainedNetwork::~TTrainedNetwork() { - std::vector::const_iterator vectBegin=mThresholdVectors.begin(); - std::vector::const_iterator vectEnd=mThresholdVectors.end(); + std::vector::const_iterator vectBegin=m_ThresholdVectors.begin(); + std::vector::const_iterator vectEnd=m_ThresholdVectors.end(); for (std::vector::const_iterator vectIter=vectBegin; vectIter!=vectEnd; @@ -150,8 +150,8 @@ TTrainedNetwork::~TTrainedNetwork() delete *vectIter; } - std::vector::const_iterator matrixBegin=mWeightMatrices.begin(); - std::vector::const_iterator matrixEnd=mWeightMatrices.end(); + std::vector::const_iterator matrixBegin=m_WeightMatrices.begin(); + std::vector::const_iterator matrixEnd=m_WeightMatrices.end(); for (std::vector::const_iterator matrixIter=matrixBegin; matrixIter!=matrixEnd; @@ -165,7 +165,7 @@ TTrainedNetwork::~TTrainedNetwork() std::vector TTrainedNetwork::getInputs() const { assert(m_inputStringToNode.size() == 0 || - m_inputStringToNode.size() == mnInput); + m_inputStringToNode.size() == m_nInput); assert(m_input_node_scale.size() == m_input_node_offset.size()); std::map input_n_to_name; @@ -176,10 +176,10 @@ std::vector TTrainedNetwork::getInputs() const { } std::vector inputs_vector; - if (m_input_node_offset.size() != mnInput) { + if (m_input_node_offset.size() != m_nInput) { return inputs_vector; } - for (unsigned input_n = 0; input_n < mnInput; input_n++){ + for (unsigned input_n = 0; input_n < m_nInput; input_n++){ std::map::const_iterator name_itr = input_n_to_name.find(input_n); Input the_input; @@ -197,8 +197,8 @@ void TTrainedNetwork::setNewWeights(std::vector & thresholdVectors, std::vector & weightMatrices) { - std::vector::const_iterator vectBegin=mThresholdVectors.begin(); - std::vector::const_iterator vectEnd=mThresholdVectors.end(); + std::vector::const_iterator vectBegin=m_ThresholdVectors.begin(); + std::vector::const_iterator vectEnd=m_ThresholdVectors.end(); for (std::vector::const_iterator vectIter=vectBegin; vectIter!=vectEnd; @@ -207,8 +207,8 @@ void TTrainedNetwork::setNewWeights(std::vector & thresholdVectors, delete *vectIter; } - std::vector::const_iterator matrixBegin=mWeightMatrices.begin(); - std::vector::const_iterator matrixEnd=mWeightMatrices.end(); + std::vector::const_iterator matrixBegin=m_WeightMatrices.begin(); + std::vector::const_iterator matrixEnd=m_WeightMatrices.end(); for (std::vector::const_iterator matrixIter=matrixBegin; matrixIter!=matrixEnd; @@ -217,11 +217,11 @@ void TTrainedNetwork::setNewWeights(std::vector & thresholdVectors, delete *matrixIter; } - mThresholdVectors.clear(); - mWeightMatrices.clear(); + m_ThresholdVectors.clear(); + m_WeightMatrices.clear(); - mThresholdVectors=thresholdVectors; - mWeightMatrices=weightMatrices; + m_ThresholdVectors=thresholdVectors; + m_WeightMatrices=weightMatrices; } @@ -229,7 +229,7 @@ std::vector TTrainedNetwork::calculateNormalized(const TTrainedNetwork::DMap& in) const { - std::vector inputs(mnInput); + std::vector inputs(m_nInput); size_t n_filled = 0; for (std::map::const_iterator itr = in.begin(); itr != in.end(); @@ -256,7 +256,7 @@ TTrainedNetwork::calculateNormalized(const TTrainedNetwork::DMap& in) if (n_filled != m_inputStringToNode.size() ) { assert(n_filled < m_inputStringToNode.size() ); std::set input_set; - for (DMapI itr = in.begin(); itr != in.end(); itr++) { + for (DMapI itr = in.begin(); itr != in.end(); ++itr) { input_set.insert(itr->first); } std::string err = "nodes not filled in NN: "; @@ -278,11 +278,11 @@ TTrainedNetwork::calculateNormalized(const TTrainedNetwork::DVec& input) { // asserts can be turned off in optomized code anyway, // use them to be safe without having to call vector.at() - assert(mnInput == input.size()); - assert(mnInput == m_input_node_scale.size()); - assert(mnInput == m_input_node_offset.size()); + assert(m_nInput == input.size()); + assert(m_nInput == m_input_node_scale.size()); + assert(m_nInput == m_input_node_offset.size()); std::vector transformed_inputs(input); - for (unsigned input_n = 0; input_n < mnInput; input_n++) { + for (unsigned input_n = 0; input_n < m_nInput; input_n++) { transformed_inputs[input_n] += m_input_node_offset[input_n]; transformed_inputs[input_n] *= m_input_node_scale[input_n]; } @@ -298,19 +298,19 @@ TTrainedNetwork::calculateOutputValues(const std::vector& input) // Pixel clusterization - Thomas Kittelmann, Oct 2011. - if (input.size() != mnInput) + if (input.size() != m_nInput) { std::cerr << "TTrainedNetwork WARNING Input size: " << input.size() - << " does not match with network: " << mnInput << std::endl; + << " does not match with network: " << m_nInput << std::endl; return {}; } TTN::DoubleBuffer_t tmp_array; tmp_array.clear(m_bufferSizeMax); // make sure it is big enough and initialise with zero - const unsigned nTargetLayers(mnHidden+1); - const unsigned lastTargetLayer(mnHidden); - unsigned nSource = mnInput, nTarget(0); + const unsigned nTargetLayers(m_nHidden+1); + const unsigned lastTargetLayer(m_nHidden); + unsigned nSource = m_nInput, nTarget(0); TTN::ConstBuffer_t source(input); const double * weights(nullptr); const double * thresholds(nullptr); @@ -319,13 +319,13 @@ TTrainedNetwork::calculateOutputValues(const std::vector& input) for (unsigned iLayer = 0; iLayer < nTargetLayers; ++iLayer) { //Find data area for target layer: nTarget = ( iLayer == lastTargetLayer ? - mnOutput : - mnHiddenLayerSize[iLayer] ); + m_nOutput : + m_nHiddenLayerSize[iLayer] ); TTN::Buffer_t target( tmp_array[iLayer] ); //Transfer the input nodes to the output nodes in this layer transition: - weights = mWeightMatrices[iLayer]->GetMatrixArray(); - thresholds = mThresholdVectors[iLayer]->GetMatrixArray(); + weights = m_WeightMatrices[iLayer]->GetMatrixArray(); + thresholds = m_ThresholdVectors[iLayer]->GetMatrixArray(); for (unsigned inodeTarget=0;inodeTarget& input) weights_tmp += nTarget; } nodeVal += *thresholds++;//see remark above. - target[inodeTarget] = ( mLinearOutput && iLayer == lastTargetLayer ) + target[inodeTarget] = ( m_LinearOutput && iLayer == lastTargetLayer ) ? nodeVal : sigmoid(nodeVal); } //Prepare for next layer transition: @@ -349,7 +349,7 @@ TTrainedNetwork::calculateOutputValues(const std::vector& input) } //std::vector result(nTarget); - if (!mNormalizeOutput) { + if (!m_NormalizeOutput) { // std::memcpy(&result[0], target, sizeof(*target)*nTarget); // the result is already in the buffer half with index (nTargetLayers-1)%2 // copy this to the front of the full buffer and shrink the array @@ -372,31 +372,31 @@ TTrainedNetwork::calculateOutputValues(const std::vector& input) Double_t TTrainedNetwork::sigmoid(Double_t x) const { - if (-2*x >= maxExpValue){ + if (-2*x >= m_maxExpValue){ return 0.; } return 1./(1.+exp(-2*x)); } bool TTrainedNetwork::is_consistent() const { - if (mThresholdVectors.size() != mWeightMatrices.size()) { + if (m_ThresholdVectors.size() != m_WeightMatrices.size()) { std::cerr << "ERROR: " - << "n threshold vectors: " << mThresholdVectors.size() - << " n weight matrices: " << mWeightMatrices.size() + << "n threshold vectors: " << m_ThresholdVectors.size() + << " n weight matrices: " << m_WeightMatrices.size() << std::endl; return false; } - int nodes_last_layer = mnInput; - for (unsigned layer_n = 0; layer_n < mThresholdVectors.size(); layer_n++){ - int n_threshold_nodes = mThresholdVectors.at(layer_n)->GetNrows(); - int n_weights_nodes = mWeightMatrices.at(layer_n)->GetNcols(); + int nodes_last_layer = m_nInput; + for (unsigned layer_n = 0; layer_n < m_ThresholdVectors.size(); layer_n++){ + int n_threshold_nodes = m_ThresholdVectors.at(layer_n)->GetNrows(); + int n_weights_nodes = m_WeightMatrices.at(layer_n)->GetNcols(); if (n_threshold_nodes != n_weights_nodes) { std::cerr << "ERROR: in layer " << layer_n << " --- n threshold: " << n_threshold_nodes << " n_weights: " << n_weights_nodes << std::endl; return false; } - int n_incoming_connections = mWeightMatrices.at(layer_n)->GetNrows(); + int n_incoming_connections = m_WeightMatrices.at(layer_n)->GetNrows(); if (n_incoming_connections != nodes_last_layer) { std::cerr << "ERROR: in layer " << layer_n << " --- last layer nodes: " << nodes_last_layer @@ -407,10 +407,10 @@ bool TTrainedNetwork::is_consistent() const { nodes_last_layer = n_weights_nodes; } - if (mThresholdVectors.size() - 1 != mnHiddenLayerSize.size() ){ + if (m_ThresholdVectors.size() - 1 != m_nHiddenLayerSize.size() ){ std::cerr << "ERROR: " - << "size mThresholdVectors: " << mThresholdVectors.size() - << " size mnHiddenLayerSize: " << mnHiddenLayerSize.size() + << "size m_ThresholdVectors: " << m_ThresholdVectors.size() + << " size m_nHiddenLayerSize: " << m_nHiddenLayerSize.size() << std::endl; return false; } @@ -419,8 +419,8 @@ bool TTrainedNetwork::is_consistent() const { } bool TTrainedNetwork::check_norm_size(unsigned size) const { - if (size != mnInput) { - std::cerr << "ERROR: TTrainedNetwork has " << mnInput << " inputs, " + if (size != m_nInput) { + std::cerr << "ERROR: TTrainedNetwork has " << m_nInput << " inputs, " << size << " normalization values provided\n"; return false; } diff --git a/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/src/TargetBuffer_t.h b/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/src/TargetBuffer_t.h index 15985134a1519149f05047acba116ea63c270f0d..6db5635740326b5a4e4a6329717d8829cda04dd7 100644 --- a/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/src/TargetBuffer_t.h +++ b/Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/src/TargetBuffer_t.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TargetBuffer_t_H #define TargetBuffer_t_H @@ -24,14 +24,16 @@ namespace TTN { template friend class BufferBase_t; public: - BufferBase_t(T_VectorType &buffer) { - m_ptr=&(buffer[0]); + BufferBase_t(T_VectorType &buffer) + : m_ptr (&(buffer[0])) #ifndef NDEBUG - // debug code - m_maxIndex=buffer.size(); - m_bufferStart=buffer.data(); - m_bufferEnd=m_bufferStart + buffer.size();//assumed contiguous + // debug code + , m_maxIndex(buffer.size()) + , m_bufferStart(buffer.data()) + , m_bufferEnd(m_bufferStart + buffer.size())//assumed contiguous #endif + { + // cppcheck-suppress missingReturn; false positive } protected: @@ -44,7 +46,9 @@ namespace TTN { , m_bufferStart(buffer.m_bufferStart) , m_bufferEnd(buffer.m_bufferEnd) #endif - {} + { + // cppcheck-suppress missingReturn; false positive + } template BufferBase_t & @@ -61,18 +65,16 @@ namespace TTN { // last two arguments are only needed for the optional range check. BufferBase_t(T_BufferType *buffer, - typename std::vector::size_type max_idx, - const std::vector &full_vector) - { - (void) max_idx; //prevent unused argument warnings - (void) full_vector; - m_ptr=buffer; + typename std::vector::size_type max_idx [[maybe_unused]], + const std::vector & full_vector [[maybe_unused]]) + : m_ptr(buffer) #ifndef NDEBUG - // debug code - m_maxIndex=max_idx; - m_bufferStart=full_vector.data(); - m_bufferEnd=m_bufferStart+full_vector.size();//assumed contiguous + // debug code + , m_maxIndex(max_idx) + , m_bufferStart(full_vector.data()) + , m_bufferEnd(m_bufferStart+full_vector.size())//assumed contiguous #endif + { } public: diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/DefParamPullPlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/DefParamPullPlots.cxx index 8589621c746e14ddc07a7a0c94b2f70f4d2a41b8..da883ed6a9dd99af2b3d94b327012fe268f09046 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/DefParamPullPlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/DefParamPullPlots.cxx @@ -53,7 +53,7 @@ namespace Trk { } void - DefParamPullPlots::fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle &truthprt, float weight) const { + DefParamPullPlots::fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle &truthprt, float weight) { const double d0_trk = trkprt.d0(); const double z0_trk = trkprt.z0(); const double phi_trk = trkprt.phi0(); diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/HitTypePlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/HitTypePlots.cxx index 9d5a6f7647d043db7450b755ccd80930f5ed7fd3..5f72d6a8100aa66173c0eb44dbd2d4831248a1d1 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/HitTypePlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/HitTypePlots.cxx @@ -29,7 +29,7 @@ namespace Trk { } void - HitTypePlots::fill(int iHits, float fEta, float fPhi, float weight) const { + HitTypePlots::fill(int iHits, float fEta, float fPhi, float weight) { Hits->Fill(iHits, weight); HitsVsEta->Fill(iHits, fEta, weight); HitsVsPhi->Fill(iHits, fPhi, weight); diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/ImpactPlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/ImpactPlots.cxx index 6eddeb900f813520347a8815532c509e3a64675e..225d8bcf25c2496bb4524c55b7f432db442b8be3 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/ImpactPlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/ImpactPlots.cxx @@ -24,7 +24,7 @@ namespace Trk { } void - ImpactPlots::fill(const xAOD::TrackParticle &trkprt, float weight) const { + ImpactPlots::fill(const xAOD::TrackParticle &trkprt, float weight) { d0->Fill(trkprt.d0(),weight); d0_small->Fill(trkprt.d0(),weight); z0->Fill(trkprt.z0(),weight); diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/ParamPlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/ParamPlots.cxx index 933e7043b5cce3743acc9f7554686c32c5fd3260..bab67afc4755689082e73d051299e974a20d6c8e 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/ParamPlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/ParamPlots.cxx @@ -37,7 +37,7 @@ namespace Trk { } void - ParamPlots::fill(const xAOD::IParticle &prt, float weight) const { + ParamPlots::fill(const xAOD::IParticle &prt, float weight) { pt->Fill(prt.pt() * 0.001, weight); eta->Fill(prt.eta(),weight); phi->Fill(prt.phi(),weight); diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/RecoInfoPlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/RecoInfoPlots.cxx index e2a5cde0cad354e87cba0b6c59aa3b49cc9a861c..6acaf50feb24796692145d749c12977824c24e0f 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/RecoInfoPlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/RecoInfoPlots.cxx @@ -25,7 +25,7 @@ namespace Trk { } void - RecoInfoPlots::fill(const xAOD::TrackParticle &trkprt, float weight) const { + RecoInfoPlots::fill(const xAOD::TrackParticle &trkprt, float weight) { float chi2 = trkprt.chiSquared(); int ndf = trkprt.numberDoF(); diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/ResolutionPlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/ResolutionPlots.cxx index 83c0ccbcdbbd41dc26634032e2f53db4d8c907be..a861a00102e0108d9c3bbc6b6a8058598b4e75e9 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/ResolutionPlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/ResolutionPlots.cxx @@ -20,7 +20,7 @@ namespace Trk { } void - ResolutionPlots::fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle &truthprt, float weight) const { + ResolutionPlots::fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle &truthprt, float weight) { Res_pT->Fill((trkprt.pt() - truthprt.pt()) / truthprt.pt(), weight); Res_eta->Fill(trkprt.eta() - truthprt.eta(),weight); Res_phi->Fill(trkprt.phi() - truthprt.phi(),weight); diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/TruthInfoPlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/TruthInfoPlots.cxx index 5e2f69af2377ef6faed3342b1f768992590635aa..fab7e83b354b58a9a0de928d8c77a656806f16ca 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/TruthInfoPlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/TruthInfoPlots.cxx @@ -18,7 +18,7 @@ namespace Trk { } void - TruthInfoPlots::fill(const xAOD::TruthParticle &truthprt, float weight ) const { + TruthInfoPlots::fill(const xAOD::TruthParticle &truthprt, float weight ) { if (truthprt.isAvailable("truthType")) { truthType->Fill(truthprt.auxdata< int >("truthType"), weight); } diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/TruthTrkExtrapolationPlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/TruthTrkExtrapolationPlots.cxx index 3e556a49fffdee636dc35ea2d24279f29b3a601d..c0e5d22b10c80c7c7cf9563bfa0f2093198d2e59 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/TruthTrkExtrapolationPlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/TruthTrkExtrapolationPlots.cxx @@ -23,7 +23,7 @@ namespace Trk { } void - TruthTrkExtrapolationPlots::fill(const xAOD::TruthParticle &truthprt, float weight) const { + TruthTrkExtrapolationPlots::fill(const xAOD::TruthParticle &truthprt, float weight) { m_CaloEntry.fill(truthprt, "CaloEntryLayer", weight); m_MuonEntry.fill(truthprt, "MuonEntryLayer", weight); m_MuonExit.fill(truthprt, "MuonExitLayer", weight); @@ -75,7 +75,7 @@ namespace Trk { } void - ExtrLayerPlots::fill(const xAOD::TruthParticle &truthprt, const std::string& sNom, float weight) const { + ExtrLayerPlots::fill(const xAOD::TruthParticle &truthprt, const std::string& sNom, float weight) { if (!truthprt.isAvailable(sNom + "_px") || !truthprt.isAvailable(sNom + "_py") || !truthprt.isAvailable(sNom + "_pz")) { @@ -221,7 +221,7 @@ namespace Trk { } void - ExtrRegionPlots::fill(const xAOD::TruthParticle &truthprt, const std::string& sDetBegin, const std::string& sDetEnd, float weight) const { + ExtrRegionPlots::fill(const xAOD::TruthParticle &truthprt, const std::string& sDetBegin, const std::string& sDetEnd, float weight) { if (!truthprt.isAvailable(sDetBegin + "px") || !truthprt.isAvailable(sDetBegin + "py") || !truthprt.isAvailable(sDetBegin + "pz") || diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..1815604b6468f367c2dfa1e58005807ef6189818 --- /dev/null +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Tracking/TrkValidation/TrkValHistUtils diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/DefParamPullPlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/DefParamPullPlots.h index 337c6119a4113a35225b09ac929e72fa5e42f88d..64b93edeab11bc1fd678d35ae5e2cdf80ad78169 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/DefParamPullPlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/DefParamPullPlots.h @@ -14,7 +14,7 @@ namespace Trk{ class DefParamPullPlots: public PlotBase { public: DefParamPullPlots(PlotBase *pParent, std::string sDir, std::string sType=""):PlotBase(pParent, sDir),m_sType(sType){ init();} - void fill(const xAOD::TrackParticle& trkprt, const xAOD::TruthParticle& truthprt, float weight=1.0) const; + void fill(const xAOD::TrackParticle& trkprt, const xAOD::TruthParticle& truthprt, float weight=1.0); TH1* Pull_d0; TH1* Pull_z0; diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/HitResidualPlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/HitResidualPlots.h index ad5ea982a7f14b5cb42c91eb3a823ce6da66b8b7..069ee1c6e448e7fb55b8335159afbf018f6aacb6 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/HitResidualPlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/HitResidualPlots.h @@ -15,7 +15,7 @@ namespace Trk{ class HitResidualPlots: public PlotBase { public: HitResidualPlots(PlotBase *pParent, std::string sDir, std::string sType=""): PlotBase(pParent, sDir),m_sType(sType) { init(); } - void fill( const Trk::ResidualPull& resPull ) const; + void fill( const Trk::ResidualPull& resPull ); TH1* residuals; TH1* pulls; diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/HitTypePlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/HitTypePlots.h index f107257c56e8e793cbf0b49de039774b75e3a47b..e893399005b51b1ad64b2018339dc831d00c07ee 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/HitTypePlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/HitTypePlots.h @@ -12,7 +12,7 @@ namespace Trk{ class HitTypePlots:public PlotBase { public: HitTypePlots(PlotBase* pParent, std::string sHitType, std::string sHitLabel, int iMin, int iMax); - void fill(int iHits, float fEta, float fPhi, float weight=1.0) const; + void fill(int iHits, float fEta, float fPhi, float weight=1.0); std::string m_sHitType; std::string m_sHitLabel; diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ImpactPlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ImpactPlots.h index 7819e1ad70f77f8a301f4909713da3d6d4b0f987..04a625cf0b81a0ba63d43c7caeebfae9562d63b3 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ImpactPlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ImpactPlots.h @@ -13,7 +13,7 @@ namespace Trk{ class ImpactPlots: public PlotBase { public: ImpactPlots(PlotBase *pParent, std::string sDir):PlotBase(pParent, sDir){ init();} - void fill(const xAOD::TrackParticle& trkprt, float weight=1.0) const; + void fill(const xAOD::TrackParticle& trkprt, float weight=1.0); TH1* z0; TH1* z0sig; diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ParamPlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ParamPlots.h index b206d15831e8744d06d2c8f9f90263cf6b39cb94..7bca5d013284a283d995c381e6295c2fab82b22e 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ParamPlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ParamPlots.h @@ -13,7 +13,7 @@ namespace Trk{ class ParamPlots:public PlotBase { public: ParamPlots(PlotBase *pParent, const std::string& sDir, std::string sParticleType); - void fill(const xAOD::IParticle& prt, float weight=1.0) const; + void fill(const xAOD::IParticle& prt, float weight=1.0); TH1* eta; TH1* phi; diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/RecoInfoPlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/RecoInfoPlots.h index 7ffd54dbac2b0a1d7612db42dfd2f05192e5a46e..e009cd9e2ed268b5ef0ed20b8bbfb99f53e498cb 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/RecoInfoPlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/RecoInfoPlots.h @@ -13,7 +13,7 @@ namespace Trk{ class RecoInfoPlots: public PlotBase { public: RecoInfoPlots(PlotBase *pParent, std::string sDir, std::string sType=""):PlotBase(pParent, sDir),m_sType(sType){ init();} - void fill(const xAOD::TrackParticle& trkprt, float weight=1.0) const; + void fill(const xAOD::TrackParticle& trkprt, float weight=1.0); TH1* trackfitchi2; TH1* trackfitndof; diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ResolutionPlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ResolutionPlots.h index 6f9f3956ef75308fd06a6b2d6576e0b812a092d9..52cf8a8540cc03e8d0f30689785921ee63e61f24 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ResolutionPlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/ResolutionPlots.h @@ -14,7 +14,7 @@ namespace Trk{ class ResolutionPlots: public PlotBase { public: ResolutionPlots(PlotBase *pParent, std::string sDir, std::string sType=""):PlotBase(pParent, sDir),m_sType(sType) { init();} - void fill(const xAOD::TrackParticle& trkprt, const xAOD::TruthParticle& truthprt, float weight=1.0) const; + void fill(const xAOD::TrackParticle& trkprt, const xAOD::TruthParticle& truthprt, float weight=1.0); TH1* Res_pT; TH1* Res_eta; diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/TruthInfoPlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/TruthInfoPlots.h index 2cc157ff5d03782318201a83f3f653513950b689..501ea52da11900d643241eaa2fee57f41c7c82a9 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/TruthInfoPlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/TruthInfoPlots.h @@ -13,7 +13,7 @@ namespace Trk{ class TruthInfoPlots: public PlotBase { public: TruthInfoPlots(PlotBase *pParent, std::string sDir):PlotBase(pParent, sDir){ init();} - void fill(const xAOD::TruthParticle& truthprt, float weight=1.0) const; + void fill(const xAOD::TruthParticle& truthprt, float weight=1.0); TH1* truthType; TH1* origin; diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/TruthTrkExtrapolationPlots.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/TruthTrkExtrapolationPlots.h index f125f1b0a9775ef466ef8924f20295c899f80b4c..2b4e72ae9506ee83394c78233f3f0f9f196865fc 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/TruthTrkExtrapolationPlots.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/TruthTrkExtrapolationPlots.h @@ -15,7 +15,7 @@ namespace Trk{ public: ExtrLayerPlots(PlotBase *pParent, const std::string& sDir, std::string sLayerName); - void fill (const xAOD::TruthParticle& truthprt, const std::string& sLayerName, float weight=1.0) const; + void fill (const xAOD::TruthParticle& truthprt, const std::string& sLayerName, float weight=1.0); std::string m_sLayerName; TH1* p; @@ -43,7 +43,7 @@ namespace Trk{ public: ExtrRegionPlots(PlotBase *pParent, const std::string& sDir, std::string sRegionBegin, std::string sRegionEnd); - void fill (const xAOD::TruthParticle& truthprt, const std::string& sRegionBegin, const std::string& sRegionEnd, float weight=1.0) const; + void fill (const xAOD::TruthParticle& truthprt, const std::string& sRegionBegin, const std::string& sRegionEnd, float weight=1.0); std::string m_sRegionBegin; std::string m_sRegionEnd; @@ -87,7 +87,7 @@ namespace Trk{ class TruthTrkExtrapolationPlots: public PlotBase { public: TruthTrkExtrapolationPlots(PlotBase *pParent, const std::string& sDir); - void fill(const xAOD::TruthParticle& truthprt, float weight=1.0) const; + void fill(const xAOD::TruthParticle& truthprt, float weight=1.0); ExtrLayerPlots m_CaloEntry; ExtrLayerPlots m_MuonEntry; diff --git a/Tracking/TrkValidation/TrkValHistUtils/src/HitResidualPlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/src/HitResidualPlots.cxx index ef8466472af7416e589a1b2a463ee89ef807af32..a9d20a0d871cc82b8a5e6a8a7dd7f2d61fef4481 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/src/HitResidualPlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/src/HitResidualPlots.cxx @@ -21,7 +21,7 @@ void HitResidualPlots::initializePlots(){ } -void HitResidualPlots::fill( const Trk::ResidualPull& resPull ) const { +void HitResidualPlots::fill( const Trk::ResidualPull& resPull ) { const float residual = resPull.residual().front(); const float pull = resPull.pull().front(); diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Derivt.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Derivt.h index edb7a54913fdabbb66ad27271ccff754658ffbb0..1e2bdf4206669b8c1d6103f9ca69d7b2e10541d7 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Derivt.h +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Derivt.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef _TrkVKalVrtCore_Derivt_H @@ -89,7 +89,7 @@ namespace Trk { class VKPointConstraint : public VKConstraintBase { public: - VKPointConstraint(int,double[3], VKVertex*, bool ); + VKPointConstraint(int,const double[3], VKVertex*, bool ); ~VKPointConstraint(); friend std::ostream& operator<<( std::ostream& out, const VKPointConstraint& ); bool onlyZ() const {return m_onlyZ; }; diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForCFT.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForCFT.h index 53a607c2923a97c8f7548acd35fce8e58bf7ca9d..9bfaa53b525d0a0658dffff833dec58b9ca00156 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForCFT.h +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForCFT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef _TrkVKalVrtCore_ForCFT_H @@ -47,7 +47,7 @@ namespace Trk { int IterationNumber; double IterationPrecision; - void prcfit( long int ntrk, double *wm, double *wmfit, double bmag, double *vrt, double *vrte) noexcept; + void prcfit( long int ntrk, double *wm, double *wmfit, double bmag, const double *vrt, const double *vrte) noexcept; void vksetIterationNum(long int Iter) noexcept; void vksetIterationPrec(double Prec) noexcept; diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Propagator.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Propagator.h index 4d7bb6df49f01f17c1cd418045f9c0df9d94f850..3912f63abab6151ad0ba1064850c64131ac1c0b7 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Propagator.h +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Propagator.h @@ -57,14 +57,14 @@ class IVKalState; ~vkalPropagator() = default; - void Propagate(long int TrkID, long int Charge, + static void Propagate(long int TrkID, long int Charge, double *ParOld, double *CovOld, double *RefStart, double *RefEnd, double *ParNew, double *CovNew, - VKalVrtControlBase* FitControl = 0) const; - bool checkTarget(double *RefEnd) const; - void Propagate(VKTrack *trk, double *RefStart, + VKalVrtControlBase* FitControl = 0) ; + static bool checkTarget(double *RefEnd) ; + static void Propagate(VKTrack *trk, double *RefStart, double *RefEnd, double *ParNew, double *CovNew, - VKalVrtControlBase* FitControl = 0) const; + VKalVrtControlBase* FitControl = 0) ; }; } diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCoreBase.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCoreBase.h index 69268318a4e5abb1785be6e88fb842f221b35cfb..7b4d6ac8c53b5c8746f980ec33cc21e9cbd38962 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCoreBase.h +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCoreBase.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef _TrkVKalVrtCoreBase_VKalVrtCore_H @@ -63,7 +63,7 @@ namespace Trk { class VKTrack { public: - VKTrack(long int, double[], double[], VKVertex *, double); + VKTrack(long int, const double[], const double[], VKVertex *, double); ~VKTrack() = default; //default destructor allows compiler to optimize out method. // VKTrack(const VKTrack & src); //copy friend std::ostream& operator<<( std::ostream& out, const VKTrack& track ); @@ -111,8 +111,8 @@ namespace Trk { double r_invR() const { return refPerig[4];} public: - void setCurrent ( double[], double[]); // set iteration (current) track parameters - void setReference( double[], double[]); // set reference track parameters + void setCurrent ( const double[], const double[]); // set iteration (current) track parameters + void setReference( const double[], const double[]); // set reference track parameters void restoreCurrentWgt(); // restore track WGT from saved copy private: diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFit.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFit.cxx index 02cdea6f7e506984624bae1a20a930dcffb1f2be..1b7e8a9df6131035438b3acfc06c069e5158e68b 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFit.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFit.cxx @@ -95,7 +95,7 @@ extern double cfSmallEigenvalue( double*, long int ); -void fillVertex(VKVertex *vk, int NTRK, long int *ich, double xyz0[3], double (*par0)[3], +void fillVertex(VKVertex *vk, int NTRK, const long int *ich, double xyz0[3], double (*par0)[3], double (*inp_Trk5)[5], double (*inp_CovTrk5)[15]) { @@ -146,8 +146,8 @@ bool checkPosition(VKVertex * vk, double vertex[3]){ extern int afterFit(VKVertex *, double *, double *, double *, double *, const VKalVrtControlBase* = nullptr); -extern void vpderiv(bool, long int , double *, double *, double *, double *, double *, double *, double *, VKalVrtControl * =nullptr); -extern void cfmasserr(VKVertex* , int*, double, double*, double*); +extern void vpderiv(bool, long int , const double *, double *, double *, double *, double *, double *, double *, VKalVrtControl * =nullptr); +extern void cfmasserr(VKVertex* , const int*, double, double*, double*); extern std::array getFitParticleMom( const VKTrack *, double); int fitVertex(VKVertex * vk) diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascade.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascade.cxx index 192d9dd0c2e55392b8c434d62522a041e7b5232a..8f2436d172f43d96872d3e8c4d3f4082813561bc 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascade.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascade.cxx @@ -29,22 +29,22 @@ extern void FullMTXfill(VKVertex * , double * ); extern int FullMCNSTfill(VKVertex * , double * , double * ); extern int vkMSolve(double *, double*, long int, double* =nullptr); -extern void copyFullMtx(double *Input, long int IPar, long int IDIM, - double *Target, long int TStart, long int TDIM); +extern void copyFullMtx(const double *Input, long int IPar, long int IDIM, + double *Target, long int TStart, long int TDIM); extern void addCrossVertexDeriv(CascadeEvent &, double * , long int , const std::vector & ); -extern void setFittedParameters(double * , std::vector &, CascadeEvent &); +extern void setFittedParameters(const double * , std::vector &, CascadeEvent &); extern int getCascadeNPar(CascadeEvent &, int Type=0); extern VKTrack * getCombinedVTrack(VKVertex *); -extern void vpderiv(bool, long int , double *, double *, double *, double *, double *, double *, double *, VKalVrtControl * =nullptr); +extern void vpderiv(bool, long int , const double *, double *, double *, double *, double *, double *, double *, VKalVrtControl * =nullptr); extern std::array getFitParticleMom( const VKTrack *, double); -extern void setFittedMatrices(double * , long int , std::vector &, std::vector< std::vector > &, CascadeEvent& ); +extern void setFittedMatrices(const double * , long int , std::vector &, std::vector< std::vector > &, CascadeEvent& ); extern std::vector transformCovar(int , double **, const std::vector& ); extern double cfVrtDstSig( VKVertex * , bool ); extern void robtest(VKVertex * , long int ); extern int fixPseudoTrackPt(long int NPar, double * fullMtx, double * LSide, CascadeEvent&); -extern void getNewCov(double *OldCov, double* Der, double* Cov, long int DIM) noexcept; +extern void getNewCov(const double *OldCov, const double* Der, double* Cov, long int DIM) noexcept; //-------------------------------------------------------------------- // @@ -511,7 +511,7 @@ int processCascade(CascadeEvent & cascadeEvent_ ) // // Iteration over complete cascade with first cascade vertex in Primary Vertex // - int processCascadePV(CascadeEvent & cascadeEvent_, double *primVrt, double *primVrtCov ) + int processCascadePV(CascadeEvent & cascadeEvent_, const double *primVrt, const double *primVrtCov ) { double aermd[6],tmpd[6]; // temporary arrays VKVertex * vk = cascadeEvent_.cascadeVertexList[cascadeEvent_.cascadeNV-1].get(); //Main vertex @@ -539,7 +539,7 @@ int processCascade(CascadeEvent & cascadeEvent_ ) // // Iteration over complete cascade with "close to primary vertex" Chi2 term // - int processCascade(CascadeEvent & cascadeEvent_, double *primVrt, double *primVrtCov ) + int processCascade(CascadeEvent & cascadeEvent_, const double *primVrt, const double *primVrtCov ) { cascadeEvent_.nearPrmVertex=1; //setting up additional Chi2 term VKVertex * vk = cascadeEvent_.cascadeVertexList[cascadeEvent_.cascadeNV-1].get(); //Main vertex diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascadeScale.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascadeScale.cxx index dcbac8cc4e8c3d7a0b6d10818059b0c473d48a63..b1ec05956e9d3fc51a825fd0ec1625df8d3b9a49 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascadeScale.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascadeScale.cxx @@ -31,7 +31,7 @@ extern int FullMCNSTfill(VKVertex * , double * , double * ); extern int getCascadeNPar(CascadeEvent &, int Type=0); extern VKTrack * getCombinedVTrack(VKVertex *); -extern void vpderiv(bool, long int , double *, double *, double *, double *, double *, double *, double *,VKalVrtControl * =nullptr); +extern void vpderiv(bool, long int , const double *, double *, double *, double *, double *, double *, double *,VKalVrtControl * =nullptr); extern std::vector transformCovar(int , double **, const std::vector& ); extern double cfVrtDstSig( VKVertex * , bool ); extern long int getVertexCharge( VKVertex *); diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeDefinition.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeDefinition.cxx index a0d355be5ac6c5b82dcba77ee1ac7f7d56f032ef..1a41d303ed8cfff19931d118e5d2b3c47b78455c 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeDefinition.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeDefinition.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrkVKalVrtCore/Derivt.h" @@ -15,7 +15,7 @@ extern const vkalMagFld myMagFld; extern int cfdinv(double *, double *, long int ); extern int cfInv5(double *cov, double *wgt ); extern int translateToFittedPos(CascadeEvent &,double Step=1.); -extern double vkvFastV( double* , double* , double*, double , double*); +extern double vkvFastV( double* , double* , const double*, double , double*); extern long int vtcfit( VKVertex * vk); extern void cfdcopy(double *source, double *target, int); @@ -69,7 +69,7 @@ VKVertex* addCascadeEntry( std::unique_ptr vk, const std::vector // vertexDefinition[iv][it] - list of real track to vertex associacion // cascadeDefinition[iv][ipv] - for given vertex IV the list of previous vertices pointing to it. // -int makeCascade(VKalVrtControl & FitCONTROL, long int NTRK, long int *ich, double *wm, double *inp_Trk5, double *inp_CovTrk5, +int makeCascade(VKalVrtControl & FitCONTROL, long int NTRK, const long int *ich, double *wm, double *inp_Trk5, double *inp_CovTrk5, const std::vector< std::vector > &vertexDefinition, const std::vector< std::vector > &cascadeDefinition, double definedCnstAccuracy=1.e-4) diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeUtils.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeUtils.cxx index d29673ebcdc7d0411cf489488418b809f3e450fa..633cb346590b02ff81a3c8ea0ec358d082bfa44d 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeUtils.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeUtils.cxx @@ -152,9 +152,9 @@ int getCascadeNPar(CascadeEvent & cascadeEvent_, int Type=0) // // Track parameters are translated at each iteration so iniV==(0,0,0) // -void setFittedParameters(double * result, std::vector & matrixPnt, CascadeEvent & cascadeEvent_) +void setFittedParameters(const double * result, std::vector & matrixPnt, CascadeEvent & cascadeEvent_) { - extern double cfchi2(double *, double *, VKTrack *); + extern double cfchi2(const double *, const double *, VKTrack *); int iv,it,Pnt; for( iv=0; iv & matrixPnt, CascadeE } } -void setFittedMatrices(double * COVFIT, long int MATRIXSIZE, +void setFittedMatrices(const double * COVFIT, long int MATRIXSIZE, std::vector & matrixPnt, std::vector< std::vector > & covarCascade, CascadeEvent & cascadeEvent_) @@ -248,7 +248,7 @@ void addCrossVertexDeriv(CascadeEvent & cascadeEvent_, double * ader, long int M // Copy matrix Input with dimension IDIM to predefined place(TStart) // into matrix Target with dimension TDIM // -void copyFullMtx(double *Input, long int IPar, long int IDIM, +void copyFullMtx(const double *Input, long int IPar, long int IDIM, double *Target, long int TStart, long int TDIM) { int i,j,it,jt; @@ -263,7 +263,7 @@ void copyFullMtx(double *Input, long int IPar, long int IDIM, //-------------------------------------------------------------------- // Make the convolution Cov=D*OldCov*Dt // -void getNewCov(double *OldCov, double* Der, double* Cov, long int DIM) noexcept +void getNewCov(const double *OldCov, const double* Der, double* Cov, long int DIM) noexcept { int i,j,it,jt; for( i=0; i a (DIM+1); @@ -564,7 +564,7 @@ return 0; //Invert packed symmetric matrix using SVD // -int vkSInvSVD(double *ci,long int DIM, double *co, double Chk) +int vkSInvSVD(const double *ci,long int DIM, double *co, double Chk) { int i,j,k; noinit_vector a (DIM+1); @@ -688,7 +688,7 @@ int vkjacobi(double **a, int n, double d[], double **v) //------------------------------------------- // ci - symmetric matrix in compact form //------------------------------------------- -void vkGetEigVal(double ci[], double d[], int n) +void vkGetEigVal(const double ci[], double d[], int n) { int i,j,k; d--; noinit_vector a (n+1); @@ -707,7 +707,7 @@ void vkGetEigVal(double ci[], double d[], int n) } } -void vkGetEigVect(double ci[], double d[], double vect[], int n) +void vkGetEigVect(const double ci[], double d[], double vect[], int n) { int i,j,k; d--; noinit_vector a (n+1); @@ -733,7 +733,7 @@ void vkGetEigVect(double ci[], double d[], double vect[], int n) k=0; for (i=1;i<=n;i++) for(j=1;j<=n;j++) vect[k++]=v[j][i]; } -int vkcholInv(double ci[], double co[], long int DIM) +int vkcholInv(const double ci[], double co[], long int DIM) { int i,j,k; std::vector p(DIM,0); @@ -775,7 +775,7 @@ int vkcholInv(double ci[], double co[], long int DIM) return 0; } -double checkMatrixInversion(double mtx[], double invmtx[], int DIM) +double checkMatrixInversion(const double mtx[], const double invmtx[], int DIM) { //std::vector> r; r.resize(DIM,std::vector(DIM,0.)); diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PrCFit.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PrCFit.cxx index 1b5eca15e1ed26f04b0d1706580880732ba3d46a..573bd3b67107bd5fbefa76afc7e54b4dd181d6ba 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PrCFit.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PrCFit.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrkVKalVrtCore/CommonPars.h" @@ -40,7 +40,7 @@ namespace Trk { /* STPCNV : track momentum from track (theta,phi,1/r) at vertex */ /*------------------------------------------------------------------------------*/ -void ForCFT::prcfit( long int ntrk, double *wm, double *wmfit, double bmag, double *vrt, double *vrte) noexcept +void ForCFT::prcfit( long int ntrk, double *wm, double *wmfit, double bmag, const double *vrt, const double *vrte) noexcept { long int i__1; double summ; diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Propagate.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Propagate.cxx index d5effa6781ab031c572053eb1a3668511994113f..c688bf7f323b0340736e6d2c4ac964dd7c5bb5a5 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Propagate.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Propagate.cxx @@ -20,9 +20,9 @@ namespace Trk { extern const vkalMagFld myMagFld; -extern void cfnewp(long int*, double*, double*, double*, double*, double*); -extern void cferpr(long int*, double*, double*, double*, double*, double*); -extern void cfnewpm (double*, double*, double*, double*, double*, double*, VKalVrtControlBase * =nullptr); +extern void cfnewp(const long int*, double*, double*, double*, double*, double*); +extern void cferpr(const long int*, double*, double*, const double*, double*, double*); +extern void cfnewpm (double*, const double*, double*, const double*, double*, double*, VKalVrtControlBase * =nullptr); //------------------------------------------------------------------------ // Old propagator functions: @@ -137,14 +137,14 @@ extern void cfnewpm (double*, double*, double*, double*, double*, double*, VKalV basePropagator::~basePropagator() = default; - bool vkalPropagator::checkTarget(double *) const + bool vkalPropagator::checkTarget(double *) { //if ( m_typePropagator == 3 ) return vk_objectProp->checkTarget(RefNew); return true; } void vkalPropagator::Propagate(long int TrkID, long int Charge, double *ParOld, double *CovOld, double *RefOld, - double *RefNew, double *ParNew, double *CovNew, VKalVrtControlBase * FitControl) const + double *RefNew, double *ParNew, double *CovNew, VKalVrtControlBase * FitControl) { //std::cout<<"Core: propagator control="<refPerig[i]; diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/RobTest.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/RobTest.cxx index fb2f22786b04c1ca52dfd57735b00933a0a57aff..e7bb953310246a992a685fe97a83f740ba44b19e 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/RobTest.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/RobTest.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h" @@ -10,120 +10,120 @@ namespace Trk { -//extern void digx(double*, double*, double*, long int , long int ); +//extern void digx(double*, double*, double*, long int , long int ); -extern void vkGetEigVect(double ci[], double d[], double vect[], int n); +extern void vkGetEigVect(const double ci[], double d[], double vect[], int n); + +void robtest(VKVertex * vk, long int ifl) +{ + long int i, j, k, kk, it; + double rob, res, c[5], darg, absX, roba[5]; + +/* ------------------------------------------------------------ */ +/* Robustification procedure for weight matrix */ +/* IROB = 0 - Standard chi^2 */ +/* = 1 - Geman-McClure function */ +/* = 2 - Welch function */ +/* = 3 - Cauchy function */ +/* = 4 - L1-L2 function */ +/* = 5 - Fair function */ +/* = 6 - Huber function */ +/* = 7 - Modified Huber function */ +/* (1,2,3) - Zero outliers */ +/* (4,5,6,7) - Downweight outliers */ +/* Author: V.Kostyukhin */ +/* ------------------------------------------------------------ */ + + int NTRK = vk->TrackList.size(); + + long int irob = vk->vk_fitterControl->vk_forcft.irob; + double Scl = vk->vk_fitterControl->vk_forcft.RobustScale; //Tuning constant + double C; // Breakdown constant + + if ( ifl == 0) { /* FILLING OF EIGENVALUES AND VECTORS */ + for (it = 0; it < NTRK ; ++it) { /* RESTORE MATRIX */ + VKTrack *trk=vk->TrackList[it].get(); + if(trk->Id < 0) continue; // Not a real track + //k = 0; double dest[5][5]; + //for (i = 0; i < 5; ++i) { + //for (j = 0; j <= i; ++j) { + // dest[i][j] = trk->WgtM[k]; + // dest[j][i] = trk->WgtM[k]; + // ++k; + // } + //} + //digx(&dest[0][0], &(vk->TrackList[it]->e[0]), &(vk->TrackList[it]->v[0][0]), 5, 1); + vkGetEigVect(trk->WgtM, trk->e ,&(trk->v[0][0]), 5); + } +//std::cout.precision(9); std::cout<<"Rob="<TrackList[0]->WgtM[1]<<", "<TrackList[0]->WgtM[2] +// <<", "<TrackList[0]->WgtM[3]<<", "<TrackList[0]->WgtM[4]<<", "<TrackList[0]->WgtM[5] +// <<", "<TrackList[0]->WgtM[6]<<", "<TrackList[0]->WgtM[7]<<", "<TrackList[0]->WgtM[8]<<'\n'; + return; + } +/* -- */ + double halfPi=M_PI/2.; + for (it = 0; it < NTRK; ++it) { + VKTrack *trk=vk->TrackList[it].get(); + if(trk->Id < 0) continue; // Not a real track + c[0]=c[1]=c[2]=c[3]=c[4]=0.; + for( k = 0; k < 5; k++){ + c[0] += trk->rmnd[k] * trk->v[0][k]; + c[1] += trk->rmnd[k] * trk->v[1][k]; + c[2] += trk->rmnd[k] * trk->v[2][k]; + c[3] += trk->rmnd[k] * trk->v[3][k]; + c[4] += trk->rmnd[k] * trk->v[4][k]; + } +//std::cout<<"rm="<rmnd[0]<<", "<rmnd[1]<<", "<rmnd[2]<< +// ", "<rmnd[3]<<", "<rmnd[4]<<", "<<'\n'; +//std::cout<<" c="<e[k]; + if(darg < 1.e-10) darg = 1.e-10; + absX = sqrt(darg); /* Abs(X) == sqrt(X)*/ + rob = 1.; C=1; + if(irob == 1)C = 1.58*Scl; /* Geman-McClure Standard =1 but c^2=2.5 is better(Gem.McC) */ + if(irob == 2)C = 2.9846*Scl; /* Welch def c^2=2.9846^2 */ + if(irob == 3)C = 2.3849*Scl; /* Cauchy def 2.385^2=5.7 */ + if(irob == 4)C = 1.; /* L1-L2 no tuning*/ + if(irob == 5)C = 1.3998*Scl; /* Fair (def=1.3998)*/ + if(irob == 6)C = 1.345 *Scl; /* Huber (def=1.345)*/ + if(irob == 7)C = 1.2107 *Scl; /* Modified Huber (def=1.2107)*/ +/* Functionals here are divided by (X^2/2)!!!*/ + double C2=C*C; + if(irob == 1)rob = 1. / (darg/C2 + 1.); /* Geman-McClure */ + if(irob == 2)rob = C2*(1. - exp(-darg/C2) )/darg; /* Welch */ + if(irob == 3)rob = C2*log(darg/C2 + 1.)/darg; /* Cauchy */ + if(irob == 4)rob = 4.*(sqrt(darg / 2. + 1.) - 1.)/darg; /* L1-L2 */ + if(irob == 5)rob = 2.*C2*(absX/C - log(absX/C + 1.))/darg; /* Fair */ + if(irob == 6)rob = C>absX ? 1. : (2*C/absX - C*C/darg) ; /* Huber */ + if(irob == 7)rob = halfPi>(absX/C) ? 2*C*C*(1-cos(absX/C))/darg : + 2*(C*absX+C*C*(1.-halfPi))/darg; /* Modified Huber */ + roba[k] = rob; + if(rob>0.99)roba[k] = 1.; //To improve precision + } +//std::cout<<"robn="<v[k][i] * trk->e[k] * trk->v[k][j]*roba[k]; + } + trk->WgtM[kk]=res; + kk++; + } + } + vk->vk_fitterControl->vk_forcft.robres[it] = roba[0] * roba[1] * roba[2] * roba[3] * roba[4]; + if(vk->vk_fitterControl->vk_forcft.robres[it]>1.)vk->vk_fitterControl->vk_forcft.robres[it]=1.; + } +//std::cout<<" Fin="<TrackList[0]->WgtM[0]<<", "<TrackList[0]->WgtM[1]<<", "<TrackList[0]->WgtM[2] +// <<", "<TrackList[0]->WgtM[3]<<", "<TrackList[0]->WgtM[4]<<", "<TrackList[0]->WgtM[5] +// <<", "<TrackList[0]->WgtM[6]<<", "<TrackList[0]->WgtM[7]<<", "<TrackList[0]->WgtM[8]<<'\n'; +} + + +} /* End of namespace */ + -void robtest(VKVertex * vk, long int ifl) -{ - long int i, j, k, kk, it; - double rob, res, c[5], darg, absX, roba[5]; - -/* ------------------------------------------------------------ */ -/* Robustification procedure for weight matrix */ -/* IROB = 0 - Standard chi^2 */ -/* = 1 - Geman-McClure function */ -/* = 2 - Welch function */ -/* = 3 - Cauchy function */ -/* = 4 - L1-L2 function */ -/* = 5 - Fair function */ -/* = 6 - Huber function */ -/* = 7 - Modified Huber function */ -/* (1,2,3) - Zero outliers */ -/* (4,5,6,7) - Downweight outliers */ -/* Author: V.Kostyukhin */ -/* ------------------------------------------------------------ */ - - int NTRK = vk->TrackList.size(); - - long int irob = vk->vk_fitterControl->vk_forcft.irob; - double Scl = vk->vk_fitterControl->vk_forcft.RobustScale; //Tuning constant - double C; // Breakdown constant - - if ( ifl == 0) { /* FILLING OF EIGENVALUES AND VECTORS */ - for (it = 0; it < NTRK ; ++it) { /* RESTORE MATRIX */ - VKTrack *trk=vk->TrackList[it].get(); - if(trk->Id < 0) continue; // Not a real track - //k = 0; double dest[5][5]; - //for (i = 0; i < 5; ++i) { - //for (j = 0; j <= i; ++j) { - // dest[i][j] = trk->WgtM[k]; - // dest[j][i] = trk->WgtM[k]; - // ++k; - // } - //} - //digx(&dest[0][0], &(vk->TrackList[it]->e[0]), &(vk->TrackList[it]->v[0][0]), 5, 1); - vkGetEigVect(trk->WgtM, trk->e ,&(trk->v[0][0]), 5); - } -//std::cout.precision(9); std::cout<<"Rob="<TrackList[0]->WgtM[1]<<", "<TrackList[0]->WgtM[2] -// <<", "<TrackList[0]->WgtM[3]<<", "<TrackList[0]->WgtM[4]<<", "<TrackList[0]->WgtM[5] -// <<", "<TrackList[0]->WgtM[6]<<", "<TrackList[0]->WgtM[7]<<", "<TrackList[0]->WgtM[8]<<'\n'; - return; - } -/* -- */ - double halfPi=M_PI/2.; - for (it = 0; it < NTRK; ++it) { - VKTrack *trk=vk->TrackList[it].get(); - if(trk->Id < 0) continue; // Not a real track - c[0]=c[1]=c[2]=c[3]=c[4]=0.; - for( k = 0; k < 5; k++){ - c[0] += trk->rmnd[k] * trk->v[0][k]; - c[1] += trk->rmnd[k] * trk->v[1][k]; - c[2] += trk->rmnd[k] * trk->v[2][k]; - c[3] += trk->rmnd[k] * trk->v[3][k]; - c[4] += trk->rmnd[k] * trk->v[4][k]; - } -//std::cout<<"rm="<rmnd[0]<<", "<rmnd[1]<<", "<rmnd[2]<< -// ", "<rmnd[3]<<", "<rmnd[4]<<", "<<'\n'; -//std::cout<<" c="<e[k]; - if(darg < 1.e-10) darg = 1.e-10; - absX = sqrt(darg); /* Abs(X) == sqrt(X)*/ - rob = 1.; C=1; - if(irob == 1)C = 1.58*Scl; /* Geman-McClure Standard =1 but c^2=2.5 is better(Gem.McC) */ - if(irob == 2)C = 2.9846*Scl; /* Welch def c^2=2.9846^2 */ - if(irob == 3)C = 2.3849*Scl; /* Cauchy def 2.385^2=5.7 */ - if(irob == 4)C = 1.; /* L1-L2 no tuning*/ - if(irob == 5)C = 1.3998*Scl; /* Fair (def=1.3998)*/ - if(irob == 6)C = 1.345 *Scl; /* Huber (def=1.345)*/ - if(irob == 7)C = 1.2107 *Scl; /* Modified Huber (def=1.2107)*/ -/* Functionals here are divided by (X^2/2)!!!*/ - double C2=C*C; - if(irob == 1)rob = 1. / (darg/C2 + 1.); /* Geman-McClure */ - if(irob == 2)rob = C2*(1. - exp(-darg/C2) )/darg; /* Welch */ - if(irob == 3)rob = C2*log(darg/C2 + 1.)/darg; /* Cauchy */ - if(irob == 4)rob = 4.*(sqrt(darg / 2. + 1.) - 1.)/darg; /* L1-L2 */ - if(irob == 5)rob = 2.*C2*(absX/C - log(absX/C + 1.))/darg; /* Fair */ - if(irob == 6)rob = C>absX ? 1. : (2*C/absX - C*C/darg) ; /* Huber */ - if(irob == 7)rob = halfPi>(absX/C) ? 2*C*C*(1-cos(absX/C))/darg : - 2*(C*absX+C*C*(1.-halfPi))/darg; /* Modified Huber */ - roba[k] = rob; - if(rob>0.99)roba[k] = 1.; //To improve precision - } -//std::cout<<"robn="<v[k][i] * trk->e[k] * trk->v[k][j]*roba[k]; - } - trk->WgtM[kk]=res; - kk++; - } - } - vk->vk_fitterControl->vk_forcft.robres[it] = roba[0] * roba[1] * roba[2] * roba[3] * roba[4]; - if(vk->vk_fitterControl->vk_forcft.robres[it]>1.)vk->vk_fitterControl->vk_forcft.robres[it]=1.; - } -//std::cout<<" Fin="<TrackList[0]->WgtM[0]<<", "<TrackList[0]->WgtM[1]<<", "<TrackList[0]->WgtM[2] -// <<", "<TrackList[0]->WgtM[3]<<", "<TrackList[0]->WgtM[4]<<", "<TrackList[0]->WgtM[5] -// <<", "<TrackList[0]->WgtM[6]<<", "<TrackList[0]->WgtM[7]<<", "<TrackList[0]->WgtM[8]<<'\n'; -} - - -} /* End of namespace */ - - diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/TrkVKalVrtCoreBase.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/TrkVKalVrtCoreBase.cxx index f3d7b026ec8e105d5cfc6895ad35fbced9542922..d75e9e5779982f2a8961a4760d6a88ca67ff0842 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/TrkVKalVrtCoreBase.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/TrkVKalVrtCoreBase.cxx @@ -41,7 +41,7 @@ namespace Trk { { } - VKTrack::VKTrack(long int iniId, double Perigee[], double Covariance[], VKVertex * vk, double m): + VKTrack::VKTrack(long int iniId, const double Perigee[], const double Covariance[], VKVertex * vk, double m): Chi2(0), m_mass(m) { Id = iniId; Charge=1; if(Perigee[4]<0)Charge=-1; @@ -51,10 +51,10 @@ namespace Trk { m_originVertex = vk; } - void VKTrack::setCurrent(double Perigee[], double Weight[]) + void VKTrack::setCurrent(const double Perigee[], const double Weight[]) { for(int i=0; i<5; i++) Perig[i]=Perigee[i]; for(int i=0; i<15; i++) WgtM[i]=WgtM_save[i]=Weight[i]; } - void VKTrack::setReference(double Perigee[], double Covariance[]) + void VKTrack::setReference(const double Perigee[], const double Covariance[]) { for(int i=0; i<5; i++) refPerig[i]=Perigee[i]; for(int i=0; i<15; i++) refCovar[i]=Covariance[i]; } void VKTrack::restoreCurrentWgt() diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Utilities.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Utilities.cxx index f9fe4240997c920bd4e5d0e62c801b08ea15f27b..e2aa55ecf27d6e38c83d785f6a35507e5fe90786 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Utilities.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Utilities.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h" @@ -16,11 +16,11 @@ namespace Trk { // PAR0(5) - fitted track // ------------------------------------------------------------ -double cfchi2(double *xyzt, long int *ich, double *part, - double *par0, double *wgt, double *rmnd) +double cfchi2(double *xyzt, const long int *ich, double *part, + const double *par0, double *wgt, double *rmnd) { - extern void cfnewp(long int*, double*, double*, double*, double*, double*); + extern void cfnewp(const long int*, double*, double*, double*, double*, double*); double phif, epsf, d1, d2, d3, d4, d5, sr, uu, vv, res, zpf; /* Parameter adjustments */ @@ -71,7 +71,7 @@ double cfchi2(double *xyzt, long int *ich, double *part, // So it transfers fitted parameters to (0,0,0) and compares with reference track parameters // ------------------------------------------------------------ -double cfchi2(double *vrtt, double * part, VKTrack * trk) +double cfchi2(const double *vrtt, const double * part, VKTrack * trk) { double d1, d2, d3, d4, d5; @@ -210,7 +210,7 @@ inline int sIndexVK(int i, int j){ return i>j ? i*(i+1)/2+j : j*(j+1)/2+i;} // // Dimensions input: CovI(N,N), output: CovF(M,M), input: Der(N,M)-first index runs first // -void tdasatVK(double *Der, double *CovI, double *CovF, long int M, long int N) +void tdasatVK(const double *Der, const double *CovI, double *CovF, long int M, long int N) { int i,j,k,f; for( k=0; k -#include - -namespace Trk { - -/* ---------------------------------------------------------- */ -/* Entry for error matrix calculation after successful fit */ -/* Error matrix has a form V(X,Y,Z,PX,PY,PZ) */ -/* ADER - full covariance matrix after fit in form */ -/* (x,y,z,track1(1:3),track2(1:3),......) */ - -#define ader_ref(a_1,a_2) ader[(a_2)*(vkalNTrkM*3+3) + (a_1) - (vkalNTrkM*3+4)] -#define dcv_ref(a_1,a_2) dcv[(a_2)*6 + (a_1) - 7] - - -#define useWeightScheme 1 - -int getFullVrtCov(VKVertex * vk, double *ader, double *dcv, double verr[6][6]) -{ - - int i,j,ic1,ic2; - - long int ic, jc, it, jt; - double cnt = 1e8; - - - extern void dsinv(long int, double *, long int , long int *) noexcept; - extern void FullMTXfill( VKVertex* , double *); - extern void vkSVDCmp(double**, int, int, double*, double**); - - TWRK * t_trk=nullptr; - long int NTRK = vk->TrackList.size(); - long int IERR=0; - long int NVar = (NTRK + 1) * 3; - if(vk->passNearVertex && vk->ConstraintList.empty()) { - /* Fit is with "pass near" constraint and then */ - /* matrix is already present */ - } else if ( !vk->ConstraintList.empty() && useWeightScheme ) { -/* Full matrix inversion i */ -// - FullMTXfill( vk, ader); - if ( vk->passNearVertex ) { - double drdpy[2][3]; - double dpipj[3][3]; - for (it = 1; it <= NTRK; ++it) { - drdpy[0][0] = vk->tmpArr[it-1]->drdp[0][0] * vk->FVC.ywgt[0] + vk->tmpArr[it-1]->drdp[1][0] * vk->FVC.ywgt[1]; - drdpy[1][0] = vk->tmpArr[it-1]->drdp[0][0] * vk->FVC.ywgt[1] + vk->tmpArr[it-1]->drdp[1][0] * vk->FVC.ywgt[2]; - drdpy[0][1] = vk->tmpArr[it-1]->drdp[0][1] * vk->FVC.ywgt[0] + vk->tmpArr[it-1]->drdp[1][1] * vk->FVC.ywgt[1]; - drdpy[1][1] = vk->tmpArr[it-1]->drdp[0][1] * vk->FVC.ywgt[1] + vk->tmpArr[it-1]->drdp[1][1] * vk->FVC.ywgt[2]; - drdpy[0][2] = vk->tmpArr[it-1]->drdp[0][2] * vk->FVC.ywgt[0] + vk->tmpArr[it-1]->drdp[1][2] * vk->FVC.ywgt[1]; - drdpy[1][2] = vk->tmpArr[it-1]->drdp[0][2] * vk->FVC.ywgt[1] + vk->tmpArr[it-1]->drdp[1][2] * vk->FVC.ywgt[2]; - for (jt = 1; jt <= NTRK; ++jt) { /* Matrix */ - for (int k = 0; k < 3; ++k) { - for (int l = 0; l < 3; ++l) { - dpipj[k][l] = 0.; - for (int j = 0; j < 2; ++j) { - dpipj[k][l] += vk->tmpArr[jt-1]->drdp[j][k] * drdpy[j][l]; - } - } - } - for (int k = 1; k <= 3; ++k) { - for (int l = 1; l <= 3; ++l) { - ader_ref(it * 3 + k, jt * 3 + l) += dpipj[l-1][k-1]; - } - } - } - } - } - Vect3DF th0t,tf0t; - for(ic1=0; ic1<(int)vk->ConstraintList.size();ic1++){ - for(ic2=0; ic2ConstraintList[ic1]->NCDim; ic2++){ - th0t = vk->ConstraintList[ic1]->h0t[ic2]; - ader_ref(1, 1) += cnt * th0t.X * th0t.X; - ader_ref(2, 1) += cnt * th0t.Y * th0t.X; - ader_ref(3, 1) += cnt * th0t.Z * th0t.X; - ader_ref(1, 2) += cnt * th0t.X * th0t.Y; - ader_ref(2, 2) += cnt * th0t.Y * th0t.Y; - ader_ref(3, 2) += cnt * th0t.Z * th0t.Y; - ader_ref(1, 3) += cnt * th0t.X * th0t.Z; - ader_ref(2, 3) += cnt * th0t.Y * th0t.Z; - ader_ref(3, 3) += cnt * th0t.Z * th0t.Z; - for (it = 1; it <= NTRK; ++it) { - tf0t = vk->ConstraintList[ic1]->f0t[it-1][ic2]; - ader_ref(1, it * 3 + 1) += cnt * th0t.X * tf0t.X; - ader_ref(2, it * 3 + 1) += cnt * th0t.Y * tf0t.X; - ader_ref(3, it * 3 + 1) += cnt * th0t.Z * tf0t.X; - ader_ref(1, it * 3 + 2) += cnt * th0t.X * tf0t.Y; - ader_ref(2, it * 3 + 2) += cnt * th0t.Y * tf0t.Y; - ader_ref(3, it * 3 + 2) += cnt * th0t.Z * tf0t.Y; - ader_ref(1, it * 3 + 3) += cnt * th0t.X * tf0t.Z; - ader_ref(2, it * 3 + 3) += cnt * th0t.Y * tf0t.Z; - ader_ref(3, it * 3 + 3) += cnt * th0t.Z * tf0t.Z; - } - } - } - - - for(ic1=0; ic1<(int)vk->ConstraintList.size();ic1++){ - for(ic2=0; ic2ConstraintList[ic1]->NCDim; ic2++){ - for (it = 1; it <= NTRK; ++it) { - for (jt = it; jt <= NTRK; ++jt) { - Vect3DF tf0ti = vk->ConstraintList[ic1]->f0t[it-1][ic2]; - Vect3DF tf0tj = vk->ConstraintList[ic1]->f0t[jt-1][ic2]; - ader_ref(it*3 + 1, jt*3 + 1) += cnt * tf0ti.X * tf0tj.X; - ader_ref(it*3 + 2, jt*3 + 1) += cnt * tf0ti.Y * tf0tj.X; - ader_ref(it*3 + 3, jt*3 + 1) += cnt * tf0ti.Z * tf0tj.X; - ader_ref(it*3 + 1, jt*3 + 2) += cnt * tf0ti.X * tf0tj.Y; - ader_ref(it*3 + 2, jt*3 + 2) += cnt * tf0ti.Y * tf0tj.Y; - ader_ref(it*3 + 3, jt*3 + 2) += cnt * tf0ti.Z * tf0tj.Y; - ader_ref(it*3 + 1, jt*3 + 3) += cnt * tf0ti.X * tf0tj.Z; - ader_ref(it*3 + 2, jt*3 + 3) += cnt * tf0ti.Y * tf0tj.Z; - ader_ref(it*3 + 3, jt*3 + 3) += cnt * tf0ti.Z * tf0tj.Z; - } - } - } - } -/* symmetrisation */ - for (i=1; i<=NVar-1; ++i) { - for (j = i+1; j<=NVar; ++j) { - ader_ref(j,i) = ader_ref(i,j); - } - } -//------------------------------------------------------------------------- -/* several checks for debugging */ -//std::cout.precision(12); -// for(ic1=0; ic1<(int)vk->ConstraintList.size();ic1++){ -// for(ic2=0; ic2ConstraintList[ic1]->NCDim; ic2++){ -// th0t = vk->ConstraintList[ic1]->h0t[ic2]; -//std::cout<<"h0t="<ConstraintList[ic1]->f0t[it-1][ic2]; -//std::cout<<"f0t="< ta (NVar+1); - noinit_vector tab ((NVar+1)*(NVar+1)); - for(i=0; i tv (NVar+1); - noinit_vector tvb ((NVar+1)*(NVar+1)); - noinit_vector tr (NVar+1); - noinit_vector trb ((NVar+1)*(NVar+1)); - noinit_vector tw (NVar+1); - for(i=0; itmax)tmax=fabs(tw[i]); - for(i=1; i std::abs(mcheck)) ? maxDiff : std::abs(mcheck); - if(i==j) maxDiff = (maxDiff > std::abs(1.-mcheck)) ? maxDiff : std::abs(1.-mcheck); - } } - //--------------------------------------------------------------------------------------- - if(maxDiff>0.1)return -1; -/* ---------------------------------------- */ - } else { -/* ---------------------------------------- */ -/* Simple and fast without constraints */ - for (i=1; i<=NVar; i++) { - for (j=1; j<=NVar; j++) { - ader_ref(i,j)=0.; - } - } - double vcov[6]={vk->fitVcov[0],vk->fitVcov[1],vk->fitVcov[2],vk->fitVcov[3],vk->fitVcov[4],vk->fitVcov[5]}; - ader_ref(1,1) = vcov[0]; - ader_ref(1,2) = vcov[1]; - ader_ref(2,2) = vcov[2]; - ader_ref(1,3) = vcov[3]; - ader_ref(2,3) = vcov[4]; - ader_ref(3,3) = vcov[5]; - ader_ref(2,1) = ader_ref(1,2); - ader_ref(3,1) = ader_ref(1,3); - ader_ref(3,2) = ader_ref(2,3); - - for (it=1; it<=NTRK; it++) { - t_trk=vk->tmpArr[it-1].get(); - ader_ref(1, it*3 + 1) = -vcov[0] * t_trk->wbci[0] - - vcov[1] * t_trk->wbci[1] - - vcov[3] * t_trk->wbci[2]; - ader_ref(2, it*3 + 1) = -vcov[1] * t_trk->wbci[0] - - vcov[2] * t_trk->wbci[1] - - vcov[4] * t_trk->wbci[2]; - ader_ref(3, it*3 + 1) = -vcov[3] * t_trk->wbci[0] - - vcov[4] * t_trk->wbci[1] - - vcov[5] * t_trk->wbci[2]; - ader_ref(1, it*3 + 2) = -vcov[0] * t_trk->wbci[3] - - vcov[1] * t_trk->wbci[4] - - vcov[3] * t_trk->wbci[5]; - ader_ref(2, it*3 + 2) = -vcov[1] * t_trk->wbci[3] - - vcov[2] * t_trk->wbci[4] - - vcov[4] * t_trk->wbci[5]; - ader_ref(3, it*3 + 2) = -vcov[3] * t_trk->wbci[3] - - vcov[4] * t_trk->wbci[4] - - vcov[5] * t_trk->wbci[5]; - ader_ref(1, it*3 + 3) = -vcov[0] * t_trk->wbci[6] - - vcov[1] * t_trk->wbci[7] - - vcov[3] * t_trk->wbci[8]; - ader_ref(2, it*3 + 3) = -vcov[1] * t_trk->wbci[6] - - vcov[2] * t_trk->wbci[7] - - vcov[4] * t_trk->wbci[8]; - ader_ref(3, it*3 + 3) = -vcov[3] * t_trk->wbci[6] - - vcov[4] * t_trk->wbci[7] - - vcov[5] * t_trk->wbci[8]; - ader_ref(it*3 + 1, 1) = ader_ref(1, it*3 + 1); - ader_ref(it*3 + 1, 2) = ader_ref(2, it*3 + 1); - ader_ref(it*3 + 1, 3) = ader_ref(3, it*3 + 1); - ader_ref(it*3 + 2, 1) = ader_ref(1, it*3 + 2); - ader_ref(it*3 + 2, 2) = ader_ref(2, it*3 + 2); - ader_ref(it*3 + 2, 3) = ader_ref(3, it*3 + 2); - ader_ref(it*3 + 3, 1) = ader_ref(1, it*3 + 3); - ader_ref(it*3 + 3, 2) = ader_ref(2, it*3 + 3); - ader_ref(it*3 + 3, 3) = ader_ref(3, it*3 + 3); - } - - - for (it = 1; it<=NTRK; ++it) { - t_trk=vk->tmpArr[it-1].get(); - for (jt=1; jt<=NTRK; ++jt) { - int j3 = jt*3; - int i3 = it*3; - ader_ref( i3+1, j3+1) = -t_trk->wbci[0]*ader_ref(1, j3+1) - t_trk->wbci[1]*ader_ref(2, j3+1) - t_trk->wbci[2]*ader_ref(3, j3+1); - ader_ref( i3+2, j3+1) = -t_trk->wbci[3]*ader_ref(1, j3+1) - t_trk->wbci[4]*ader_ref(2, j3+1) - t_trk->wbci[5]*ader_ref(3, j3+1); - ader_ref( i3+3, j3+1) = -t_trk->wbci[6]*ader_ref(1, j3+1) - t_trk->wbci[7]*ader_ref(2, j3+1) - t_trk->wbci[8]*ader_ref(3, j3+1); - ader_ref( i3+1, j3+2) = -t_trk->wbci[0]*ader_ref(1, j3+2) - t_trk->wbci[1]*ader_ref(2, j3+2) - t_trk->wbci[2]*ader_ref(3, j3+2); - ader_ref( i3+2, j3+2) = -t_trk->wbci[3]*ader_ref(1, j3+2) - t_trk->wbci[4]*ader_ref(2, j3+2) - t_trk->wbci[5]*ader_ref(3, j3+2); - ader_ref( i3+3, j3+2) = -t_trk->wbci[6]*ader_ref(1, j3+2) - t_trk->wbci[7]*ader_ref(2, j3+2) - t_trk->wbci[8]*ader_ref(3, j3+2); - ader_ref( i3+1, j3+3) = -t_trk->wbci[0]*ader_ref(1, j3+3) - t_trk->wbci[1]*ader_ref(2, j3+3) - t_trk->wbci[2]*ader_ref(3, j3+3); - ader_ref( i3+2, j3+3) = -t_trk->wbci[3]*ader_ref(1, j3+3) - t_trk->wbci[4]*ader_ref(2, j3+3) - t_trk->wbci[5]*ader_ref(3, j3+3); - ader_ref( i3+3, j3+3) = -t_trk->wbci[6]*ader_ref(1, j3+3) - t_trk->wbci[7]*ader_ref(2, j3+3) - t_trk->wbci[8]*ader_ref(3, j3+3); - if (it == jt) { - ader_ref( i3+1, i3+1) += t_trk->wci[0]; - ader_ref( i3+1, i3+2) += t_trk->wci[1]; - ader_ref( i3+2, i3+1) += t_trk->wci[1]; - ader_ref( i3+2, i3+2) += t_trk->wci[2]; - ader_ref( i3+1, i3+3) += t_trk->wci[3]; - ader_ref( i3+3, i3+1) += t_trk->wci[3]; - ader_ref( i3+2, i3+3) += t_trk->wci[4]; - ader_ref( i3+3, i3+2) += t_trk->wci[4]; - ader_ref( i3+3, i3+3) += t_trk->wci[5]; - } - } - } -//for(int ii=1; ii<=9; ii++)std::cout<ConstraintList.empty() && !useWeightScheme ){ -//--------------------------------------------------------------------- -// Covariance matrix with constraints a la Avery. -// ader_ref() should contain nonconstraint covariance matrix -//--------------------------------------------------------------------- - long int totNC=0; //total number of constraints - std::vector > tf0t; // derivative collectors - std::vector< Vect3DF > th0t; // derivative collectors - std::vector< double > taa; // derivative collectors - std::vector< Vect3DF > tmpVec; - for(int ii=0; ii<(int)vk->ConstraintList.size();ii++){ - totNC += vk->ConstraintList[ii]->NCDim; - for(ic=0; ic<(int)vk->ConstraintList[ii]->NCDim; ic++){ - taa.push_back( vk->ConstraintList[ii]->aa[ic] ); - th0t.push_back( vk->ConstraintList[ii]->h0t[ic] ); - tmpVec.clear(); - for(it=0; it<(int)vk->ConstraintList[ii]->f0t.size(); it++){ - tmpVec.push_back( vk->ConstraintList[ii]->f0t[it][ic] ); - } - tf0t.push_back( tmpVec ); - } - } -// R,RC[ic][i] - double **R =new double*[totNC]; for(ic=0; icexistFullCov = 1; - return 0; -} -#undef dcv_ref -#undef ader_ref - -#undef useWeightScheme - -} /* End of VKalVrtCore namespace*/ - +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TrkVKalVrtCore/CommonPars.h" +#include "TrkVKalVrtCore/Derivt.h" +#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h" +#include +#include + +namespace Trk { + +/* ---------------------------------------------------------- */ +/* Entry for error matrix calculation after successful fit */ +/* Error matrix has a form V(X,Y,Z,PX,PY,PZ) */ +/* ADER - full covariance matrix after fit in form */ +/* (x,y,z,track1(1:3),track2(1:3),......) */ + +#define ader_ref(a_1,a_2) ader[(a_2)*(vkalNTrkM*3+3) + (a_1) - (vkalNTrkM*3+4)] +#define dcv_ref(a_1,a_2) dcv[(a_2)*6 + (a_1) - 7] + + +#define useWeightScheme 1 + +int getFullVrtCov(VKVertex * vk, double *ader, const double *dcv, double verr[6][6]) +{ + + int i,j,ic1,ic2; + + long int ic, jc, it, jt; + double cnt = 1e8; + + + extern void dsinv(long int, double *, long int , long int *) noexcept; + extern void FullMTXfill( VKVertex* , double *); + extern void vkSVDCmp(double**, int, int, double*, double**); + + TWRK * t_trk=nullptr; + long int NTRK = vk->TrackList.size(); + long int IERR=0; + long int NVar = (NTRK + 1) * 3; + if(vk->passNearVertex && vk->ConstraintList.empty()) { + /* Fit is with "pass near" constraint and then */ + /* matrix is already present */ + } else if ( !vk->ConstraintList.empty() && useWeightScheme ) { +/* Full matrix inversion i */ +// + FullMTXfill( vk, ader); + if ( vk->passNearVertex ) { + double drdpy[2][3]; + double dpipj[3][3]; + for (it = 1; it <= NTRK; ++it) { + drdpy[0][0] = vk->tmpArr[it-1]->drdp[0][0] * vk->FVC.ywgt[0] + vk->tmpArr[it-1]->drdp[1][0] * vk->FVC.ywgt[1]; + drdpy[1][0] = vk->tmpArr[it-1]->drdp[0][0] * vk->FVC.ywgt[1] + vk->tmpArr[it-1]->drdp[1][0] * vk->FVC.ywgt[2]; + drdpy[0][1] = vk->tmpArr[it-1]->drdp[0][1] * vk->FVC.ywgt[0] + vk->tmpArr[it-1]->drdp[1][1] * vk->FVC.ywgt[1]; + drdpy[1][1] = vk->tmpArr[it-1]->drdp[0][1] * vk->FVC.ywgt[1] + vk->tmpArr[it-1]->drdp[1][1] * vk->FVC.ywgt[2]; + drdpy[0][2] = vk->tmpArr[it-1]->drdp[0][2] * vk->FVC.ywgt[0] + vk->tmpArr[it-1]->drdp[1][2] * vk->FVC.ywgt[1]; + drdpy[1][2] = vk->tmpArr[it-1]->drdp[0][2] * vk->FVC.ywgt[1] + vk->tmpArr[it-1]->drdp[1][2] * vk->FVC.ywgt[2]; + for (jt = 1; jt <= NTRK; ++jt) { /* Matrix */ + for (int k = 0; k < 3; ++k) { + for (int l = 0; l < 3; ++l) { + dpipj[k][l] = 0.; + for (int j = 0; j < 2; ++j) { + dpipj[k][l] += vk->tmpArr[jt-1]->drdp[j][k] * drdpy[j][l]; + } + } + } + for (int k = 1; k <= 3; ++k) { + for (int l = 1; l <= 3; ++l) { + ader_ref(it * 3 + k, jt * 3 + l) += dpipj[l-1][k-1]; + } + } + } + } + } + Vect3DF th0t,tf0t; + for(ic1=0; ic1<(int)vk->ConstraintList.size();ic1++){ + for(ic2=0; ic2ConstraintList[ic1]->NCDim; ic2++){ + th0t = vk->ConstraintList[ic1]->h0t[ic2]; + ader_ref(1, 1) += cnt * th0t.X * th0t.X; + ader_ref(2, 1) += cnt * th0t.Y * th0t.X; + ader_ref(3, 1) += cnt * th0t.Z * th0t.X; + ader_ref(1, 2) += cnt * th0t.X * th0t.Y; + ader_ref(2, 2) += cnt * th0t.Y * th0t.Y; + ader_ref(3, 2) += cnt * th0t.Z * th0t.Y; + ader_ref(1, 3) += cnt * th0t.X * th0t.Z; + ader_ref(2, 3) += cnt * th0t.Y * th0t.Z; + ader_ref(3, 3) += cnt * th0t.Z * th0t.Z; + for (it = 1; it <= NTRK; ++it) { + tf0t = vk->ConstraintList[ic1]->f0t[it-1][ic2]; + ader_ref(1, it * 3 + 1) += cnt * th0t.X * tf0t.X; + ader_ref(2, it * 3 + 1) += cnt * th0t.Y * tf0t.X; + ader_ref(3, it * 3 + 1) += cnt * th0t.Z * tf0t.X; + ader_ref(1, it * 3 + 2) += cnt * th0t.X * tf0t.Y; + ader_ref(2, it * 3 + 2) += cnt * th0t.Y * tf0t.Y; + ader_ref(3, it * 3 + 2) += cnt * th0t.Z * tf0t.Y; + ader_ref(1, it * 3 + 3) += cnt * th0t.X * tf0t.Z; + ader_ref(2, it * 3 + 3) += cnt * th0t.Y * tf0t.Z; + ader_ref(3, it * 3 + 3) += cnt * th0t.Z * tf0t.Z; + } + } + } + + + for(ic1=0; ic1<(int)vk->ConstraintList.size();ic1++){ + for(ic2=0; ic2ConstraintList[ic1]->NCDim; ic2++){ + for (it = 1; it <= NTRK; ++it) { + for (jt = it; jt <= NTRK; ++jt) { + Vect3DF tf0ti = vk->ConstraintList[ic1]->f0t[it-1][ic2]; + Vect3DF tf0tj = vk->ConstraintList[ic1]->f0t[jt-1][ic2]; + ader_ref(it*3 + 1, jt*3 + 1) += cnt * tf0ti.X * tf0tj.X; + ader_ref(it*3 + 2, jt*3 + 1) += cnt * tf0ti.Y * tf0tj.X; + ader_ref(it*3 + 3, jt*3 + 1) += cnt * tf0ti.Z * tf0tj.X; + ader_ref(it*3 + 1, jt*3 + 2) += cnt * tf0ti.X * tf0tj.Y; + ader_ref(it*3 + 2, jt*3 + 2) += cnt * tf0ti.Y * tf0tj.Y; + ader_ref(it*3 + 3, jt*3 + 2) += cnt * tf0ti.Z * tf0tj.Y; + ader_ref(it*3 + 1, jt*3 + 3) += cnt * tf0ti.X * tf0tj.Z; + ader_ref(it*3 + 2, jt*3 + 3) += cnt * tf0ti.Y * tf0tj.Z; + ader_ref(it*3 + 3, jt*3 + 3) += cnt * tf0ti.Z * tf0tj.Z; + } + } + } + } +/* symmetrisation */ + for (i=1; i<=NVar-1; ++i) { + for (j = i+1; j<=NVar; ++j) { + ader_ref(j,i) = ader_ref(i,j); + } + } +//------------------------------------------------------------------------- +/* several checks for debugging */ +//std::cout.precision(12); +// for(ic1=0; ic1<(int)vk->ConstraintList.size();ic1++){ +// for(ic2=0; ic2ConstraintList[ic1]->NCDim; ic2++){ +// th0t = vk->ConstraintList[ic1]->h0t[ic2]; +//std::cout<<"h0t="<ConstraintList[ic1]->f0t[it-1][ic2]; +//std::cout<<"f0t="< ta (NVar+1); + noinit_vector tab ((NVar+1)*(NVar+1)); + for(i=0; i tv (NVar+1); + noinit_vector tvb ((NVar+1)*(NVar+1)); + noinit_vector tr (NVar+1); + noinit_vector trb ((NVar+1)*(NVar+1)); + noinit_vector tw (NVar+1); + for(i=0; itmax)tmax=fabs(tw[i]); + for(i=1; i std::abs(mcheck)) ? maxDiff : std::abs(mcheck); + if(i==j) maxDiff = (maxDiff > std::abs(1.-mcheck)) ? maxDiff : std::abs(1.-mcheck); + } } + //--------------------------------------------------------------------------------------- + if(maxDiff>0.1)return -1; +/* ---------------------------------------- */ + } else { +/* ---------------------------------------- */ +/* Simple and fast without constraints */ + for (i=1; i<=NVar; i++) { + for (j=1; j<=NVar; j++) { + ader_ref(i,j)=0.; + } + } + double vcov[6]={vk->fitVcov[0],vk->fitVcov[1],vk->fitVcov[2],vk->fitVcov[3],vk->fitVcov[4],vk->fitVcov[5]}; + ader_ref(1,1) = vcov[0]; + ader_ref(1,2) = vcov[1]; + ader_ref(2,2) = vcov[2]; + ader_ref(1,3) = vcov[3]; + ader_ref(2,3) = vcov[4]; + ader_ref(3,3) = vcov[5]; + ader_ref(2,1) = ader_ref(1,2); + ader_ref(3,1) = ader_ref(1,3); + ader_ref(3,2) = ader_ref(2,3); + + for (it=1; it<=NTRK; it++) { + t_trk=vk->tmpArr[it-1].get(); + ader_ref(1, it*3 + 1) = -vcov[0] * t_trk->wbci[0] + - vcov[1] * t_trk->wbci[1] + - vcov[3] * t_trk->wbci[2]; + ader_ref(2, it*3 + 1) = -vcov[1] * t_trk->wbci[0] + - vcov[2] * t_trk->wbci[1] + - vcov[4] * t_trk->wbci[2]; + ader_ref(3, it*3 + 1) = -vcov[3] * t_trk->wbci[0] + - vcov[4] * t_trk->wbci[1] + - vcov[5] * t_trk->wbci[2]; + ader_ref(1, it*3 + 2) = -vcov[0] * t_trk->wbci[3] + - vcov[1] * t_trk->wbci[4] + - vcov[3] * t_trk->wbci[5]; + ader_ref(2, it*3 + 2) = -vcov[1] * t_trk->wbci[3] + - vcov[2] * t_trk->wbci[4] + - vcov[4] * t_trk->wbci[5]; + ader_ref(3, it*3 + 2) = -vcov[3] * t_trk->wbci[3] + - vcov[4] * t_trk->wbci[4] + - vcov[5] * t_trk->wbci[5]; + ader_ref(1, it*3 + 3) = -vcov[0] * t_trk->wbci[6] + - vcov[1] * t_trk->wbci[7] + - vcov[3] * t_trk->wbci[8]; + ader_ref(2, it*3 + 3) = -vcov[1] * t_trk->wbci[6] + - vcov[2] * t_trk->wbci[7] + - vcov[4] * t_trk->wbci[8]; + ader_ref(3, it*3 + 3) = -vcov[3] * t_trk->wbci[6] + - vcov[4] * t_trk->wbci[7] + - vcov[5] * t_trk->wbci[8]; + ader_ref(it*3 + 1, 1) = ader_ref(1, it*3 + 1); + ader_ref(it*3 + 1, 2) = ader_ref(2, it*3 + 1); + ader_ref(it*3 + 1, 3) = ader_ref(3, it*3 + 1); + ader_ref(it*3 + 2, 1) = ader_ref(1, it*3 + 2); + ader_ref(it*3 + 2, 2) = ader_ref(2, it*3 + 2); + ader_ref(it*3 + 2, 3) = ader_ref(3, it*3 + 2); + ader_ref(it*3 + 3, 1) = ader_ref(1, it*3 + 3); + ader_ref(it*3 + 3, 2) = ader_ref(2, it*3 + 3); + ader_ref(it*3 + 3, 3) = ader_ref(3, it*3 + 3); + } + + + for (it = 1; it<=NTRK; ++it) { + t_trk=vk->tmpArr[it-1].get(); + for (jt=1; jt<=NTRK; ++jt) { + int j3 = jt*3; + int i3 = it*3; + ader_ref( i3+1, j3+1) = -t_trk->wbci[0]*ader_ref(1, j3+1) - t_trk->wbci[1]*ader_ref(2, j3+1) - t_trk->wbci[2]*ader_ref(3, j3+1); + ader_ref( i3+2, j3+1) = -t_trk->wbci[3]*ader_ref(1, j3+1) - t_trk->wbci[4]*ader_ref(2, j3+1) - t_trk->wbci[5]*ader_ref(3, j3+1); + ader_ref( i3+3, j3+1) = -t_trk->wbci[6]*ader_ref(1, j3+1) - t_trk->wbci[7]*ader_ref(2, j3+1) - t_trk->wbci[8]*ader_ref(3, j3+1); + ader_ref( i3+1, j3+2) = -t_trk->wbci[0]*ader_ref(1, j3+2) - t_trk->wbci[1]*ader_ref(2, j3+2) - t_trk->wbci[2]*ader_ref(3, j3+2); + ader_ref( i3+2, j3+2) = -t_trk->wbci[3]*ader_ref(1, j3+2) - t_trk->wbci[4]*ader_ref(2, j3+2) - t_trk->wbci[5]*ader_ref(3, j3+2); + ader_ref( i3+3, j3+2) = -t_trk->wbci[6]*ader_ref(1, j3+2) - t_trk->wbci[7]*ader_ref(2, j3+2) - t_trk->wbci[8]*ader_ref(3, j3+2); + ader_ref( i3+1, j3+3) = -t_trk->wbci[0]*ader_ref(1, j3+3) - t_trk->wbci[1]*ader_ref(2, j3+3) - t_trk->wbci[2]*ader_ref(3, j3+3); + ader_ref( i3+2, j3+3) = -t_trk->wbci[3]*ader_ref(1, j3+3) - t_trk->wbci[4]*ader_ref(2, j3+3) - t_trk->wbci[5]*ader_ref(3, j3+3); + ader_ref( i3+3, j3+3) = -t_trk->wbci[6]*ader_ref(1, j3+3) - t_trk->wbci[7]*ader_ref(2, j3+3) - t_trk->wbci[8]*ader_ref(3, j3+3); + if (it == jt) { + ader_ref( i3+1, i3+1) += t_trk->wci[0]; + ader_ref( i3+1, i3+2) += t_trk->wci[1]; + ader_ref( i3+2, i3+1) += t_trk->wci[1]; + ader_ref( i3+2, i3+2) += t_trk->wci[2]; + ader_ref( i3+1, i3+3) += t_trk->wci[3]; + ader_ref( i3+3, i3+1) += t_trk->wci[3]; + ader_ref( i3+2, i3+3) += t_trk->wci[4]; + ader_ref( i3+3, i3+2) += t_trk->wci[4]; + ader_ref( i3+3, i3+3) += t_trk->wci[5]; + } + } + } +//for(int ii=1; ii<=9; ii++)std::cout<ConstraintList.empty() && !useWeightScheme ){ +//--------------------------------------------------------------------- +// Covariance matrix with constraints a la Avery. +// ader_ref() should contain nonconstraint covariance matrix +//--------------------------------------------------------------------- + long int totNC=0; //total number of constraints + std::vector > tf0t; // derivative collectors + std::vector< Vect3DF > th0t; // derivative collectors + std::vector< double > taa; // derivative collectors + std::vector< Vect3DF > tmpVec; + for(int ii=0; ii<(int)vk->ConstraintList.size();ii++){ + totNC += vk->ConstraintList[ii]->NCDim; + for(ic=0; ic<(int)vk->ConstraintList[ii]->NCDim; ic++){ + taa.push_back( vk->ConstraintList[ii]->aa[ic] ); + th0t.push_back( vk->ConstraintList[ii]->h0t[ic] ); + tmpVec.clear(); + for(it=0; it<(int)vk->ConstraintList[ii]->f0t.size(); it++){ + tmpVec.push_back( vk->ConstraintList[ii]->f0t[it][ic] ); + } + tf0t.push_back( tmpVec ); + } + } +// R,RC[ic][i] + double **R =new double*[totNC]; for(ic=0; icexistFullCov = 1; + return 0; +} +#undef dcv_ref +#undef ader_ref + +#undef useWeightScheme + +} /* End of VKalVrtCore namespace*/ + diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtDeriv.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtDeriv.cxx index e6c37bedcf5f8856cfbe6a049f9146009225738b..ba53a3baba153ad115f0104286cf9700dc96c68f 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtDeriv.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtDeriv.cxx @@ -16,7 +16,7 @@ extern const vkalPropagator myPropagator; extern const vkalMagFld myMagFld; -void vpderiv(bool UseTrackErr, long int Charge, double *pari0, double *covi, double *vrtref, double *covvrtref, +void vpderiv(bool UseTrackErr, long int Charge, const double *pari0, double *covi, double *vrtref, double *covvrtref, double *drdpar, double *dwgt, double *rv0, VKalVrtControl * FitCONTROL) { /* Initialized data */ @@ -36,7 +36,7 @@ void vpderiv(bool UseTrackErr, long int Charge, double *pari0, double *covi, dou extern int cfdinv(double *, double *, long int); - extern void tdasatVK(double *, double *, double *, long int, long int); + extern void tdasatVK(const double *, const double *, double *, long int, long int); #define rvec_ref(a_1,a_2) rvec[(a_2)*2 + (a_1) - 1] diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/XYZtrp.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/XYZtrp.cxx index b126128704318b7d40ae83dc7a5e75ec19d6b02d..3c6f52681886bfd76a4dd5905173390711b8d890 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/XYZtrp.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/XYZtrp.cxx @@ -1,206 +1,206 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -#include "TrkVKalVrtCore/CommonPars.h" -#include "TrkVKalVrtCore/Propagator.h" -#include "TrkVKalVrtCore/VKalVrtBMag.h" -#include -#include - -namespace Trk { - -extern const vkalPropagator myPropagator; -extern void tdasatVK(double *, double *, double *, long int, long int); - -#define cnv_ref(a_1,a_2) cnv[(a_2)*6 + (a_1) - 7] - -void xyztrp(long int *ich, double *vrt0, double *pv0, double *covi, double BMAG, double *paro, double *errt) -{ - double covd[15],par[5], cnv[36]; /* was [6][6] */ -/* ---------------------------------------------------------- */ -/* Subroutine for convertion */ -/* (X,Y,Z,PX,PY,PZ) --> (eps,z,theta,phi,1/r) */ -/* Now it's used in VKalVrtFitter only */ -/* */ -/* Input: */ -/* ICH - charge of track ( +1,0,-1 ) */ -/* VRT0(3) - Vertex of particle */ -/* PV0(3) - Momentum of particle */ -/* COVI(21) - simmetric covariance matrix */ -/* Output: */ -/* PARO(5) - (eps,z,theta,phi,1/r) */ -/* ERRT(15) - simmetric error matrix */ -/* Reference point for output is (0,0,0) */ -/* For ICH=0 PARO(5) = const/pt */ -/* Propagation is done for NEW track, */ -/* so no TrkID reference established */ -/* Author: V.Kostyukhin */ -/* ---------------------------------------------------------- */ - - double constBF =BMAG * vkalMagCnvCst; - - double pt = sqrt(pv0[0]*pv0[0] + pv0[1]*pv0[1]); - double pp = pt*pt + pv0[2]*pv0[2]; // p**2 - double cs = pv0[0] / pt; - double sn = pv0[1] / pt; - double ctg = pv0[2] / pt; - double rho = (*ich) * constBF / pt; - if ((*ich) == 0)rho = constBF / pt; -/* -- Output parameters */ - par[0] = 0.; /* (-Yv*cos + Xv*sin) */ - par[1] = 0.; /* Zv - cotth*(Xv*cos + Yv*sin) */ - par[2] = acos(pv0[2] / sqrt(pp)); - if(par[2]<1.e-5)par[2]=1.e-5; - if(par[2]>M_PI-1.e-5) par[2]=M_PI-1.e-5; - par[3] = atan2(pv0[1], pv0[0]); - par[4] = rho; - if ((*ich) == 0)par[4] = constBF / pt; -//--- - double dTheta_dPx = pv0[0]*pv0[2]/(pt*pp); //dTheta/dPx - double dTheta_dPy = pv0[1]*pv0[2]/(pt*pp); //dTheta/dPy - double dTheta_dPz = -pt/pp; //dTheta/dPz - double dPhi_dPx = -pv0[1]/(pt*pt); //dPhi/dPx - double dPhi_dPy = pv0[0]/(pt*pt); //dPhi/dPy - double dPhi_dPz = 0; //dPhi/dPz - double dRho_dPx = -pv0[0]/(pt*pt) * rho; //dInvR/dPx - double dRho_dPy = -pv0[1]/(pt*pt) * rho; //dInvR/dPy - double dRho_dPz = 0.; //dInvR/dPz -//--- - cnv_ref(1, 1) = sn; - cnv_ref(2, 1) = -cs; - cnv_ref(3, 1) = 0.; - cnv_ref(4, 1) = 0.; - cnv_ref(5, 1) = 0.; - cnv_ref(6, 1) = 0.; - - cnv_ref(1, 2) = -cs * ctg; - cnv_ref(2, 2) = -sn * ctg; - cnv_ref(3, 2) = 1.; - cnv_ref(4, 2) = 0.; - cnv_ref(5, 2) = 0.; - cnv_ref(6, 2) = 0.; - - cnv_ref(1, 3) = 0.; - cnv_ref(2, 3) = 0.; - cnv_ref(3, 3) = 0.; - cnv_ref(4, 3) = dTheta_dPx; - cnv_ref(5, 3) = dTheta_dPy; - cnv_ref(6, 3) = dTheta_dPz; - - cnv_ref(1, 4) = 0.; - cnv_ref(2, 4) = 0.; - if(*ich) cnv_ref(1, 4) = -cs * rho; // For charged tracks only - if(*ich) cnv_ref(2, 4) = -sn * rho; // - cnv_ref(3, 4) = 0.; - cnv_ref(4, 4) = dPhi_dPx; - cnv_ref(5, 4) = dPhi_dPy; - cnv_ref(6, 4) = dPhi_dPz; - - cnv_ref(1, 5) = 0.; - cnv_ref(2, 5) = 0.; - cnv_ref(3, 5) = 0.; - cnv_ref(4, 5) = dRho_dPx; - cnv_ref(5, 5) = dRho_dPy; - cnv_ref(6, 5) = dRho_dPz; - tdasatVK(cnv, covi , covd, 5, 6); - -/* -- Translation to (0,0,0) (BackPropagation) --*/ - double Ref0[3]={0.,0.,0.}; - myPropagator.Propagate(-999, (*ich), par, covd, vrt0, Ref0, paro, errt, nullptr); - -} - - -void combinedTrack(long int ICH, double *pv0, double *covi, double BMAG, double *par, double *covo) -{ - - double cnv[36]; /* was [6][6] */ -/* ---------------------------------------------------------- */ -/* Subroutine for convertion for VKalvrtCore */ -/* Correct magnetic field BMAG at conversion point */ -/* is provided externally. */ -/* (X,Y,Z,PX,PY,PZ) --> (eps,z,theta,phi,1/r) */ -/* Input: */ -/* ICH - charge of track ( +1,0,-1 ) */ -/* PV0(3) - Momentum of particle */ -/* COVI(21) - simmetric covariance matrix */ -/* Output: */ -/* PARO(5) - (eps,z,theta,phi,1/r) */ -/* ERRT(15) - simmetric error matrix */ -/* NO PROPAGATION IS DONE!!!! */ -/* For ICH=0 PARO(5) = const/pt */ -/* Author: V.Kostyukhin */ -/* ---------------------------------------------------------- */ - - double constBF =BMAG * vkalMagCnvCst; - - double pt = sqrt(pv0[0]*pv0[0] + pv0[1]*pv0[1]); - double pp = pt*pt + pv0[2]*pv0[2]; - double cs = pv0[0] / pt; - double sn = pv0[1] / pt; - double ctg = pv0[2] / pt; - double rho = ICH * constBF / pt; - if ( ICH==0 )rho = constBF / pt; -/* -- Output parameters */ - par[0] = 0.; /* (-Yv*cos + Xv*sin) */ - par[1] = 0.; /* Zv - cotth*(Xv*cos + Yv*sin) */ - par[2] = acos(pv0[2] / sqrt(pp)); - if(par[2]<1.e-5)par[2]=1.e-5; - if(par[2]>M_PI-1.e-5) par[2]=M_PI-1.e-5; - par[3] = atan2(pv0[1], pv0[0]); - par[4] = rho; - if ( ICH==0 )par[4] = constBF / pt; -// - double dTheta_dPx = pv0[0]*pv0[2]/(pt*pp); //dTheta/dPx - double dTheta_dPy = pv0[1]*pv0[2]/(pt*pp); //dTheta/dPy - double dTheta_dPz = -pt/pp; //dTheta/dPz - double dPhi_dPx = -pv0[1]/(pt*pt); //dPhi/dPx - double dPhi_dPy = pv0[0]/(pt*pt); //dPhi/dPy - double dPhi_dPz = 0; //dPhi/dPz - double dRho_dPx = -pv0[0]/(pt*pt) * rho; //dInvR/dPx - double dRho_dPy = -pv0[1]/(pt*pt) * rho; //dInvR/dPy - double dRho_dPz = 0.; //dInvR/dPz -//--- - cnv_ref(1, 1) = sn; - cnv_ref(2, 1) = -cs; - cnv_ref(3, 1) = 0.; - cnv_ref(4, 1) = 0.; - cnv_ref(5, 1) = 0.; - cnv_ref(6, 1) = 0.; - - cnv_ref(1, 2) = -cs * ctg; - cnv_ref(2, 2) = -sn * ctg; - cnv_ref(3, 2) = 1.; - cnv_ref(4, 2) = 0.; - cnv_ref(5, 2) = 0.; - cnv_ref(6, 2) = 0.; - - cnv_ref(1, 3) = 0.; - cnv_ref(2, 3) = 0.; - cnv_ref(3, 3) = 0.; - cnv_ref(4, 3) = dTheta_dPx; - cnv_ref(5, 3) = dTheta_dPy; - cnv_ref(6, 3) = dTheta_dPz; - - cnv_ref(1, 4) = 0.; - cnv_ref(2, 4) = 0.; - if(ICH) cnv_ref(1, 4) = -cs * rho; //For charged tracks only - if(ICH) cnv_ref(2, 4) = -sn * rho; // - cnv_ref(3, 4) = 0.; - cnv_ref(4, 4) = dPhi_dPx; - cnv_ref(5, 4) = dPhi_dPy; - cnv_ref(6, 4) = dPhi_dPz; - - cnv_ref(1, 5) = 0.; - cnv_ref(2, 5) = 0.; - cnv_ref(3, 5) = 0.; - cnv_ref(4, 5) = dRho_dPx; - cnv_ref(5, 5) = dRho_dPy; - cnv_ref(6, 5) = dRho_dPz; - tdasatVK(cnv, covi , covo, 5, 6); -} -#undef cnv_ref - -} /* End of VKalVrtCore namespace */ - +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TrkVKalVrtCore/CommonPars.h" +#include "TrkVKalVrtCore/Propagator.h" +#include "TrkVKalVrtCore/VKalVrtBMag.h" +#include +#include + +namespace Trk { + +extern const vkalPropagator myPropagator; +extern void tdasatVK(const double *, const double *, double *, long int, long int); + +#define cnv_ref(a_1,a_2) cnv[(a_2)*6 + (a_1) - 7] + +void xyztrp(const long int *ich, double *vrt0, double *pv0, double *covi, double BMAG, double *paro, double *errt) +{ + double covd[15],par[5], cnv[36]; /* was [6][6] */ +/* ---------------------------------------------------------- */ +/* Subroutine for convertion */ +/* (X,Y,Z,PX,PY,PZ) --> (eps,z,theta,phi,1/r) */ +/* Now it's used in VKalVrtFitter only */ +/* */ +/* Input: */ +/* ICH - charge of track ( +1,0,-1 ) */ +/* VRT0(3) - Vertex of particle */ +/* PV0(3) - Momentum of particle */ +/* COVI(21) - simmetric covariance matrix */ +/* Output: */ +/* PARO(5) - (eps,z,theta,phi,1/r) */ +/* ERRT(15) - simmetric error matrix */ +/* Reference point for output is (0,0,0) */ +/* For ICH=0 PARO(5) = const/pt */ +/* Propagation is done for NEW track, */ +/* so no TrkID reference established */ +/* Author: V.Kostyukhin */ +/* ---------------------------------------------------------- */ + + double constBF =BMAG * vkalMagCnvCst; + + double pt = sqrt(pv0[0]*pv0[0] + pv0[1]*pv0[1]); + double pp = pt*pt + pv0[2]*pv0[2]; // p**2 + double cs = pv0[0] / pt; + double sn = pv0[1] / pt; + double ctg = pv0[2] / pt; + double rho = (*ich) * constBF / pt; + if ((*ich) == 0)rho = constBF / pt; +/* -- Output parameters */ + par[0] = 0.; /* (-Yv*cos + Xv*sin) */ + par[1] = 0.; /* Zv - cotth*(Xv*cos + Yv*sin) */ + par[2] = acos(pv0[2] / sqrt(pp)); + if(par[2]<1.e-5)par[2]=1.e-5; + if(par[2]>M_PI-1.e-5) par[2]=M_PI-1.e-5; + par[3] = atan2(pv0[1], pv0[0]); + par[4] = rho; + if ((*ich) == 0)par[4] = constBF / pt; +//--- + double dTheta_dPx = pv0[0]*pv0[2]/(pt*pp); //dTheta/dPx + double dTheta_dPy = pv0[1]*pv0[2]/(pt*pp); //dTheta/dPy + double dTheta_dPz = -pt/pp; //dTheta/dPz + double dPhi_dPx = -pv0[1]/(pt*pt); //dPhi/dPx + double dPhi_dPy = pv0[0]/(pt*pt); //dPhi/dPy + double dPhi_dPz = 0; //dPhi/dPz + double dRho_dPx = -pv0[0]/(pt*pt) * rho; //dInvR/dPx + double dRho_dPy = -pv0[1]/(pt*pt) * rho; //dInvR/dPy + double dRho_dPz = 0.; //dInvR/dPz +//--- + cnv_ref(1, 1) = sn; + cnv_ref(2, 1) = -cs; + cnv_ref(3, 1) = 0.; + cnv_ref(4, 1) = 0.; + cnv_ref(5, 1) = 0.; + cnv_ref(6, 1) = 0.; + + cnv_ref(1, 2) = -cs * ctg; + cnv_ref(2, 2) = -sn * ctg; + cnv_ref(3, 2) = 1.; + cnv_ref(4, 2) = 0.; + cnv_ref(5, 2) = 0.; + cnv_ref(6, 2) = 0.; + + cnv_ref(1, 3) = 0.; + cnv_ref(2, 3) = 0.; + cnv_ref(3, 3) = 0.; + cnv_ref(4, 3) = dTheta_dPx; + cnv_ref(5, 3) = dTheta_dPy; + cnv_ref(6, 3) = dTheta_dPz; + + cnv_ref(1, 4) = 0.; + cnv_ref(2, 4) = 0.; + if(*ich) cnv_ref(1, 4) = -cs * rho; // For charged tracks only + if(*ich) cnv_ref(2, 4) = -sn * rho; // + cnv_ref(3, 4) = 0.; + cnv_ref(4, 4) = dPhi_dPx; + cnv_ref(5, 4) = dPhi_dPy; + cnv_ref(6, 4) = dPhi_dPz; + + cnv_ref(1, 5) = 0.; + cnv_ref(2, 5) = 0.; + cnv_ref(3, 5) = 0.; + cnv_ref(4, 5) = dRho_dPx; + cnv_ref(5, 5) = dRho_dPy; + cnv_ref(6, 5) = dRho_dPz; + tdasatVK(cnv, covi , covd, 5, 6); + +/* -- Translation to (0,0,0) (BackPropagation) --*/ + double Ref0[3]={0.,0.,0.}; + myPropagator.Propagate(-999, (*ich), par, covd, vrt0, Ref0, paro, errt, nullptr); + +} + + +void combinedTrack(long int ICH, double *pv0, double *covi, double BMAG, double *par, double *covo) +{ + + double cnv[36]; /* was [6][6] */ +/* ---------------------------------------------------------- */ +/* Subroutine for convertion for VKalvrtCore */ +/* Correct magnetic field BMAG at conversion point */ +/* is provided externally. */ +/* (X,Y,Z,PX,PY,PZ) --> (eps,z,theta,phi,1/r) */ +/* Input: */ +/* ICH - charge of track ( +1,0,-1 ) */ +/* PV0(3) - Momentum of particle */ +/* COVI(21) - simmetric covariance matrix */ +/* Output: */ +/* PARO(5) - (eps,z,theta,phi,1/r) */ +/* ERRT(15) - simmetric error matrix */ +/* NO PROPAGATION IS DONE!!!! */ +/* For ICH=0 PARO(5) = const/pt */ +/* Author: V.Kostyukhin */ +/* ---------------------------------------------------------- */ + + double constBF =BMAG * vkalMagCnvCst; + + double pt = sqrt(pv0[0]*pv0[0] + pv0[1]*pv0[1]); + double pp = pt*pt + pv0[2]*pv0[2]; + double cs = pv0[0] / pt; + double sn = pv0[1] / pt; + double ctg = pv0[2] / pt; + double rho = ICH * constBF / pt; + if ( ICH==0 )rho = constBF / pt; +/* -- Output parameters */ + par[0] = 0.; /* (-Yv*cos + Xv*sin) */ + par[1] = 0.; /* Zv - cotth*(Xv*cos + Yv*sin) */ + par[2] = acos(pv0[2] / sqrt(pp)); + if(par[2]<1.e-5)par[2]=1.e-5; + if(par[2]>M_PI-1.e-5) par[2]=M_PI-1.e-5; + par[3] = atan2(pv0[1], pv0[0]); + par[4] = rho; + if ( ICH==0 )par[4] = constBF / pt; +// + double dTheta_dPx = pv0[0]*pv0[2]/(pt*pp); //dTheta/dPx + double dTheta_dPy = pv0[1]*pv0[2]/(pt*pp); //dTheta/dPy + double dTheta_dPz = -pt/pp; //dTheta/dPz + double dPhi_dPx = -pv0[1]/(pt*pt); //dPhi/dPx + double dPhi_dPy = pv0[0]/(pt*pt); //dPhi/dPy + double dPhi_dPz = 0; //dPhi/dPz + double dRho_dPx = -pv0[0]/(pt*pt) * rho; //dInvR/dPx + double dRho_dPy = -pv0[1]/(pt*pt) * rho; //dInvR/dPy + double dRho_dPz = 0.; //dInvR/dPz +//--- + cnv_ref(1, 1) = sn; + cnv_ref(2, 1) = -cs; + cnv_ref(3, 1) = 0.; + cnv_ref(4, 1) = 0.; + cnv_ref(5, 1) = 0.; + cnv_ref(6, 1) = 0.; + + cnv_ref(1, 2) = -cs * ctg; + cnv_ref(2, 2) = -sn * ctg; + cnv_ref(3, 2) = 1.; + cnv_ref(4, 2) = 0.; + cnv_ref(5, 2) = 0.; + cnv_ref(6, 2) = 0.; + + cnv_ref(1, 3) = 0.; + cnv_ref(2, 3) = 0.; + cnv_ref(3, 3) = 0.; + cnv_ref(4, 3) = dTheta_dPx; + cnv_ref(5, 3) = dTheta_dPy; + cnv_ref(6, 3) = dTheta_dPz; + + cnv_ref(1, 4) = 0.; + cnv_ref(2, 4) = 0.; + if(ICH) cnv_ref(1, 4) = -cs * rho; //For charged tracks only + if(ICH) cnv_ref(2, 4) = -sn * rho; // + cnv_ref(3, 4) = 0.; + cnv_ref(4, 4) = dPhi_dPx; + cnv_ref(5, 4) = dPhi_dPy; + cnv_ref(6, 4) = dPhi_dPz; + + cnv_ref(1, 5) = 0.; + cnv_ref(2, 5) = 0.; + cnv_ref(3, 5) = 0.; + cnv_ref(4, 5) = dRho_dPx; + cnv_ref(5, 5) = dRho_dPy; + cnv_ref(6, 5) = dRho_dPz; + tdasatVK(cnv, covi , covo, 5, 6); +} +#undef cnv_ref + +} /* End of VKalVrtCore namespace */ + diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfClstPnt.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfClstPnt.cxx index ba30b5718c62e7abbfd4e6c1b5e5a4ca7e4b51a5..d3837cf87da7fd2fef68d873355b6b3ffa6bd29f 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfClstPnt.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfClstPnt.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include @@ -7,7 +7,7 @@ namespace Trk { -void cfClstPnt( double *par, double *Vrt, double *ClstPnt) +void cfClstPnt( double *par, const double *Vrt, double *ClstPnt) { double e[3]; //Track direction at perigee e[0] = cos(par[3]); diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfErPr.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfErPr.cxx index b48bbc9972a79464d7f0f7bb9f7114b06da012bd..330a973b87ee7ad1b60a42af5571b95b365672d3 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfErPr.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfErPr.cxx @@ -1,88 +1,88 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrkVKalVrtCore/TrkVKalUtils.h" -#include -#include - -namespace Trk { - - -void cferpr(long int *ich, double *par, double *ref, double *s0, double *errold, double *errnew) -{ - - - double r__, dsphi, dseps, dsrho, cs, sn, xp, yp; - double derivm[25]; /* was [5][5] */ - double ctg, dsq, dyp, d__3; - - extern void tdasatVK(double *, double *, double *, long int , long int ); - - -/* ------------------------------------------ */ -/* This routine propagates the trajectory error matrix */ -/* originally evaluated at s=0 to the curved abcissa S */ -/* assuming that the track travels into VACUUM */ -/* INPUT: ICH Charge of track */ -/* PAR(5) Track parameters */ -/* REF(3) New reference point */ -/* ERROLD error matrix at (0,0,0) */ -/* S0 curved abcissa of propagation */ -/* OUTPUT: ERRNEW New error matrix */ -/* ------ */ -/* derivm(i,j)=D(X'.j)/D(X.i) */ -/* ----------------------------------------------------------- */ -/* Author: V.Kostyukhin */ -/* ------------------------------------------------------------ */ - /* Parameter adjustments */ - --par; - --ref; - - - /* --------------------------------------------------- */ - for (int ii= 0; ii< 25; ++ii) derivm[ii] = 0.; -/* -- */ - cs = cos(par[4]); - sn = sin(par[4]); - xp = ref[1] * cs + ref[2] * sn; //==(*s0) for neutral particles - yp = ref[1] * sn - ref[2] * cs; - double sinp3 = sin(par[3]); - ctg = cos(par[3]) / sinp3; - derivm[6] = 1.; - derivm[12] = 1.; - derivm[24] = 1.; - if (*ich != 0) { - r__ = 1. / par[5]; - dyp = r__ - par[1] + yp; - dsphi = -r__ * (yp * dyp + xp * xp) / (dyp * dyp + xp * xp); - dseps = r__ * xp / (dyp * dyp + xp * xp); - dsrho = -r__ * (*s0) + r__ * r__ * dseps; - derivm[5] = dseps * ctg; - derivm[7] = -(*s0) / (sinp3 * sinp3); - derivm[8] = dsphi * ctg; - derivm[9] = dsrho * ctg; - derivm[15] = par[5] * dseps; -/* Computing 2nd power */ - d__3 = r__ - par[1]; - dsq = sqrt(ref[1]*ref[1] + ref[2]*ref[2] + d__3*d__3 + 2.*d__3*yp); - derivm[4] = -(r__*r__) + d_sign(1., r__) * (r__*r__) * dyp / dsq; - derivm[3] = d_sign(1., r__) * (par[1] - r__) * xp / dsq; - derivm[19] = *s0 + par[5] * dsrho; - derivm[0] = d_sign(1., r__) * dyp / dsq; - derivm[18] = par[5] * dsphi + 1.; - } else { - derivm[0] = 1.; - derivm[18] = 1.; - //derivm[3] = par[1] - xp; VK Error!!! - derivm[3] = - xp; //dEps/dPhi - derivm[7] = -xp / (sinp3 * sinp3); //dZ/dTheta - derivm[8] = -yp * ctg; //dZ/dPhi - } - tdasatVK(derivm, &errold[0], &errnew[0], 5, 5); - -} - - -} /* End of VKalVrtCore namespace */ - +#include +#include + +namespace Trk { + + +void cferpr(const long int *ich, double *par, double *ref, const double *s0, double *errold, double *errnew) +{ + + + double r__, dsphi, dseps, dsrho, cs, sn, xp, yp; + double derivm[25]; /* was [5][5] */ + double ctg, dsq, dyp, d__3; + + extern void tdasatVK(const double *, const double *, double *, long int , long int ); + + +/* ------------------------------------------ */ +/* This routine propagates the trajectory error matrix */ +/* originally evaluated at s=0 to the curved abcissa S */ +/* assuming that the track travels into VACUUM */ +/* INPUT: ICH Charge of track */ +/* PAR(5) Track parameters */ +/* REF(3) New reference point */ +/* ERROLD error matrix at (0,0,0) */ +/* S0 curved abcissa of propagation */ +/* OUTPUT: ERRNEW New error matrix */ +/* ------ */ +/* derivm(i,j)=D(X'.j)/D(X.i) */ +/* ----------------------------------------------------------- */ +/* Author: V.Kostyukhin */ +/* ------------------------------------------------------------ */ + /* Parameter adjustments */ + --par; + --ref; + + + /* --------------------------------------------------- */ + for (int ii= 0; ii< 25; ++ii) derivm[ii] = 0.; +/* -- */ + cs = cos(par[4]); + sn = sin(par[4]); + xp = ref[1] * cs + ref[2] * sn; //==(*s0) for neutral particles + yp = ref[1] * sn - ref[2] * cs; + double sinp3 = sin(par[3]); + ctg = cos(par[3]) / sinp3; + derivm[6] = 1.; + derivm[12] = 1.; + derivm[24] = 1.; + if (*ich != 0) { + r__ = 1. / par[5]; + dyp = r__ - par[1] + yp; + dsphi = -r__ * (yp * dyp + xp * xp) / (dyp * dyp + xp * xp); + dseps = r__ * xp / (dyp * dyp + xp * xp); + dsrho = -r__ * (*s0) + r__ * r__ * dseps; + derivm[5] = dseps * ctg; + derivm[7] = -(*s0) / (sinp3 * sinp3); + derivm[8] = dsphi * ctg; + derivm[9] = dsrho * ctg; + derivm[15] = par[5] * dseps; +/* Computing 2nd power */ + d__3 = r__ - par[1]; + dsq = sqrt(ref[1]*ref[1] + ref[2]*ref[2] + d__3*d__3 + 2.*d__3*yp); + derivm[4] = -(r__*r__) + d_sign(1., r__) * (r__*r__) * dyp / dsq; + derivm[3] = d_sign(1., r__) * (par[1] - r__) * xp / dsq; + derivm[19] = *s0 + par[5] * dsrho; + derivm[0] = d_sign(1., r__) * dyp / dsq; + derivm[18] = par[5] * dsphi + 1.; + } else { + derivm[0] = 1.; + derivm[18] = 1.; + //derivm[3] = par[1] - xp; VK Error!!! + derivm[3] = - xp; //dEps/dPhi + derivm[7] = -xp / (sinp3 * sinp3); //dZ/dTheta + derivm[8] = -yp * ctg; //dZ/dPhi + } + tdasatVK(derivm, &errold[0], &errnew[0], 5, 5); + +} + + +} /* End of VKalVrtCore namespace */ + diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfImp.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfImp.cxx index d4c21c25f77b164a94441213d69c211f3cd4b132..b8830cc9ff045b59f858ffc74f4c3c8efe331095 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfImp.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfImp.cxx @@ -1,185 +1,185 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#include "TrkVKalVrtCore/Propagator.h" -#include "TrkVKalVrtCore/TrkVKalVrtCore.h" -#include -#include - -namespace Trk { - -extern const vkalPropagator myPropagator; -extern int cfdinv(double *, double *, long int); - -#define min(a,b) ((a) <= (b) ? (a) : (b)) -#define max(a,b) ((a) >= (b) ? (a) : (b)) - - - void cfimp(long int TrkID, long int ich, int IFL, double *par, - double *err, double *vrt, double *vcov, double *rimp, - double *rcov, double *sign , VKalVrtControlBase * FitCONTROL ) -{ - double dcov[3], errd[15], paro[5]; - double dwgt[3], errn[15]; - int i__, j, ij; - - double cnv[6] /* was [2][3] */; -/* --------------------------------------------------------- */ -/* Impact parameter calculation */ -/* Input: */ -/* ICH -charge(-1,0,1) */ -/* IFL = 1 contribution from VRT is added */ -/* IFL =-1 contribution from VRT is subtructed */ -/* PAR(5),ERR(15) - peregee parameters and error matrix */ -/* VRT(3),VCOV(6) - vertex and its error matrix */ -/* */ -/* SIGNIFICANCE IS CALCULATED FOR PERIGEE POINT BY DEF. */ -/* (NOT FOR THE CLOSEST POINT!!!) */ -/* */ -/* Output: */ -/* RIMP(1) - impact in XY */ -/* RIMP(2) - impact in Z */ -/* RIMP(3) - Theta at new vertex */ -/* RIMP(4) - Phi at new vertex */ -/* RIMP(5) - curvature at vertex */ -/* RCOV(3) - error matrix for RIMP */ -/* SIGN - impact significance */ -/* Author: V.Kostyukhin */ -/* --------------------------------------------------------- */ - /* Parameter adjustments */ - --vcov; - - /* Function Body */ - for (int ii = 0; ii < 15; ++ii) {errd[ii] = err[ii];} - - - double Ref0[3]={0.,0.,0.}; //base reference point for standard perigee - - myPropagator.Propagate(TrkID, ich, par, errd, Ref0, vrt, paro, errn, FitCONTROL); - -//std::cout <<" CFImp new par R,Z="< +#include + +namespace Trk { + +extern const vkalPropagator myPropagator; +extern int cfdinv(double *, double *, long int); + +#define min(a,b) ((a) <= (b) ? (a) : (b)) +#define max(a,b) ((a) >= (b) ? (a) : (b)) + + + void cfimp(long int TrkID, long int ich, int IFL, double *par, + const double *err, double *vrt, double *vcov, double *rimp, + double *rcov, double *sign , VKalVrtControlBase * FitCONTROL ) +{ + double dcov[3], errd[15], paro[5]; + double dwgt[3], errn[15]; + int i__, j, ij; + + double cnv[6] /* was [2][3] */; +/* --------------------------------------------------------- */ +/* Impact parameter calculation */ +/* Input: */ +/* ICH -charge(-1,0,1) */ +/* IFL = 1 contribution from VRT is added */ +/* IFL =-1 contribution from VRT is subtructed */ +/* PAR(5),ERR(15) - peregee parameters and error matrix */ +/* VRT(3),VCOV(6) - vertex and its error matrix */ +/* */ +/* SIGNIFICANCE IS CALCULATED FOR PERIGEE POINT BY DEF. */ +/* (NOT FOR THE CLOSEST POINT!!!) */ +/* */ +/* Output: */ +/* RIMP(1) - impact in XY */ +/* RIMP(2) - impact in Z */ +/* RIMP(3) - Theta at new vertex */ +/* RIMP(4) - Phi at new vertex */ +/* RIMP(5) - curvature at vertex */ +/* RCOV(3) - error matrix for RIMP */ +/* SIGN - impact significance */ +/* Author: V.Kostyukhin */ +/* --------------------------------------------------------- */ + /* Parameter adjustments */ + --vcov; + + /* Function Body */ + for (int ii = 0; ii < 15; ++ii) {errd[ii] = err[ii];} + + + double Ref0[3]={0.,0.,0.}; //base reference point for standard perigee + + myPropagator.Propagate(TrkID, ich, par, errd, Ref0, vrt, paro, errn, FitCONTROL); + +//std::cout <<" CFImp new par R,Z="<TrackList.size(); //Deliberately not using make_unique @@ -72,7 +72,7 @@ void cfmasserr(VKVertex * vk, int *list, double BMAG, double *MASS, double *sigM } -void cfmasserrold_(long int *ntrk, long int *list, double *parfs, +void cfmasserrold_(const long int *ntrk, long int *list, double *parfs, double *ams, double *deriv, double BMAG, double *dm, double *sigm) { int i__; diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfNewP.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfNewP.cxx index f49346999470297f4fa08fbf11e4c4d4bea090b1..74e6c66c7ce490a863486bc8b4b624e8183d9bf3 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfNewP.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfNewP.cxx @@ -1,12 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include namespace Trk { -void cfnewp(long int *ich, double *parold, double *ref, double *s, double *parnew, double *per) +void cfnewp(const long int *ich, double *parold, double *ref, double *s, double *parnew, double *per) { double dphi, coth, hper, zper, zeps, r__, cs, xc, yc, sn, sipart, eps; diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfNewPm.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfNewPm.cxx index 65a98df4656e0a8714e4ee0cc8a8ce7c91ea4cfd..2adf15986a22b62e46f7719e357d9eb85e75368e 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfNewPm.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfNewPm.cxx @@ -1,119 +1,119 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#include "TrkVKalVrtCore/Propagator.h" -#include "TrkVKalVrtCore/TrkVKalUtils.h" -#include "TrkVKalVrtCore/VKalVrtBMag.h" -#include -#include - -namespace Trk { - -extern const vkalMagFld myMagFld; - - -extern double d_sign(double, double); -extern void cfnewp(long int *, double *, double *, double *, double *, double *); -extern void vkgrkuta_(double *, double *, double *, double *, VKalVrtControlBase* =nullptr ); - - -void cfnewpm(double *par, double *xyzStart, double *xyzEnd, double *ustep, double *parn, double *closePoint, VKalVrtControlBase * CONTROL) -{ - double d__1, d__2,dist_left; - double vect[7], stmg, vout[7]={0.}, dpar0[5]; - double perig[3], dstep, xyzst[3], charge; - double posold, poscur, totway, dp; - double dX, dY, dZ; - long int ich; - -/* --------------------------------------------------------- */ -/* The same as CFNEWP but for the case on nonuniform */ -/* magnetic field */ -/* */ -/* Propagation from xyzStart reference point to xyzEnd point*/ -/* PAR - perigee parameters wrt xyzStart */ -/* PARN - perigee parameters wrt xyzEnd */ -/* Author: V.Kostyukhin */ -/* --------------------------------------------------------- */ - /* Parameter adjustments */ - --par; - - d__1 = tan(par[3]); - totway = (*ustep) * sqrt(1. / (d__1 * d__1) + 1.); - - if (fabs(*ustep) < 10. && fabs(totway) < 20.) return; // Distance(mm) is small. Simplest propagation is used - - stmg = 40.; //Propagation step in mm for nonuniform field - - vect[0] = sin(par[4]) * par[1] +xyzStart[0]; - vect[1] = -cos(par[4]) * par[1] +xyzStart[1]; - vect[2] = par[2] +xyzStart[2]; - - double constB = myMagFld.getMagFld(vect,CONTROL) * myMagFld.getCnvCst(); - - double pt = constB / fabs(par[5]); - double px = pt * cos(par[4]); - double py = pt * sin(par[4]); - double pz = pt / tan(par[3]); - double p = sqrt(pt * pt + pz * pz); - - vect[3] = px / p; - vect[4] = py / p; - vect[5] = pz / p; - vect[6] = p; - charge = -d_sign( 1., par[5]); - poscur = 0.; -//std::cout <<"VkGrkuta vect="< +#include + +namespace Trk { + +extern const vkalMagFld myMagFld; + + +extern double d_sign(double, double); +extern void cfnewp(const long int *, double *, double *, double *, double *, double *); +extern void vkgrkuta_(const double *, const double *, double *, double *, VKalVrtControlBase* =nullptr ); + + +void cfnewpm(double *par, const double *xyzStart, double *xyzEnd, const double *ustep, double *parn, double *closePoint, VKalVrtControlBase * CONTROL) +{ + double d__1, d__2,dist_left; + double vect[7], stmg, vout[7]={0.}, dpar0[5]; + double perig[3], dstep, xyzst[3], charge; + double posold, poscur, totway, dp; + double dX, dY, dZ; + long int ich; + +/* --------------------------------------------------------- */ +/* The same as CFNEWP but for the case on nonuniform */ +/* magnetic field */ +/* */ +/* Propagation from xyzStart reference point to xyzEnd point*/ +/* PAR - perigee parameters wrt xyzStart */ +/* PARN - perigee parameters wrt xyzEnd */ +/* Author: V.Kostyukhin */ +/* --------------------------------------------------------- */ + /* Parameter adjustments */ + --par; + + d__1 = tan(par[3]); + totway = (*ustep) * sqrt(1. / (d__1 * d__1) + 1.); + + if (fabs(*ustep) < 10. && fabs(totway) < 20.) return; // Distance(mm) is small. Simplest propagation is used + + stmg = 40.; //Propagation step in mm for nonuniform field + + vect[0] = sin(par[4]) * par[1] +xyzStart[0]; + vect[1] = -cos(par[4]) * par[1] +xyzStart[1]; + vect[2] = par[2] +xyzStart[2]; + + double constB = myMagFld.getMagFld(vect,CONTROL) * myMagFld.getCnvCst(); + + double pt = constB / fabs(par[5]); + double px = pt * cos(par[4]); + double py = pt * sin(par[4]); + double pz = pt / tan(par[3]); + double p = sqrt(pt * pt + pz * pz); + + vect[3] = px / p; + vect[4] = py / p; + vect[5] = pz / p; + vect[6] = p; + charge = -d_sign( 1., par[5]); + poscur = 0.; +//std::cout <<"VkGrkuta vect="< namespace Trk { - extern int makeCascade(VKalVrtControl & FitCONTROL, long int NTRK, long int *ich, double *wm, double *inp_Trk5, double *inp_CovTrk5, + extern int makeCascade(VKalVrtControl & FitCONTROL, long int NTRK, const long int *ich, double *wm, double *inp_Trk5, double *inp_CovTrk5, const std::vector< std::vector > &vertexDefinition, const std::vector< std::vector > &cascadeDefinition, double definedCnstAccuracy=1.e-4); extern int processCascade(CascadeEvent &); extern int processCascade(CascadeEvent &, double *); - extern int processCascade(CascadeEvent &, double *, double *); - extern int processCascadePV(CascadeEvent &, double *, double *); + extern int processCascade(CascadeEvent &, const double *, const double *); + extern int processCascadePV(CascadeEvent &, const double *, const double *); extern void getFittedCascade( CascadeEvent &, std::vector< Vect3DF > &, std::vector >& , diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalGetImpact.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalGetImpact.cxx index 05156a3a28e92ac2126a9711dc6de9763544b60c..7658f52bbae35088bc58e7fc3a7f645562e40cff 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalGetImpact.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalGetImpact.cxx @@ -12,7 +12,7 @@ namespace Trk { extern - void cfimp(long int TrkID, long int ICH, int IFL, double* PAR, double* ERR, + void cfimp(long int TrkID, long int ICH, int IFL, double* PAR, const double* ERR, double* VRT, double* VCOV, double* RIMP, double* RCOV, double* SIGN, VKalVrtControlBase * FitCONTROL ); diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalVrtFitFastSvc.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalVrtFitFastSvc.cxx index 769b2d55a4d5fe30de8370719476c3d93577ae7c..0ca20bbce235ccbd52f36255d79bf3a470b8b388 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalVrtFitFastSvc.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalVrtFitFastSvc.cxx @@ -13,7 +13,7 @@ namespace Trk { - extern double vkvFastV( double* , double* , double* vRef, double dbmag, double*); + extern double vkvFastV( double* , double* , const double* vRef, double dbmag, double*); } // //__________________________________________________________________________ diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalVrtFitSvc.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalVrtFitSvc.cxx index 4e59e52584fbb9352f63008d6c3b6fbbe317a606..a742e131f34abaa4d73898e52fc570ac7023e928 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalVrtFitSvc.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalVrtFitSvc.cxx @@ -17,7 +17,7 @@ namespace Trk { extern void cfpest( int ntrk, double *vrt, long int *Charge, double (*part)[5], double (*par0)[3]); - extern void xyztrp( long int* Charge, double* vrt, double* Mom, double* CovVrtMom, double BMAG, double* Perig, double* CovPerig ); + extern void xyztrp( const long int* Charge, double* vrt, double* Mom, double* CovVrtMom, double BMAG, double* Perig, double* CovPerig ); extern int CFit(VKalVrtControl *FitCONTROL, int ifCovV0, int NTRK, long int *ich, double xyz0[3], double (*par0)[3], diff --git a/Trigger/TrigAccel/TrigGpuTest/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAccel/TrigGpuTest/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..48b5dadb7c83a59a4177f7c1cfb0d6cd718f15b5 --- /dev/null +++ b/Trigger/TrigAccel/TrigGpuTest/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigAccel/TrigGpuTest diff --git a/Trigger/TrigAccel/TrigGpuTest/src/trigGpuTest.cxx b/Trigger/TrigAccel/TrigGpuTest/src/trigGpuTest.cxx index 83dca524a5a2ac6f215648c5becad1c3729b5c05..12a0086fdf237dd58f097c7f0118549c41bf26a0 100644 --- a/Trigger/TrigAccel/TrigGpuTest/src/trigGpuTest.cxx +++ b/Trigger/TrigAccel/TrigGpuTest/src/trigGpuTest.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include @@ -21,7 +21,7 @@ int main(int argc, char* argv[]) { if(argc < 4) { std::cout<<"trigGpuTest usage: ./trigGpuTest nevents"<run(); diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h index 42fa8239f338a3dc5b3db458ab64918537d69162..cd4dd0361af96911de7c27846aeeca70b002bc60 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h @@ -27,7 +27,7 @@ #include "TrigInDetAnalysis/TIDAVertex.h" #include "TrigInDetAnalysis/TrackSelector.h" #include "TrigInDetAnalysisUtils/T_AnalysisConfig.h" -#include "TrigInDetAnalysisUtils/TagNProbe2.h" +#include "TrigInDetAnalysisUtils/TagNProbe.h" #include "TrigInDetAnalysisExample/Analysis_Tier0.h" #include "TrigInDetAnalysisExample/AnalysisR3_Tier0.h" @@ -106,7 +106,7 @@ public: TrackFilter* testFilter, TrackFilter* referenceFilter, TrackAssociator* associator, TrackAnalysis* analysis, - TagNProbe2* TnP_tool = 0) : + TagNProbe* TnP_tool = 0) : T_AnalysisConfig( analysisInstanceName, testChainName, testType, testKey, referenceChainName, referenceType, referenceKey, @@ -1362,7 +1362,7 @@ protected: bool m_containTracks; - TagNProbe2* m_TnP_tool; + TagNProbe* m_TnP_tool; TH1F* m_invmass; TH1F* m_invmass_obj; diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigR3_Tier0.h b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigR3_Tier0.h index f52eceb263b8c07329587d75d166b2032ba86776..0976472eead8ce098bec8809bfdc536ab30fc1f3 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigR3_Tier0.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigR3_Tier0.h @@ -27,7 +27,7 @@ #include "TrigInDetAnalysis/TIDAVertex.h" #include "TrigInDetAnalysis/TrackSelector.h" #include "TrigInDetAnalysisUtils/T_AnalysisConfig.h" -#include "TrigInDetAnalysisUtils/TagNProbe2.h" +#include "TrigInDetAnalysisUtils/TagNProbe.h" #include "TrigInDetAnalysisExample/AnalysisR3_Tier0.h" #include "TrigInDetAnalysisExample/VtxAnalysis.h" @@ -110,7 +110,7 @@ public: TrackFilter* testFilter, TrackFilter* referenceFilter, TrackAssociator* associator, TrackAnalysis* analysis, - TagNProbe2* TnP_tool = 0) : + TagNProbe* TnP_tool = 0) : T_AnalysisConfig( analysisInstanceName, testChainName, testType, testKey, referenceChainName, referenceType, referenceKey, @@ -229,7 +229,7 @@ protected: virtual void loop() { - const TagNProbe2* pTnP_tool = m_TnP_tool; + const TagNProbe* pTnP_tool = m_TnP_tool; if( m_provider->msg().level() <= MSG::VERBOSE) { m_provider->msg(MSG::VERBOSE) << "AnalysisConfigR3_Tier0::loop() for " << T_AnalysisConfig::m_analysisInstanceName << endmsg; @@ -1256,7 +1256,7 @@ protected: bool m_containTracks; - TagNProbe2* m_TnP_tool ; + TagNProbe* m_TnP_tool ; bool m_tnp_flag; diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigR3Mon.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigR3Mon.cxx index c48e38d30d704c0566295aac9ecb2e7983ed6736..c3c85f7ab2bee444b6d41f4fef16bbde8384b658 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigR3Mon.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigR3Mon.cxx @@ -13,7 +13,7 @@ #include "TrigInDetAnalysisUtils/Filters.h" #include "TrigInDetAnalysisUtils/Filter_Track.h" -#include "TrigInDetAnalysisUtils/TagNProbe2.h" +#include "TrigInDetAnalysisUtils/TagNProbe.h" // #include "AthenaMonitoring/AthenaMonManager.h" // #include "AthenaMonitoring/ManagedMonitorToolTest.h" @@ -385,7 +385,7 @@ StatusCode TrigR3Mon::bookHistograms() { ChainString probe = m_chainNames[i] ; - TagNProbe2* tnp = 0; + TagNProbe* tnp = 0; if ( probe.extra().find("probe")!=std::string::npos ) { @@ -407,8 +407,8 @@ StatusCode TrigR3Mon::bookHistograms() { double massMin = 40; double massMax = 150; - if ( m_mcTruth ) tnp = new TagNProbe2( "Truth", massMin, massMax ); - else tnp = new TagNProbe2( "Offline", massMin, massMax ); + if ( m_mcTruth ) tnp = new TagNProbe( "Truth", massMin, massMax ); + else tnp = new TagNProbe( "Offline", massMin, massMax ); tnp->tag(tag) ; tnp->probe(probe) ; @@ -423,7 +423,7 @@ StatusCode TrigR3Mon::bookHistograms() { /// can only iuse R3 navigation now - if ( m_tdt->getNavigationFormat() != "TriggerElement" ) { + { ATH_MSG_INFO( "configure analysis: " << m_chainNames[i] ); diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigTestBase.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigTestBase.cxx index 142170f760d3b7c88e0e386427f9c6c1facf98d3..661c22cd89b311af3a2cbf5fc7489b7898ebc06a 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigTestBase.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/TrigTestBase.cxx @@ -380,7 +380,7 @@ StatusCode TrigTestBase::book(bool newEventsBlock, bool newLumiBlock, bool newRu // tag and probe object creation for (unsigned i=0; itag(tag); tnp->probe(probe); ATH_MSG_DEBUG( "Tag and probe pair found: " + tag + " : " + probe ); diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.cxx index 6581db1df25aa98396b13df88540cbdfadde6d9d..b473a1ff66411505b3c7ff6b2bce2dd79942c575 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.cxx @@ -65,6 +65,8 @@ void ConfAnalysis::initialise() { void ConfAnalysis::initialiseInternal() { + if ( m_initialised ) return; + m_initialised = true; // std::cout << "ConfAnalysis::initialise() " << name() << std::endl; @@ -314,6 +316,14 @@ void ConfAnalysis::initialiseInternal() { addHistogram( new TH1F( "roi_dphi", "roi_dphi", 50, -1, 1 ) ); addHistogram( new TH1F( "roi_dR", "roi_dR", 50, 0, 1 ) ); + // tag and probe invariant mass histograms + if ( m_TnP_tool ) { + m_invmass = new TH1F( "invmass", "invariant mass;mass [GeV]", 320, 0, 200 ); + m_invmassObj = new TH1F( "invmassObj", "invariant mass;mass [GeV]", 320, 0, 200 ); + addHistogram( m_invmass ); + addHistogram( m_invmassObj ); + } + // efficiencies and purities eff_pt = new Efficiency( find("pT"), "pT_eff" ); eff_pt->Hist()->GetXaxis()->SetTitle("P_{T} [GeV]"); @@ -891,7 +901,6 @@ void ConfAnalysis::finalise() { if ( !m_initialised ) return; - std::cout << "ConfAnalysis::finalise() " << name(); if ( name().size()<19 ) std::cout << "\t"; @@ -899,6 +908,7 @@ void ConfAnalysis::finalise() { if ( name().size()<41 ) std::cout << "\t"; if ( name().size()<52 ) std::cout << "\t"; + std::cout << "\tNreco " << Nreco << "\tNref " << Nref << "\tNmatched " << Nmatched; @@ -918,7 +928,6 @@ void ConfAnalysis::finalise() { std::map::iterator hitr=m_histos.begin(); std::map::iterator hend=m_histos.end(); for ( ; hitr!=hend ; hitr++ ) hitr->second->Write(); - // std::cout << "DBG >" << eff_pt->Hist()->GetName() << "< DBG" << std::endl; // std::vector heff = { eff_pt, @@ -935,7 +944,7 @@ void ConfAnalysis::finalise() { eff_roi_deta, eff_roi_dphi, eff_roi_dR }; - + for ( unsigned i=0 ; ifinalise(); heff[i]->Bayes()->Write( ( heff[i]->name()+"_tg" ).c_str() ); @@ -943,7 +952,6 @@ void ConfAnalysis::finalise() { // std::cout << "DBG >" << purity_pt->Hist()->GetName() << "< DBG" << std::endl; - eff_vs_mult->finalise(); // Normalise(n_vtx_tracks); @@ -989,8 +997,6 @@ void ConfAnalysis::finalise() { mdeltaR_v_eta->Finalise(); mdeltaR_v_eta->Write(); mdeltaR_v_pt->Finalise(); mdeltaR_v_pt->Write(); - - for ( unsigned i=rDd0res.size() ; i-- ; ) { rDd0res[i]->Finalise(Resplot::FitNull95); rDd0res[i]->Write(); @@ -1174,10 +1180,10 @@ void ConfAnalysis::execute(const std::vector& reftracks, TrigObjectMatcher* objects ) { // leave this commented code in for debug purposes ... - // if ( objects ) std::cout << "TrigObjectMatcher: " << objects << std::endl; + // if ( objects ) std::cout << "TrigObjectMatcher: " << objects << std::endl; - if ( !m_initialised ) initialiseInternal(); - + if ( !m_initialised ) initialiseInternal(); + if ( m_print ) { std::cout << "ConfAnalysis::execute() \t " << name() << "\tref " << reftracks.size() diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.h b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.h index 761d2178cb22ac17295223224c89272285a32137..93a0daffea7ef5b0f3a469ba6e65546b3737d70e 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.h @@ -24,6 +24,7 @@ #include "TrigInDetAnalysis/TrigObjectMatcher.h" #include "TrigInDetAnalysisExample/ChainString.h" +#include "TrigInDetAnalysisUtils/TagNProbe.h" #include "Resplot.h" @@ -50,23 +51,26 @@ class ConfAnalysis : public TrackAnalysis { public: - ConfAnalysis( const std::string& name, const ChainString& config ) : + ConfAnalysis( const std::string& name, const ChainString& config, TagNProbe* TnP_tool=0 ) : TrackAnalysis( clean(name) ), mconfig(config), Nreco(0), Nref(0), Nmatched(0), m_print(false), m_roi(0), m_initialised(false), m_initialiseFirstEvent(false) { // , m_lfirst(true) { std::cout << "ConfAnalysis::ConfAnalysis() " << TrackAnalysis::name() << " ..." << std::endl; - } - + setTnPtool( TnP_tool ); + } + ~ConfAnalysis() { // std::cout << "ConfAnalysis::~ConfAnalysis() " << name() << std::endl; std::map::iterator hitr=m_histos.begin(); std::map::iterator hend=m_histos.end(); for ( ; hitr!=hend ; hitr++ ) delete hitr->second; - //2D histograms + //2D histograms std::map::iterator hitr2D=m_histos2D.begin(); - std::map::iterator hend2D=m_histos2D.end(); + std::map::iterator hend2D=m_histos2D.end(); for ( ; hitr2D!=hend2D ; hitr2D++ ) delete hitr2D->second; + // tag and probe object + if ( m_TnP_tool ) delete m_TnP_tool; } virtual void initialise(); @@ -108,6 +112,16 @@ public: const ChainString& config() const { return mconfig; } + // methods for tag and probe invariant mass plots + + void setTnPtool(TagNProbe* TnP_tool) { m_TnP_tool = TnP_tool; } + + virtual TagNProbe* getTnPtool() { return m_TnP_tool; } + + virtual TH1F* getHist_invmass() { return m_invmass; } + + virtual TH1F* getHist_invmassObj() { return m_invmassObj; } + private: void addHistogram( TH1F* h ) { @@ -140,6 +154,13 @@ private: std::map m_histos; std::map m_histos2D; + // tag and probe invariant mass histograms + TH1F* m_invmass = 0; + TH1F* m_invmassObj = 0; + + // tag and probe object + TagNProbe* m_TnP_tool; + Efficiency* eff_pt = 0; Efficiency* eff_ptp = 0; Efficiency* eff_ptm = 0; diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx index ce84ce93cc4ef1585e1e8921b6c29f8c07ae46aa..b982ecb95b5fd220970ca3f2ccce7aeb2949568a 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx @@ -427,8 +427,6 @@ int main(int argc, char** argv) bool useoldrms = true; bool nofit = false; - bool doTnP = false; // added for tagNprobe - bool doTnP_histos = false; // added for tagNprobe std::string vertexSelection = ""; std::string vertexSelection_rec = ""; @@ -448,8 +446,6 @@ int main(int argc, char** argv) refChain = argv[i]; } else if ( std::string(argv[i])=="--rms" ) useoldrms = false; - else if ( std::string(argv[i])=="--tnp" ) doTnP = true; - else if ( std::string(argv[i])=="--tnph" ) doTnP_histos = true; else if ( std::string(argv[i])=="-n" || std::string(argv[i])=="--nofit" ) nofit = true; else if ( std::string(argv[i])=="-t" || std::string(argv[i])=="--testChain" ) { if ( ++i>=argc ) return usage(argv[0], -1); @@ -570,10 +566,6 @@ int main(int argc, char** argv) int ntracks = 0; - /// Zmass window cuts for Tag&Probe analysis - double ZmassMax = 110.; // GeV - double ZmassMin = 70.; // GeV - //bool printflag = false; // JK removed (unused) bool rotate_testtracks = false; @@ -646,12 +638,6 @@ int main(int argc, char** argv) if ( inputdata.isTagDefined("Rmatch") ) Rmatch = inputdata.GetValue("Rmatch"); - /// set upper and lower Zmass window cuts from datafile for Tag&Probe analysis - if ( inputdata.isTagDefined("ZmassMax") ) ZmassMax = inputdata.GetValue("ZmassMax"); - if ( inputdata.isTagDefined("ZmassMin") ) ZmassMin = inputdata.GetValue("ZmassMin"); - /// set doTnP_histos flag from datafile for Tag&Probe analysis - if ( inputdata.isTagDefined("doTnPHistos") ) doTnP_histos = ( inputdata.GetValue("doTnPHistos")==0 ? false : true ); - std::string useMatcher = "DeltaR"; if ( inputdata.isTagDefined("UseMatcher") ) useMatcher = inputdata.GetString("UseMatcher"); @@ -672,32 +658,6 @@ int main(int argc, char** argv) else if ( inputdata.isTagDefined("testChain") ) testChains.push_back( inputdata.GetString("testChain") ); } - /// get the tag and probe chains for Tag&Probe analysis - - TagNProbe* TnP_tool = 0; // declare T&P tool as null pointer - - if ( inputdata.isTagDefined("TagnProbe") ) { - - /// The TagnProbe chain name vector is stuctured in pairs - /// Each pair has the strucure: tag chain - probe chain - - TnP_tool = new TagNProbe(); // initialise T&P tool - - testChains.clear(); // delete the old testChain vector - - /// get the Tag&Probe chain name vector - std::vector tnpChains = inputdata.GetStringVector("TagnProbe"); - - TnP_tool->FillMap( tnpChains ); // fill tag/probe chains map for bookkeeping - - doTnP = TnP_tool->isTnP(); // set the T&P flag - if ( !doTnP ) doTnP_histos = false; // set this flag to false if doTnP is false - - testChains = TnP_tool->GetProbeChainNames(); // replace testChains - - } - - /// new code - can extract vtx name, pt, any extra options that we want, /// but also chop off everythiung after :post @@ -1128,10 +1088,52 @@ int main(int argc, char** argv) // std::cout << "chain name " << chainname << "\t:" << chainnames.back() << " : " << chainnames.size() << std::endl; + // tag and probe object creation and configuration + + TagNProbe* TnP_tool = 0; + ChainString probe = chainConfig[i]; + + if ( probe.extra().find("_tag")!=std::string::npos ) continue; + + // probe can be the .head() so convert m_chainNames to a ChainString and search the .extra() specifically + size_t p = probe.extra().find("_probe"); + + if ( p!=std::string::npos ) { + + std::string probe_key = probe.extra().erase( p, 6) ; + + for ( unsigned j=0 ; jtag(tag); + TnP_tool->probe(probe); + std::cout << "Tag and probe pair found! \nTag : " << tag << "\nProbe: " << probe <initialiseFirstEvent(initialiseFirstEvent); analy_conf->initialise(); @@ -1170,9 +1172,19 @@ int main(int argc, char** argv) // for (unsigned int ic=0 ; ic::value_type( chainname, analy_conf ) ); + analyses.push_back(analy_conf); + } + else { + std::cerr << "WARNING: Duplicated chain" + << "\n" + << "---------------------------------" + << "---------------------------------" + << "---------------------------------" << std::endl; + continue; + } std::cout << "analysis: " << chainname << "\t" << analy_conf << "\n" @@ -1190,9 +1202,6 @@ int main(int argc, char** argv) analyses.push_back(analp); } - /// filling map for Tag&Probe invariant mass histograms - if ( doTnP_histos ) TnP_tool->BookMinvHisto( chainname ); - } std::cout << "main() finished looping" << std::endl; @@ -1773,18 +1782,6 @@ int main(int argc, char** argv) std::cout << "reference chain:\n" << *refchain << std::endl; } - /// configure the T&P tool for this event, if doTnP = true - if ( doTnP ) { - TnP_tool->ResetEventConfiguration(); /// reset the TnP_tool for this event - - /// do the event-by-event configuration - TnP_tool->SetEventConfiguration( - &refTracks, refFilter, // offline tracks and filter - refChain, // offline chain name - &tom, // trigger object matcher - ZmassMin, ZmassMax ); // set the Zmass range - } - for ( unsigned ic=0 ; icchains().size() ; ic++ ) { TIDA::Chain& chain = track_ev->chains()[ic]; @@ -1798,27 +1795,29 @@ int main(int argc, char** argv) if ( analitr==analysis.end() ) continue; - - if ( debugPrintout ) { - std::cout << "test chain:\n" << chain << std::endl; + if ( debugPrintout ) { + std::cout << "test chain:\n" << chain << std::endl; } - - std::vector rois; /// these are the rois to process - - if ( doTnP ) { - /// if doTnP = true, do the T&P selection and get the vector of RoIs - rois = TnP_tool->GetRois( &chain, track_ev->chains() ); - /// now the TnP_tool object contains all the info on the good probes that have been found - /// including, for each one of them, the invariant mass(es) calculated with the - /// corresponding tag(s). One can access to these info at any time in the following lines + ConfAnalysis* cf = dynamic_cast(analitr->second); + + std::vector rois; /// these are the rois to process + + // tag and probe object retreival and filling of the roi vector + TagNProbe* TnP_tool = cf->getTnPtool(); + if ( TnP_tool ) { + foutdir->cd(); + cf->initialiseInternal(); + // changes to output directory and books the invariant mass histograms + TH1F* m_invmass = cf->getHist_invmass(); + TH1F* m_invmass_obj = cf->getHist_invmassObj(); + rois = TnP_tool->GetRois( track_ev->chains(), &refTracks, refFilter, m_invmass, m_invmass_obj ); } else { - /// if doTnP==false, do std analysis and fill the rois vector from chain - rois.reserve( chain.size() ); - for ( size_t ir=0 ; irFillMinvHisto( chain.name(), ir ); - } - testTracks.clear(); testTracks.selectTracks( troi.tracks() ); @@ -2029,8 +2020,6 @@ int main(int argc, char** argv) /// remove any tracks below the pt threshold if one is specifed for the analysis - ConfAnalysis* cf = dynamic_cast( analitr->second ); - if ( cf ) { std::string ptconfig = cf->config().postvalue("pt"); if ( ptconfig!="" ) { @@ -2293,13 +2282,6 @@ int main(int argc, char** argv) delete analyses[i]; } - /// write out the histograms - if ( doTnP ) { - // saving Minv histos for Tag&Probe analysis if doTnP_histos = true - if ( doTnP_histos ) TnP_tool->WriteMinvHisto( foutdir ); - delete TnP_tool; // deleting T&P tool - } - foutput.Write(); foutput.Close(); diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat index 9c15bd454c6603ff8a1ae15cd53fd6eaca5f3976..862bdb0204a5f7a3fe6d46d054bed066dff0e7bd 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat @@ -58,6 +58,15 @@ testChains = { "HLT_e5_lhvloose_nopix_lrtloose_idperf_probe_g25_medium_L1EM20VH:HLT_IDTrack_ElecLRT_FTF:HLT_Roi_FastElectron_LRT:0", "HLT_e5_lhvloose_nopix_lrtloose_idperf_probe_g25_medium_L1EM20VH:HLT_IDTrack_ElecLRT_IDTrig:HLT_Roi_FastElectron_LRT:0", + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:extra=el_tag:roi=HLT_Roi_FastElectron:te=0", + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_FTF:extra=el_probe:roi=HLT_Roi_FastElectron:te=1", + + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:extra=el_tag:te=0", + "HLT_e26_lhtight_e14_etcut_idperf_nogsf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_IDTrig:extra=el_probe:te=1", + + "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_GSF:extra=el_tag:te=0", + "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:key=HLT_IDTrack_Electron_GSF:extra=el_probe:te=1", + "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauCore_FTF:HLT_Roi_TauCore", "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_TauIso_FTF:HLT_Roi_TauIso", "HLT_tau25_idperf_tracktwo_L1TAU12IM:HLT_IDTrack_Tau_IDTrig:HLT_Roi_TauIso", diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-TnP.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-TnP.dat deleted file mode 100755 index 747a00e695882da1b39d22739910d998a840b386..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-TnP.dat +++ /dev/null @@ -1,42 +0,0 @@ -// emacs: this is -*- c++ -*- - -#include "TIDAdata_cuts.dat" - -ZmassMin = 0.0; -ZmassMax = 110.0; - -doTnPHistos = 1; - - -refChain = "Truth"; -//refChain = "Offline"; -//refChain = "Electrons"; -//refChain = "Muons"; -//refChain = "Taus"; - - -MinVertices = 0; - - -// #include "TIDAdata-chains-run3.dat" - -testChains = {}; - - -InitialiseFirstEvent = 1; - -outputFile = "data-output.root"; -DataFiles = { "TrkNtuple-0000.root"}; -//DataSets = {"./"} - - -#include "TIDAbeam.dat" - -TagnProbe = { - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:1", - - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:1" -}; - diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-offline-TnP.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-offline-TnP.dat deleted file mode 100755 index 64ce7e2cdd42074b87769a64c13c8f9024105647..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-offline-TnP.dat +++ /dev/null @@ -1,38 +0,0 @@ -// emacs: this is -*- c++ -*- - -#include "TIDAdata_cuts-offline.dat" - -ZmassMin = 0.0; -ZmassMax = 110.0; - -doTnPHistos = 1; - -//refChain = "Truth"; -refChain = "Offline"; -//refChain = "Electrons"; -//refChain = "Muons"; -//refChain = "Taus"; - -MinVertices = 0; - -/// do not loadthe chains for the TnP analyses -/// #include "TIDAdata-chains-run3.dat" - -testChains = {}; - -outputFile = "data-output.root"; -DataFiles = { "TrkNtuple-0000.root"}; -//DataSets = {"/eos/atlas/atlascerngroupdisk/trig-id/data18_13TeV/muon-tnp/user.maparo.00363979.physics_Main.merge.AOD.f1002_m2037-20191004-141732_EXT0"}; -//DataSets = {"/eos/atlas/atlascerngroupdisk/trig-id/data18_13TeV/muon-tnp/user.maparo.00358395.physics_Main.merge.AOD.f961_m2015-20191004-141716_EXT0"}; - -#include "TIDAbeam.dat" - - -TagnProbe = { - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:1", - - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:0", - "HLT_e26_lhtight_e14_etcut_idperf_probe_50invmAB130_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:1" -}; - diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhisto-panel-TnP.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhisto-panel-TnP.dat index 612d89ee58a870cbb6fd8008d4900baa4ded315c..33c3049d418cafd4e2ef9a25811530ea5c5fd1ec 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhisto-panel-TnP.dat +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhisto-panel-TnP.dat @@ -1,6 +1,6 @@ // emacs: this is -*- c++ -*- -panels = { eff_panel, res_panel, diff_panel, spoff_panel, sp_panel, dist_panel, trt_panel, tnp_panel }; +panels = { eff_panel, res_panel, diff_panel, spoff_panel, sp_panel, dist_panel, trt_panel }; panel_columns = { eff_panel, 3 }; @@ -63,7 +63,10 @@ dist_panel = { "a0_rec", "a0 rec", "xaxis:lin:autosym:-3:3", "Trigger a_{0} [mm]", "yaxis:log:auton", "Normalised entries", "z0", "z0", "xaxis:lin:-200:200", "Reference z_{0} [mm]", "yaxis:log:auton", "Normalised entries", - "z0_rec", "z0_rec", "xaxis:lin:-200:200", "Trigger z_{0} [mm]", "yaxis:log:auton", "Normalised entries" + "z0_rec", "z0_rec", "xaxis:lin:-200:200", "Trigger z_{0} [mm]", "yaxis:log:auton", "Normalised entries", + + "invmass", "Tracks M_{INV}^{tag+probe}", "xaxis:lin:autow", "Offline tracks M_{INV} [GeV]", "yaxis:lin:autow", "Entries" , + "invmass_obj", "Electrons M_{INV}^{tag+probe}", "xaxis:lin:autow", "Offline dielectron M_{INV} [GeV]", "yaxis:lin:autow", "Entries", }; @@ -96,8 +99,3 @@ trt_panel = { }; -tnp_panel = { - "Minv_TnP", "Tracks M_{INV}^{tag+probe}", "xaxis:lin:autow", "Offline tracks M_{INV} [GeV]", "yaxis:lin:autow", "" , - "Minv_obj_TnP", "Electrons M_{INV}^{tag+probe}", "xaxis:lin:autow", "Offline dielectron M_{INV} [GeV]", "yaxis:lin:autow", "" -}; - diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe.h b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe.h index 51f53e9eff618c081654d175f31cf67321f7aacc..d54e99c8fd9a404c613445e8a6ec01519397419d 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe.h @@ -2,221 +2,182 @@ /** ** @file TagNProbe.h ** - ** @author marco aparo - ** @date Fri 02 Jul 2021 13:30:00 CET + ** @author mark sutton + ** @date Sat Apr 9 12:55:17 CEST 2022 ** - ** Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + ** Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration **/ #ifndef TIDAUTILS_TAGNPROBE_H #define TIDAUTILS_TAGNPROBE_H -#include +#include -#include "TLorentzVector.h" +#include "TrigInDetAnalysis/TIDAChain.h" +#include "TrigInDetAnalysis/TIDARoiDescriptor.h" +#include "TrigInDetAnalysis/TrigObjectMatcher.h" +#include "TrigInDetAnalysis/Track.h" -#include "TrigInDetAnalysis/TIDAEvent.h" #include "TrigInDetAnalysis/TrackSelector.h" #include "TrigInDetAnalysisUtils/Filters.h" -#include "TrigInDetAnalysisUtils/Filter_Offline2017.h" -#include "TrigInDetAnalysis/TrackSelector.h" -#include "TrigInDetAnalysis/TrigObjectMatcher.h" -#include "TH1D.h" -#include -#include -#include - -#include "TrigInDetAnalysis/TrackAnalysis.h" -#include "TrigInDetAnalysis/Track.h" -#include "TrigInDetAnalysis/TIDDirectory.h" -#include "TrigInDetAnalysis/Efficiency.h" -#include "TrigInDetAnalysis/TIDARoiDescriptor.h" +#include "TLorentzVector.h" class TagNProbe { public: - TagNProbe() { } - + TagNProbe( const std::string& refName, double massMin, double massMax, bool unique_flag=true ); + virtual ~TagNProbe() { } + /// getters and setters - /// configuration methods - - void SetEventConfiguration( - TrackSelector * refTracks, // reference tracks - TrackFilter* refFilter, // reference filter - std::string refName, // reference objects name - TrigObjectMatcher* tom, // trigger object matcher - double ZmassMin, // ZmassMin - double ZmassMax, // ZmassMax - bool unique_flag=true ) { // unique flag (default=true) - m_refTracks = refTracks; - m_refFilter = refFilter; - m_particleType = refName; - m_tom = tom; - m_ZmassMin = ZmassMin; - m_ZmassMax = ZmassMax; - m_unique = unique_flag; - } - - void ResetEventConfiguration() { - m_refTracks = 0; - m_refFilter = 0; - m_particleType = ""; - m_tom = 0; - m_ZmassMin = 0.; - m_ZmassMax = 999.; - m_unique = false; - } - - void SetUniqueFlag( bool flag ) { m_unique = flag; } - - void SetParticleType( std::string type ) { m_particleType = type; } - - void SetZmassWindow( double ZmassMin, double ZmassMax ) { m_ZmassMin = ZmassMin; m_ZmassMax = ZmassMax; } - - void SetObjMatcher( TrigObjectMatcher* tom ) { m_tom = tom; } - - void SetOfflineTracks( TrackSelector * refTracks, TrackFilter* refFilter ) { - m_refTracks = refTracks; - m_refFilter = refFilter; - } - - void SetChains( TIDA::Chain * chain, TIDA::Chain * chain_tnp ) { - m_chain = chain; - m_chain_tnp = chain_tnp; - } - - template - void Fill( T* h, T* h1, int i ) { - /// don't need to check both these, we can just call this as many times as we like, - /// could pass in the vector even so that - // we leave the old code in, but commented, since we are still developing, so once - // we know everything is working we can delete all the older code - // if ( m_masses[i].size() == m_masses_obj[i].size() && m_masses[i].size() > 0 ) { - - /// don't understand this - why is this method filling lots of masses - /// from an vector of masses from 0 up to the input index ? - /// isn't this index just the index of the roi ? Why the loop ? - for ( size_t im=0 ; imFill( m_masses[i].at(im) ); - } - for ( size_t im=0 ; imFill( m_masses_obj[i].at(im) ); - } - } - - - /// probe searching method - - bool FindProbes(); - - void FindTIDAChains( std::vector& chains ) ; - - /// getter methods + /// could be moved to the constructor now ... + void tag( const std::string& chainName ) { m_tagChainName = chainName; } + void probe( const std::string& chainName ) { m_probeChainName = chainName; } - std::vector GetProbes() { return m_probes; } + const std::string& tag() const { return m_tagChainName; } + const std::string& probe() const { return m_probeChainName; } - std::vector GetTags( unsigned int probe_index=0 ) { return m_tags[ probe_index ]; } - - std::vector GetInvMasses( unsigned int probe_index=0 ) { return m_masses[ probe_index ]; } - - std::vector GetInvMasses_obj( unsigned int probe_index=0 ) { return m_masses_obj[ probe_index ]; } - - std::vector GetRois( TIDA::Chain * chain, std::vector& chains ); - - std::vector GetRois( std::vector& chains ); - - void tag( const std::string& chainName ) { m_tagChainName = chainName ; } - - const std::string& tag() { return m_tagChainName ; } - - void probe( const std::string& chainName ) { m_probeChainName = chainName ; } - - const std::string& probe() { return m_probeChainName ; } +public: - TIDA::Chain* GetTIDAProbe() { return m_chain_tnp ; } + template + std::vector GetRois( std::vector& chains, + const TrackSelector* refTracks, + TrackFilter* refFilter, + T* hmass, + T* hmass_obj, + TrigObjectMatcher* tom=0 ) const { - TIDA::Chain* GetTIDATag() { return m_chain ; } + std::vector probes; - TH1D* GetMinvHisto() { return m_hMinv ; } + TIDA::Chain* chain_tag = findChain( tag(), chains ); + TIDA::Chain* chain_probe = findChain( probe(), chains ); - TH1D* GetMinvObjHisto() { return m_hMinv_obj ; } + if ( chain_tag==0 || chain_probe==0 ) return probes; + // loop for possible probes + for ( size_t ip=0 ; ipsize() ; ip++ ) { + + TIDA::Roi& proi = chain_probe->rois()[ip]; + + TIDARoiDescriptor roi_probe( proi.roi() ); + + bool found_tnp = false; + + // loop for possible tags + for ( size_t it=0 ; itsize() ; it++ ) { + + TIDA::Roi& troi = chain_tag->rois()[it]; + TIDARoiDescriptor roi_tag( troi.roi() ); + + /// tag and probe are the same: skip this tag + if ( roi_probe == roi_tag ) continue; + + if ( selection( troi, proi, refTracks, refFilter, hmass, hmass_obj, tom ) ) { + found_tnp = true; + if ( m_unique ) break; + } + + } // end loop on tags + + if ( found_tnp ) probes.push_back( &proi ); + + } // end loop on probes + + return probes; + + } - /// utility methods +protected: - void FillMap( std::vector& tnpChains ); + double pt( const TIDA::Track* t ) const { return t->pT(); } + double pt( const TrackTrigObject* t ) const { return t->pt(); } - std::vector GetProbeChainNames() { return m_probe_chain_names; } - - bool isTnP() { return m_tnp_map.size()>0; } - - TIDA::Chain* GetTagChain( std::string probe_name, std::vector& chains ); + template + double mass( const T* t1, const T* t2 ) const { + TLorentzVector v1; + v1.SetPtEtaPhiM( pt(t1)*0.001, t1->eta(), t1->phi(), m_mass ); + TLorentzVector v2; + v2.SetPtEtaPhiM( pt(t2)*0.001, t2->eta(), t2->phi(), m_mass ); + return (v1+v2).M(); + } - void BookMinvHisto( std::string chain_name ); - void BookMinvHisto(); + template + bool selection( const TIDA::Roi& troi, const TIDA::Roi& proi, + const TrackSelector* refTracks, + TrackFilter* refFilter, + T* hmass, + T* hmass_obj, + TrigObjectMatcher* tom=0) const { + + /// get reference tracks from the tag roi + TIDARoiDescriptor roi_tag( troi.roi() ); - void FillMinvHisto( std::string chain_name, unsigned int probe_index ); + dynamic_cast(refFilter)->setRoi( &roi_tag ); - void FillMinvHisto( unsigned int probe_index ); + std::vector refp_tag = refTracks->tracks( refFilter ); - void WriteMinvHisto( TDirectory* foutdir ); + /// get reference tracks from the probe roi + TIDARoiDescriptor roi_probe( proi.roi() ); + dynamic_cast( refFilter )->setRoi( &roi_probe ); - /// internal methods for computation (protected) + std::vector refp_probe = refTracks->tracks( refFilter ); -protected: + /// loop over tag ref tracks + bool found = false; - std::pair selection( TIDA::Roi & troi, TIDA::Roi & proi ); + for ( size_t it=0; itz0() - refp_probe[ip]->z0() ); + + if ( invmass_obj>m_massMin && invmass_objFill( invmass ); + hmass_obj->Fill( invmass_obj ); + found = true; + } + } + } - /// internally used variables + return found; -private: + } - TrackSelector * m_refTracks; - TrackFilter * m_refFilter; - TIDA::Chain * m_chain; - TIDA::Chain * m_chain_tnp; + double mass_obj( const TIDA::Track* t1, const TIDA::Track* t2, TrigObjectMatcher* tom=0 ) const; - std::string m_probeChainName ; - std::string m_tagChainName ; + TIDA::Chain* findChain( const std::string& chainname, std::vector& chains ) const; - std::vector m_probes; - std::vector< std::vector > m_masses; - std::vector< std::vector > m_masses_obj; - std::vector< std::vector > m_tags; - bool m_unique; +private: std::string m_particleType; - double m_ZmassMin, m_ZmassMax; + double m_mass; - TrigObjectMatcher* m_tom; + double m_massMin; + double m_massMax; - /// supporting variables for utility methods + bool m_unique; - std::map m_tnp_map; - std::vector m_probe_chain_names; + std::string m_probeChainName ; + std::string m_tagChainName ; - std::map m_hMinv_map; - std::map m_hMinv_obj_map; +}; - TH1D* m_hMinv ; - TH1D* m_hMinv_obj ; -}; +#endif /// TIDAUTILS_TAGNPROBE_H + -#endif // TIDAUTILS_TAGNPROBE_H diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe2.h b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe2.h deleted file mode 100644 index 73f74c105503c409e2a474bd49de798d304f7e2a..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/TagNProbe2.h +++ /dev/null @@ -1,183 +0,0 @@ -/// emacs: this is -*- c++ -*- -/** - ** @file TagNProbe2.h - ** - ** @author mark sutton - ** @date Sat Apr 9 12:55:17 CEST 2022 - ** - ** Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration - **/ - - -#ifndef TIDAUTILS_TAGNPROBE2_H -#define TIDAUTILS_TAGNPROBE2_H - -#include - -#include "TrigInDetAnalysis/TIDAChain.h" -#include "TrigInDetAnalysis/TIDARoiDescriptor.h" -#include "TrigInDetAnalysis/TrigObjectMatcher.h" -#include "TrigInDetAnalysis/Track.h" - -#include "TrigInDetAnalysis/TrackSelector.h" -#include "TrigInDetAnalysisUtils/Filters.h" - -#include "TLorentzVector.h" - - -class TagNProbe2 { - -public: - - TagNProbe2( const std::string& refName, double massMin, double massMax, bool unique_flag=true ); - - virtual ~TagNProbe2() { } - - /// getters and setters - - /// could be moved to the constructor now ... - void tag( const std::string& chainName ) { m_tagChainName = chainName; } - void probe( const std::string& chainName ) { m_probeChainName = chainName; } - - const std::string& tag() const { return m_tagChainName; } - const std::string& probe() const { return m_probeChainName; } - -public: - - template - std::vector GetRois( std::vector& chains, - const TrackSelector* refTracks, - TrackFilter* refFilter, - T* hmass, - T* hmass_obj, - TrigObjectMatcher* tom=0 ) const { - - std::vector probes; - - TIDA::Chain* chain_tag = findChain( tag(), chains ); - TIDA::Chain* chain_probe = findChain( probe(), chains ); - - if ( chain_tag==0 || chain_probe==0 ) return probes; - - // loop for possible probes - for ( size_t ip=0 ; ipsize() ; ip++ ) { - - TIDA::Roi& proi = chain_probe->rois()[ip]; - - TIDARoiDescriptor roi_probe( proi.roi() ); - - bool found_tnp = false; - - // loop for possible tags - for ( size_t it=0 ; itsize() ; it++ ) { - - TIDA::Roi& troi = chain_tag->rois()[it]; - TIDARoiDescriptor roi_tag( troi.roi() ); - - /// tag and probe are the same: skip this tag - if ( roi_probe == roi_tag ) continue; - - if ( selection( troi, proi, refTracks, refFilter, hmass, hmass_obj, tom ) ) { - found_tnp = true; - if ( m_unique ) break; - } - - } // end loop on tags - - if ( found_tnp ) probes.push_back( &proi ); - - } // end loop on probes - - return probes; - - } - -protected: - - double pt( const TIDA::Track* t ) const { return t->pT(); } - double pt( const TrackTrigObject* t ) const { return t->pt(); } - - template - double mass( const T* t1, const T* t2 ) const { - TLorentzVector v1; - v1.SetPtEtaPhiM( pt(t1)*0.001, t1->eta(), t1->phi(), m_mass ); - TLorentzVector v2; - v2.SetPtEtaPhiM( pt(t2)*0.001, t2->eta(), t2->phi(), m_mass ); - return (v1+v2).M(); - } - - - template - bool selection( const TIDA::Roi& troi, const TIDA::Roi& proi, - const TrackSelector* refTracks, - TrackFilter* refFilter, - T* hmass, - T* hmass_obj, - TrigObjectMatcher* tom=0) const { - - /// get reference tracks from the tag roi - TIDARoiDescriptor roi_tag( troi.roi() ); - - dynamic_cast(refFilter)->setRoi( &roi_tag ); - - std::vector refp_tag = refTracks->tracks( refFilter ); - - /// get reference tracks from the probe roi - TIDARoiDescriptor roi_probe( proi.roi() ); - - dynamic_cast( refFilter )->setRoi( &roi_probe ); - - std::vector refp_probe = refTracks->tracks( refFilter ); - - /// loop over tag ref tracks - bool found = false; - - for ( size_t it=0; itz0() - refp_probe[ip]->z0() ); - - if ( invmass_obj>m_massMin && invmass_objFill( invmass ); - hmass_obj->Fill( invmass_obj ); - found = true; - } - - } - } - - return found; - - } - - - double mass_obj( const TIDA::Track* t1, const TIDA::Track* t2, TrigObjectMatcher* tom=0 ) const; - - TIDA::Chain* findChain( const std::string& chainname, std::vector& chains ) const; - - -private: - - std::string m_particleType; - - double m_mass; - - double m_massMin; - double m_massMax; - - bool m_unique; - - std::string m_probeChainName ; - std::string m_tagChainName ; - -}; - - -#endif /// TIDAUTILS_TAGNPROBE2_H - - diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe.cxx index c85753f5dc7a352856736a1b86daadcfb6f67c71..49140186e09bc1ac30c0d8a7f881bf58ae66f256 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe.cxx @@ -1,408 +1,51 @@ /** ** @file TagNProbe.cxx ** - ** @author marco aparo - ** @date Fri 02 Jul 2021 13:30:00 CET + ** @author mark sutton + ** @date Sat Apr 9 12:55:17 CEST 2022 ** - ** Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + ** Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration **/ #include "TrigInDetAnalysisUtils/TagNProbe.h" -double TagNProbe::computeZ_obj( TIDA::Track* t1, TIDA::Track* t2 ) { - - double muonMass = 0.10565; // GeV - double electronMass = 0.000510; // GeV - double tauMass = 1.77686; // GeV - - /// get tag and probe particle type and setting mass - - TString tnpType( m_particleType ); - double mass = 0.; - if ( tnpType.Contains("Muon") ) mass = muonMass; - else if ( tnpType.Contains("Electron") ) mass = electronMass; - else if ( tnpType.Contains("Tau") ) mass = tauMass; - - TLorentzVector v1, v2; - double z0_1, z0_2; - if ( tnpType.Contains("Electron") ) { - - if ( m_tom != 0 && !m_tom->status() ) - return -1.0; - - const TrackTrigObject* tobj1 = m_tom->object( t1->id() ); - const TrackTrigObject* tobj2 = m_tom->object( t2->id() ); - - v1.SetPtEtaPhiM( (tobj1->pt())/1000., tobj1->eta(), tobj1->phi(), mass ); - v2.SetPtEtaPhiM( (tobj2->pt())/1000., tobj2->eta(), tobj2->phi(), mass ); - z0_1 = (double)(tobj1->z0()); - z0_2 = (double)(tobj2->z0()); - } - else { - v1.SetPtEtaPhiM( (t1->pT())/1000., t1->eta(), t1->phi(), mass ); - v2.SetPtEtaPhiM( (t2->pT())/1000., t2->eta(), t2->phi(), mass ); - z0_1 = (double)(t1->z0()); - z0_2 = (double)(t2->z0()); - } - - double invMass = (double)( v1 + v2 ).M(); - double z0diff = std::fabs( z0_1 - z0_2 ); - - if ( invMass > m_ZmassMin && invMass < m_ZmassMax && z0diff < 5 ) return invMass; - - return -1.0; - -} - - - - -// ------------------------------------------------------------------ - -double TagNProbe::computeZ( TIDA::Track* t1, TIDA::Track* t2 ) { - - double muonMass = 0.10565; // GeV - double electronMass = 0.000510; // GeV - double tauMass = 1.77686; // GeV - - /// get tag and probe particle type and setting mass - - TString tnpType( m_particleType ); - double mass = 0.; - if ( tnpType.Contains("Muon") ) mass = muonMass; - else if ( tnpType.Contains("Electron") ) mass = electronMass; - else if ( tnpType.Contains("Tau") ) mass = tauMass; - - TLorentzVector v1; - v1.SetPtEtaPhiM( (t1->pT())/1000., t1->eta(), t1->phi(), mass ); - - TLorentzVector v2; - v2.SetPtEtaPhiM( (t2->pT())/1000., t2->eta(), t2->phi(), mass ); - - double invMass = (double)( v1 + v2 ).M(); - - /// this cut is performed on the object-based inv. mass - return invMass; - -} - - - - -// ------------------------------------------------------------------ - -std::pair TagNProbe::selection( TIDA::Roi& troi, TIDA::Roi& proi ) +TagNProbe::TagNProbe( const std::string& refName, double massMin, double massMax, bool unique_flag ) : + m_particleType(refName), + m_mass(0), + m_massMin(massMin), + m_massMax(massMax), + m_unique(unique_flag) { + const double muonMass = 0.10565; // GeV + const double electronMass = 0.000510; // GeV + const double tauMass = 1.77686; // GeV - TIDARoiDescriptor roi_tag( troi.roi() ); - TIDARoiDescriptor roi_probe( proi.roi() ); - - /// getting reference tracks from the tag roi - dynamic_cast< Filter_Combined* >( m_refFilter )->setRoi( &roi_tag ); - std::vector< TIDA::Track* > refp_tag = m_refTracks->tracks( m_refFilter ); - - /// getting reference tracks from the probe roi - dynamic_cast< Filter_Combined* >( m_refFilter )->setRoi( &roi_probe ); - std::vector< TIDA::Track* > refp_probe = m_refTracks->tracks( m_refFilter ); - - /// loop on tag ref tracks - for ( size_t it=0; it InvMass = std::make_pair( pair_mass, pair_mass_obj ); - if ( pair_mass_obj > 0 ) - return InvMass; - - } - - } - - std::pair pNull = std::make_pair( 0., 0. ); - - return pNull; - -} - - - - -// ------------------------------------------------------------------ - -bool TagNProbe::FindProbes() -{ - - m_probes.clear(); - m_tags.clear(); - m_masses.clear(); - m_masses_obj.clear(); - - if ( m_chain==0 || m_chain_tnp==0 ) - return false; - - // loop for possible probes - for ( size_t ip=0 ; ipsize() ; ip++ ) { - - TIDA::Roi& proi = m_chain_tnp->rois()[ ip ]; - TIDARoiDescriptor roi_probe( proi.roi() ); - - bool found_tnp = false; - - std::vector tags; - std::vector masses; - std::vector masses_obj; - - // loop for possible tags - for ( size_t it=0 ; itsize() ; it++ ) { - - TIDA::Roi& troi = m_chain->rois()[ it ]; - TIDARoiDescriptor roi_tag( troi.roi() ); - - /// tag and probe are the same: skip this tag - if ( roi_probe == roi_tag ) continue; - - std::pair InvMasses = selection( troi, proi ); - double mass = InvMasses.first; - double mass_obj = InvMasses.second; - - if ( !found_tnp && mass>0 ) found_tnp = true; - - if ( mass>0 ) { - tags.push_back( &troi ); - masses.push_back( mass ); - masses_obj.push_back( mass_obj ); - if ( m_unique ) break; - } - - } // end loop on tags - - if ( found_tnp ) { - m_probes.push_back( &proi ); - m_tags.push_back( tags ); - m_masses.push_back( masses ); - m_masses_obj.push_back( masses_obj ); - } - - } // end loop on probes - - return true; - + if ( m_particleType.find("Muon")!=std::string::npos ) m_mass = muonMass; + else if ( m_particleType.find("Electron")!=std::string::npos ) m_mass = electronMass; + else if ( m_particleType.find("Tau")!=std::string::npos ) m_mass = tauMass; } -// ------------------------------------------------------------------ -void TagNProbe::FillMap( std::vector& tnpChains ) { - /// first clear the map - m_tnp_map.clear(); +double TagNProbe::mass_obj( const TIDA::Track* t1, const TIDA::Track* t2, TrigObjectMatcher* tom ) const { - for ( size_t i=0 ; i::value_type( chain_probe_name, chain_tag_name ) ); - - /// new testChain vector is filled only with probe chain names - m_probe_chain_names.push_back( tnpChains[i+1] ); + if ( tom!=0 && tom->status() ) { + return mass( tom->object(t1->id()), tom->object(t2->id()) ); } - -} - -// ------------------------------------------------------------------ - -TIDA::Chain* TagNProbe::GetTagChain( std::string probe_name, std::vector& chains ) { - - TIDA::Chain* chain_tag = 0; - - std::map::const_iterator tnpitr = m_tnp_map.find( probe_name ); - - if ( tnpitr != m_tnp_map.end() ) { - - for ( size_t icp=0 ; icpsecond ) { - chain_tag = &( chains[icp] ); - break; - } - } + else { + return mass( t1, t2 ); } - - return chain_tag; - -} - -// ------------------------------------------------------------------ - -std::vector TagNProbe::GetRois( TIDA::Chain * chain, std::vector& chains ) { - - std::vector rois; - TIDA::Chain* chain_tag = 0; - - /// for each configured probe chain find the correspondig tag chain in the event - chain_tag = GetTagChain( chain->name(), chains ); - if ( chain_tag == 0 ) return rois; - - /// resetting the chains - m_chain = 0; - m_chain_tnp = 0; - - /// setting the chains - SetChains( chain, chain_tag ); - - /// find the probe RoIs - if ( !FindProbes() ) return rois; - - /// getting the vector of rois to process - rois = GetProbes(); - - return rois; -} - -// ------------------------------------------------------------------ - -std::vector TagNProbe::GetRois( std::vector& chains ) { - - std::vector rois; - FindTIDAChains(chains) ; - - /// find the probe RoIs - if ( !FindProbes() ) return rois; - - /// getting the vector of rois to process - rois = GetProbes(); - - return rois; -} - -// ------------------------------------------------------------------ - -void TagNProbe::BookMinvHisto( std::string chain_name ) { - - std::string hname_base = chain_name; - std::replace( hname_base.begin(), hname_base.end(), '/', '_' ); - std::replace( hname_base.begin(), hname_base.end(), ':', '_' ); - - std::string hname_1 = hname_base + "_Minv_TnP"; - std::string hname_2 = hname_base + "_Minv_obj_TnP"; - - m_hMinv_map[ chain_name ] = new TH1D( hname_1.c_str(), hname_1.c_str(), 320, 0, 200 ); - m_hMinv_obj_map[ chain_name ] = new TH1D( hname_2.c_str(), hname_2.c_str(), 320, 0, 200 ); - } -// ------------------------------------------------------------------ - -void TagNProbe::BookMinvHisto( ) { - - m_hMinv = new TH1D( "Minv_TnP", "Tag&Probe invariant mass", 320, 0, 200 ); - m_hMinv_obj = new TH1D( "Minv_obj_TnP", "Tag&Probe invariant mass (object-based)", 320, 0, 200 ); - -} - -// ------------------------------------------------------------------ - -void TagNProbe::FillMinvHisto( std::string chain_name, unsigned int probe_index ) { - - /// find the histogram for chain_name - std::map::iterator hMinv_itr = m_hMinv_map.find( chain_name ); - std::map::iterator hMinv_obj_itr = m_hMinv_obj_map.find( chain_name ); - - /// check if histod exist, if yes fill them - if ( hMinv_itr != m_hMinv_map.end() && - hMinv_obj_itr != m_hMinv_obj_map.end() && - m_masses[probe_index].size() == m_masses_obj[probe_index].size() ) { - // for ( size_t im=0 ; imsecond->Fill( m_masses[probe_index].at(im) ); - // hMinv_obj_itr->second->Fill( m_masses_obj[probe_index].at(im) ); - // } +TIDA::Chain* TagNProbe::findChain( const std::string& chainname, std::vector& chains ) const { + for ( size_t i=chains.size() ; i-- ; ) { + if ( chains[i].name() == chainname ) return &chains[i]; } + return 0; } -// ------------------------------------------------------------------ - -void TagNProbe::FillMinvHisto( unsigned int probe_index ) { - - if ( m_masses[probe_index].size() == m_masses_obj[probe_index].size() && - m_masses[probe_index].size() > 0 ) { - - // for ( size_t im=0 ; imFill( m_masses[probe_index].at(im) ); - // m_hMinv_obj->Fill( m_masses_obj[probe_index].at(im) ); - // } - } -} - -// ------------------------------------------------------------------ - -void TagNProbe::WriteMinvHisto( TDirectory* foutdir ) { - - foutdir->cd(); - - std::map::iterator hMinv_itr; - for ( hMinv_itr=m_hMinv_map.begin() ; hMinv_itr!=m_hMinv_map.end() ; hMinv_itr++ ) { - - std::string dirname = hMinv_itr->first; - std::replace( dirname.begin(), dirname.end(), '/', '_' ); - std::replace( dirname.begin(), dirname.end(), ':', '_' ); - - std::string dirpath( foutdir->GetPath() ); - dirpath += dirname; - -#if 0 - /// renaming (title and object name) histos - /// setting output TDirectory - /// Write is called in rmain.cxx - hMinv_itr->second->SetTitle( "Tag&Probe invariant mass" ); - hMinv_itr->second->SetName( "Minv_TnP" ); - hMinv_itr->second->SetDirectory( foutdir->GetDirectory( dirpath.c_str() ) ); -#endif - - foutdir->cd(); - } - - std::map::iterator hMinv_obj_itr; - for ( hMinv_obj_itr=m_hMinv_obj_map.begin() ; hMinv_obj_itr!=m_hMinv_obj_map.end() ; hMinv_obj_itr++ ) { - - std::string dirname = hMinv_obj_itr->first; - std::replace( dirname.begin(), dirname.end(), '/', '_' ); - std::replace( dirname.begin(), dirname.end(), ':', '_' ); - - std::string dirpath( foutdir->GetPath() ); - dirpath += dirname; - -#if 0 - /// renaming (title and object name) histos and - /// setting output TDirectory - /// Write is called in rmain.cxx - hMinv_obj_itr->second->SetTitle( "Tag&Probe invariant mass (object-based)" ); - hMinv_obj_itr->second->SetName( "Minv_obj_TnP" ); - hMinv_obj_itr->second->SetDirectory( foutdir->GetDirectory( dirpath.c_str() ) ); -#endif - - foutdir->cd(); - } - -} - -// ------------------------------------------------------------------ - -void TagNProbe::FindTIDAChains( std::vector& chains ) { - - for ( int ic=0 ; ic<(int)(chains.size()) ; ++ic ){ - std::string chainConfig = chains[ic].name() ; - if ( (chainConfig) == m_probeChainName ) m_chain_tnp = &( chains[ic] ) ; - if ( (chainConfig) == m_tagChainName ) m_chain = &( chains[ic] ) ; - } -} diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe2.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe2.cxx deleted file mode 100644 index beec1a880b7157cd8343a53293947d778f3b0a5b..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/src/TagNProbe2.cxx +++ /dev/null @@ -1,51 +0,0 @@ -/** - ** @file TagNProbe2.cxx - ** - ** @author mark sutton - ** @date Sat Apr 9 12:55:17 CEST 2022 - ** - ** Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration - **/ - - -#include "TrigInDetAnalysisUtils/TagNProbe2.h" - - -TagNProbe2::TagNProbe2( const std::string& refName, double massMin, double massMax, bool unique_flag ) : - m_particleType(refName), - m_mass(0), - m_massMin(massMin), - m_massMax(massMax), - m_unique(unique_flag) -{ - double muonMass = 0.10565; // GeV - double electronMass = 0.000510; // GeV - double tauMass = 1.77686; // GeV - - if ( m_particleType.find("Muon")!=std::string::npos ) m_mass = muonMass; - else if ( m_particleType.find("Electron")!=std::string::npos ) m_mass = electronMass; - else if ( m_particleType.find("Tau")!=std::string::npos ) m_mass = tauMass; -} - - - -double TagNProbe2::mass_obj( const TIDA::Track* t1, const TIDA::Track* t2, TrigObjectMatcher* tom ) const { - - if ( tom!=0 && tom->status() ) { - return mass( tom->object(t1->id()), tom->object(t2->id()) ); - } - else { - return mass( t1, t2 ); - } - -} - - -TIDA::Chain* TagNProbe2::findChain( const std::string& chainname, std::vector& chains ) const { - for ( size_t i=chains.size() ; i-- ; ) { - if ( chains[i].name() == chainname ) return &chains[i]; - } - return 0; -} - - diff --git a/Trigger/TrigConfiguration/TrigConfIO/python/HLTTriggerConfigAccess.py b/Trigger/TrigConfiguration/TrigConfIO/python/HLTTriggerConfigAccess.py index 079356f8abb9ec43535a84d592f3dbb3884370fc..12438e2dc0b808140f095bf179a3e5ca77c09dfe 100644 --- a/Trigger/TrigConfiguration/TrigConfIO/python/HLTTriggerConfigAccess.py +++ b/Trigger/TrigConfiguration/TrigConfIO/python/HLTTriggerConfigAccess.py @@ -118,12 +118,12 @@ class HLTMonitoringAccess(TriggerConfigAccess): """ this class provides access to the HLT monitoring json """ - def __init__(self, filename = None, jsonString=None, dbalias = None, monikey = None ): + def __init__(self, filename = None, jsonString=None, dbalias = None, smkey = None ): """ accessor needs to be initialized with either a filename or the dbalias and hlpskey """ super(HLTMonitoringAccess,self).__init__( ConfigType.HLTMON, mainkey = "signatures", - jsonString = jsonString, filename = filename, dbalias = dbalias, dbkey = monikey ) + jsonString = jsonString, filename = filename, dbalias = dbalias, dbkey = smkey ) self.loader.setQuery({ 1: "SELECT HMG_DATA FROM( SELECT * FROM (SELECT SMT.SMT_HLT_MENU_ID FROM {schema}.SUPER_MASTER_TABLE SMT WHERE SMT.SMT_ID={dbkey}) lhs JOIN (SELECT HMG.HMG_HLT_MENU_ID,HMG.HMG_DATA FROM {schema}.HLT_MONITORING_GROUPS HMG WHERE HMG.HMG_IN_USE = 1) rhs ON lhs.SMT_HLT_MENU_ID = rhs.HMG_HLT_MENU_ID);" #for schema v7 (first implementation of monitoring groups) diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/python/TriggerConfigAccess.py b/Trigger/TrigConfiguration/TrigConfigSvc/python/TriggerConfigAccess.py index 6c32ee42e90a0b66dc805718ac1b16385f9f911d..bcbfa338b8f04a5f00087e0558ed6927293d2096 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/python/TriggerConfigAccess.py +++ b/Trigger/TrigConfiguration/TrigConfigSvc/python/TriggerConfigAccess.py @@ -182,9 +182,9 @@ def getHLTPrescalesSetAccess( flags = None ): """This is the case when reconstructing the data.""" from RecExConfig.InputFilePeeker import inpSum keysFromCool = getKeysFromCool( inpSum["run_number"] ) - cfg = HLTPrescalesSetAccess( dbalias = keysFromCool["DB"], l1pskey = keysFromCool['HLTPSK'] ) + cfg = HLTPrescalesSetAccess( dbalias = keysFromCool["DB"], hltpskey = keysFromCool['HLTPSK'] ) elif tc["SOURCE"] == "DB": - cfg = HLTPrescalesSetAccess( dbalias = tc["DBCONN"], l1pskey = tc["HLTPSK"] ) + cfg = HLTPrescalesSetAccess( dbalias = tc["DBCONN"], hltpskey = tc["HLTPSK"] ) elif tc["SOURCE"] == "INFILE": cfg = HLTPrescalesSetAccess(jsonString=_getJSONFromMetadata(flags, key='TriggerMenuJson_HLTPS')) else: @@ -214,11 +214,12 @@ def getHLTMonitoringAccess( flags = None ): if tc["SOURCE"] == "FILE": cfg = HLTMonitoringAccess( filename = getHLTMonitoringFileName( flags ) ) elif tc["SOURCE"] == "COOL": - # TODO when database will be ready - raise NotImplementedError("Python COOL access to the HLT monitoring not yet implemented") + """This is the case when reconstructing the data.""" + from RecExConfig.InputFilePeeker import inpSum + keysFromCool = getKeysFromCool( inpSum["run_number"] ) + cfg = HLTMonitoringAccess( dbalias = keysFromCool["DB"], smkey = keysFromCool['SMK'] ) elif tc["SOURCE"] == "DB": - # TODO when database will be ready - raise NotImplementedError("Python DB access to the HLT monitoring not yet implemented") + cfg = HLTMonitoringAccess( dbalias = tc["DBCONN"], smkey = tc["SMK"] ) elif tc["SOURCE"] == "INFILE": cfg = HLTMonitoringAccess(jsonString=_getJSONFromMetadata(flags, key='TriggerMenuJson_HLTMonitoring')) else: diff --git a/Trigger/TrigCost/EnhancedBiasWeighter/EnhancedBiasWeighter/EnhancedBiasWeighter.h b/Trigger/TrigCost/EnhancedBiasWeighter/EnhancedBiasWeighter/EnhancedBiasWeighter.h index fb7bb5c79138a1ae882ddb0c382a14e80d4c714e..58796306308fd4cd95050bc1b47c60509cc5a832 100644 --- a/Trigger/TrigCost/EnhancedBiasWeighter/EnhancedBiasWeighter/EnhancedBiasWeighter.h +++ b/Trigger/TrigCost/EnhancedBiasWeighter/EnhancedBiasWeighter/EnhancedBiasWeighter.h @@ -184,7 +184,6 @@ class EnhancedBiasWeighter: public asg::AsgTool, public virtual IEnhancedBiasWei Gaudi::Property m_runNumber{this, "RunNumber", 0, "Run we're processing (if data), needed at initialize to locate and read in extra configuration."}; Gaudi::Property m_errorOnMissingEBWeights{this, "ErrorOnMissingEBWeights", false, "If true, Throws error if EB weights are missing."}; - Gaudi::Property m_calculateWeightingData{this, "CalculateWeightingData", true, "If true, read from COOL, CONDBR2 and XMLs. If false, read directly from decorated TRIG1 dAOD."}; Gaudi::Property m_enforceEBGRL{this, "EnforceEBGRL", true, "Each Enhanced Bias run has a 'good run list' style veto on some LB. If this flag is true, events in these LB get weight 0"}; Gaudi::Property m_useBunchCrossingData{this, "UseBunchCrossingData", true, "BunchCrossing data requires CONDBR2 access. Can be disabled here if this is a problem."}; Gaudi::Property m_isMC{this, "IsMC", false, "MC mode? If so we need a cross section and filter efficiency"}; diff --git a/Trigger/TrigCost/EnhancedBiasWeighter/Root/EnhancedBiasWeighter.cxx b/Trigger/TrigCost/EnhancedBiasWeighter/Root/EnhancedBiasWeighter.cxx index 2003930b199dfe41a71f1e172b63143be3ae8081..49aa47b9dd3ebacd0193c6d1ae605c1fb3f01207 100644 --- a/Trigger/TrigCost/EnhancedBiasWeighter/Root/EnhancedBiasWeighter.cxx +++ b/Trigger/TrigCost/EnhancedBiasWeighter/Root/EnhancedBiasWeighter.cxx @@ -35,37 +35,32 @@ EnhancedBiasWeighter::EnhancedBiasWeighter( const std::string& name ) StatusCode EnhancedBiasWeighter::initialize() { ATH_MSG_INFO ("Initializing " << name() << "..."); - ATH_CHECK( m_bunchCrossingKey.initialize( m_calculateWeightingData && m_useBunchCrossingData ) ); + ATH_CHECK( m_bunchCrossingKey.initialize( m_useBunchCrossingData ) ); - if (m_calculateWeightingData == true) { + if (m_isMC) { - if (m_isMC) { - - if (m_mcCrossSection == 0 || m_mcFilterEfficiency == 0) { - ATH_MSG_FATAL("For MC rates, a cross section and filter efficiency must be supplied."); - return StatusCode::FAILURE; - } - m_deadtime = 1.; // No deadtime for MC - m_pairedBunches = FULL_RING; // Assume full-ring - const float mcCrossSectionInSqCm = 1e-33 * m_mcCrossSection; // Convert nb -> cm^2 - m_mcModifiedCrossSection = mcCrossSectionInSqCm * m_mcFilterEfficiency * m_mcKFactor; - ATH_MSG_INFO ("Running over MC with xsec:" << m_mcCrossSection << " nb, filter efficiency:" << m_mcFilterEfficiency << ", k-factor:" << m_mcKFactor); + if (m_mcCrossSection == 0 || m_mcFilterEfficiency == 0) { + ATH_MSG_FATAL("For MC rates, a cross section and filter efficiency must be supplied."); + return StatusCode::FAILURE; + } + m_deadtime = 1.; // No deadtime for MC + m_pairedBunches = FULL_RING; // Assume full-ring + const float mcCrossSectionInSqCm = 1e-33 * m_mcCrossSection; // Convert nb -> cm^2 + m_mcModifiedCrossSection = mcCrossSectionInSqCm * m_mcFilterEfficiency * m_mcKFactor; + ATH_MSG_INFO ("Running over MC with xsec:" << m_mcCrossSection << " nb, filter efficiency:" << m_mcFilterEfficiency << ", k-factor:" << m_mcKFactor); - } else { // isData + } else { // isData - if (m_runNumber == 0u) { - ATH_MSG_FATAL("calculateWeightingData is TRUE, but the RunNumber property has not been set. This must be set such that we can read in the correct data."); - return StatusCode::FAILURE; - } - ATH_MSG_INFO ("calculateWeightingData is TRUE. This job will read in EnhancedBias weighting data from CVMFS and COOL."); - ATH_CHECK( loadWeights() ); - ATH_CHECK( loadLumi() ); + if (m_runNumber == 0u) { + ATH_MSG_FATAL("calculateWeightingData is TRUE, but the RunNumber property has not been set. This must be set such that we can read in the correct data."); + return StatusCode::FAILURE; + } + ATH_MSG_INFO ("calculateWeightingData is TRUE. This job will read in EnhancedBias weighting data from CVMFS and COOL."); + ATH_CHECK( loadWeights() ); + ATH_CHECK( loadLumi() ); - } // end isData + } // end isData - } else { - ATH_MSG_INFO ("calculateWeightingData is FALSE. This job must be running over an EnhancedBias TRIG1 dAOD which has already been decorated with weighting data."); - } return StatusCode::SUCCESS; } @@ -386,44 +381,35 @@ int32_t EnhancedBiasWeighter::getEventEBID(const EventContext& context) const double EnhancedBiasWeighter::getEBWeight(const xAOD::EventInfo* eventInfo) const { - if (m_enforceEBGRL && !isGoodLB(eventInfo)) { return 0; } ATH_CHECK( trackAverages(eventInfo), 0 ); - if (m_calculateWeightingData) { + if (m_isMC) { - if (m_isMC) { - - if (m_mcIgnoreGeneratorWeights) { - return 1.; - } - - const std::vector weights = eventInfo->mcEventWeights(); - if (weights.size() > 0) { - return weights[0]; - } + if (m_mcIgnoreGeneratorWeights) { return 1.; + } - } else { // isData - - int32_t ebID = getEventEBID(eventInfo); - const auto mapIterator = m_idToWeightMap.find(ebID); - if (mapIterator == m_idToWeightMap.end() ) { - ATH_MSG_ERROR( "Couldn't find enhanced bias weight for event with ID " << ebID); - return 0; - } - return mapIterator->second; - - } // isData + const std::vector weights = eventInfo->mcEventWeights(); + if (weights.size() > 0) { + return weights[0]; + } + return 1.; - } else { + } else { // isData - return eventInfo->auxdata("EnhancedBiasWeight"); + int32_t ebID = getEventEBID(eventInfo); + const auto mapIterator = m_idToWeightMap.find(ebID); + if (mapIterator == m_idToWeightMap.end() ) { + ATH_MSG_ERROR( "Couldn't find enhanced bias weight for event with ID " << ebID); + return 0; + } + return mapIterator->second; - } + } // isData } @@ -436,31 +422,22 @@ double EnhancedBiasWeighter::getEBWeight(const EventContext& context) const ATH_CHECK( trackAverages(context), 0 ); - if (m_calculateWeightingData) { - - if (m_isMC) { - - ATH_MSG_ERROR( "Cannot use EventContext based getEBWeight with MC. Needs full EventInfo."); - return 0.; - - } else { // isData + if (m_isMC) { - int32_t ebID = getEventEBID(context); - const auto mapIterator = m_idToWeightMap.find(ebID); - if (mapIterator == m_idToWeightMap.end() ) { - ATH_MSG_ERROR( "Couldn't find enhanced bias weight for event with ID " << ebID); - return 0; - } - return mapIterator->second; - - } // isData + ATH_MSG_ERROR( "Cannot use EventContext based getEBWeight with MC. Needs full EventInfo."); + return 0.; - } else { + } else { // isData - ATH_MSG_ERROR( "Cannot use EventContext based getEBWeight unless calculating it. Needs full EventInfo."); - return 0.; + int32_t ebID = getEventEBID(context); + const auto mapIterator = m_idToWeightMap.find(ebID); + if (mapIterator == m_idToWeightMap.end() ) { + ATH_MSG_ERROR( "Couldn't find enhanced bias weight for event with ID " << ebID); + return 0; + } + return mapIterator->second; - } + } // isData } @@ -480,220 +457,165 @@ StatusCode EnhancedBiasWeighter::trackAverages(const xAOD::EventInfo* eventInfo) double EnhancedBiasWeighter::getEBLiveTime(const xAOD::EventInfo* eventInfo) const { + if (m_isMC) { + // Probability that a single pp interaction yields this MC process (ratio of xsec) + const double probOfProcess = m_mcModifiedCrossSection / m_inelasticCrossSection; + // Probability that a single bunch-crossing yeild this MC process. Binomial statistics (1 - Prob(exactly 0 interactions, given mu interactions)). + const double probOfBunchCrossing = 1. - std::pow( 1. - probOfProcess, std::ceil(eventInfo->actualInteractionsPerCrossing()) ); + const double bunchCrossingRate = m_pairedBunches * LHC_FREQUENCY; + // How much wall-time does this event represent? This is the reciprocal of the rate, which is the % per crossing scaled by the crossing rate. + ATH_MSG_DEBUG("MC livetime debug: probOfProcess:" << probOfProcess << " probOfBunchCrossing:" << probOfBunchCrossing << " bunchCrossingRate:" << bunchCrossingRate << " time:" << (1. / (probOfBunchCrossing * bunchCrossingRate))); + return 1. / (probOfBunchCrossing * bunchCrossingRate); - if (m_calculateWeightingData) { - - if (m_isMC) { - - // Probability that a single pp interaction yields this MC process (ratio of xsec) - const double probOfProcess = m_mcModifiedCrossSection / m_inelasticCrossSection; - // Probability that a single bunch-crossing yeild this MC process. Binomial statistics (1 - Prob(exactly 0 interactions, given mu interactions)). - const double probOfBunchCrossing = 1. - std::pow( 1. - probOfProcess, std::ceil(eventInfo->actualInteractionsPerCrossing()) ); - const double bunchCrossingRate = m_pairedBunches * LHC_FREQUENCY; - // How much wall-time does this event represent? This is the reciprocal of the rate, which is the % per crossing scaled by the crossing rate. - ATH_MSG_DEBUG("MC livetime debug: probOfProcess:" << probOfProcess << " probOfBunchCrossing:" << probOfBunchCrossing << " bunchCrossingRate:" << bunchCrossingRate << " time:" << (1. / (probOfBunchCrossing * bunchCrossingRate))); - return 1. / (probOfBunchCrossing * bunchCrossingRate); - - } else { - - uint32_t lumiBlock = eventInfo->lumiBlock(); - std::lock_guard scopeLock(m_mutex); - - // Check the cache - const auto inCacheIterator = m_eventLivetime.find( lumiBlock ); - if (inCacheIterator != m_eventLivetime.end()) return inCacheIterator->second; - - // Else calculate - const auto mapIterator = m_eventsPerLB.find(lumiBlock); - if (mapIterator == m_eventsPerLB.end() ) { - if (m_errorOnMissingEBWeights) { - ATH_MSG_ERROR( "Couldn't find LB info for LB: " << lumiBlock ); - } - return 0; - } - const int32_t eventsInThisLB = mapIterator->second; - const double lbLength = m_readLumiBlock.getLumiBlockLength(lumiBlock, msg()); - // This event is one in eventsInThisLB, so has an effective temporal contribution of: - double eventLivetime = 0; - if (eventsInThisLB > 0 && fabs(lbLength) > 1e-10) eventLivetime = (1. / static_cast(eventsInThisLB)) * lbLength; - // Cache this (mutable) - m_eventLivetime[lumiBlock] = eventLivetime; - return eventLivetime; + } else { - } // isData + uint32_t lumiBlock = eventInfo->lumiBlock(); + std::lock_guard scopeLock(m_mutex); - } else { + // Check the cache + const auto inCacheIterator = m_eventLivetime.find( lumiBlock ); + if (inCacheIterator != m_eventLivetime.end()) return inCacheIterator->second; - return eventInfo->auxdata("EnhancedBiasLivetime"); + // Else calculate + const auto mapIterator = m_eventsPerLB.find(lumiBlock); + if (mapIterator == m_eventsPerLB.end() ) { + if (m_errorOnMissingEBWeights) { + ATH_MSG_ERROR( "Couldn't find LB info for LB: " << lumiBlock ); + } + return 0; + } + const int32_t eventsInThisLB = mapIterator->second; + const double lbLength = m_readLumiBlock.getLumiBlockLength(lumiBlock, msg()); + // This event is one in eventsInThisLB, so has an effective temporal contribution of: + double eventLivetime = 0; + if (eventsInThisLB > 0 && fabs(lbLength) > 1e-10) eventLivetime = (1. / static_cast(eventsInThisLB)) * lbLength; + // Cache this (mutable) + m_eventLivetime[lumiBlock] = eventLivetime; + return eventLivetime; - } + } // isData } double EnhancedBiasWeighter::getEBLiveTime(const EventContext& context) const { + if (m_isMC) { + ATH_MSG_ERROR( "Cannot use EventContext based getEBLiveTime with MC. Needs full EventInfo."); + return 0.; - if (m_calculateWeightingData) { - - if (m_isMC) { + } else { - ATH_MSG_ERROR( "Cannot use EventContext based getEBLiveTime with MC. Needs full EventInfo."); - return 0.; + uint32_t lumiBlock = context.eventID().lumi_block(); + std::lock_guard scopeLock(m_mutex); - } else { - - uint32_t lumiBlock = context.eventID().lumi_block(); - std::lock_guard scopeLock(m_mutex); - - // Check the cache - const auto inCacheIterator = m_eventLivetime.find( lumiBlock ); - if (inCacheIterator != m_eventLivetime.end()) return inCacheIterator->second; - - // Else calculate - const auto mapIterator = m_eventsPerLB.find(lumiBlock); - if (mapIterator == m_eventsPerLB.end() ) { - if (m_errorOnMissingEBWeights) { - ATH_MSG_ERROR( "Couldn't find LB info for LB: " << lumiBlock ); - } - return 0.; - } - const int32_t eventsInThisLB = mapIterator->second; - const double lbLength = m_readLumiBlock.getLumiBlockLength(lumiBlock, msg()); - // This event is one in eventsInThisLB, so has an effective temporal contribution of: - double eventLivetime = 0; - if (eventsInThisLB > 0 && fabs(lbLength) > 1e-10) eventLivetime = (1. / static_cast(eventsInThisLB)) * lbLength; - // Cache this (mutable) - m_eventLivetime[lumiBlock] = eventLivetime; - return eventLivetime; - - } // isData + // Check the cache + const auto inCacheIterator = m_eventLivetime.find( lumiBlock ); + if (inCacheIterator != m_eventLivetime.end()) return inCacheIterator->second; - } else { + // Else calculate + const auto mapIterator = m_eventsPerLB.find(lumiBlock); + if (mapIterator == m_eventsPerLB.end() ) { + if (m_errorOnMissingEBWeights) { + ATH_MSG_ERROR( "Couldn't find LB info for LB: " << lumiBlock ); + } + return 0.; + } + const int32_t eventsInThisLB = mapIterator->second; + const double lbLength = m_readLumiBlock.getLumiBlockLength(lumiBlock, msg()); + // This event is one in eventsInThisLB, so has an effective temporal contribution of: + double eventLivetime = 0; + if (eventsInThisLB > 0 && fabs(lbLength) > 1e-10) eventLivetime = (1. / static_cast(eventsInThisLB)) * lbLength; + // Cache this (mutable) + m_eventLivetime[lumiBlock] = eventLivetime; + return eventLivetime; - ATH_MSG_ERROR( "Cannot use EventContext based getEBLiveTime unless calculating it. Needs full EventInfo."); - return 0.; + } // isData - } } double EnhancedBiasWeighter::getLBLength(const xAOD::EventInfo* eventInfo) const { - if (m_calculateWeightingData) { - if (m_isMC) { - ATH_MSG_ERROR( "getLBLength Does not work for MC."); - return 0.; - } else { - uint32_t lumiBlock = eventInfo->lumiBlock(); - const double lbLength = m_readLumiBlock.getLumiBlockLength(lumiBlock, msg()); - return lbLength; - } // isData - } else { - ATH_MSG_ERROR( "getLBLength Requires CalculateWeightingData=True"); + if (m_isMC) { + ATH_MSG_ERROR( "getLBLength Does not work for MC."); return 0.; - } + } else { + uint32_t lumiBlock = eventInfo->lumiBlock(); + const double lbLength = m_readLumiBlock.getLumiBlockLength(lumiBlock, msg()); + return lbLength; + } // isData } double EnhancedBiasWeighter::getLBLength(const EventContext& context) const { - if (m_calculateWeightingData) { - if (m_isMC) { - ATH_MSG_ERROR( "getLBLength Does not work for MC."); - return 0.; - } else { - uint32_t lumiBlock = context.eventID().lumi_block(); - const double lbLength = m_readLumiBlock.getLumiBlockLength(lumiBlock, msg()); - return lbLength; - } // isData - } else { - ATH_MSG_ERROR( "getLBLength Requires CalculateWeightingData=True"); + if (m_isMC) { + ATH_MSG_ERROR( "getLBLength Does not work for MC."); return 0.; - } + } else { + uint32_t lumiBlock = context.eventID().lumi_block(); + const double lbLength = m_readLumiBlock.getLumiBlockLength(lumiBlock, msg()); + return lbLength; + } // isData } bool EnhancedBiasWeighter::isUnbiasedEvent(const xAOD::EventInfo* eventInfo) const { - if (m_calculateWeightingData) { - - if (m_isMC) { + if (m_isMC) { - return true; + return true; - } else { //isData + } else { //isData - int32_t ebID = getEventEBID(eventInfo); - const auto mapIterator = m_idToUnbiasedMap.find(ebID); - if (mapIterator == m_idToUnbiasedMap.end() ) { - ATH_MSG_ERROR("Couldn't find isUnbiased information for event with ID " << ebID); - return false; - } - return mapIterator->second; - - } // isData + int32_t ebID = getEventEBID(eventInfo); + const auto mapIterator = m_idToUnbiasedMap.find(ebID); + if (mapIterator == m_idToUnbiasedMap.end() ) { + ATH_MSG_ERROR("Couldn't find isUnbiased information for event with ID " << ebID); + return false; + } + return mapIterator->second; - } else { - - return static_cast( eventInfo->auxdata("IsUnbiasedEventFlag") ); - - } + } // isData } bool EnhancedBiasWeighter::isGoodLB(const xAOD::EventInfo* eventInfo) const { - if (m_calculateWeightingData) { - - if (m_isMC) { - - return true; - - } else { // isData - - uint32_t lumiBlock = eventInfo->lumiBlock(); - - const auto mapIterator = m_goodLB.find(lumiBlock); - if (mapIterator == m_goodLB.end() ) { - ATH_MSG_ERROR( "Couldn't find LB good/bad info for LB: " << lumiBlock ); - return false; - } - return static_cast(mapIterator->second); + if (m_isMC) { + + return true; - } // isData + } else { // isData - } else { + uint32_t lumiBlock = eventInfo->lumiBlock(); - return static_cast( eventInfo->auxdata("IsGoodLBFlag") ); + const auto mapIterator = m_goodLB.find(lumiBlock); + if (mapIterator == m_goodLB.end() ) { + ATH_MSG_ERROR( "Couldn't find LB good/bad info for LB: " << lumiBlock ); + return false; + } + return static_cast(mapIterator->second); - } + } // isData } bool EnhancedBiasWeighter::isGoodLB(const EventContext& context) const { - if (m_calculateWeightingData) { - - if (m_isMC) { - - return true; - - } else { // isData - - uint32_t lumiBlock = context.eventID().lumi_block(); - - const auto mapIterator = m_goodLB.find(lumiBlock); - if (mapIterator == m_goodLB.end() ) { - ATH_MSG_ERROR( "Couldn't find LB good/bad info for LB: " << lumiBlock ); - return false; - } - return static_cast(mapIterator->second); + if (m_isMC) { + + return true; - } // isData + } else { // isData - } else { + uint32_t lumiBlock = context.eventID().lumi_block(); - ATH_MSG_ERROR( "Cannot use EventContext based isGoodLB unless calculating it. Needs full EventInfo."); - return false; + const auto mapIterator = m_goodLB.find(lumiBlock); + if (mapIterator == m_goodLB.end() ) { + ATH_MSG_ERROR( "Couldn't find LB good/bad info for LB: " << lumiBlock ); + return false; + } + return static_cast(mapIterator->second); - } + } // isData } bool EnhancedBiasWeighter::isMC() const { @@ -706,59 +628,42 @@ uint32_t EnhancedBiasWeighter::getRunNumber() const { double EnhancedBiasWeighter::getLBLumi(const xAOD::EventInfo* eventInfo) const { - if (m_calculateWeightingData) { - - if (m_isMC) { + if (m_isMC) { - const double mu = std::ceil( eventInfo->actualInteractionsPerCrossing() ); - return (mu * LHC_FREQUENCY * m_pairedBunches) / m_inelasticCrossSection; + const double mu = std::ceil( eventInfo->actualInteractionsPerCrossing() ); + return (mu * LHC_FREQUENCY * m_pairedBunches) / m_inelasticCrossSection; - } else { // isData - - uint32_t lumiBlock = eventInfo->lumiBlock(); - const auto mapIterator = m_lumiPerLB.find(lumiBlock); - if (mapIterator == m_lumiPerLB.end() ) { - ATH_MSG_ERROR( "Couldn't find lumi info for LB: " << lumiBlock ); - return 0.; - } - return mapIterator->second; - - } // isData - - } else { + } else { // isData - return eventInfo->auxdata("LBLumi"); + uint32_t lumiBlock = eventInfo->lumiBlock(); + const auto mapIterator = m_lumiPerLB.find(lumiBlock); + if (mapIterator == m_lumiPerLB.end() ) { + ATH_MSG_ERROR( "Couldn't find lumi info for LB: " << lumiBlock ); + return 0.; + } + return mapIterator->second; - } + } // isData } double EnhancedBiasWeighter::getLBLumi(const EventContext& context) const { - if (m_calculateWeightingData) { - - if (m_isMC) { - - ATH_MSG_ERROR( "Cannot use EventContext based getLBLumi with MC. Needs full EventInfo."); - return 0.; + if (m_isMC) { - } else { // isData - - uint32_t lumiBlock = context.eventID().lumi_block(); - const auto mapIterator = m_lumiPerLB.find(lumiBlock); - if (mapIterator == m_lumiPerLB.end() ) { - ATH_MSG_ERROR( "Couldn't find lumi info for LB: " << lumiBlock ); - return 0.; - } - return mapIterator->second; - - } // isData + ATH_MSG_ERROR( "Cannot use EventContext based getLBLumi with MC. Needs full EventInfo."); + return 0.; - } else { + } else { // isData - ATH_MSG_ERROR( "Cannot use EventContext based getLBLumi unless calculating it. Needs full EventInfo."); - return 0; + uint32_t lumiBlock = context.eventID().lumi_block(); + const auto mapIterator = m_lumiPerLB.find(lumiBlock); + if (mapIterator == m_lumiPerLB.end() ) { + ATH_MSG_ERROR( "Couldn't find lumi info for LB: " << lumiBlock ); + return 0.; + } + return mapIterator->second; - } + } // isData } double EnhancedBiasWeighter::getDeadtime() const @@ -773,20 +678,13 @@ uint32_t EnhancedBiasWeighter::getPairedBunches() const StatusCode EnhancedBiasWeighter::getDistanceIntoTrain(const xAOD::EventInfo* eventInfo, uint32_t& distance) const { - if (m_calculateWeightingData) { - - if (!m_useBunchCrossingData) return StatusCode::SUCCESS; - - const EventContext& context = Gaudi::Hive::currentContext(); - SG::ReadCondHandle bunchCrossingTool (m_bunchCrossingKey, context); - ATH_CHECK( bunchCrossingTool.isValid() ); - distance = bunchCrossingTool->distanceFromFront( eventInfo->bcid(), BunchCrossingCondData::BunchDistanceType::BunchCrossings ); - - } else { + if (!m_useBunchCrossingData) return StatusCode::SUCCESS; - distance = eventInfo->auxdata("BCIDDistanceFromFront"); + const EventContext& context = Gaudi::Hive::currentContext(); + SG::ReadCondHandle bunchCrossingTool (m_bunchCrossingKey, context); + ATH_CHECK( bunchCrossingTool.isValid() ); + distance = bunchCrossingTool->distanceFromFront( eventInfo->bcid(), BunchCrossingCondData::BunchDistanceType::BunchCrossings ); - } return StatusCode::SUCCESS; } @@ -803,12 +701,6 @@ double EnhancedBiasWeighter::getAverageMu() const StatusCode EnhancedBiasWeighter::addBranches() const { - - if (m_calculateWeightingData == false) { - ATH_MSG_FATAL( "Cannot decorate AOD with EnhancedBias data if loadEnhancedBiasData is FALSE "); - return StatusCode::FAILURE; - } - // Set up the decorator SG::AuxElement::Decorator< double > decoratorEBWeight("EnhancedBiasWeight"); SG::AuxElement::Decorator< double > decoratorEBLivetime("EnhancedBiasLivetime"); diff --git a/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesAnalysisAlg.h b/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesAnalysisAlg.h index b475b27c1efb10171b58bf41faa87f7d3236ae20..33c15c1941a6592913bec9cb8a26b5bf03cd3c88 100644 --- a/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesAnalysisAlg.h +++ b/Trigger/TrigCost/RatesAnalysis/RatesAnalysis/RatesAnalysisAlg.h @@ -103,7 +103,7 @@ class RatesAnalysisAlg: public ::AthAnalysisAlgorithm { const double thresholdMin, const double thresholdMax, const uint32_t thresholdBins = 100, - const RatesScanTrigger::TriggerBehaviour_t behaviour = RatesScanTrigger::TriggerBehaviour_t::kTriggerAboveThreshold, + const RatesScanTrigger::TriggerBehaviour_t behaviour = RatesScanTrigger::TriggerBehaviour_t::kTriggerBelowThreshold, const double prescale = 1., const std::string& seedName = "", const double seedPrecale = 1., diff --git a/Trigger/TrigEvent/TrigCombinedEventTPCnv/TrigCombinedEventTPCnv/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigEvent/TrigCombinedEventTPCnv/TrigCombinedEventTPCnv/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..e46feecdceb3e1535d641c335c44851def26a7fa --- /dev/null +++ b/Trigger/TrigEvent/TrigCombinedEventTPCnv/TrigCombinedEventTPCnv/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigEvent/TrigCombinedEventTPCnv diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/CMakeLists.txt b/Trigger/TrigEvent/TrigDecisionEventTPCnv/CMakeLists.txt index bd6dffa70cf74743aa63ddc2d3c9882e144704dd..286d926a0731a047ae028e1c415f97142e3a3b87 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/CMakeLists.txt +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( TrigDecisionEventTPCnv ) @@ -7,7 +7,7 @@ atlas_subdir( TrigDecisionEventTPCnv ) atlas_add_tpcnv_library( TrigDecisionEventTPCnv src/*.cxx PUBLIC_HEADERS TrigDecisionEventTPCnv - LINK_LIBRARIES AthenaPoolCnvSvcLib DataModelAthenaPoolLib TrigDecisionEvent TrigSteeringEventTPCnv + LINK_LIBRARIES AthenaPoolCnvSvcLib CxxUtils DataModelAthenaPoolLib TrigDecisionEvent TrigSteeringEventTPCnv PRIVATE_LINK_LIBRARIES AthenaKernel ) atlas_add_dictionary( TrigDecisionEventTPCnvDict diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..acda2466d2acac2eb1c7bf7db3a7b4a3692414e7 --- /dev/null +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigEvent/TrigDecisionEventTPCnv diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p2.h b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p2.h index e66bbba8e2ea424b4741b5785b9f8b2b0de392dc..d56dc47a06c0491450f724240b6caa2a9dcd1168 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p2.h +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p2.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -16,7 +16,6 @@ * @author Tomasz Bold - UST-AGH Krakow * * File and Version Information: - * $Id: TrigDecisionCnv_p2.h,v 1.2 2009-04-01 22:04:16 salvator Exp $ **********************************************************************************/ #ifndef TrigDecisionEventTPCnv_TrigDecisionCnv_p2_H @@ -24,7 +23,6 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" -#include "TrigSteeringEventTPCnv/HLTResultCnv_p1.h" #include "TrigSteeringEventTPCnv/Lvl1ResultCnv_p1.h" class MsgStream; @@ -36,17 +34,17 @@ namespace TrigDec { namespace TrigDec { - class TrigDecisionCnv_p2 : public T_AthenaPoolTPCnvBase { + class TrigDecisionCnv_p2 : public T_AthenaPoolTPCnvConstBase { public: + using base_class::persToTrans; + using base_class::transToPers; + TrigDecisionCnv_p2() {} - void persToTrans(const TrigDecision_p2* persObj, TrigDecision* transObj, MsgStream& log); - void transToPers(const TrigDecision* transObj, TrigDecision_p2* persObj, MsgStream& log); + virtual void persToTrans(const TrigDecision_p2* persObj, TrigDecision* transObj, MsgStream& log) const override; + virtual void transToPers(const TrigDecision* transObj, TrigDecision_p2* persObj, MsgStream& log) const override; private: - - //converters - HLT::HLTResultCnv_p1 m_hltResultCnv; LVL1CTP::Lvl1ResultCnv_p1 m_lvl1ResultCnv; }; diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p3.h b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p3.h index 0bbcd22e4f3f4280b118ef89f84de65d04074af9..a20b5a06d9249145f7ca482fca709929af358e84 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p3.h +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p3.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -16,7 +16,6 @@ * @author Tomasz Bold - UST-AGH Krakow * * File and Version Information: - * $Id: TrigDecisionCnv_p3.h,v 1.2 2009-04-01 22:04:16 salvator Exp $ **********************************************************************************/ #ifndef TrigDecisionEventTPCnv_TrigDecisionCnv_p3_H @@ -24,7 +23,6 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" -#include "TrigSteeringEventTPCnv/HLTResultCnv_p1.h" #include "TrigSteeringEventTPCnv/Lvl1ResultCnv_p2.h" class MsgStream; @@ -36,17 +34,17 @@ namespace TrigDec { namespace TrigDec { - class TrigDecisionCnv_p3 : public T_AthenaPoolTPCnvBase { + class TrigDecisionCnv_p3 : public T_AthenaPoolTPCnvConstBase { public: + using base_class::persToTrans; + using base_class::transToPers; + TrigDecisionCnv_p3() {} - void persToTrans(const TrigDecision_p3* persObj, TrigDecision* transObj, MsgStream& log); - void transToPers(const TrigDecision* transObj, TrigDecision_p3* persObj, MsgStream& log); + virtual void persToTrans(const TrigDecision_p3* persObj, TrigDecision* transObj, MsgStream& log) const override; + virtual void transToPers(const TrigDecision* transObj, TrigDecision_p3* persObj, MsgStream& log) const override; private: - - //converters - HLT::HLTResultCnv_p1 m_hltResultCnv; LVL1CTP::Lvl1ResultCnv_p2 m_lvl1ResultCnv; }; diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p4.h b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p4.h index 0fa3895563dd2b4a99ea7b4c36ea58d6c8ae8b2a..013a536cf989cc461454d53b1b3b04d05d1ea109 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p4.h +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p4.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -16,7 +16,6 @@ * @author Tomasz Bold - UST-AGH Krakow * * File and Version Information: - * $Id: TrigDecisionCnv_p4.h,v 1.2 2009-04-01 22:04:16 salvator Exp $ **********************************************************************************/ #ifndef TrigDecisionEventTPCnv_TrigDecisionCnv_p4_H @@ -24,7 +23,6 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" -#include "TrigSteeringEventTPCnv/HLTResultCnv_p1.h" #include "TrigSteeringEventTPCnv/Lvl1ResultCnv_p2.h" class MsgStream; @@ -36,17 +34,17 @@ namespace TrigDec { namespace TrigDec { - class TrigDecisionCnv_p4 : public T_AthenaPoolTPCnvBase { + class TrigDecisionCnv_p4 : public T_AthenaPoolTPCnvConstBase { public: + using base_class::persToTrans; + using base_class::transToPers; + TrigDecisionCnv_p4() {} - void persToTrans(const TrigDecision_p4* persObj, TrigDecision* transObj, MsgStream& log); - void transToPers(const TrigDecision* transObj, TrigDecision_p4* persObj, MsgStream& log); + virtual void persToTrans(const TrigDecision_p4* persObj, TrigDecision* transObj, MsgStream& log) const override; + virtual void transToPers(const TrigDecision* transObj, TrigDecision_p4* persObj, MsgStream& log) const override; private: - - //converters - HLT::HLTResultCnv_p1 m_hltResultCnv; LVL1CTP::Lvl1ResultCnv_p2 m_lvl1ResultCnv; }; diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p5.h b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p5.h index bc8c5f4001869375eff0b34c6548e6b3e6643bf5..ad25d20369060208fb35d24da9642ffa7fc7b0a0 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p5.h +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/TrigDecisionEventTPCnv/TrigDecisionCnv_p5.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -16,7 +16,6 @@ * @author Tomasz Bold - UST-AGH Krakow * * File and Version Information: - * $Id: TrigDecisionCnv_p5.h,v 1.2 2009-04-01 22:04:16 salvator Exp $ **********************************************************************************/ #ifndef TrigDecisionEventTPCnv_TrigDecisionCnv_p5_H @@ -24,7 +23,6 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" -#include "TrigSteeringEventTPCnv/HLTResultCnv_p1.h" #include "TrigSteeringEventTPCnv/Lvl1ResultCnv_p2.h" class MsgStream; @@ -36,17 +34,17 @@ namespace TrigDec { namespace TrigDec { - class TrigDecisionCnv_p5 : public T_AthenaPoolTPCnvBase { + class TrigDecisionCnv_p5 : public T_AthenaPoolTPCnvConstBase { public: + using base_class::persToTrans; + using base_class::transToPers; + TrigDecisionCnv_p5() {} - void persToTrans(const TrigDecision_p5* persObj, TrigDecision* transObj, MsgStream& log); - void transToPers(const TrigDecision* transObj, TrigDecision_p5* persObj, MsgStream& log); + virtual void persToTrans(const TrigDecision_p5* persObj, TrigDecision* transObj, MsgStream& log) const override; + virtual void transToPers(const TrigDecision* transObj, TrigDecision_p5* persObj, MsgStream& log) const override; private: - - //converters - HLT::HLTResultCnv_p1 m_hltResultCnv; LVL1CTP::Lvl1ResultCnv_p2 m_lvl1ResultCnv; }; diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p2.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p2.cxx index 464c705baeff77101eb5625e1a099c0cd967b321..7c1e795cf282f13f8248d28374bb9f9c0b654e5a 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p2.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p2.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigDecisionEvent/TrigDecision.h" @@ -7,14 +7,14 @@ #include "TrigDecisionEventTPCnv/TrigDecisionCnv_p2.h" #include "DataModelAthenaPool/DataLinkCnv_p1.h" namespace { -DataLinkCnv_p1 > dataLinkConverter; + const DataLinkCnv_p1 > dataLinkConverter; } using namespace TrigDec; void TrigDecisionCnv_p2::transToPers(const TrigDec::TrigDecision* trans, - TrigDecision_p2* pers, MsgStream &log) + TrigDecision_p2* pers, MsgStream &log) const { log << MSG::DEBUG << "TrigDecisionCnv_p2::transToPers called " << trans << " " << pers << endmsg; @@ -34,7 +34,7 @@ void TrigDecisionCnv_p2::transToPers(const TrigDec::TrigDecision* trans, } void TrigDecisionCnv_p2::persToTrans(const TrigDec::TrigDecision_p2* pers, - TrigDecision* trans, MsgStream &log) + TrigDecision* trans, MsgStream &log) const { log << MSG::DEBUG << "TrigDecisionCnv_p2::persToTrans called " << endmsg; diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p3.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p3.cxx index 8e43bc389bb77f2ada47fb72e2f541b0e886bdaa..71d72561442339246f3b0367a3ff457c84dfef90 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p3.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p3.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigDecisionEvent/TrigDecision.h" @@ -7,14 +7,14 @@ #include "TrigDecisionEventTPCnv/TrigDecisionCnv_p3.h" #include "DataModelAthenaPool/DataLinkCnv_p1.h" namespace { -DataLinkCnv_p1 > dataLinkConverter; + const DataLinkCnv_p1 > dataLinkConverter; } using namespace TrigDec; void TrigDecisionCnv_p3::transToPers(const TrigDec::TrigDecision* trans, - TrigDecision_p3* pers, MsgStream &log) + TrigDecision_p3* pers, MsgStream &log) const { log << MSG::DEBUG << "TrigDecisionCnv_p3::transToPers called " << trans << " " << pers << endmsg; @@ -34,7 +34,7 @@ void TrigDecisionCnv_p3::transToPers(const TrigDec::TrigDecision* trans, } void TrigDecisionCnv_p3::persToTrans(const TrigDec::TrigDecision_p3* pers, - TrigDecision* trans, MsgStream &log) + TrigDecision* trans, MsgStream &log) const { log << MSG::DEBUG << "TrigDecisionCnv_p3::persToTrans called " << endmsg; diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p4.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p4.cxx index 105bc92e305b4ab47a0e71ab4652a197a5dfcafb..e6de15c7e608fb383e907ca21b7173b9dfb6ca11 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p4.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p4.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigDecisionEvent/TrigDecision.h" @@ -7,14 +7,14 @@ #include "TrigDecisionEventTPCnv/TrigDecisionCnv_p4.h" #include "DataModelAthenaPool/DataLinkCnv_p1.h" namespace { -DataLinkCnv_p1 > dataLinkConverter; + const DataLinkCnv_p1 > dataLinkConverter; } using namespace TrigDec; void TrigDecisionCnv_p4::transToPers(const TrigDec::TrigDecision* trans, - TrigDecision_p4* pers, MsgStream &log) + TrigDecision_p4* pers, MsgStream &log) const { log << MSG::DEBUG << "TrigDecisionCnv_p4::transToPers called " << trans << " " << pers << endmsg; @@ -31,7 +31,7 @@ void TrigDecisionCnv_p4::transToPers(const TrigDec::TrigDecision* trans, } void TrigDecisionCnv_p4::persToTrans(const TrigDec::TrigDecision_p4* pers, - TrigDecision* trans, MsgStream &log) + TrigDecision* trans, MsgStream &log) const { log << MSG::DEBUG << "TrigDecisionCnv_p4::persToTrans called " << endmsg; diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p5.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p5.cxx index 5bab2245a22da0dcdec2df52a49ad14fd4bf309f..ae22fb08aa15148dfd75dde29e8d016cf48705d9 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p5.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/src/TrigDecisionCnv_p5.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigDecisionEvent/TrigDecision.h" @@ -7,14 +7,14 @@ #include "TrigDecisionEventTPCnv/TrigDecisionCnv_p5.h" #include "DataModelAthenaPool/DataLinkCnv_p2.h" namespace { -DataLinkCnv_p2 > dataLinkConverter; + const DataLinkCnv_p2 > dataLinkConverter; } using namespace TrigDec; void TrigDecisionCnv_p5::transToPers(const TrigDec::TrigDecision* trans, - TrigDecision_p5* pers, MsgStream &log) + TrigDecision_p5* pers, MsgStream &log) const { log << MSG::DEBUG << "TrigDecisionCnv_p5::transToPers called " << trans << " " << pers << endmsg; @@ -32,7 +32,7 @@ void TrigDecisionCnv_p5::transToPers(const TrigDec::TrigDecision* trans, } void TrigDecisionCnv_p5::persToTrans(const TrigDec::TrigDecision_p5* pers, - TrigDecision* trans, MsgStream &log) + TrigDecision* trans, MsgStream &log) const { log << MSG::DEBUG << "TrigDecisionCnv_p5::persToTrans called " << endmsg; diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p1_test.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p1_test.cxx index a5c2011101ca8671e4d036034c8765519126def2..4d73a690706734ea05624ff7738386f8ad99a04c 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p1_test.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p1_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigDecisionEventTPCnv/test/TrigDecisionCnv_p1_test.cxx @@ -18,6 +18,7 @@ #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -82,7 +83,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE() { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p2_test.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p2_test.cxx index 883a9b84b17745541bc2cfbc507163522bada864..be07cec9b4d30bb9ed5cd65e7e505a3d50e5a242 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p2_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -19,6 +19,7 @@ #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -81,7 +82,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE() { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p3_test.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p3_test.cxx index 4dfb7f62368ee4c6031838ed565dcbbf06f106d5..dd37c9bbe6dd77875183d824155ddbbb8b8e17b8 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p3_test.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p3_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -19,6 +19,7 @@ #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -81,7 +82,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE() { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p4_test.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p4_test.cxx index 4fa12b65437c572118c75caaae034a38bf9f6d90..8ef8c120166f10fa189d1c4e8c26d0a0cf942889 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p4_test.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p4_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -19,6 +19,7 @@ #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -80,7 +81,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE() { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p5_test.cxx b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p5_test.cxx index 84040786815f3eebce8b72bdbcb7a7b5fd1efad3..5dcfaca8533445fbf012696158e024cf4a098c61 100644 --- a/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p5_test.cxx +++ b/Trigger/TrigEvent/TrigDecisionEventTPCnv/test/TrigDecisionCnv_p5_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -19,6 +19,7 @@ #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" #include "GaudiKernel/MsgStream.h" +#include "CxxUtils/checker_macros.h" #include #include @@ -80,7 +81,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE() { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigEvent/TrigEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..23805cf0e71fe698e8f7f09e43935e9b715e2393 --- /dev/null +++ b/Trigger/TrigEvent/TrigEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigEvent/TrigEventAthenaPool diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureCnv.cxx index 211500b60e64049a2fc7071c2bb280c5d3465f31..213d83f9c7788333cb4812eb415164bcc1560e1b 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureCnv.cxx @@ -45,8 +45,8 @@ CombinedMuonFeature *CombinedMuonFeatureCnv::createTransient() CombinedMuonFeature *transObj(0); - static pool::Guid p1_guid( "7B8452AC-DDD8-42C5-85BD-D2CE183065A1" ); - static pool::Guid p0_guid( "9DFC54CA-4799-4BCB-A95B-919E7E761112" ); + static const pool::Guid p1_guid( "7B8452AC-DDD8-42C5-85BD-D2CE183065A1" ); + static const pool::Guid p0_guid( "9DFC54CA-4799-4BCB-A95B-919E7E761112" ); if( compareClassGuid( p1_guid ) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureContainerCnv.cxx index 732bb0b6f4863fdea86f0e617cb7b1ee4ba33862..6969b11cf2ee592b8f8d2134a61cc8473d65ed0a 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureContainerCnv.cxx @@ -1,32 +1,21 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "CombinedMuonFeatureContainerCnv.h" -#include "TrigMuonEventTPCnv/CombinedMuonFeatureContainerCnv_tlp1.h" #include "TrigMuonEventTPCnv/CombinedMuonFeatureContainer_p2.h" -#include "TrigMuonEventTPCnv/CombinedMuonFeatureContainerCnv_p2.h" - #include "TrigMuonEventTPCnv/CombinedMuonFeatureContainer_p3.h" -#include "TrigMuonEventTPCnv/CombinedMuonFeatureContainerCnv_p3.h" - #include "TrigMuonEventTPCnv/CombinedMuonFeatureContainer_p4.h" -#include "TrigMuonEventTPCnv/CombinedMuonFeatureContainerCnv_p4.h" - -static CombinedMuonFeatureContainerCnv_tlp1 TLPconverter1; -static CombinedMuonFeatureContainerCnv_p2 TPconverter2; -static CombinedMuonFeatureContainerCnv_p3 TPconverter3; -static CombinedMuonFeatureContainerCnv_p4 TPconverter; -//createPersistent +//createPersistent CombinedMuonFeatureContainer_PERS * CombinedMuonFeatureContainerCnv::createPersistent( CombinedMuonFeatureContainer *transObj) { MsgStream mlog(msgSvc(), "CombinedMuonFeatureContainerConverter" ); mlog << MSG::DEBUG << "CombinedMuonFeatureContainerCnv::createPersistent called" << endmsg; - CombinedMuonFeatureContainer_PERS * p_cont = TPconverter.createPersistent( transObj, mlog ); + CombinedMuonFeatureContainer_PERS * p_cont = m_converter.createPersistent( transObj, mlog ); return p_cont; @@ -40,34 +29,34 @@ CombinedMuonFeatureContainer * CombinedMuonFeatureContainerCnv::createTransient( mlog << MSG::DEBUG << "CombinedMuonFeatureContainerCnv::createTransient called" << endmsg; - static pool::Guid p4_guid( "A06B9B51-FFA9-4AC1-9079-8AF49C4A9B87" ); - static pool::Guid p3_guid( "02262E5F-7645-4919-9CD9-66D88796DCFA" ); - static pool::Guid p2_guid( "E9D9F99E-D64F-4114-90EA-236FAF9063BB" ); - static pool::Guid tlp1_guid( "9C558B18-1B1D-4186-AF26-A5F3EACCBE1B" ); - static pool::Guid p0_guid( "574BFA1C-ADB8-40DB-B538-0CA20E20CAAD" ); + static const pool::Guid p4_guid( "A06B9B51-FFA9-4AC1-9079-8AF49C4A9B87" ); + static const pool::Guid p3_guid( "02262E5F-7645-4919-9CD9-66D88796DCFA" ); + static const pool::Guid p2_guid( "E9D9F99E-D64F-4114-90EA-236FAF9063BB" ); + static const pool::Guid tlp1_guid( "9C558B18-1B1D-4186-AF26-A5F3EACCBE1B" ); + static const pool::Guid p0_guid( "574BFA1C-ADB8-40DB-B538-0CA20E20CAAD" ); //CombinedMuonFeatureContainer *p_collection = 0; if( compareClassGuid( p4_guid ) ){ std::unique_ptr< CombinedMuonFeatureContainer_p4 > col_vect( poolReadObject< CombinedMuonFeatureContainer_p4 >() ); // std::cout << "Reading CMFC p2" << std::endl; - return TPconverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; }else if( compareClassGuid( p3_guid ) ){ std::unique_ptr< CombinedMuonFeatureContainer_p3 > col_vect( poolReadObject< CombinedMuonFeatureContainer_p3 >() ); // std::cout << "Reading CMFC p2" << std::endl; - return TPconverter3.createTransient( col_vect.get(), mlog ) ; + return m_converter3.createTransient( col_vect.get(), mlog ) ; }else if( compareClassGuid( p2_guid ) ) { std::unique_ptr< CombinedMuonFeatureContainer_p2 > col_vect( poolReadObject< CombinedMuonFeatureContainer_p2 >() ); // std::cout << "Reading CMFC p2" << std::endl; - return TPconverter2.createTransient( col_vect.get(), mlog ) ; + return m_converter2.createTransient( col_vect.get(), mlog ) ; }else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< CombinedMuonFeatureContainer_tlp1 > col_vect( poolReadObject< CombinedMuonFeatureContainer_tlp1 >() ); // std::cout << "Reading CMFC tlp1" << std::endl; - return TLPconverter1.createTransient( col_vect.get(), mlog ); + return m_converter1.createTransient( col_vect.get(), mlog ); }else if( compareClassGuid( p0_guid ) ){ diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureContainerCnv.h index 1fb1fd1c03558c69552b6b460f58cc3ba4a5e2b0..81a75c0177eb33691e745811cd74444051fb9344 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/CombinedMuonFeatureContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_COMBINEDMUONFEATURECONTAINER_CNV_H @@ -10,6 +10,10 @@ #include "TrigMuonEventTPCnv/CombinedMuonFeatureContainer_p2.h" #include "TrigMuonEventTPCnv/CombinedMuonFeatureContainer_p3.h" #include "TrigMuonEventTPCnv/CombinedMuonFeatureContainer_p4.h" +#include "TrigMuonEventTPCnv/CombinedMuonFeatureContainerCnv_tlp1.h" +#include "TrigMuonEventTPCnv/CombinedMuonFeatureContainerCnv_p2.h" +#include "TrigMuonEventTPCnv/CombinedMuonFeatureContainerCnv_p3.h" +#include "TrigMuonEventTPCnv/CombinedMuonFeatureContainerCnv_p4.h" typedef CombinedMuonFeatureContainer_p4 CombinedMuonFeatureContainer_PERS; @@ -27,6 +31,12 @@ protected: virtual CombinedMuonFeatureContainer_PERS *createPersistent( CombinedMuonFeatureContainer *transObj); virtual CombinedMuonFeatureContainer *createTransient(); +private: + CombinedMuonFeatureContainerCnv_tlp1 m_converter1; + CombinedMuonFeatureContainerCnv_p2 m_converter2; + CombinedMuonFeatureContainerCnv_p3 m_converter3; + CombinedMuonFeatureContainerCnv_p4 m_converter; + }; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/ElectronMuonTopoInfoContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/ElectronMuonTopoInfoContainerCnv.cxx index 5965ed9f62dfcc1391def548f805fdd4ccb3d339..172b047f4ce00a1542b74193c27e1e53ab544896 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/ElectronMuonTopoInfoContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/ElectronMuonTopoInfoContainerCnv.cxx @@ -1,11 +1,8 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "ElectronMuonTopoInfoContainerCnv.h" -#include "TrigTopoEventTPCnv/ElectronMuonTopoInfoContainerCnv_p1.h" - -static ElectronMuonTopoInfoContainerCnv_p1 TPConverter; //createPersistent ElectronMuonTopoInfoContainer_PERS * ElectronMuonTopoInfoContainerCnv::createPersistent( ElectronMuonTopoInfoContainer *transObj) @@ -14,7 +11,7 @@ ElectronMuonTopoInfoContainer_PERS * ElectronMuonTopoInfoContainerCnv::createPer mlog << MSG::DEBUG << "ElectronMuonTopoInfoContainerCnv::createPersistent called" << endmsg; - ElectronMuonTopoInfoContainer_PERS * p_emTopoCont = TPConverter.createPersistent( transObj, mlog ); + ElectronMuonTopoInfoContainer_PERS * p_emTopoCont = m_converter.createPersistent( transObj, mlog ); return p_emTopoCont; @@ -27,11 +24,11 @@ ElectronMuonTopoInfoContainer * ElectronMuonTopoInfoContainerCnv::createTransien mlog << MSG::DEBUG << "ElectronMuonTopoInfoContainerCnv::createTransient called" << endmsg; - static pool::Guid p1_guid( "0A775717-3FC9-4FF4-A18B-3F520B2D4DAC" ); + static const pool::Guid p1_guid( "0A775717-3FC9-4FF4-A18B-3F520B2D4DAC" ); if( compareClassGuid( p1_guid ) ){ std::unique_ptr< ElectronMuonTopoInfoContainer_p1 > col_vect( poolReadObject< ElectronMuonTopoInfoContainer_p1 >() ); - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else { throw std::runtime_error( "Unsupported persistent version of ElectronMuonTopoInfoContainer" ); } }//end of create transient method diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/ElectronMuonTopoInfoContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/ElectronMuonTopoInfoContainerCnv.h index 232acfe3d38a55ccda3720148ed6ddb2db8a08d1..2eb26b0cf8844cf1fd34ca24118a1a02788c8b9c 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/ElectronMuonTopoInfoContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/ElectronMuonTopoInfoContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_ELECTRONMUONTOPOINFO_CNV_H @@ -11,7 +11,7 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigTopoEvent/ElectronMuonTopoInfoContainer.h" #include "TrigTopoEventTPCnv/ElectronMuonTopoInfoContainerCnv_p1.h" - + typedef ElectronMuonTopoInfoContainer_p1 ElectronMuonTopoInfoContainer_PERS; typedef T_AthenaPoolCustomCnv ElectronMuonTopoInfoContainerCnvBase; @@ -30,7 +30,10 @@ protected: virtual ElectronMuonTopoInfoContainer_PERS *createPersistent( ElectronMuonTopoInfoContainer *transObj); virtual ElectronMuonTopoInfoContainer *createTransient(); - + +private: + ElectronMuonTopoInfoContainerCnv_p1 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureCnv.cxx index da404d04fb0934243169676cf2b0f3d3c82f0a20..685d9125eaa179c9e19f31a27ef22c242ff8d2ae 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureCnv.cxx @@ -44,8 +44,8 @@ IsoMuonFeature *IsoMuonFeatureCnv::createTransient() IsoMuonFeature *transObj(0); - static pool::Guid p1_guid("31A90EEE-AF5A-4CAF-9A83-F523D141C4CF"); - static pool::Guid p0_guid("60ECF1E1-408A-43CA-9858-62AAFE8041FF"); + static const pool::Guid p1_guid("31A90EEE-AF5A-4CAF-9A83-F523D141C4CF"); + static const pool::Guid p0_guid("60ECF1E1-408A-43CA-9858-62AAFE8041FF"); if( compareClassGuid( p1_guid ) ) { std::unique_ptr< IsoMuonFeature_tlp1 > ptr_tlp1( this->poolReadObject< IsoMuonFeature_tlp1 >() ); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureContainerCnv.cxx index 1c9121ec0b89da4b10fbe8ef314d944454928001..5866b1100df2a4921e105bf0b7e454c1f7ee6ab3 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureContainerCnv.cxx @@ -1,29 +1,20 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "IsoMuonFeatureContainerCnv.h" #include "TrigMuonEventTPCnv/IsoMuonFeatureContainer_tlp1.h" -#include "TrigMuonEventTPCnv/IsoMuonFeatureContainerCnv_tlp1.h" - #include "TrigMuonEventTPCnv/IsoMuonFeatureContainer_p2.h" -#include "TrigMuonEventTPCnv/IsoMuonFeatureContainerCnv_p2.h" - #include "TrigMuonEventTPCnv/IsoMuonFeatureContainer_p3.h" -#include "TrigMuonEventTPCnv/IsoMuonFeatureContainerCnv_p3.h" - -static IsoMuonFeatureContainerCnv_tlp1 TLPconverter1; -static IsoMuonFeatureContainerCnv_p2 TPconverter2; -static IsoMuonFeatureContainerCnv_p3 TPconverter; -//createPersistent +//createPersistent IsoMuonFeatureContainer_PERS * IsoMuonFeatureContainerCnv::createPersistent( IsoMuonFeatureContainer *transObj) { MsgStream mlog(msgSvc(), "IsoMuonFeatureContainerConverter" ); mlog << MSG::DEBUG << "IsoMuonFeatureContainerCnv::createPersistent called" << endmsg; - IsoMuonFeatureContainer_PERS * p_cont = TPconverter.createPersistent( transObj, mlog ); + IsoMuonFeatureContainer_PERS * p_cont = m_converter.createPersistent( transObj, mlog ); return p_cont; @@ -36,26 +27,26 @@ IsoMuonFeatureContainer * IsoMuonFeatureContainerCnv::createTransient() mlog << MSG::DEBUG << "IsoMuonFeatureContainerCnv::createTransient called" << endmsg; - static pool::Guid p3_guid( "291897DE-5380-424C-AE8F-FFE69DCC8F15" ); - static pool::Guid p2_guid( "A9A660B1-DEFD-4B56-A10D-9F41178715BD" ); - static pool::Guid tlp1_guid( "B9543660-E776-405D-8DB7-06AD06A24BAB" ); - static pool::Guid p0_guid( "3962B221-2A36-4160-AEE5-3BB6BC29BB46" ); + static const pool::Guid p3_guid( "291897DE-5380-424C-AE8F-FFE69DCC8F15" ); + static const pool::Guid p2_guid( "A9A660B1-DEFD-4B56-A10D-9F41178715BD" ); + static const pool::Guid tlp1_guid( "B9543660-E776-405D-8DB7-06AD06A24BAB" ); + static const pool::Guid p0_guid( "3962B221-2A36-4160-AEE5-3BB6BC29BB46" ); //IsoMuonFeatureContainer *p_collection = 0; if( compareClassGuid( p3_guid ) ){ std::unique_ptr< IsoMuonFeatureContainer_p3 > col_vect( poolReadObject< IsoMuonFeatureContainer_p3 >() ); // std::cout << "Reading IMFC p3" << std::endl; - return TPconverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; }else if( compareClassGuid( p2_guid ) ){ std::unique_ptr< IsoMuonFeatureContainer_p2 > col_vect( poolReadObject< IsoMuonFeatureContainer_p2 >() ); // std::cout << "Reading IMFC p2" << std::endl; - return TPconverter2.createTransient( col_vect.get(), mlog ) ; + return m_converter2.createTransient( col_vect.get(), mlog ) ; }else if( compareClassGuid( tlp1_guid ) ){ std::unique_ptr< IsoMuonFeatureContainer_tlp1 > col_vect( poolReadObject< IsoMuonFeatureContainer_tlp1 >() ); // std::cout << "Reading IMFC tlp1" << std::endl; - return TLPconverter1.createTransient( col_vect.get(), mlog ); + return m_converter1.createTransient( col_vect.get(), mlog ); }else if( compareClassGuid( p0_guid ) ){ return poolReadObject< IsoMuonFeatureContainer >(); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureContainerCnv.h index 0d98a273dc0161e5072e600af84394ed3a92f144..e6706655fed195799ee36868695cbeeda209821e 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/IsoMuonFeatureContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_ISOMUONFEATURECONTAINER_CNV_H @@ -8,7 +8,10 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigMuonEvent/IsoMuonFeatureContainer.h" #include "TrigMuonEventTPCnv/IsoMuonFeatureContainer_p2.h" -#include "TrigMuonEventTPCnv/IsoMuonFeatureContainer_p3.h" +#include "TrigMuonEventTPCnv/IsoMuonFeatureContainer_p3.h" +#include "TrigMuonEventTPCnv/IsoMuonFeatureContainerCnv_tlp1.h" +#include "TrigMuonEventTPCnv/IsoMuonFeatureContainerCnv_p2.h" +#include "TrigMuonEventTPCnv/IsoMuonFeatureContainerCnv_p3.h" typedef IsoMuonFeatureContainer_p3 IsoMuonFeatureContainer_PERS; @@ -27,6 +30,11 @@ protected: virtual IsoMuonFeatureContainer_PERS *createPersistent( IsoMuonFeatureContainer *transObj); virtual IsoMuonFeatureContainer *createTransient(); +private: + IsoMuonFeatureContainerCnv_tlp1 m_converter1; + IsoMuonFeatureContainerCnv_p2 m_converter2; + IsoMuonFeatureContainerCnv_p3 m_converter; + }; #endif //ISOMUONFEATURECONTAINER_CNV_H diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureCnv.cxx index 57e39ffbae3549efce526d5a61ecd7a67d59b1f4..c9bf6346d294cc7f0e37d1d1bf38648089defdc4 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureCnv.cxx @@ -27,9 +27,9 @@ MuonFeature* MuonFeatureCnv::createTransient() { mlog << MSG::DEBUG << "MuonFeatureCnv::createTransient " << endmsg; - static pool::Guid p2_guid("3785A9E4-7845-4B54-B49F-DCC2A24409C0"); - static pool::Guid p1_guid("3DFFECBF-3251-4BE7-9D12-B3A9FCAC486E"); - static pool::Guid p0_guid("295FBAFB-ED82-43EA-8B63-6E3D3F4D2A9F"); + static const pool::Guid p2_guid("3785A9E4-7845-4B54-B49F-DCC2A24409C0"); + static const pool::Guid p1_guid("3DFFECBF-3251-4BE7-9D12-B3A9FCAC486E"); + static const pool::Guid p0_guid("295FBAFB-ED82-43EA-8B63-6E3D3F4D2A9F"); if( compareClassGuid(p1_guid) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureContainerCnv.cxx index a6abfc3909b02fc7a6c99fff9675ac1d555bdb2f..37ec46aacb830f6f083ab0592d1862c8cb262901 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureContainerCnv.cxx @@ -1,17 +1,9 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "MuonFeatureContainerCnv.h" -#include "TrigMuonEventTPCnv/MuonFeatureContainerCnv_tlp1.h" -#include "TrigMuonEventTPCnv/MuonFeatureContainerCnv_tlp2.h" - #include "TrigMuonEventTPCnv/MuonFeatureContainer_p3.h" -#include "TrigMuonEventTPCnv/MuonFeatureContainerCnv_p3.h" - -static MuonFeatureContainerCnv_tlp1 TPconverter1; -static MuonFeatureContainerCnv_tlp2 TPconverter2; -static MuonFeatureContainerCnv_p3 TPconverter; //createPersistent MuonFeatureContainer_PERS * MuonFeatureContainerCnv::createPersistent( MuonFeatureContainer *transObj) @@ -20,7 +12,7 @@ MuonFeatureContainer_PERS * MuonFeatureContainerCnv::createPersistent( MuonFeatu mlog << MSG::DEBUG << "MuonFeatureContainerCnv::createPersistent called" << endmsg; - MuonFeatureContainer_PERS * p_cont = TPconverter.createPersistent( transObj, mlog ); + MuonFeatureContainer_PERS * p_cont = m_converter.createPersistent( transObj, mlog ); return p_cont; @@ -34,28 +26,28 @@ MuonFeatureContainer * MuonFeatureContainerCnv::createTransient() mlog << MSG::DEBUG << "MuonFeatureContainerCnv::createTransient called" << endmsg; - static pool::Guid p3_guid( "5B571BCD-FE49-4C56-A357-1B535FE65829" ); - static pool::Guid tlp2_guid( "2F4ABBC8-EA77-487B-820F-76179BB3828C" ); - static pool::Guid tlp1_guid( "039BE61C-DE27-48B3-A2AE-7172BB755CEE" ); - static pool::Guid p0_guid( "45225F26-A517-4E8B-BA93-DDFD1217B9A8" ); + static const pool::Guid p3_guid( "5B571BCD-FE49-4C56-A357-1B535FE65829" ); + static const pool::Guid tlp2_guid( "2F4ABBC8-EA77-487B-820F-76179BB3828C" ); + static const pool::Guid tlp1_guid( "039BE61C-DE27-48B3-A2AE-7172BB755CEE" ); + static const pool::Guid p0_guid( "45225F26-A517-4E8B-BA93-DDFD1217B9A8" ); if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< MuonFeatureContainer_tlp1 > col_vect( poolReadObject< MuonFeatureContainer_tlp1 >() ); // std::cout << "Reading MFC p1" << std::endl; - return TPconverter1.createTransient( col_vect.get(), mlog ) ; + return m_converter1.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( tlp2_guid ) ) { std::unique_ptr< MuonFeatureContainer_tlp2 > col_vect( poolReadObject< MuonFeatureContainer_tlp2 >() ); // std::cout << "Reading MFC p2" << std::endl; - return TPconverter2.createTransient( col_vect.get(), mlog ) ; + return m_converter2.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( p3_guid ) ) { std::unique_ptr< MuonFeatureContainer_p3 > col_vect( poolReadObject< MuonFeatureContainer_p3 >() ); // std::cout << "Reading MFC p3" << std::endl; - return TPconverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( p0_guid ) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureContainerCnv.h index 1d7659f7b99710a77215014cdf6c538fbca3f2dc..eed23b05eb2cc8510c8e72f4a7120ddcbff06c1e 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_MUONFEATURECONTAINER_CNV_H @@ -7,7 +7,9 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigMuonEvent/MuonFeatureContainer.h" -#include "TrigMuonEventTPCnv/MuonFeatureContainer_p3.h" +#include "TrigMuonEventTPCnv/MuonFeatureContainerCnv_tlp1.h" +#include "TrigMuonEventTPCnv/MuonFeatureContainerCnv_tlp2.h" +#include "TrigMuonEventTPCnv/MuonFeatureContainerCnv_p3.h" typedef MuonFeatureContainer_p3 MuonFeatureContainer_PERS; @@ -25,6 +27,10 @@ protected: virtual MuonFeatureContainer_PERS *createPersistent( MuonFeatureContainer *transObj); virtual MuonFeatureContainer *createTransient(); +private: + MuonFeatureContainerCnv_tlp1 m_converter1; + MuonFeatureContainerCnv_tlp2 m_converter2; + MuonFeatureContainerCnv_p3 m_converter; }; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsCnv.cxx index 8e43e2e68082e22b60bf98c0c7ba57c7825b8ff1..4bf20ab6f6c7f788d75ed28ba98f9275594f1a6c 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsCnv.cxx @@ -26,7 +26,7 @@ MuonFeatureDetails* MuonFeatureDetailsCnv::createTransient() { mlog << MSG::DEBUG << "MuonFeatureDetailsCnv::createTransient " << endmsg; - static pool::Guid p1_guid("E841B555-766B-48EF-96F8-F4BE39EE8BCB"); + static const pool::Guid p1_guid("E841B555-766B-48EF-96F8-F4BE39EE8BCB"); if( compareClassGuid(p1_guid) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsContainerCnv.cxx index 9ccb1f5c701aec53e8642eca79c641674c5ada8e..6b66b0b0b3b6c95f7b3837fcddcb6443cbe49d65 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsContainerCnv.cxx @@ -1,22 +1,17 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "MuonFeatureDetailsContainerCnv.h" #include "TrigMuonEventTPCnv/MuonFeatureDetailsContainer_tlp1.h" -#include "TrigMuonEventTPCnv/MuonFeatureDetailsContainerCnv_tlp1.h" - #include "TrigMuonEventTPCnv/MuonFeatureDetailsContainer_p2.h" -#include "TrigMuonEventTPCnv/MuonFeatureDetailsContainerCnv_p2.h" -static MuonFeatureDetailsContainerCnv_tlp1 TLPconverter1; -static MuonFeatureDetailsContainerCnv_p2 TPconverter; - + MuonFeatureDetailsContainer_PERS * MuonFeatureDetailsContainerCnv::createPersistent( MuonFeatureDetailsContainer *transObj) { MsgStream mlog(msgSvc(), "MuonFeatureDetailsContainerConverter" ); mlog << MSG::DEBUG << "MuonFeatureDetailsContainerCnv::createPersistent called" << endmsg; - MuonFeatureDetailsContainer_PERS * p_cont = TPconverter.createPersistent( transObj, mlog ); + MuonFeatureDetailsContainer_PERS * p_cont = m_converter.createPersistent( transObj, mlog ); return p_cont; } @@ -27,18 +22,18 @@ MuonFeatureDetailsContainer * MuonFeatureDetailsContainerCnv::createTransient() MsgStream mlog(msgSvc(), "MuonFeatureDetailsContainerConverter" ); // mlog << MSG::DEBUG << "MuonFeatureDetailsContainerCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "CF2FFCB2-3936-4800-9146-52B203A47478" ); - static pool::Guid p2_guid( "95327E52-C8B2-45E4-9EAF-C65A17AB27F5" ); + static const pool::Guid tlp1_guid( "CF2FFCB2-3936-4800-9146-52B203A47478" ); + static const pool::Guid p2_guid( "95327E52-C8B2-45E4-9EAF-C65A17AB27F5" ); if( compareClassGuid( p2_guid ) ){ std::unique_ptr< MuonFeatureDetailsContainer_p2 > col_vect( poolReadObject< MuonFeatureDetailsContainer_p2 >() ); // std::cout << "Reading MFDC p2" << std::endl; - return TPconverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( tlp1_guid ) ){ std::unique_ptr< MuonFeatureDetailsContainer_tlp1 > col_vect( poolReadObject< MuonFeatureDetailsContainer_tlp1 >() ); // std::cout << "Reading MFDC tlp1" << std::endl; - return TLPconverter1.createTransient( col_vect.get(), mlog ); + return m_converter1.createTransient( col_vect.get(), mlog ); } else throw std::runtime_error( "Unsupported persistent version of MuonFeatureDetailsContainer" ); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsContainerCnv.h index 9849c8d4c357fdc89516461d6715dec587fbb393..d976f1679bdc27ac6095e00a5521217f9b93c284 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/MuonFeatureDetailsContainerCnv.h @@ -1,14 +1,15 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_MUONFEATUREDETAILSCONTAINER_CNV_H #define TRIGEVENTATHENAPOOL_MUONFEATUREDETAILSCONTAINER_CNV_H -// #include "GaudiKernel/MsgStream.h" #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigMuonEvent/MuonFeatureDetailsContainer.h" #include "TrigMuonEventTPCnv/MuonFeatureDetailsContainer_p2.h" +#include "TrigMuonEventTPCnv/MuonFeatureDetailsContainerCnv_tlp1.h" +#include "TrigMuonEventTPCnv/MuonFeatureDetailsContainerCnv_p2.h" typedef MuonFeatureDetailsContainer_p2 MuonFeatureDetailsContainer_PERS; @@ -27,6 +28,10 @@ protected: virtual MuonFeatureDetailsContainer_PERS *createPersistent( MuonFeatureDetailsContainer *transObj); virtual MuonFeatureDetailsContainer *createTransient(); +private: + MuonFeatureDetailsContainerCnv_tlp1 m_converter1; + MuonFeatureDetailsContainerCnv_p2 m_converter; + }; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsCnv.cxx index d58d04835c66eea20fac49c3a25efa4710022e0e..d2f96216fe0ab1048e021a4c9e73458e5ad600ee 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsCnv.cxx @@ -30,7 +30,7 @@ RingerRings* RingerRingsCnv::createTransient() { MsgStream mlog(msgSvc(), "RingerRingsConverter" ); mlog << MSG::DEBUG << "RingerRingsCnv::createTransient " << endmsg; - static pool::Guid tlp1_guid("7A3BC015-8ECE-44A9-A2BD-9D52B3D2B354"); + static const pool::Guid tlp1_guid("7A3BC015-8ECE-44A9-A2BD-9D52B3D2B354"); RingerRings *trans_cont(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsContainerCnv.cxx index aa56757579da0af9262b20dfa76ad813e058f68c..0e4e086d41423be7f490a7da7efb6564e75af6f4 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsContainerCnv.cxx @@ -1,21 +1,16 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "RingerRingsContainerCnv.h" -#include "TrigCaloEventTPCnv/RingerRingsContainerCnv_tlp1.h" -#include "TrigCaloEventTPCnv/RingerRingsContainerCnv_p2.h" -static RingerRingsContainerCnv_tlp1 TPConverter_tlp1; -static RingerRingsContainerCnv_p2 TPConverter; - // createPersistent RingerRingsContainer_PERS *RingerRingsContainerCnv::createPersistent(RingerRingsContainer *transObj) { MsgStream mlog(msgSvc(), "RingerRingsContainerConverter"); mlog << MSG::DEBUG << "RingerRingsContainerCnv::createPersistent called" << endmsg; - RingerRingsContainer_PERS *p_RingerRingsCont = TPConverter.createPersistent(transObj, mlog); + RingerRingsContainer_PERS *p_RingerRingsCont = m_converter.createPersistent(transObj, mlog); return p_RingerRingsCont; @@ -28,17 +23,17 @@ RingerRingsContainer *RingerRingsContainerCnv::createTransient() { mlog << MSG::DEBUG << "RingerRingsContainerCnv::createTransient called" << endmsg; - static pool::Guid p2_guid("30D29B68-6D41-429E-AC16-930ACF71280D"); - static pool::Guid tlp1_guid("B5587828-50D8-4DAA-97F3-5E41A7F3E3FE"); + static const pool::Guid p2_guid("30D29B68-6D41-429E-AC16-930ACF71280D"); + static const pool::Guid tlp1_guid("B5587828-50D8-4DAA-97F3-5E41A7F3E3FE"); if( compareClassGuid( p2_guid ) ){ std::unique_ptr< RingerRingsContainer_p2 > col_vect( poolReadObject< RingerRingsContainer_p2 >() ); // std::cout << "Reading IMFC p2" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if (compareClassGuid(tlp1_guid)) { std::unique_ptr< RingerRingsContainer_tlp1 > col_vect( poolReadObject< RingerRingsContainer_tlp1 >() ); // std::cout << "Reading IMFC tlp1" << std::endl; - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else { throw std::runtime_error("Unsupported persistent version of RingerRingsContainer"); } }//end of create transient method diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsContainerCnv.h index b966e64927755f3818294fcf88f3754c9a5375d0..3435ed7d53967fb8854941023fa78d36f9ba7bd6 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/RingerRingsContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_RINGERRINGSCONTAINER_CNV_H @@ -10,8 +10,10 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigCaloEvent/RingerRingsContainer.h" +#include "TrigCaloEventTPCnv/RingerRingsContainerCnv_tlp1.h" #include "TrigCaloEventTPCnv/RingerRingsContainerCnv_p2.h" - + + typedef RingerRingsContainer_p2 RingerRingsContainer_PERS; typedef T_AthenaPoolCustomCnv RingerRingsContainerCnvBase; @@ -28,7 +30,11 @@ protected: virtual RingerRingsContainer_PERS *createPersistent(RingerRingsContainer *transObj); virtual RingerRingsContainer *createTransient(); - + +private: + RingerRingsContainerCnv_tlp1 m_converter_tlp1; + RingerRingsContainerCnv_p2 m_converter; + }; #endif diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureCnv.cxx index ce93887d1d2891e0a802eb795d7f132df96df14b..e5ed38cf80cbf33bfcc0ba1f4c9e949e088d466b 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureCnv.cxx @@ -32,10 +32,10 @@ TileMuFeature* TileMuFeatureCnv::createTransient() { mlog << MSG::DEBUG << "TileMuFeatureCnv::createTransient " << endmsg; - static pool::Guid p1_guid("F853E605-AFD5-44F9-98BC-4D777CBCBEE4"); + static const pool::Guid p1_guid("F853E605-AFD5-44F9-98BC-4D777CBCBEE4"); // from "TrigEvent/TrigMuonEventTPCnv/TrigMuonEventTPCnv/selection.xml" - static pool::Guid p0_guid("526B0709-442D-4D2C-8C1F-8C3922149656"); + static const pool::Guid p0_guid("526B0709-442D-4D2C-8C1F-8C3922149656"); // from "TrigEvent/TrigMuonEvent/TrigMuonEvent/selection.xml" if( compareClassGuid(p1_guid) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureContainerCnv.cxx index 5538eb575cadb52b6ba5c7c404b9bb7fae465231..15737280da84ee0b5817c3c9e2a69d7530369d20 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureContainerCnv.cxx @@ -1,15 +1,11 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TileMuFeatureContainerCnv.h" -#include "TrigMuonEventTPCnv/TileMuFeatureContainerCnv_tlp1.h" #include "TrigMuonEventTPCnv/TileMuFeatureContainer_p2.h" -#include "TrigMuonEventTPCnv/TileMuFeatureContainerCnv_p2.h" -static TileMuFeatureContainerCnv_tlp1 TLPconverter1; -static TileMuFeatureContainerCnv_p2 TPconverter; //createPersistent TileMuFeatureContainer_PERS * TileMuFeatureContainerCnv::createPersistent( TileMuFeatureContainer *transObj) @@ -18,7 +14,7 @@ TileMuFeatureContainer_PERS * TileMuFeatureContainerCnv::createPersistent( TileM mlog << MSG::DEBUG << "TileMuFeatureContainerCnv::createPersistent called" << endmsg; - TileMuFeatureContainer_PERS * p_cont = TPconverter.createPersistent( transObj, mlog ); + TileMuFeatureContainer_PERS * p_cont = m_converter.createPersistent( transObj, mlog ); return p_cont; @@ -31,17 +27,17 @@ TileMuFeatureContainer * TileMuFeatureContainerCnv::createTransient() mlog << MSG::DEBUG << "TileMuFeatureContainerCnv::createTransient called" << endmsg; - static pool::Guid p2_guid( "D7B3C086-B471-47EE-B8EC-E58DC4CD2AD9" ); - static pool::Guid tlp1_guid( "4684172D-3590-4464-BCA6-477725ADD755" ); - static pool::Guid p0_guid( "8B428EC4-339C-4517-A047-C0F5F98B820B" ); + static const pool::Guid p2_guid( "D7B3C086-B471-47EE-B8EC-E58DC4CD2AD9" ); + static const pool::Guid tlp1_guid( "4684172D-3590-4464-BCA6-477725ADD755" ); + static const pool::Guid p0_guid( "8B428EC4-339C-4517-A047-C0F5F98B820B" ); if( compareClassGuid( p2_guid ) ){ std::unique_ptr< TileMuFeatureContainer_p2 > col_vect( poolReadObject< TileMuFeatureContainer_p2 >() ); - return TPconverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; }else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TileMuFeatureContainer_tlp1 > col_vect( poolReadObject< TileMuFeatureContainer_tlp1 >() ); - return TLPconverter1.createTransient( col_vect.get(), mlog ); + return m_converter1.createTransient( col_vect.get(), mlog ); }else if( compareClassGuid( p0_guid ) ){ diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureContainerCnv.h index d431f36fcfd66c9d9ffed2ab7a990ec9be061d5d..e1eb61a304babcd3f43c71ee20de5c17dabf111b 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileMuFeatureContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TILEMUFEATURECONTAINER_CNV_H @@ -8,6 +8,8 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigMuonEvent/TileMuFeatureContainer.h" #include "TrigMuonEventTPCnv/TileMuFeatureContainer_p2.h" +#include "TrigMuonEventTPCnv/TileMuFeatureContainerCnv_tlp1.h" +#include "TrigMuonEventTPCnv/TileMuFeatureContainerCnv_p2.h" typedef TileMuFeatureContainer_p2 TileMuFeatureContainer_PERS; @@ -26,6 +28,10 @@ protected: virtual TileMuFeatureContainer_PERS *createPersistent( TileMuFeatureContainer *transObj); virtual TileMuFeatureContainer *createTransient(); +private: + TileMuFeatureContainerCnv_tlp1 m_converter1; + TileMuFeatureContainerCnv_p2 m_converter; + }; #endif //TILEMUFEATURECONTAINER_CNV_H diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileTrackMuFeatureContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileTrackMuFeatureContainerCnv.cxx index a15e8fd46564ef289f8687f7f62f03cceaa18f86..1578eb9e87dfe8e6328871981a1daad96a62e6ef 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileTrackMuFeatureContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileTrackMuFeatureContainerCnv.cxx @@ -1,15 +1,11 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TileTrackMuFeatureContainerCnv.h" -#include "TrigMuonEventTPCnv/TileTrackMuFeatureContainerCnv_tlp1.h" #include "TrigMuonEventTPCnv/TileTrackMuFeatureContainer_p3.h" -#include "TrigMuonEventTPCnv/TileTrackMuFeatureContainerCnv_p3.h" -static TileTrackMuFeatureContainerCnv_tlp1 TLPconverter1; -static TileTrackMuFeatureContainerCnv_p3 TPconverter; //createPersistent TileTrackMuFeatureContainer_PERS * TileTrackMuFeatureContainerCnv::createPersistent( TileTrackMuFeatureContainer *transObj) @@ -18,7 +14,7 @@ TileTrackMuFeatureContainer_PERS * TileTrackMuFeatureContainerCnv::createPersist mlog << MSG::DEBUG << "TileTrackMuFeatureContainerCnv::createPersistent called" << endmsg; - TileTrackMuFeatureContainer_PERS * p_cont = TPconverter.createPersistent( transObj, mlog ); + TileTrackMuFeatureContainer_PERS * p_cont = m_converter.createPersistent( transObj, mlog ); return p_cont; @@ -32,17 +28,17 @@ TileTrackMuFeatureContainer * TileTrackMuFeatureContainerCnv::createTransient() mlog << MSG::DEBUG << "TileTrackMuFeatureContainerCnv::createTransient called" << endmsg; - static pool::Guid p3_guid( "25018D00-1D18-4B4C-9C07-37993260EADB"); - static pool::Guid tlp1_guid( "983ED5FE-D0A2-43AE-90A9-268C8B61E8B3"); - static pool::Guid p0_guid( "1AFABC18-EB97-412D-B27C-C744ABA6E1DC"); + static const pool::Guid p3_guid( "25018D00-1D18-4B4C-9C07-37993260EADB"); + static const pool::Guid tlp1_guid( "983ED5FE-D0A2-43AE-90A9-268C8B61E8B3"); + static const pool::Guid p0_guid( "1AFABC18-EB97-412D-B27C-C744ABA6E1DC"); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TileTrackMuFeatureContainer_p3 > col_vect( poolReadObject< TileTrackMuFeatureContainer_p3 >() ); - return TPconverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; }else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TileTrackMuFeatureContainer_tlp1 > col_vect( poolReadObject< TileTrackMuFeatureContainer_tlp1 >() ); - return TLPconverter1.createTransient( col_vect.get(), mlog ); + return m_converter1.createTransient( col_vect.get(), mlog ); }else if( compareClassGuid( p0_guid ) ){ diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileTrackMuFeatureContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileTrackMuFeatureContainerCnv.h index 47b884c47e62aa27c6c3a26d36fbf780a27d7f0f..8e2abc349ba50791fa8aac547e16d4d3ca5e5026 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TileTrackMuFeatureContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TileTrackMuFeatureContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -22,6 +22,8 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigMuonEvent/TileTrackMuFeatureContainer.h" #include "TrigMuonEventTPCnv/TileTrackMuFeatureContainer_p3.h" +#include "TrigMuonEventTPCnv/TileTrackMuFeatureContainerCnv_tlp1.h" +#include "TrigMuonEventTPCnv/TileTrackMuFeatureContainerCnv_p3.h" //----------------------------------------------------------------------------- // Base class definition @@ -45,7 +47,11 @@ protected: virtual TileTrackMuFeatureContainer_PERS *createPersistent( TileTrackMuFeatureContainer *transObj); virtual TileTrackMuFeatureContainer *createTransient(); - + +private: + TileTrackMuFeatureContainerCnv_tlp1 m_converter1; + TileTrackMuFeatureContainerCnv_p3 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCaloClusterContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCaloClusterContainerCnv.cxx index aa52a59064a84b3d31ff29b8de40b1156bf03007..4815ba3a62f39e1a231622f40f1e07d0583e4c7f 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCaloClusterContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCaloClusterContainerCnv.cxx @@ -1,11 +1,8 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigCaloClusterContainerCnv.h" -#include "TrigCaloEventTPCnv/TrigCaloClusterContainerCnv_p3.h" - -static TrigCaloClusterContainerCnv_p3 TPConverter; //createPersistent TrigCaloClusterContainer_PERS * TrigCaloClusterContainerCnv::createPersistent( TrigCaloClusterContainer *transObj) @@ -14,7 +11,7 @@ TrigCaloClusterContainer_PERS * TrigCaloClusterContainerCnv::createPersistent( T mlog << MSG::DEBUG << "TrigCaloClusterContainerCnv::createPersistent called" << endmsg; - TrigCaloClusterContainer_PERS * p_CaloClusterCont = TPConverter.createPersistent( transObj, mlog ); + TrigCaloClusterContainer_PERS * p_CaloClusterCont = m_converter.createPersistent( transObj, mlog ); return p_CaloClusterCont; @@ -27,12 +24,12 @@ TrigCaloClusterContainer * TrigCaloClusterContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigCaloClusterContainerCnv::createTransient called" << endmsg; - static pool::Guid p3_guid( "98A28943-662A-4141-82C3-537447264DA3" ); + static const pool::Guid p3_guid( "98A28943-662A-4141-82C3-537447264DA3" ); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigCaloClusterContainer_p3 > col_vect( poolReadObject< TrigCaloClusterContainer_p3 >() ); // std::cout << "Reading IMFC p3" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else { throw std::runtime_error( "Unsupported persistent version of TrigCaloClusterContainer" ); } }//end of create transient method diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCaloClusterContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCaloClusterContainerCnv.h index 06d37510fdb7efdbc717c1f13c7e0aba6ad78692..bc41e170ef6130f0847c222e351823b6c6698660 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCaloClusterContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCaloClusterContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGCALOCLUSTERCONTAINER_CNV_H @@ -30,7 +30,10 @@ protected: virtual TrigCaloClusterContainer_PERS *createPersistent( TrigCaloClusterContainer *transObj); virtual TrigCaloClusterContainer *createTransient(); - + +private: + TrigCaloClusterContainerCnv_p3 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeCnv.cxx index 288ca8bab487cb98207138507d6f692ccb4ac4ef..3844415e5db29394f606bc692779c4d44989b1b9 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeCnv.cxx @@ -37,7 +37,7 @@ TrigComposite* TrigCompositeCnv::createTransient() MsgStream mlog(msgSvc(), "TrigCompositeConverter" ); mlog << MSG::DEBUG << "TrigCompositeCnv::createTransient " << endmsg; - static pool::Guid p1_guid("53F70884-38EE-4D08-9F03-FA8BED725B63"); + static const pool::Guid p1_guid("53F70884-38EE-4D08-9F03-FA8BED725B63"); TrigComposite *trans_cont(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeContainerCnv.cxx index 5421db0bc9cecf88f5683d7e174a2629055ec9b1..ce89297f692d92400fc736b24b1250c95ed0317d 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeContainerCnv.cxx @@ -1,11 +1,8 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigCompositeContainerCnv.h" -#include "TrigCombinedEventTPCnv/TrigCompositeContainerCnv_p1.h" - -static TrigCompositeContainerCnv_p1 TPConverter; //createPersistent TrigCompositeContainer_PERS * TrigCompositeContainerCnv::createPersistent( TrigCompositeContainer *transObj) @@ -14,7 +11,7 @@ TrigCompositeContainer_PERS * TrigCompositeContainerCnv::createPersistent( TrigC mlog << MSG::DEBUG << "TrigCompositeContainerCnv::createPersistent called" << endmsg; - TrigCompositeContainer_PERS * p_CompositeCont = TPConverter.createPersistent( transObj, mlog ); + TrigCompositeContainer_PERS * p_CompositeCont = m_converter.createPersistent( transObj, mlog ); return p_CompositeCont; @@ -27,13 +24,13 @@ TrigCompositeContainer * TrigCompositeContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigCompositeContainerCnv::createTransient called" << endmsg; - static pool::Guid p1_guid( "6D16EA6B-968C-41F0-B5E8-9CC6D5BD7F9A" ); + static const pool::Guid p1_guid( "6D16EA6B-968C-41F0-B5E8-9CC6D5BD7F9A" ); if( compareClassGuid( p1_guid ) ){ std::unique_ptr< TrigCompositeContainer_p1 > col_vect( poolReadObject< TrigCompositeContainer_p1 >() ); // std::cout << "Reading IMFC p1" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else { throw std::runtime_error( "Unsupported persistent version of TrigCompositeContainer" ); } }//end of create transient method diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeContainerCnv.h index 9c6e066c247b53302ea63f68f34e1c665d119b84..43ec13c545be66f57ca67ef1f037ce25aca7406b 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigCompositeContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGCOMPOSITECONTAINER_CNV_H @@ -11,7 +11,7 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigCombinedEvent/TrigCompositeContainer.h" #include "TrigCombinedEventTPCnv/TrigCompositeContainerCnv_p1.h" - + typedef TrigCompositeContainer_p1 TrigCompositeContainer_PERS; typedef T_AthenaPoolCustomCnv TrigCompositeContainerCnvBase; @@ -30,6 +30,9 @@ protected: virtual TrigCompositeContainer_PERS *createPersistent( TrigCompositeContainer *transObj); virtual TrigCompositeContainer *createTransient(); + +private: + TrigCompositeContainerCnv_p1 m_converter; };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigDecisionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigDecisionCnv.cxx index 1cfe1701696f5171c73e1326a8fe87c541cb089c..e14adab344ac96317716bf657f770832f1749c85 100755 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigDecisionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigDecisionCnv.cxx @@ -37,11 +37,11 @@ TrigDec::TrigDecision* TrigDecisionCnv::createTransient() { MsgStream log(msgSvc(), "TrigDecisionConverter" ); - static pool::Guid p1_guid("83D7E08D-CF8C-47A0-963F-5618A9509334"); - static pool::Guid p2_guid("6BE81E51-B42B-4783-957D-84E7F383E9D5"); - static pool::Guid p3_guid("1C0527B6-1B94-4F47-ADE4-D24E7BF91D3E"); - static pool::Guid p4_guid("78F57689-0902-4E47-BB04-9BD10C7EF8B5"); - static pool::Guid p5_guid("DA3DEF39-2401-4A8E-ACD2-851B0DF10AFA"); + static const pool::Guid p1_guid("83D7E08D-CF8C-47A0-963F-5618A9509334"); + static const pool::Guid p2_guid("6BE81E51-B42B-4783-957D-84E7F383E9D5"); + static const pool::Guid p3_guid("1C0527B6-1B94-4F47-ADE4-D24E7BF91D3E"); + static const pool::Guid p4_guid("78F57689-0902-4E47-BB04-9BD10C7EF8B5"); + static const pool::Guid p5_guid("DA3DEF39-2401-4A8E-ACD2-851B0DF10AFA"); if ( compareClassGuid(p1_guid) ) { // using unique_ptr ensures deletion of the persistent object diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEFBjetContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEFBjetContainerCnv.cxx index 556ddd52fb63846379996e7d04b4137b5333cbaa..59e6a07859de5674ef2b82aad6227bbac8ee0493 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEFBjetContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEFBjetContainerCnv.cxx @@ -46,10 +46,10 @@ TrigEFBjetContainer * TrigEFBjetContainerCnv::createTransient() { mlog << MSG::DEBUG << "TrigEFBjetContainerCnv::createTransient called" << endmsg; - static pool::Guid tlp2_guid( "91EA22B6-9273-4206-AEB5-FE23A269C5AA" ); - static pool::Guid tlp1_guid( "F933A067-5788-4AD6-B696-C8B0E988EF2D" ); - static pool::Guid p0_guid( "EDAFEE8F-968E-44A4-BEED-7E7F5C86F397" ); - static pool::Guid p0_guid2( "D08290EE-4CB3-4570-BF7E-0FA008668A24" ); + static const pool::Guid tlp2_guid( "91EA22B6-9273-4206-AEB5-FE23A269C5AA" ); + static const pool::Guid tlp1_guid( "F933A067-5788-4AD6-B696-C8B0E988EF2D" ); + static const pool::Guid p0_guid( "EDAFEE8F-968E-44A4-BEED-7E7F5C86F397" ); + static const pool::Guid p0_guid2( "D08290EE-4CB3-4570-BF7E-0FA008668A24" ); TrigEFBjetContainer *p_collection = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEFBphysContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEFBphysContainerCnv.cxx index 152f59622bd9edccc38b2826790a408df62ab5e0..4491433eaa37eccd4fb2fd054de542d4cca59dd0 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEFBphysContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEFBphysContainerCnv.cxx @@ -46,10 +46,10 @@ TrigEFBphysContainer * TrigEFBphysContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigEFBphysContainerCnv::createTransient called" << endmsg; - static pool::Guid tlp2_guid( "D93906C2-4F81-44A7-98BE-71302891FE44" ); - static pool::Guid tlp1_guid( "5F5B068F-32DB-4CC9-BA9E-C74C076AAAA1" ); - static pool::Guid p0_guid( "033EAD89-6721-46F2-9D32-2670BA63B901" ); - static pool::Guid p0_guid2( "760BB4E7-61C1-4365-BE20-C8251E808BA4" ); + static const pool::Guid tlp2_guid( "D93906C2-4F81-44A7-98BE-71302891FE44" ); + static const pool::Guid tlp1_guid( "5F5B068F-32DB-4CC9-BA9E-C74C076AAAA1" ); + static const pool::Guid p0_guid( "033EAD89-6721-46F2-9D32-2670BA63B901" ); + static const pool::Guid p0_guid2( "760BB4E7-61C1-4365-BE20-C8251E808BA4" ); TrigEFBphysContainer *p_collection = 0; if( compareClassGuid( tlp2_guid ) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterCnv.cxx index ccfec204ac36aab83863cbf966d85c0100faf385..4511889e587fb58f35c5f23750b16fbe46f6c1ea 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterCnv.cxx @@ -38,9 +38,9 @@ TrigEMCluster* TrigEMClusterCnv::createTransient() MsgStream mlog(msgSvc(), "TrigEMClusterConverter" ); mlog << MSG::DEBUG << "TrigEMClusterCnv::createTransient " << endmsg; - static pool::Guid tlp2_guid("61D02BB3-0F97-4809-AC93-72B2DC2DF624"); - static pool::Guid tlp1_guid("EF5124F2-7B9C-4CBE-8D7F-1AD368A8A125"); - static pool::Guid p0_guid("E60986AE-938E-4256-A100-CD99158ADE9E"); + static const pool::Guid tlp2_guid("61D02BB3-0F97-4809-AC93-72B2DC2DF624"); + static const pool::Guid tlp1_guid("EF5124F2-7B9C-4CBE-8D7F-1AD368A8A125"); + static const pool::Guid p0_guid("E60986AE-938E-4256-A100-CD99158ADE9E"); TrigEMCluster *trans_cont(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterContainerCnv.cxx index 1b3b7686b5a9aa47f314081579d075cda55a28df..a7bfebacd27fe1c568152f89a91dc7ae689d9825 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterContainerCnv.cxx @@ -1,15 +1,9 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigEMClusterContainerCnv.h" -#include "TrigCaloEventTPCnv/TrigEMClusterContainerCnv_tlp1.h" -#include "TrigCaloEventTPCnv/TrigEMClusterContainerCnv_p4.h" -#include "TrigCaloEventTPCnv/TrigEMClusterContainerCnv_p3.h" -static TrigEMClusterContainerCnv_tlp1 TPConverter_tlp1; -static TrigEMClusterContainerCnv_p4 TPConverter; -static TrigEMClusterContainerCnv_p3 TPConverter_p3; //createPersistent TrigEMClusterContainer_PERS * TrigEMClusterContainerCnv::createPersistent( TrigEMClusterContainer *transObj) @@ -18,7 +12,7 @@ TrigEMClusterContainer_PERS * TrigEMClusterContainerCnv::createPersistent( TrigE mlog << MSG::DEBUG << "TrigEMClusterContainerCnv::createPersistent called" << endmsg; - TrigEMClusterContainer_PERS * p_EMClusterCont = TPConverter.createPersistent( transObj, mlog ); + TrigEMClusterContainer_PERS * p_EMClusterCont = m_converter.createPersistent( transObj, mlog ); return p_EMClusterCont; @@ -31,20 +25,20 @@ TrigEMClusterContainer * TrigEMClusterContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigEMClusterContainerCnv::createTransient called" << endmsg; - static pool::Guid p3_guid( "0BF627E6-52A0-4F10-9FFD-A513DF2DBC31" ); - static pool::Guid p4_guid( "7B430CA8-5D16-4E26-B0A4-461F983610EB" ); - static pool::Guid tlp1_guid( "CAA8145E-F382-4727-A114-26E137D4B27E" ); + static const pool::Guid p3_guid( "0BF627E6-52A0-4F10-9FFD-A513DF2DBC31" ); + static const pool::Guid p4_guid( "7B430CA8-5D16-4E26-B0A4-461F983610EB" ); + static const pool::Guid tlp1_guid( "CAA8145E-F382-4727-A114-26E137D4B27E" ); if( compareClassGuid( p4_guid ) ){ std::unique_ptr< TrigEMClusterContainer_p4 > col_vect( poolReadObject< TrigEMClusterContainer_p4 >() ); // std::cout << "Reading IMFC p4" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigEMClusterContainer_p3 > col_vect( poolReadObject< TrigEMClusterContainer_p3 >() ); - return TPConverter_p3.createTransient( col_vect.get(), mlog ) ; + return m_converter_p3.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigEMClusterContainer_tlp1 > col_vect( poolReadObject< TrigEMClusterContainer_tlp1 >() ); - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else { throw std::runtime_error( "Unsupported persistent version of TrigEMClusterContainer" ); } }//end of create transient method diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterContainerCnv.h index 724d17182b47df5b23247bac937ebe0d6ae1df42..127b8ea146f74141b3b3778e19328c16184fea62 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigEMClusterContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGEMCLUSTERCONTAINER_CNV_H @@ -10,8 +10,10 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigCaloEvent/TrigEMClusterContainer.h" +#include "TrigCaloEventTPCnv/TrigEMClusterContainerCnv_tlp1.h" +#include "TrigCaloEventTPCnv/TrigEMClusterContainerCnv_p3.h" #include "TrigCaloEventTPCnv/TrigEMClusterContainerCnv_p4.h" - + typedef TrigEMClusterContainer_p4 TrigEMClusterContainer_PERS; typedef T_AthenaPoolCustomCnv TrigEMClusterContainerCnvBase; @@ -26,11 +28,16 @@ class TrigEMClusterContainerCnv : public TrigEMClusterContainerCnvBase public: TrigEMClusterContainerCnv( ISvcLocator *svcloc ): TrigEMClusterContainerCnvBase(svcloc){} protected: - virtual TrigEMClusterContainer_PERS *createPersistent( TrigEMClusterContainer *transObj); virtual TrigEMClusterContainer *createTransient(); - + +private: + TrigEMClusterContainerCnv_tlp1 m_converter_tlp1; + TrigEMClusterContainerCnv_p4 m_converter; + TrigEMClusterContainerCnv_p3 m_converter_p3; + + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigElectronContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigElectronContainerCnv.cxx index 6ad7d1cfb4defc7bbfb870ecd0b1f603be56a2a1..716af26f65b0b7bf8016a7d15dd9fb4b327bfcbb 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigElectronContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigElectronContainerCnv.cxx @@ -1,17 +1,9 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigElectronContainerCnv.h" -#include "TrigParticleTPCnv/TrigElectronContainerCnv_tlp1.h" -#include "TrigParticleTPCnv/TrigElectronContainerCnv_tlp2.h" - #include "TrigParticleTPCnv/TrigElectronContainer_p3.h" -#include "TrigParticleTPCnv/TrigElectronContainerCnv_p3.h" - -static TrigElectronContainerCnv_tlp1 TPConverter_tlp1; -static TrigElectronContainerCnv_tlp2 TPConverter_tlp2; -static TrigElectronContainerCnv_p3 TPConverter; //create persistent TrigElectronContainer_PERS* TrigElectronContainerCnv::createPersistent(TrigElectronContainer* transCont) @@ -19,7 +11,7 @@ TrigElectronContainer_PERS* TrigElectronContainerCnv::createPersistent(TrigElect MsgStream mlog(msgSvc(), "TrigElectronContainerConverter" ); mlog << MSG::DEBUG << "TrigElectronContainerCnv::createPersistent" << endmsg; - TrigElectronContainer_PERS *persObj = TPConverter.createPersistent( transCont, mlog ); + TrigElectronContainer_PERS *persObj = m_converter.createPersistent( transCont, mlog ); return persObj; } @@ -30,26 +22,26 @@ TrigElectronContainer* TrigElectronContainerCnv::createTransient() MsgStream mlog(msgSvc(), "TrigElectronContainerConverter" ); mlog << MSG::DEBUG << "TrigElectronContainerCnv::createTransient" << endmsg; - static pool::Guid p3_guid("F2E0066A-3BC5-44F2-A18C-57C63481988D"); - static pool::Guid tlp2_guid("2EDB14B9-0B61-4014-90C2-20AEB7AAFEBE"); - static pool::Guid tlp1_guid("8831D2A9-F4B6-40BE-97C1-4BD7F9468267"); - static pool::Guid p0_guid2("2F97E0FB-7C93-4616-B322-1A01BF65D331"); - static pool::Guid p0_guid1("EA6EA1A5-16FC-4DBF-896E-D933B25E65E0"); + static const pool::Guid p3_guid("F2E0066A-3BC5-44F2-A18C-57C63481988D"); + static const pool::Guid tlp2_guid("2EDB14B9-0B61-4014-90C2-20AEB7AAFEBE"); + static const pool::Guid tlp1_guid("8831D2A9-F4B6-40BE-97C1-4BD7F9468267"); + static const pool::Guid p0_guid2("2F97E0FB-7C93-4616-B322-1A01BF65D331"); + static const pool::Guid p0_guid1("EA6EA1A5-16FC-4DBF-896E-D933B25E65E0"); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigElectronContainer_p3 > col_vect( poolReadObject< TrigElectronContainer_p3 >() ); // std::cout << "Reading IMFC p3" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if ( compareClassGuid(tlp2_guid) ) { std::unique_ptr< TrigElectronContainer_tlp2 > col_vect( poolReadObject< TrigElectronContainer_tlp2 >() ); - return TPConverter_tlp2.createTransient( col_vect.get(), mlog ); + return m_converter_tlp2.createTransient( col_vect.get(), mlog ); } else if ( compareClassGuid(tlp1_guid) ) { std::unique_ptr< TrigElectronContainer_tlp1 > col_vect( poolReadObject< TrigElectronContainer_tlp1 >() ); - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else if ( compareClassGuid(p0_guid1) || compareClassGuid(p0_guid2) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigElectronContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigElectronContainerCnv.h index 4b44a8168bbeb9d7d44341a8c0a7366243535dcb..bd16e3e4d90dbacf69158e901c20d55680d13324 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigElectronContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigElectronContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGELECTRONCONTAINERCNV_H @@ -10,6 +10,9 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigParticle/TrigElectronContainer.h" #include "TrigParticleTPCnv/TrigElectronContainer_p3.h" +#include "TrigParticleTPCnv/TrigElectronContainerCnv_tlp1.h" +#include "TrigParticleTPCnv/TrigElectronContainerCnv_tlp2.h" +#include "TrigParticleTPCnv/TrigElectronContainerCnv_p3.h" typedef TrigElectronContainer_p3 TrigElectronContainer_PERS; typedef T_AthenaPoolCustomCnv TrigElectronContainerCnvBase; @@ -27,6 +30,12 @@ protected: virtual TrigElectronContainer_PERS* createPersistent(TrigElectronContainer* transCont); virtual TrigElectronContainer* createTransient (); +private: + TrigElectronContainerCnv_tlp1 m_converter_tlp1; + TrigElectronContainerCnv_tlp2 m_converter_tlp2; + TrigElectronContainerCnv_p3 m_converter; + + }; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto1DCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto1DCnv.cxx index 0bb9292a0c4ff43c7c11fa6d2c79c136bae4f0c8..43ef6a2ac4f974848d350c7ded2bc20db2e5952b 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto1DCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto1DCnv.cxx @@ -22,7 +22,7 @@ TrigHisto1D* TrigHisto1DCnv::createTransient() { MsgStream mlog(msgSvc(), "TrigHisto1DConverter" ); mlog << MSG::DEBUG << "TrigHisto1DCnv::createTransient " << endmsg; - static pool::Guid p1_guid("C304621E-2266-4863-9B47-7C3450B00399"); + static const pool::Guid p1_guid("C304621E-2266-4863-9B47-7C3450B00399"); TrigHisto1D *transObj = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto1DContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto1DContainerCnv.cxx index bbc30868d6520698ecb8452aaa202f0e5dd4d57a..98e0dad11c13f01a39e71e07c4740164fa8b541b 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto1DContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto1DContainerCnv.cxx @@ -39,9 +39,9 @@ TrigHisto1DContainer* TrigHisto1DContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigHisto1DContainerCnv::createTransient" << endmsg; - static pool::Guid tlp1_guid( "CDC70E22-85DF-45B4-B69E-FC7FD70987A9" ); - static pool::Guid p1_guid( "B6240954-1842-45F5-AB5B-50934C633B1E" ); - static pool::Guid trans_guid( "B5752F0C-EF7A-4330-8413-1CCF0FC58AC8" ); + static const pool::Guid tlp1_guid( "CDC70E22-85DF-45B4-B69E-FC7FD70987A9" ); + static const pool::Guid p1_guid( "B6240954-1842-45F5-AB5B-50934C633B1E" ); + static const pool::Guid trans_guid( "B5752F0C-EF7A-4330-8413-1CCF0FC58AC8" ); TrigHisto1DContainer *p_container = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto2DCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto2DCnv.cxx index a606b4ba13c3d7954c2ca5b6fd674bdaeaaf6ab1..8152eebd78fa6c7d75fefaac1b01a51cfd8a87b4 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto2DCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto2DCnv.cxx @@ -22,7 +22,7 @@ TrigHisto2D* TrigHisto2DCnv::createTransient() { MsgStream mlog(msgSvc(), "TrigHisto2DConverter" ); mlog << MSG::DEBUG << "TrigHisto2DCnv::createTransient " << endmsg; - static pool::Guid p1_guid("8CF4D0A0-2957-4014-AEB2-140D1A013E7F"); + static const pool::Guid p1_guid("8CF4D0A0-2957-4014-AEB2-140D1A013E7F"); TrigHisto2D *transObj = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto2DContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto2DContainerCnv.cxx index ff37fc7b4fd14d227cca1d54766ddb1c0356d16a..ac9a89d248dddcbb6e46171bfeb82990d8e47495 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto2DContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigHisto2DContainerCnv.cxx @@ -38,9 +38,9 @@ TrigHisto2DContainer* TrigHisto2DContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigHisto2DContainerCnv::createTransient" << endmsg; - static pool::Guid tlp1_guid( "59C6A169-C537-4DEC-984D-41CE2544F96E" ); - static pool::Guid p1_guid( "C9FE79CB-6875-4E35-A1E3-23DFA6F94DFE" ); - static pool::Guid trans_guid( "E43A29FA-3BC9-4B08-9A94-735E1EC53951" ); + static const pool::Guid tlp1_guid( "59C6A169-C537-4DEC-984D-41CE2544F96E" ); + static const pool::Guid p1_guid( "C9FE79CB-6875-4E35-A1E3-23DFA6F94DFE" ); + static const pool::Guid trans_guid( "E43A29FA-3BC9-4B08-9A94-735E1EC53951" ); TrigHisto2DContainer *p_container = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigInDetTrackCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigInDetTrackCollectionCnv.cxx index 269c1cd30b7215d2976ee48e3d4e5adea5c4fe69..e92832a540160d2e4d70a879f83b2a7c8c5b3e70 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigInDetTrackCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigInDetTrackCollectionCnv.cxx @@ -46,11 +46,11 @@ TrigInDetTrackCollection* TrigInDetTrackCollectionCnv::createTransient() { MsgStream mlog(msgSvc(), "TrigInDetTrackCollectionConverter" ); mlog << MSG::DEBUG << "TrigInDetTrackCollectionCnv::createTransient " << endmsg; - static pool::Guid tlp4_guid("E1B8EE19-4F7B-4EF2-8FDC-45AA871BD628"); - static pool::Guid tlp3_guid("196F811B-382D-47A9-8551-D2038343BFFA"); - static pool::Guid tlp2_guid("4DBBB46F-33C9-4571-AE5E-A2335D7A2976"); - static pool::Guid tlp1_guid("0B5CA4CA-0A0F-43DC-8973-0E2212B2E8DA"); - static pool::Guid p0_guid("5F6029E6-764B-4126-891D-73BFC3CC391C"); + static const pool::Guid tlp4_guid("E1B8EE19-4F7B-4EF2-8FDC-45AA871BD628"); + static const pool::Guid tlp3_guid("196F811B-382D-47A9-8551-D2038343BFFA"); + static const pool::Guid tlp2_guid("4DBBB46F-33C9-4571-AE5E-A2335D7A2976"); + static const pool::Guid tlp1_guid("0B5CA4CA-0A0F-43DC-8973-0E2212B2E8DA"); + static const pool::Guid p0_guid("5F6029E6-764B-4126-891D-73BFC3CC391C"); TrigInDetTrackCollection *transObj = 0; if( compareClassGuid(tlp4_guid) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BjetContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BjetContainerCnv.cxx index 725533960b9ec2d59714d1212a0a46f23f01d151..0a02a950d89c193a971ddd063e7b345788c33c44 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BjetContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BjetContainerCnv.cxx @@ -1,17 +1,9 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigL2BjetContainerCnv.h" -#include "TrigParticleTPCnv/TrigL2BjetContainerCnv_tlp1.h" -#include "TrigParticleTPCnv/TrigL2BjetContainerCnv_tlp2.h" - #include "TrigParticleTPCnv/TrigL2BjetContainer_p3.h" -#include "TrigParticleTPCnv/TrigL2BjetContainerCnv_p3.h" - -static TrigL2BjetContainerCnv_tlp1 TLPconverter1; -static TrigL2BjetContainerCnv_tlp2 TLPconverter2; -static TrigL2BjetContainerCnv_p3 TPconverter; //* createPersistent *// TrigL2BjetContainer_PERS * TrigL2BjetContainerCnv::createPersistent( TrigL2BjetContainer *transObj) { @@ -20,7 +12,7 @@ TrigL2BjetContainer_PERS * TrigL2BjetContainerCnv::createPersistent( TrigL2BjetC mlog << MSG::DEBUG << "TrigL2BjetContainerCnv::createPersistent called" << endmsg; - TrigL2BjetContainer_PERS * p_L2BjetCont = TPconverter.createPersistent( transObj, mlog ); + TrigL2BjetContainer_PERS * p_L2BjetCont = m_converter.createPersistent( transObj, mlog ); return p_L2BjetCont; @@ -33,28 +25,28 @@ TrigL2BjetContainer * TrigL2BjetContainerCnv::createTransient() { mlog << MSG::DEBUG << "TrigL2BjetContainerCnv::createTransient called" << endmsg; - static pool::Guid p3_guid( "65534D07-EECA-46B1-A6AA-A4DA4DFEAAEF" ); - static pool::Guid tlp2_guid( "67162A5D-CEC3-4D9B-AF43-1858D6F1558E" ); - static pool::Guid tlp1_guid( "716A64FC-6EAF-4851-A0C8-8CE73C43C051" ); - static pool::Guid p0_guid( "B4842D15-7BFB-476E-8C68-F2F38E588380" ); - static pool::Guid p0_guid2( "F6ACED03-42F3-4192-A4E2-47FA9A9B9D49" ); + static const pool::Guid p3_guid( "65534D07-EECA-46B1-A6AA-A4DA4DFEAAEF" ); + static const pool::Guid tlp2_guid( "67162A5D-CEC3-4D9B-AF43-1858D6F1558E" ); + static const pool::Guid tlp1_guid( "716A64FC-6EAF-4851-A0C8-8CE73C43C051" ); + static const pool::Guid p0_guid( "B4842D15-7BFB-476E-8C68-F2F38E588380" ); + static const pool::Guid p0_guid2( "F6ACED03-42F3-4192-A4E2-47FA9A9B9D49" ); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigL2BjetContainer_p3 > col_vect( poolReadObject< TrigL2BjetContainer_p3 >() ); // std::cout << "Reading IMFC p3" << std::endl; - return TPconverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if ( compareClassGuid( tlp2_guid ) ) { std::unique_ptr< TrigL2BjetContainer_tlp2 > col_vect( poolReadObject< TrigL2BjetContainer_tlp2 >() ); // std::cout << "Reading IMFC tlp2" << std::endl; - return TLPconverter2.createTransient( col_vect.get(), mlog ); + return m_converter2.createTransient( col_vect.get(), mlog ); } else if ( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigL2BjetContainer_tlp1 > col_vect( poolReadObject< TrigL2BjetContainer_tlp1 >() ); // std::cout << "Reading IMFC tlp1" << std::endl; - return TLPconverter1.createTransient( col_vect.get(), mlog ); + return m_converter1.createTransient( col_vect.get(), mlog ); } else if( compareClassGuid( p0_guid ) || compareClassGuid( p0_guid2 ) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BjetContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BjetContainerCnv.h index d2d7d8c7ec936dad813d203d3649c277cfa646b5..cd7a603087ce162e801d29cc4551f87fd8553d82 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BjetContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BjetContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGL2BJETCONTAINER_CNV_H @@ -9,6 +9,9 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigParticle/TrigL2BjetContainer.h" #include "TrigParticleTPCnv/TrigL2BjetContainer_p3.h" +#include "TrigParticleTPCnv/TrigL2BjetContainerCnv_tlp1.h" +#include "TrigParticleTPCnv/TrigL2BjetContainerCnv_tlp2.h" +#include "TrigParticleTPCnv/TrigL2BjetContainerCnv_p3.h" typedef TrigL2BjetContainer_p3 TrigL2BjetContainer_PERS; @@ -26,6 +29,11 @@ protected: virtual TrigL2BjetContainer_PERS *createPersistent( TrigL2BjetContainer *transObj); virtual TrigL2BjetContainer *createTransient(); +private: + TrigL2BjetContainerCnv_tlp1 m_converter1; + TrigL2BjetContainerCnv_tlp2 m_converter2; + TrigL2BjetContainerCnv_p3 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BphysContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BphysContainerCnv.cxx index a13bffb12cf5b6504a13db43a6f7d097c804b2e0..f4963854b8cdd85f805a2ba3303b92784a6a543e 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BphysContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigL2BphysContainerCnv.cxx @@ -50,10 +50,10 @@ TrigL2BphysContainer * TrigL2BphysContainerCnv::createTransient() m_impl->m_log << MSG::DEBUG << "TrigL2BphysContainerCnv::createTransient called" << endmsg; - static pool::Guid tlp2_guid( "2E35788D-BE17-4FE1-9DB5-709E05880CEC" ); - static pool::Guid tlp1_guid( "E8AA6B0A-B057-4058-B5A9-AC0B719626AF" ); - static pool::Guid p0_guid( "23296C53-6811-4D19-BD32-816B5DD0508F" ); - static pool::Guid p0_guid2( "390F41C1-CCFA-4A1D-B046-F9F462FD64D0" ); + static const pool::Guid tlp2_guid( "2E35788D-BE17-4FE1-9DB5-709E05880CEC" ); + static const pool::Guid tlp1_guid( "E8AA6B0A-B057-4058-B5A9-AC0B719626AF" ); + static const pool::Guid p0_guid( "23296C53-6811-4D19-BD32-816B5DD0508F" ); + static const pool::Guid p0_guid2( "390F41C1-CCFA-4A1D-B046-F9F462FD64D0" ); TrigL2BphysContainer *p_collection = 0; if( compareClassGuid( tlp2_guid ) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETCnv.cxx index e5a70cd76e2ce0e9c9d3a3f147bb6070a0d40703..8149807d6ad5cf793f2ddec32dd5ab67d138ccbd 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETCnv.cxx @@ -32,9 +32,9 @@ TrigMissingET* TrigMissingETCnv::createTransient() { mlog << MSG::DEBUG << "TrigMissingETCnv::createTransient " << endmsg; - static pool::Guid p2_guid("9972F10B-2B6A-42A7-AF71-D8FB60F07C6D"); - static pool::Guid p1_guid("A65F0499-A789-4D66-9930-E8651FE91F8A"); - static pool::Guid p0_guid("1403772C-7444-4340-930B-ABD51C243A09"); + static const pool::Guid p2_guid("9972F10B-2B6A-42A7-AF71-D8FB60F07C6D"); + static const pool::Guid p1_guid("A65F0499-A789-4D66-9930-E8651FE91F8A"); + static const pool::Guid p0_guid("1403772C-7444-4340-930B-ABD51C243A09"); if( compareClassGuid(p2_guid) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETContainerCnv.cxx index aa3f7b32553697bc427a73cca2029b38fdac7b97..54e1fadd1ddda719eb810e25f2f45814da5a8dd2 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETContainerCnv.cxx @@ -1,25 +1,19 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigMissingETContainerCnv.h" -#include "TrigMissingEtEventTPCnv/TrigMissingETContainerCnv_tlp1.h" #include "TrigMissingEtEventTPCnv/TrigMissingETContainer_p1.h" - -#include "TrigMissingEtEventTPCnv/TrigMissingETContainerCnv_p3.h" #include "TrigMissingEtEventTPCnv/TrigMissingETContainer_p3.h" -static TrigMissingETContainerCnv_tlp1 converter_tlp1; -static TrigMissingETContainerCnv_p3 TPConverter; - -//createPersistent +//createPersistent TrigMissingETContainer_PERS * TrigMissingETContainerCnv::createPersistent( TrigMissingETContainer *transObj) { MsgStream mlog(msgSvc(), "TrigMissingETContainerConverter" ); mlog << MSG::DEBUG << "TrigMissingETContainerCnv::createPersistent" << endmsg; - TrigMissingETContainer_PERS* persObj = TPConverter.createPersistent( transObj, mlog ); + TrigMissingETContainer_PERS* persObj = m_converter.createPersistent( transObj, mlog ); return persObj; @@ -33,18 +27,18 @@ TrigMissingETContainer* TrigMissingETContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigMissingETContainerCnv::createTransient" << endmsg; - static pool::Guid p3_guid( "F5C98A61-4F40-4FE6-A1A9-D5EF00FFFBF0" ); - static pool::Guid tlp1_guid( "23EC84A7-8614-42D6-B82D-B0861D3CE08D" ); + static const pool::Guid p3_guid( "F5C98A61-4F40-4FE6-A1A9-D5EF00FFFBF0" ); + static const pool::Guid tlp1_guid( "23EC84A7-8614-42D6-B82D-B0861D3CE08D" ); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigMissingETContainer_p3 > col_vect( poolReadObject< TrigMissingETContainer_p3 >() ); // std::cout << "Reading IMFC p3" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigMissingETContainer_tlp1 > col_vect( poolReadObject< TrigMissingETContainer_tlp1 >() ); // std::cout << "Reading IMFC tlp1" << std::endl; - return converter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else throw std::runtime_error( "Unsupported persistent version of TrigMissingETContainer" ); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETContainerCnv.h index 7b64e9fcc77ffc90420e3b6364b5c5bffcf82e48..85923dc82179e2a3bcaa66055f0ecbadcd2abb07 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMissingETContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGMISSINGETCONTAINER_CNV_H @@ -11,6 +11,8 @@ #include "TrigMissingEtEvent/TrigMissingETContainer.h" #include "TrigMissingEtEventTPCnv/TrigMissingETContainer_p3.h" +#include "TrigMissingEtEventTPCnv/TrigMissingETContainerCnv_tlp1.h" +#include "TrigMissingEtEventTPCnv/TrigMissingETContainerCnv_p3.h" typedef TrigMissingETContainer_p3 TrigMissingETContainer_PERS; @@ -28,6 +30,10 @@ protected: virtual TrigMissingETContainer_PERS *createPersistent( TrigMissingETContainer *transObj); virtual TrigMissingETContainer *createTransient(); +private: + TrigMissingETContainerCnv_tlp1 m_converter_tlp1; + TrigMissingETContainerCnv_p3 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonConfigCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonConfigCnv.cxx index 972a3c5698ba8096fedf890a5f3c436b6f346740..01e6d3240374918073cdd799ca30ec701d51b239 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonConfigCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonConfigCnv.cxx @@ -37,7 +37,7 @@ TrigMonConfig* TrigMonConfigCnv::createTransient() { (*m_log) << MSG::DEBUG << "TrigMonConfigCnv::createTransient " << endmsg; - static pool::Guid p1_guid("E841D3CA-AB5A-4955-850A-B368DE66A987"); + static const pool::Guid p1_guid("E841D3CA-AB5A-4955-850A-B368DE66A987"); TrigMonConfig *trans_obj(0); if(compareClassGuid(p1_guid)) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonConfigCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonConfigCollectionCnv.cxx index 3de8e1497a23fce8158b8f429cbe46a668d15403..5b88a426071089702958ee66c760ac4afd505cce 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonConfigCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonConfigCollectionCnv.cxx @@ -45,8 +45,8 @@ TrigMonConfigCollection* TrigMonConfigCollectionCnv::createTransient() { (*m_log) << MSG::DEBUG << "TrigMonConfigCollectionCnv::createTransient " << endmsg; - static pool::Guid tlp1_guid("887A60C5-BD4D-467C-9629-9F0EE818398A"); - static pool::Guid p1_guid("77FAC318-137E-4563-A681-68356299E397"); + static const pool::Guid tlp1_guid("887A60C5-BD4D-467C-9629-9F0EE818398A"); + static const pool::Guid p1_guid("77FAC318-137E-4563-A681-68356299E397"); TrigMonConfigCollection *trans_obj(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonEventCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonEventCnv.cxx index ac6fa9328ef4c1b13b48e960386efccaf276613b..bb84fdd101b01a034256f9367ff98f72fc59225b 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonEventCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonEventCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ @@ -37,7 +37,7 @@ TrigMonEvent* TrigMonEventCnv::createTransient() { (*m_log) << MSG::DEBUG << "TrigMonEventCnv::createTransient " << endmsg; - static pool::Guid p1_guid("AECD5837-E8DA-4FF3-8601-44B4C17355ED"); + static const pool::Guid p1_guid("AECD5837-E8DA-4FF3-8601-44B4C17355ED"); TrigMonEvent *trans_obj(0); if( compareClassGuid(p1_guid) ) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonEventCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonEventCollectionCnv.cxx index a7cb47941abde398337a3008e6049e0f6059510b..e0b37206c320fe7bf11eefe0ebddfbca4f654552 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonEventCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMonEventCollectionCnv.cxx @@ -45,8 +45,8 @@ TrigMonEventCollection* TrigMonEventCollectionCnv::createTransient() { (*m_log) << MSG::DEBUG << "TrigMonEventCollectionCnv::createTransient " << endmsg; - static pool::Guid tlp1_guid("F224B21A-0CE8-40F1-B88B-027DA832A2A5"); - static pool::Guid p1_guid("9A0D41EB-9A40-42A1-8CDA-C80845FC7271"); + static const pool::Guid tlp1_guid("F224B21A-0CE8-40F1-B88B-027DA832A2A5"); + static const pool::Guid p1_guid("9A0D41EB-9A40-42A1-8CDA-C80845FC7271"); TrigMonEventCollection *trans_obj(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureCnv.cxx index 0b2eaa8100e74dac438c8a9d54e5a33045c4daf0..6ca5bc429d6e509dac58ddea60a760db95035783 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureCnv.cxx @@ -1,12 +1,9 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigMuonClusterFeatureCnv.h" #include "TrigMuonEventTPCnv/TrigMuonClusterFeature_tlp1.h" -#include "TrigMuonEventTPCnv/TrigMuonClusterFeatureCnv_tlp1.h" - -static TrigMuonClusterFeatureCnv_tlp1 TPConverter; //----------------------------------------------------------------------------- // Create persistent @@ -19,7 +16,7 @@ TrigMuonClusterFeatureCnv::createPersistent( TrigMuonClusterFeature *transObj) mlog << MSG::DEBUG << "TrigMuonClusterFeatureCnv::createPersistent" << endmsg; - TrigMuonClusterFeature_PERS *persObj = TPConverter.createPersistent( transObj, mlog ); + TrigMuonClusterFeature_PERS *persObj = m_converter.createPersistent( transObj, mlog ); return persObj; } @@ -33,12 +30,12 @@ TrigMuonClusterFeature *TrigMuonClusterFeatureCnv::createTransient() mlog << MSG::DEBUG << "TrigMuonClusterFeatureCnv::createTransient " << endmsg; - static pool::Guid p1_guid("AE4D5D57-689D-40CB-83B3-CB047884952F"); - static pool::Guid p0_guid("A7B1865B-55D0-49D2-9778-5E0797FB06FE"); + static const pool::Guid p1_guid("AE4D5D57-689D-40CB-83B3-CB047884952F"); + static const pool::Guid p0_guid("A7B1865B-55D0-49D2-9778-5E0797FB06FE"); if( compareClassGuid( p1_guid ) ) { std::unique_ptr< TrigMuonClusterFeature_tlp1 > col_vect( poolReadObject< TrigMuonClusterFeature_tlp1 >() ); - return TPConverter.createTransient( col_vect.get(), mlog ); + return m_converter.createTransient( col_vect.get(), mlog ); } else if( compareClassGuid(p0_guid) ) { // old version from before TP separation, just return it diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureCnv.h index 08db4ed8007e2fd87e60cc968f63f471c3382bb1..ee5fa2f0b81444333b5a8fda5872f370160afdd0 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGMUONCLUSTERFEATURECNV_H @@ -8,7 +8,7 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigMuonEvent/TrigMuonClusterFeature.h" -#include "TrigMuonEventTPCnv/TrigMuonClusterFeatureCnv_tlp1.h" +#include "TrigMuonEventTPCnv/TrigMuonClusterFeatureCnv_tlp1.h" //----------------------------------------------------------------------------- // Base class definition @@ -29,7 +29,9 @@ protected: virtual TrigMuonClusterFeature_PERS* createPersistent( TrigMuonClusterFeature *transObj); virtual TrigMuonClusterFeature* createTransient(); - +private: + TrigMuonClusterFeatureCnv_tlp1 m_converter; + }; #endif // TRIGMUONCLUSTERFEATURE_CNV_H diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureContainerCnv.cxx index 6bde5df819c869274df16c70213a9a13645985d9..58a2478e4a46a37b38d066ab23cffa2cd956ae50 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonClusterFeatureContainerCnv.cxx @@ -39,8 +39,8 @@ TrigMuonClusterFeatureContainer * TrigMuonClusterFeatureContainerCnv::createTran mlog << MSG::DEBUG << "TrigMuonClusterFeatureContainerCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "036D8CC1-5FBD-4676-9D84-F233567F52D2" ); - static pool::Guid p0_guid( "5B09201A-D1CD-43BA-A1B5-786189444579" ); + static const pool::Guid tlp1_guid( "036D8CC1-5FBD-4676-9D84-F233567F52D2" ); + static const pool::Guid p0_guid( "5B09201A-D1CD-43BA-A1B5-786189444579" ); TrigMuonClusterFeatureContainer *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFContainerCnv.cxx index 0dd67fd734e4dd9aa6350c1dab9cca9b14314c16..3450bbf973efe3f8ff55afa042ff56830706eaf7 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFContainerCnv.cxx @@ -1,16 +1,9 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigMuonEFContainerCnv.h" -#include "TrigMuonEventTPCnv/TrigMuonEFContainerCnv_tlp1.h" - #include "TrigMuonEventTPCnv/TrigMuonEFContainer_p2.h" -#include "TrigMuonEventTPCnv/TrigMuonEFContainerCnv_p2.h" - - -static TrigMuonEFContainerCnv_tlp1 TPConverter_tlp1; -static TrigMuonEFContainerCnv_p2 TPConverter; //createPersistent TrigMuonEFContainer_PERS * TrigMuonEFContainerCnv::createPersistent( TrigMuonEFContainer *transObj) @@ -19,7 +12,7 @@ TrigMuonEFContainer_PERS * TrigMuonEFContainerCnv::createPersistent( TrigMuonEFC mlog << MSG::DEBUG << "TrigMuonEFContainerCnv::createPersistent called" << endmsg; - TrigMuonEFContainer_PERS * p_muEFcont = TPConverter.createPersistent( transObj, mlog ); + TrigMuonEFContainer_PERS * p_muEFcont = m_converter.createPersistent( transObj, mlog ); return p_muEFcont; @@ -33,19 +26,19 @@ TrigMuonEFContainer * TrigMuonEFContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigMuonEFContainerCnv::createTransient called" << endmsg; - static pool::Guid p2_guid( "3BB5C107-2975-4F9E-AACC-9FD948C3D2A8" ); - static pool::Guid p1_guid( "567E65A0-23E8-469F-94F7-A03F6E9C1C2E" ); - static pool::Guid p0_guid( "BB866230-C9D8-437A-A11B-A0CC08ACD97B" ); + static const pool::Guid p2_guid( "3BB5C107-2975-4F9E-AACC-9FD948C3D2A8" ); + static const pool::Guid p1_guid( "567E65A0-23E8-469F-94F7-A03F6E9C1C2E" ); + static const pool::Guid p0_guid( "BB866230-C9D8-437A-A11B-A0CC08ACD97B" ); if( compareClassGuid( p2_guid ) ){ std::unique_ptr< TrigMuonEFContainer_p2 > col_vect( poolReadObject< TrigMuonEFContainer_p2 >() ); // std::cout << "Reading IMFC p2" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( p1_guid ) ) { std::unique_ptr< TrigMuonEFContainer_tlp1 > col_vect( poolReadObject< TrigMuonEFContainer_tlp1 >() ); // std::cout << "Reading IMFC tlp1" << std::endl; - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else if( compareClassGuid( p0_guid ) ){ diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFContainerCnv.h index c7f835fd17e8d5a99af543b7d14846c07ff8757e..bb0eb6d68beff1aec9f0dd55b3cc71f4e7ea17fb 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGMUONEFCONTAINER_CNV_H @@ -10,6 +10,8 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigMuonEvent/TrigMuonEFContainer.h" #include "TrigMuonEventTPCnv/TrigMuonEFContainer_p2.h" +#include "TrigMuonEventTPCnv/TrigMuonEFContainerCnv_tlp1.h" +#include "TrigMuonEventTPCnv/TrigMuonEFContainerCnv_p2.h" typedef TrigMuonEFContainer_p2 TrigMuonEFContainer_PERS; @@ -27,6 +29,10 @@ protected: virtual TrigMuonEFContainer_PERS *createPersistent( TrigMuonEFContainer *transObj); virtual TrigMuonEFContainer *createTransient(); + +private: + TrigMuonEFContainerCnv_tlp1 m_converter_tlp1; + TrigMuonEFContainerCnv_p2 m_converter; };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFInfoContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFInfoContainerCnv.cxx index e1af37b26f5c549548970f07ce6f3fddba76584c..65024464e017b43ace622622064f9dc61388c22a 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFInfoContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFInfoContainerCnv.cxx @@ -38,8 +38,8 @@ TrigMuonEFInfoContainer * TrigMuonEFInfoContainerCnv::createTransient(){ mlog << MSG::DEBUG << "TrigMuonEFInfoContainerCnv::createTransient called" << endmsg; - static pool::Guid p1_guid( "B768E99D-9CC3-4368-ADD5-36816D2A0298" ); - static pool::Guid p2_guid( "AF8CBEC0-4BBF-438A-82DE-873F133F4821" ); + static const pool::Guid p1_guid( "B768E99D-9CC3-4368-ADD5-36816D2A0298" ); + static const pool::Guid p2_guid( "AF8CBEC0-4BBF-438A-82DE-873F133F4821" ); TrigMuonEFInfoContainer *p_collection = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFIsolationContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFIsolationContainerCnv.cxx index 14a8f36dab45bbf1f5d85432afa6c4e9221d411d..7b4d005700aa6c5df361d1b34bb27d6fb8bf4612 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFIsolationContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFIsolationContainerCnv.cxx @@ -1,15 +1,10 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigMuonEFIsolationContainerCnv.h" #include "TrigMuonEventTPCnv/TrigMuonEFIsolationContainer_p1.h" -#include "TrigMuonEventTPCnv/TrigMuonEFIsolationContainerCnv_p1.h" #include "TrigMuonEventTPCnv/TrigMuonEFIsolationContainer_p2.h" -#include "TrigMuonEventTPCnv/TrigMuonEFIsolationContainerCnv_p2.h" - -static TrigMuonEFIsolationContainerCnv_p1 TPconverter_p1; -static TrigMuonEFIsolationContainerCnv_p2 TPconverter_p2; TrigMuonEFIsolationContainerCnv::TrigMuonEFIsolationContainerCnv(ISvcLocator* svcloc) : @@ -25,7 +20,7 @@ TrigMuonEFIsolationContainer_PERS* TrigMuonEFIsolationContainerCnv::createPersis MsgStream mlog(msgSvc(), "TrigMuonEFIsolationContainerConverter" ); mlog << MSG::DEBUG << "TrigMuonEFIsolationContainerCnv::createPersistent" << endmsg; - TrigMuonEFIsolationContainer_PERS *persObj = TPconverter_p2.createPersistent(transCont, mlog); + TrigMuonEFIsolationContainer_PERS *persObj = m_converter_p2.createPersistent(transCont, mlog); return persObj; } @@ -36,17 +31,17 @@ TrigMuonEFIsolationContainer* TrigMuonEFIsolationContainerCnv::createTransient() MsgStream mlog(msgSvc(), "TrigMuonEFIsolationContainerConverter" ); mlog << MSG::DEBUG << "TrigMuonEFIsolationContainerCnv::createTransient" << endmsg; - static pool::Guid p1_guid("5C3ECE20-F26F-4811-BA76-B2DC567858BC"); - static pool::Guid p2_guid("B24570F4-BB65-4D5C-A8E2-C44E36E7B0B5"); + static const pool::Guid p1_guid("5C3ECE20-F26F-4811-BA76-B2DC567858BC"); + static const pool::Guid p2_guid("B24570F4-BB65-4D5C-A8E2-C44E36E7B0B5"); TrigMuonEFIsolationContainer* trans_cont(0); if ( compareClassGuid(p2_guid) ) { std::unique_ptr< TrigMuonEFIsolationContainer_p2 > col_vect( this->poolReadObject< TrigMuonEFIsolationContainer_p2 >() ); - trans_cont = TPconverter_p2.createTransient( col_vect.get(), mlog ); + trans_cont = m_converter_p2.createTransient( col_vect.get(), mlog ); } else if ( compareClassGuid(p1_guid) ) { std::unique_ptr< TrigMuonEFIsolationContainer_p1 > col_vect( this->poolReadObject< TrigMuonEFIsolationContainer_p1 >() ); - trans_cont = TPconverter_p1.createTransient( col_vect.get(), mlog ); + trans_cont = m_converter_p1.createTransient( col_vect.get(), mlog ); } else { throw std::runtime_error("Unsupported persistent version of Data container"); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFIsolationContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFIsolationContainerCnv.h index 82f506c08d94afda9400a2d9a9ae4a95f1a857cf..aed7c9bd0e1b75dfbe2dfa75217865fa3eab7f7d 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFIsolationContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigMuonEFIsolationContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGMUONEFISOLATIONCONTAINERCNV_H__ @@ -16,6 +16,8 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigMuonEvent/TrigMuonEFIsolationContainer.h" #include "TrigMuonEventTPCnv/TrigMuonEFIsolationContainer_p2.h" +#include "TrigMuonEventTPCnv/TrigMuonEFIsolationContainerCnv_p1.h" +#include "TrigMuonEventTPCnv/TrigMuonEFIsolationContainerCnv_p2.h" // typedef to the latest persistent version typedef TrigMuonEFIsolationContainer_p2 TrigMuonEFIsolationContainer_PERS; @@ -38,6 +40,11 @@ protected: TrigMuonEFIsolationContainer* createTransient(); +private: + TrigMuonEFIsolationContainerCnv_p1 m_converter_p1; + TrigMuonEFIsolationContainerCnv_p2 m_converter_p2; + + };//class TrigMuonEFIsolationContainerCnv diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigPhotonContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigPhotonContainerCnv.cxx index 32a8f30b311361799dde15b3f4d186c8c102e499..b7ac648c7e662f170d63b3e3f0827a8e00e8073c 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigPhotonContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigPhotonContainerCnv.cxx @@ -1,28 +1,20 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigPhotonContainerCnv.h" #include "TrigParticleTPCnv/TrigPhotonContainer_tlp1.h" -#include "TrigParticleTPCnv/TrigPhotonContainerCnv_tlp1.h" #include "TrigParticleTPCnv/TrigPhotonContainer_tlp2.h" -#include "TrigParticleTPCnv/TrigPhotonContainerCnv_tlp2.h" #include "TrigParticleTPCnv/TrigPhotonContainer_p3.h" -#include "TrigParticleTPCnv/TrigPhotonContainerCnv_p3.h" -static TrigPhotonContainerCnv_tlp1 TPConverter_tlp1; -static TrigPhotonContainerCnv_tlp2 TPConverter_tlp2; -static TrigPhotonContainerCnv_p3 TPConverter; - - -//createPersistent +//createPersistent TrigPhotonContainer_PERS * TrigPhotonContainerCnv::createPersistent( TrigPhotonContainer *transObj) { MsgStream mlog(msgSvc(), "TrigPhotonContainerConverter" ); mlog << MSG::DEBUG << "TrigPhotonContainerCnv::createPersistent called" << endmsg; - TrigPhotonContainer_PERS * p_PhotonCont = TPConverter.createPersistent( transObj, mlog ); + TrigPhotonContainer_PERS * p_PhotonCont = m_converter.createPersistent( transObj, mlog ); return p_PhotonCont; @@ -36,26 +28,26 @@ TrigPhotonContainer * TrigPhotonContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigPhotonContainerCnv::createTransient called" << endmsg; - static pool::Guid p3_guid( "40192614-E7C5-4BAF-825F-CB9F3E023315" ); - static pool::Guid tlp2_guid( "96487DD7-9CF7-4351-BF33-011E6CA515F0" ); - static pool::Guid tlp1_guid( "7F4B4EF4-D7F6-4208-B522-4003A34EC664" ); - static pool::Guid p0_guid2( "65F1CCA1-B672-4E26-B74E-397CE6C8F617" ); - static pool::Guid p0_guid( "CB04DF3E-C363-49E3-9BE1-AD25230AB1EA" ); + static const pool::Guid p3_guid( "40192614-E7C5-4BAF-825F-CB9F3E023315" ); + static const pool::Guid tlp2_guid( "96487DD7-9CF7-4351-BF33-011E6CA515F0" ); + static const pool::Guid tlp1_guid( "7F4B4EF4-D7F6-4208-B522-4003A34EC664" ); + static const pool::Guid p0_guid2( "65F1CCA1-B672-4E26-B74E-397CE6C8F617" ); + static const pool::Guid p0_guid( "CB04DF3E-C363-49E3-9BE1-AD25230AB1EA" ); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigPhotonContainer_p3 > col_vect( poolReadObject< TrigPhotonContainer_p3 >() ); // std::cout << "Reading IMFC p3" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( tlp2_guid ) ) { std::unique_ptr< TrigPhotonContainer_tlp2 > col_vect( poolReadObject< TrigPhotonContainer_tlp2 >() ); - return TPConverter_tlp2.createTransient( col_vect.get(), mlog ); + return m_converter_tlp2.createTransient( col_vect.get(), mlog ); } else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigPhotonContainer_tlp1 > col_vect( poolReadObject< TrigPhotonContainer_tlp1 >() ); - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else if( compareClassGuid( p0_guid ) || compareClassGuid( p0_guid2 ) ){ diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigPhotonContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigPhotonContainerCnv.h index 817e38b851d5dd1967635f089aa0e460e0051b6d..4cb3642fde19630f0bb15f48f33e4263eb5dca50 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigPhotonContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigPhotonContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGPHOTONCONTAINER_CNV_H @@ -10,6 +10,9 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigParticle/TrigPhotonContainer.h" #include "TrigParticleTPCnv/TrigPhotonContainer_p3.h" +#include "TrigParticleTPCnv/TrigPhotonContainerCnv_tlp1.h" +#include "TrigParticleTPCnv/TrigPhotonContainerCnv_tlp2.h" +#include "TrigParticleTPCnv/TrigPhotonContainerCnv_p3.h" typedef TrigPhotonContainer_p3 TrigPhotonContainer_PERS; @@ -27,6 +30,11 @@ protected: virtual TrigPhotonContainer_PERS *createPersistent( TrigPhotonContainer *transObj); virtual TrigPhotonContainer *createTransient(); + +private: + TrigPhotonContainerCnv_tlp1 m_converter_tlp1; + TrigPhotonContainerCnv_tlp2 m_converter_tlp2; + TrigPhotonContainerCnv_p3 m_converter; };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputCnv.cxx index 22671b9852af3bcb7698023f6999573100a38c9f..27c606fa0a4d3dc0d6fc07e4193ce99c08ab34ad 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputCnv.cxx @@ -36,7 +36,7 @@ TrigRNNOutput* TrigRNNOutputCnv::createTransient() MsgStream mlog(msgSvc(), "TrigRNNOutputConverter" ); mlog << MSG::DEBUG << "TrigRNNOutputCnv::createTransient " << endmsg; - static pool::Guid tlp1_guid("BA106EC3-F776-DE11-BCB3-000423DD5A1A"); + static const pool::Guid tlp1_guid("BA106EC3-F776-DE11-BCB3-000423DD5A1A"); TrigRNNOutput *trans_cont(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputContainerCnv.cxx index 8dba2c7ebd69b3b7ad3611c4c2beab9fb8e69fde..f8cc73b6df28f0f1395891c0ec8024048ad20853 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputContainerCnv.cxx @@ -1,14 +1,9 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigRNNOutputContainerCnv.h" -#include "TrigCaloEventTPCnv/TrigRNNOutputContainerCnv_tlp1.h" #include "TrigCaloEventTPCnv/TrigRNNOutputContainer_p2.h" -#include "TrigCaloEventTPCnv/TrigRNNOutputContainerCnv_p2.h" - -static TrigRNNOutputContainerCnv_tlp1 TPConverter_tlp1; -static TrigRNNOutputContainerCnv_p2 TPConverter; //createPersistent TrigRNNOutputContainer_PERS * TrigRNNOutputContainerCnv::createPersistent( TrigRNNOutputContainer *transObj) @@ -17,7 +12,7 @@ TrigRNNOutputContainer_PERS * TrigRNNOutputContainerCnv::createPersistent( TrigR mlog << MSG::DEBUG << "TrigRNNOutputContainerCnv::createPersistent called" << endmsg; - TrigRNNOutputContainer_PERS * p_Cont = TPConverter.createPersistent( transObj, mlog ); + TrigRNNOutputContainer_PERS * p_Cont = m_converter.createPersistent( transObj, mlog ); return p_Cont; @@ -31,17 +26,17 @@ TrigRNNOutputContainer * TrigRNNOutputContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigRNNOutputContainerCnv::createTransient called" << endmsg; - static pool::Guid tr_guid("FED72B55-6275-DE11-8F1B-000423DD5A1A"); - static pool::Guid tlp1_guid("86A89E9D-F776-DE11-B65D-000423DD5A1A"); - static pool::Guid p2_guid("B10FA1AF-F38F-4025-83C4-3A83A3F3AE71"); + static const pool::Guid tr_guid("FED72B55-6275-DE11-8F1B-000423DD5A1A"); + static const pool::Guid tlp1_guid("86A89E9D-F776-DE11-B65D-000423DD5A1A"); + static const pool::Guid p2_guid("B10FA1AF-F38F-4025-83C4-3A83A3F3AE71"); if( compareClassGuid( p2_guid ) ){ std::unique_ptr< TrigRNNOutputContainer_p2 > col_vect( poolReadObject< TrigRNNOutputContainer_p2 >() ); // std::cout << "Reading IMFC p2" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if ( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigRNNOutputContainer_tlp1 > col_vect( poolReadObject< TrigRNNOutputContainer_tlp1 >() ); - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else if (compareClassGuid(tr_guid)) { // regular object from before the T/P separation return poolReadObject(); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputContainerCnv.h index f770ad1d05ac1e9b9183bc2277779a8e297f6420..a231a5f8b388945c77ecaa4a83855b9480d631ed 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigRNNOutputContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGRNNOUTPUTCONTAINERCNV_H @@ -10,6 +10,8 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigCaloEvent/TrigRNNOutputContainer.h" #include "TrigCaloEventTPCnv/TrigRNNOutputContainer_p2.h" +#include "TrigCaloEventTPCnv/TrigRNNOutputContainerCnv_tlp1.h" +#include "TrigCaloEventTPCnv/TrigRNNOutputContainerCnv_p2.h" typedef TrigRNNOutputContainer_p2 TrigRNNOutputContainer_PERS; @@ -27,6 +29,10 @@ protected: virtual TrigRNNOutputContainer_PERS *createPersistent( TrigRNNOutputContainer *transObj); virtual TrigRNNOutputContainer *createTransient(); + +private: + TrigRNNOutputContainerCnv_tlp1 m_converter_tlp1; + TrigRNNOutputContainerCnv_p2 m_converter; };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCnv.cxx index 15fc501afcaa7c2cee10daab843362b1fbeb1ef5..283f141e140c711210d4e1f73a6ba653295a7b62 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCnv.cxx @@ -1,16 +1,14 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigSpacePointCountsCnv.h" #include "RootConversions/TConverterRegistry.h" #include "TrigInDetEventTPCnv/TrigSpacePointCounts_p1_old_cnv.h" #include "TrigInDetEventTPCnv/TrigSpacePointCounts_p1.h" -#include "TrigInDetEventTPCnv/TrigSpacePointCountsCnv_p1.h" #include "TrigInDetEventTPCnv/TrigSpacePointCounts_p2.h" -#include "TrigInDetEventTPCnv/TrigSpacePointCountsCnv_p2.h" #include "TrigInDetEventTPCnv/TrigSpacePointCounts_p3.h" -#include "TrigInDetEventTPCnv/TrigSpacePointCountsCnv_p3.h" + TrigSpacePointCountsCnv::TrigSpacePointCountsCnv(ISvcLocator *svcloc): TrigSpacePointCountsCnvBase(svcloc) {} TrigSpacePointCountsCnv::~TrigSpacePointCountsCnv(){} @@ -20,10 +18,8 @@ TrigSpacePointCounts_PERS* TrigSpacePointCountsCnv::createPersistent(TrigSpacePo MsgStream mlog(msgSvc(), "TrigSpacePointCountsConverter" ); mlog << MSG::DEBUG << "TrigSpacePointCountsCnv::createPersistent" << endmsg; - - TrigSpacePointCountsCnv_p3 converter; - TrigSpacePointCounts_PERS *persObj = converter.createPersistent( transObj, mlog ); + TrigSpacePointCounts_PERS *persObj = m_converter_p3.createPersistent( transObj, mlog ); return persObj; } @@ -34,25 +30,22 @@ TrigSpacePointCounts* TrigSpacePointCountsCnv::createTransient() { mlog << MSG::DEBUG << "TrigSpacePointCountsCnv::createTransient " << endmsg; - static pool::Guid p3_guid("43E61EDF-2902-4F64-8A89-F625DB7DA7CC"); - static pool::Guid p2_guid("3A6CFBCF-E2AE-4E3D-A965-091718A5CB9F"); - static pool::Guid p1_guid("8BF48F79-C6C2-4AA7-8180-16BC6C39280F"); - static pool::Guid p0_guid("1BCAD9FD-DAFE-4E50-9A37-C75E822E6D02"); + static const pool::Guid p3_guid("43E61EDF-2902-4F64-8A89-F625DB7DA7CC"); + static const pool::Guid p2_guid("3A6CFBCF-E2AE-4E3D-A965-091718A5CB9F"); + static const pool::Guid p1_guid("8BF48F79-C6C2-4AA7-8180-16BC6C39280F"); + static const pool::Guid p0_guid("1BCAD9FD-DAFE-4E50-9A37-C75E822E6D02"); if(compareClassGuid(p3_guid)) { std::unique_ptr pers_ptr( poolReadObject< TrigSpacePointCounts_p3 >() ); - TrigSpacePointCountsCnv_p3 converter; - return converter.createTransient( pers_ptr.get(), mlog ); + return m_converter_p3.createTransient( pers_ptr.get(), mlog ); } if(compareClassGuid(p2_guid)) { std::unique_ptr pers_ptr( poolReadObject< TrigSpacePointCounts_p2 >() ); - TrigSpacePointCountsCnv_p2 converter; - return converter.createTransient( pers_ptr.get(), mlog ); + return m_converter_p2.createTransient( pers_ptr.get(), mlog ); } if(compareClassGuid(p1_guid)) { std::unique_ptr pers_ptr( poolReadObject< TrigSpacePointCounts_p1 >() ); - TrigSpacePointCountsCnv_p1 converter; - return converter.createTransient( pers_ptr.get(), mlog ); + return m_converter_p1.createTransient( pers_ptr.get(), mlog ); } else if( compareClassGuid(p0_guid) ) { // old version from before TP separation, just return it @@ -64,15 +57,23 @@ TrigSpacePointCounts* TrigSpacePointCountsCnv::createTransient() { } - -StatusCode TrigSpacePointCountsCnv::initialize() -{ - static bool did_rootcnv = false; - if (!did_rootcnv) { - did_rootcnv = true; +namespace { + // Helper to be able to call thread-unsafe code during initialize as we + // currently cannot mark Converter::initialize() as thread-unsafe. + StatusCode loadConverter ATLAS_NOT_THREAD_SAFE() { static TrigSpacePointCounts_p1_old_cnv cnv; TConverterRegistry::Instance()->AddConverter (&cnv); + return StatusCode::SUCCESS; } +} + +StatusCode TrigSpacePointCountsCnv::initialize() +{ + [[maybe_unused]] static const bool did_rootcnv = []{ + StatusCode sc ATLAS_THREAD_SAFE = loadConverter(); + return sc.isSuccess(); + }(); + return TrigSpacePointCountsCnvBase::initialize(); } diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCnv.h index 4743556760fee66cb9fca5dda97a3267c8597b2c..eee329f99da3fa6b5b8148e3fe2aad80dd437624 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -12,14 +12,16 @@ * @author Andrew Hamilton - U. Geneva * @author Francesca Bucci - U. Geneva * - * File and Version Information: - * $Id: TrigSpacePointCountsCnv.h,v 1.4 2009-02-23 18:59:20 ssnyder Exp $ **********************************************************************************/ #ifndef TRIGEVENTATHENAPOOL_TRIGSPACEPOINTCOUNTSCNV_H #define TRIGEVENTATHENAPOOL_TRIGSPACEPOINTCOUNTSCNV_H #include "TrigInDetEvent/TrigSpacePointCounts.h" #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" +#include "TrigInDetEventTPCnv/TrigSpacePointCountsCnv_p1.h" +#include "TrigInDetEventTPCnv/TrigSpacePointCountsCnv_p2.h" +#include "TrigInDetEventTPCnv/TrigSpacePointCountsCnv_p3.h" + class TrigSpacePointCounts_p3; // typedef to the latest persistent version @@ -41,6 +43,11 @@ public: protected: virtual TrigSpacePointCounts_PERS *createPersistent(TrigSpacePointCounts *transObj); virtual TrigSpacePointCounts *createTransient(); + +private: + TrigSpacePointCountsCnv_p1 m_converter_p1; + TrigSpacePointCountsCnv_p2 m_converter_p2; + TrigSpacePointCountsCnv_p3 m_converter_p3; }; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCollectionCnv.cxx index 08f21dc69f0e20fd8997c2b7fffe36974f74b8f6..7655a69d406d57b24f0d81fd9b70d567fa9c40aa 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCollectionCnv.cxx @@ -1,24 +1,19 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigSpacePointCountsCollectionCnv.h" -#include "TrigInDetEventTPCnv/TrigSpacePointCountsCollectionCnv_tlp1.h" #include "TrigInDetEventTPCnv/TrigSpacePointCountsCollection_p4.h" -#include "TrigInDetEventTPCnv/TrigSpacePointCountsCollectionCnv_p4.h" -static TrigSpacePointCountsCollectionCnv_tlp1 TPConverter_tlp1; -static TrigSpacePointCountsCollectionCnv_p4 TPConverter; - -//createPersistent +//createPersistent TrigSpacePointCountsCollection_PERS * TrigSpacePointCountsCollectionCnv::createPersistent( TrigSpacePointCountsCollection *transObj) { MsgStream mlog(msgSvc(), "TrigSpacePointCountsCollectionConverter" ); mlog << MSG::DEBUG << "TrigSpacePointCountsCollectionCnv::createPersistent called" << endmsg; - TrigSpacePointCountsCollection_PERS * p_cont = TPConverter.createPersistent( transObj, mlog ); + TrigSpacePointCountsCollection_PERS * p_cont = m_converter.createPersistent( transObj, mlog ); return p_cont; @@ -32,19 +27,19 @@ TrigSpacePointCountsCollection * TrigSpacePointCountsCollectionCnv::createTransi mlog << MSG::DEBUG << "TrigSpacePointCountsCollectionCnv::createTransient called" << endmsg; - static pool::Guid p4_guid( "ACEDF654-09D7-49F6-9054-8E2CEE767367" ); - static pool::Guid tlp1_guid( "55733D7E-0054-4785-ADA8-3EA70D7477F2" ); - static pool::Guid p0_guid( "633C9739-C3D1-4F5D-9678-887445DA42B6" ); + static const pool::Guid p4_guid( "ACEDF654-09D7-49F6-9054-8E2CEE767367" ); + static const pool::Guid tlp1_guid( "55733D7E-0054-4785-ADA8-3EA70D7477F2" ); + static const pool::Guid p0_guid( "633C9739-C3D1-4F5D-9678-887445DA42B6" ); if( compareClassGuid( p4_guid ) ) { std::unique_ptr< TrigSpacePointCountsCollection_p4 > col_vect( poolReadObject< TrigSpacePointCountsCollection_p4 >() ); // std::cout << "Reading IMFC p4" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigSpacePointCountsCollection_tlp1 > col_vect( poolReadObject< TrigSpacePointCountsCollection_tlp1 >() ); // std::cout << "Reading IMFC tlp1" << std::endl; - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else if( compareClassGuid( p0_guid ) ) { return poolReadObject< TrigSpacePointCountsCollection >(); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCollectionCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCollectionCnv.h index 15faddcd4918401acea197bea5037d94bbc9a504..9efb975aad535747814053d925378f00c7b216c8 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCollectionCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigSpacePointCountsCollectionCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGSPACEPOINTCOUNTSCOLLECTION_CNV_H @@ -9,6 +9,8 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigInDetEvent/TrigSpacePointCountsCollection.h" #include "TrigInDetEventTPCnv/TrigSpacePointCountsCollection_p4.h" +#include "TrigInDetEventTPCnv/TrigSpacePointCountsCollectionCnv_tlp1.h" +#include "TrigInDetEventTPCnv/TrigSpacePointCountsCollectionCnv_p4.h" typedef TrigSpacePointCountsCollection_p4 TrigSpacePointCountsCollection_PERS; @@ -31,7 +33,11 @@ protected: virtual TrigSpacePointCountsCollection_PERS *createPersistent( TrigSpacePointCountsCollection *transObj); virtual TrigSpacePointCountsCollection *createTransient(); - + +private: + TrigSpacePointCountsCollectionCnv_tlp1 m_converter_tlp1; + TrigSpacePointCountsCollectionCnv_p4 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetCnv.cxx index 242aa8a5819002e32caf87bca20322bffa2aa0b8..e27c614a868f8f2b42a9f1290f522677de7ca9bb 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetCnv.cxx @@ -40,8 +40,8 @@ TrigT2Jet * TrigT2JetCnv::createTransient() mlog << MSG::DEBUG << "TrigT2JetCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "EAF10B4D-AD26-4030-AF0C-1060A39D663D" ); - static pool::Guid p0_guid( "242473A8-A320-49F1-A680-136EA26C1FAF" ); + static const pool::Guid tlp1_guid( "EAF10B4D-AD26-4030-AF0C-1060A39D663D" ); + static const pool::Guid p0_guid( "242473A8-A320-49F1-A680-136EA26C1FAF" ); TrigT2Jet *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetContainerCnv.cxx index 2558c680e004baa5d7d47070b17747b08b535012..8aeb6fcac12320f8e2f29441f2f8ac7a8ef0a834 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetContainerCnv.cxx @@ -1,17 +1,10 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigT2JetContainerCnv.h" #include "TrigCaloEventTPCnv/TrigT2JetContainer_tlp1.h" -#include "TrigCaloEventTPCnv/TrigT2JetContainerCnv_tlp1.h" - #include "TrigCaloEventTPCnv/TrigT2JetContainer_p3.h" -#include "TrigCaloEventTPCnv/TrigT2JetContainerCnv_p3.h" - - -static TrigT2JetContainerCnv_tlp1 TPConverter_tlp1; -static TrigT2JetContainerCnv_p3 TPConverter; //createPersistent TrigT2JetContainer_PERS * TrigT2JetContainerCnv::createPersistent( TrigT2JetContainer *transObj) @@ -21,7 +14,7 @@ TrigT2JetContainer_PERS * TrigT2JetContainerCnv::createPersistent( TrigT2JetCont mlog << MSG::DEBUG << "TrigT2JetContainerCnv::createPersistent" << endmsg; - TrigT2JetContainer_PERS* p_T2JetCont = TPConverter.createPersistent( transObj, mlog ); + TrigT2JetContainer_PERS* p_T2JetCont = m_converter.createPersistent( transObj, mlog ); return p_T2JetCont; @@ -36,18 +29,18 @@ TrigT2JetContainer * TrigT2JetContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigT2JetContainerCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "3B670168-C5AA-48A1-9813-C94530980EBF" ); - static pool::Guid p3_guid( "6215BEE2-45E7-4681-9089-9BD470CDAF4D" ); + static const pool::Guid tlp1_guid( "3B670168-C5AA-48A1-9813-C94530980EBF" ); + static const pool::Guid p3_guid( "6215BEE2-45E7-4681-9089-9BD470CDAF4D" ); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigT2JetContainer_p3 > col_vect( poolReadObject< TrigT2JetContainer_p3 >() ); //std::cout << "Reading TTCC p3" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigT2JetContainer_tlp1 > col_vect( poolReadObject< TrigT2JetContainer_tlp1 >() ); //std::cout << "Reading TTC tlp1" << std::endl; - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else throw std::runtime_error( "Unsupported persistent version of TrigT2JetContainer" ); }//end of create transient method diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetContainerCnv.h index da7ce06ba0bc2bd041d4554487b8f63ea4b7b65f..80da760cbb36c45d1a3733a36c8084d08832edb3 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2JetContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -12,8 +12,6 @@ * @author Andrew Hamilton - U. Geneva * @author Francesca Bucci - U. Geneva * - * File and Version Information: - * $Id: TrigT2JetContainerCnv.h,v 1.2 2009-02-23 18:59:20 ssnyder Exp $ **********************************************************************************/ #ifndef TRIGEVENTATHENAPOOL_TRIGT2JETCONTAINER_CNV_H #define TRIGEVENTATHENAPOOL_TRIGT2JETCONTAINER_CNV_H @@ -23,6 +21,9 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigCaloEvent/TrigT2JetContainer.h" #include "TrigCaloEventTPCnv/TrigT2JetContainer_p3.h" +#include "TrigCaloEventTPCnv/TrigT2JetContainerCnv_tlp1.h" +#include "TrigCaloEventTPCnv/TrigT2JetContainerCnv_p3.h" + typedef TrigT2JetContainer_p3 TrigT2JetContainer_PERS; @@ -41,7 +42,11 @@ protected: virtual TrigT2JetContainer_PERS *createPersistent( TrigT2JetContainer *transObj); virtual TrigT2JetContainer *createTransient(); - + +private: + TrigT2JetContainerCnv_tlp1 m_converter_tlp1; + TrigT2JetContainerCnv_p3 m_converter; + };//end of class definitions #endif //TRIGT2JETCONTAINER_CNV_H diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsCnv.cxx index 2f5734c09f28b68f102eabfa8cd2946041dd2b0a..0ed7428508efbdce0b9a5292befcef33e23d9e1f 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsCnv.cxx @@ -25,8 +25,8 @@ TrigT2MbtsBits* TrigT2MbtsBitsCnv::createTransient() { MsgStream mlog(msgSvc(), "TrigT2MbtsBitsConverter" ); mlog << MSG::DEBUG << "TrigT2MbtsBitsCnv::createTransient " << endmsg; - static pool::Guid p2_guid("6D130C0D-20A2-4304-8E70-6775892217A6"); - static pool::Guid p1_guid("32E86328-15EB-42F5-A93F-6F891220A626"); + static const pool::Guid p2_guid("6D130C0D-20A2-4304-8E70-6775892217A6"); + static const pool::Guid p1_guid("32E86328-15EB-42F5-A93F-6F891220A626"); TrigT2MbtsBits *transObj = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsContainerCnv.cxx index c7944ba81710b4b37d3af04cfcc156c10ec69bb6..4d3858946d181ea6b93bfd24a3e5267fc8259508 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsContainerCnv.cxx @@ -1,14 +1,8 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigT2MbtsBitsContainerCnv.h" -#include "TrigCaloEventTPCnv/TrigT2MbtsBitsContainerCnv_tlp1.h" -#include "TrigCaloEventTPCnv/TrigT2MbtsBitsContainerCnv_p3.h" - -static TrigT2MbtsBitsContainerCnv_tlp1 TPConverter_tlp1; -static TrigT2MbtsBitsContainerCnv_p3 TPConverter; -static TrigT2MbtsBitsContainerCnv_p1 TP1Converter; //createPersistent TrigT2MbtsBitsContainer_PERS * TrigT2MbtsBitsContainerCnv::createPersistent( TrigT2MbtsBitsContainer *transObj) @@ -17,7 +11,7 @@ TrigT2MbtsBitsContainer_PERS * TrigT2MbtsBitsContainerCnv::createPersistent( Tri mlog << MSG::DEBUG << "TrigT2MbtsBitsContainerCnv::createPersistent" << endmsg; - TrigT2MbtsBitsContainer_PERS* persObj = TPConverter.createPersistent( transObj, mlog ); + TrigT2MbtsBitsContainer_PERS* persObj = m_converter.createPersistent( transObj, mlog ); return persObj; @@ -31,27 +25,27 @@ TrigT2MbtsBitsContainer* TrigT2MbtsBitsContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigT2MbtsBitsContainerCnv::createTransient" << endmsg; - static pool::Guid p3_guid( "60BD805D-F64E-46DF-87CD-0B4443660C97" ); - static pool::Guid tlp1_guid( "82BAAC80-62FC-4E6D-9BD7-1619064FF7AC" ); - static pool::Guid p1_guid( "139D9BFE-0944-44A6-8D9E-10CEEF8B30B9" ); - static pool::Guid trans_guid( "BBB00ED0-1D5C-4C73-8785-6BF239D07816" ); + static const pool::Guid p3_guid( "60BD805D-F64E-46DF-87CD-0B4443660C97" ); + static const pool::Guid tlp1_guid( "82BAAC80-62FC-4E6D-9BD7-1619064FF7AC" ); + static const pool::Guid p1_guid( "139D9BFE-0944-44A6-8D9E-10CEEF8B30B9" ); + static const pool::Guid trans_guid( "BBB00ED0-1D5C-4C73-8785-6BF239D07816" ); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigT2MbtsBitsContainer_p3 > col_vect( poolReadObject< TrigT2MbtsBitsContainer_p3 >() ); // std::cout << "Reading IMFC p3" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if(compareClassGuid(tlp1_guid)) { std::unique_ptr< TrigT2MbtsBitsContainer_tlp1 > col_vect( poolReadObject< TrigT2MbtsBitsContainer_tlp1 >() ); // std::cout << "Reading IMFC tlp1" << std::endl; - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else if(compareClassGuid(p1_guid)) { std::unique_ptr< TrigT2MbtsBitsContainer_p1 > col_vect( poolReadObject< TrigT2MbtsBitsContainer_p1 >() ); - return TP1Converter.createTransient( col_vect.get(), mlog ); + return m_converter_p1.createTransient( col_vect.get(), mlog ); } else if(compareClassGuid(trans_guid)) { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsContainerCnv.h index 3056b3b28ace5d9f799b3931bed0f2757e6abf0c..934210626fee4a0d3813ad4aa0bd7f75eb80b675 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigT2MbtsBitsContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGT2MBTSBITSCONTAINER_CNV_H @@ -8,8 +8,9 @@ #include "GaudiKernel/MsgStream.h" #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigCaloEvent/TrigT2MbtsBitsContainer.h" +#include "TrigCaloEventTPCnv/TrigT2MbtsBitsContainerCnv_tlp1.h" #include "TrigCaloEventTPCnv/TrigT2MbtsBitsContainerCnv_p3.h" - + typedef TrigT2MbtsBitsContainer_p3 TrigT2MbtsBitsContainer_PERS; typedef T_AthenaPoolCustomCnv TrigT2MbtsBitsContainerCnvBase; @@ -26,7 +27,12 @@ protected: virtual TrigT2MbtsBitsContainer_PERS *createPersistent( TrigT2MbtsBitsContainer *transObj); virtual TrigT2MbtsBitsContainer *createTransient(); - + +private: + TrigT2MbtsBitsContainerCnv_tlp1 m_converter_tlp1; + TrigT2MbtsBitsContainerCnv_p1 m_converter_p1; + TrigT2MbtsBitsContainerCnv_p3 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterCnv.cxx index 4191b898dbfeb876e46901218420f4efd9d6757e..c61c69e8ecaeae002a723d064138bf2d6bf4cf61 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterCnv.cxx @@ -44,9 +44,9 @@ TrigTauCluster* TrigTauClusterCnv::createTransient() MsgStream mlog(msgSvc(), "TrigTauClusterConverter" ); mlog << MSG::DEBUG << "TrigTauClusterCnv::createTransient " << endmsg; - static pool::Guid tlp2_guid("CEDD0095-1134-4CEC-91CC-61028B214F6C"); - static pool::Guid tlp1_guid("60C9B591-CE4B-473C-9CB9-8C4F99271D76"); - static pool::Guid p0_guid("9B3B6AE8-9CE6-44AB-8B31-8B39FED52607"); + static const pool::Guid tlp2_guid("CEDD0095-1134-4CEC-91CC-61028B214F6C"); + static const pool::Guid tlp1_guid("60C9B591-CE4B-473C-9CB9-8C4F99271D76"); + static const pool::Guid p0_guid("9B3B6AE8-9CE6-44AB-8B31-8B39FED52607"); TrigTauCluster *trans_cont(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterContainerCnv.cxx index 66139bd7e5fca42a8a8af99d45ee76ef3de01de1..05eeb79067825e876bfb3b782767b022ff5f86f2 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterContainerCnv.cxx @@ -1,33 +1,21 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigTauClusterContainerCnv.h" #include "TrigCaloEventTPCnv/TrigTauClusterContainer_tlp1.h" -#include "TrigCaloEventTPCnv/TrigTauClusterContainerCnv_tlp1.h" - #include "TrigCaloEventTPCnv/TrigTauClusterContainer_p3.h" -#include "TrigCaloEventTPCnv/TrigTauClusterContainerCnv_p3.h" - #include "TrigCaloEventTPCnv/TrigTauClusterContainer_p4.h" -#include "TrigCaloEventTPCnv/TrigTauClusterContainerCnv_p4.h" - #include "TrigCaloEventTPCnv/TrigTauClusterContainer_p5.h" -#include "TrigCaloEventTPCnv/TrigTauClusterContainerCnv_p5.h" - -static TrigTauClusterContainerCnv_tlp1 TPconverter1; -static TrigTauClusterContainerCnv_p3 TPconverter3; -static TrigTauClusterContainerCnv_p4 TPconverter4; -static TrigTauClusterContainerCnv_p5 TPconverter5; -//createPersistent +//createPersistent TrigTauClusterContainer_PERS* TrigTauClusterContainerCnv::createPersistent(TrigTauClusterContainer *transObj) { MsgStream mlog(msgSvc(), "TrigTauClusterContainerConverter"); mlog << MSG::DEBUG << "TrigTauClusterContainerCnv::createPersistent called" << endmsg; - TrigTauClusterContainer_PERS* p_TauClusterCont = TPconverter5.createPersistent(transObj, mlog); + TrigTauClusterContainer_PERS* p_TauClusterCont = m_converter5.createPersistent(transObj, mlog); return p_TauClusterCont; @@ -41,35 +29,35 @@ TrigTauClusterContainer* TrigTauClusterContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigTauClusterContainerCnv::createTransient called" << endmsg; - static pool::Guid p5_guid("8384F60B-952E-4DE4-B307-1AC1C405E156"); - static pool::Guid p4_guid("D41E29BA-0FE8-4319-85F4-93EA68AD9195"); - static pool::Guid p3_guid("3BB1A500-2188-47D4-9352-6638DEA3FC7D"); - static pool::Guid tlp1_guid("E1FC5307-A747-42D7-9542-998A9AACB445"); - static pool::Guid tlp2_guid("07437EBD-7637-4C3F-B177-6D640AE36FAD"); + static const pool::Guid p5_guid("8384F60B-952E-4DE4-B307-1AC1C405E156"); + static const pool::Guid p4_guid("D41E29BA-0FE8-4319-85F4-93EA68AD9195"); + static const pool::Guid p3_guid("3BB1A500-2188-47D4-9352-6638DEA3FC7D"); + static const pool::Guid tlp1_guid("E1FC5307-A747-42D7-9542-998A9AACB445"); + static const pool::Guid tlp2_guid("07437EBD-7637-4C3F-B177-6D640AE36FAD"); if(compareClassGuid(p5_guid)) { std::unique_ptr< TrigTauClusterContainer_p5 > col_vect(poolReadObject< TrigTauClusterContainer_p5 >()); //std::cout << "Reading TTCC p5" << std::endl; - return TPconverter5.createTransient(col_vect.get(), mlog); + return m_converter5.createTransient(col_vect.get(), mlog); } else if(compareClassGuid(p4_guid)) { std::unique_ptr< TrigTauClusterContainer_p4 > col_vect(poolReadObject< TrigTauClusterContainer_p4 >()); //std::cout << "Reading TTCC p4" << std::endl; - return TPconverter4.createTransient(col_vect.get(), mlog); + return m_converter4.createTransient(col_vect.get(), mlog); } else if(compareClassGuid(p3_guid)) { std::unique_ptr< TrigTauClusterContainer_p3 > col_vect(poolReadObject< TrigTauClusterContainer_p3 >()); //std::cout << "Reading TTCC p3" << std::endl; - return TPconverter3.createTransient(col_vect.get(), mlog); + return m_converter3.createTransient(col_vect.get(), mlog); } else if(compareClassGuid(tlp1_guid)) { std::unique_ptr< TrigTauClusterContainer_tlp1 > col_vect(poolReadObject< TrigTauClusterContainer_tlp1 >()); //std::cout << "Reading TTC tlp1" << std::endl; - return TPconverter1.createTransient( col_vect.get(), mlog ); + return m_converter1.createTransient( col_vect.get(), mlog ); } else { diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterContainerCnv.h index 056ba1aeaad0419691148823adfa382508d9f92e..61ab0ac1693715ad39f49840d6fdb75384908310 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************************** @@ -12,8 +12,6 @@ * @author Andrew Hamilton - U. Geneva * @author Francesca Bucci - U. Geneva * -* File and Version Information: -* $Id: TrigTauClusterContainerCnv.h,v 1.5 2009-03-06 18:08:44 masik Exp $ **********************************************************************************/ #ifndef TRIGEVENTATHENAPOOL_TRIGTAUCLUSTERCONTAINER_CNV_H #define TRIGEVENTATHENAPOOL_TRIGTAUCLUSTERCONTAINER_CNV_H @@ -22,6 +20,10 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigCaloEvent/TrigTauClusterContainer.h" #include "TrigCaloEventTPCnv/TrigTauClusterContainer_p5.h" +#include "TrigCaloEventTPCnv/TrigTauClusterContainerCnv_tlp1.h" +#include "TrigCaloEventTPCnv/TrigTauClusterContainerCnv_p3.h" +#include "TrigCaloEventTPCnv/TrigTauClusterContainerCnv_p4.h" +#include "TrigCaloEventTPCnv/TrigTauClusterContainerCnv_p5.h" typedef TrigTauClusterContainer_p5 TrigTauClusterContainer_PERS; @@ -38,6 +40,13 @@ protected: virtual TrigTauClusterContainer_PERS* createPersistent(TrigTauClusterContainer *transObj); virtual TrigTauClusterContainer* createTransient(); + +private: + TrigTauClusterContainerCnv_tlp1 m_converter1; + TrigTauClusterContainerCnv_p3 m_converter3; + TrigTauClusterContainerCnv_p4 m_converter4; + TrigTauClusterContainerCnv_p5 m_converter5; + }; #endif diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsCnv.cxx index 3df3c4cebe694f698a1f5427d3a6f905a09987c4..01cf33749ab4664f15c378c321dd833f53c9d54e 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsCnv.cxx @@ -34,8 +34,8 @@ TrigTauClusterDetails* TrigTauClusterDetailsCnv::createTransient() MsgStream mlog(msgSvc(), "TrigTauClusterDetailsConverter" ); mlog << MSG::DEBUG << "TrigTauClusterDetailsCnv::createTransient " << endmsg; - static pool::Guid tlp1_guid("4F82A265-04F7-4BE9-9DB1-42C00A574778"); - static pool::Guid p0_guid("1C8021CB-F4FB-473A-B379-9BEF3FC7FEB9"); + static const pool::Guid tlp1_guid("4F82A265-04F7-4BE9-9DB1-42C00A574778"); + static const pool::Guid p0_guid("1C8021CB-F4FB-473A-B379-9BEF3FC7FEB9"); TrigTauClusterDetails *trans_cont(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsContainerCnv.cxx index 4b77c2b1f3c2235073cb198011c9124c2c8de4d3..c5789d1af4763ed2a9312411580141cd6d890e7b 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsContainerCnv.cxx @@ -1,14 +1,9 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigTauClusterDetailsContainerCnv.h" -#include "TrigCaloEventTPCnv/TrigTauClusterDetailsContainerCnv_tlp1.h" #include "TrigCaloEventTPCnv/TrigTauClusterDetailsContainer_p2.h" -#include "TrigCaloEventTPCnv/TrigTauClusterDetailsContainerCnv_p2.h" - -static TrigTauClusterDetailsContainerCnv_tlp1 TPconverter1; -static TrigTauClusterDetailsContainerCnv_p2 TPconverter; //createPersistent TrigTauClusterDetailsContainer_PERS * TrigTauClusterDetailsContainerCnv::createPersistent( TrigTauClusterDetailsContainer *transObj) @@ -17,7 +12,7 @@ TrigTauClusterDetailsContainer_PERS * TrigTauClusterDetailsContainerCnv::createP mlog << MSG::DEBUG << "TrigTauClusterDetailsContainerCnv::createPersistent called" << endmsg; - TrigTauClusterDetailsContainer_PERS * p_TauClusterCont = TPconverter.createPersistent( transObj, mlog ); + TrigTauClusterDetailsContainer_PERS * p_TauClusterCont = m_converter.createPersistent( transObj, mlog ); return p_TauClusterCont; @@ -30,19 +25,19 @@ TrigTauClusterDetailsContainer * TrigTauClusterDetailsContainerCnv::createTransi mlog << MSG::DEBUG << "TrigTauClusterDetailsContainerCnv::createTransient called" << endmsg; - static pool::Guid p2_guid( "AAEE63E0-BA47-45AD-AC28-E07EC68812C4" ); - static pool::Guid tlp1_guid( "D7DA2036-9F38-4060-A5C9-75C72AF104C4" ); + static const pool::Guid p2_guid( "AAEE63E0-BA47-45AD-AC28-E07EC68812C4" ); + static const pool::Guid tlp1_guid( "D7DA2036-9F38-4060-A5C9-75C72AF104C4" ); if( compareClassGuid( p2_guid ) ){ std::unique_ptr< TrigTauClusterDetailsContainer_p2 > col_vect( poolReadObject< TrigTauClusterDetailsContainer_p2 >() ); //std::cout << "Reading TTCD p2" << std::endl; - return TPconverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; }else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigTauClusterDetailsContainer_tlp1 > col_vect( poolReadObject< TrigTauClusterDetailsContainer_tlp1 >() ); //std::cout << "Reading TTCD tlp1" << std::endl; - return TPconverter1.createTransient( col_vect.get(), mlog ); + return m_converter1.createTransient( col_vect.get(), mlog ); } else throw std::runtime_error( "Unsupported persistent version of TrigTauClusterDetailsContainer" ); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsContainerCnv.h index 110609990c9a55a0fb4bb96b1da9c28fd7a33433..aae5bb8b4b7aec88ed37ec0b44e833fe924d7879 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauClusterDetailsContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGTAUCLUSTERDETAILSCONTAINER_CNV_H @@ -12,6 +12,8 @@ #include "TrigCaloEvent/TrigTauClusterDetailsContainer.h" #include "TrigCaloEventTPCnv/TrigTauClusterDetailsContainer_p2.h" +#include "TrigCaloEventTPCnv/TrigTauClusterDetailsContainerCnv_tlp1.h" +#include "TrigCaloEventTPCnv/TrigTauClusterDetailsContainerCnv_p2.h" typedef TrigTauClusterDetailsContainer_p2 TrigTauClusterDetailsContainer_PERS; @@ -30,6 +32,10 @@ protected: virtual TrigTauClusterDetailsContainer_PERS *createPersistent( TrigTauClusterDetailsContainer *transObj); virtual TrigTauClusterDetailsContainer *createTransient(); +private: + TrigTauClusterDetailsContainerCnv_tlp1 m_converter1; + TrigTauClusterDetailsContainerCnv_p2 m_converter; + }; #endif diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauCnv.cxx index 360b6cfa920aab8905001621aa5c2ac46b6e8bb1..36d27d229803be284b9b0fccd55990e232b10192 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauCnv.cxx @@ -42,10 +42,10 @@ TrigTau* TrigTauCnv::createTransient() MsgStream mlog(msgSvc(), "TrigTauConverter" ); mlog << MSG::DEBUG << "TrigTauCnv::createTransient " << endmsg; - static pool::Guid tlp1_guid("82AE3333-5398-4590-A51A-616832332D9B"); - static pool::Guid p0_guid("F95B5B76-13D3-4EB4-94BB-1383B8571ADD"); - static pool::Guid tlp2_guid("B2619D46-FB89-4961-8A57-6A980A2EFB33"); - static pool::Guid p2_guid("9CA7EFF2-DB12-4E06-A425-01B1D8367BE3"); + static const pool::Guid tlp1_guid("82AE3333-5398-4590-A51A-616832332D9B"); + static const pool::Guid p0_guid("F95B5B76-13D3-4EB4-94BB-1383B8571ADD"); + static const pool::Guid tlp2_guid("B2619D46-FB89-4961-8A57-6A980A2EFB33"); + static const pool::Guid p2_guid("9CA7EFF2-DB12-4E06-A425-01B1D8367BE3"); TrigTau *trans_cont(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauContainerCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauContainerCnv.cxx index b1c0047f5afdb8b8011043d8db44828e514f0196..ee9f9c1bc9d90e01acefa6d5faf9f247badbe7f4 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauContainerCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauContainerCnv.cxx @@ -1,13 +1,8 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigTauContainerCnv.h" -#include "TrigParticleTPCnv/TrigTauContainerCnv_tlp1.h" -#include "TrigParticleTPCnv/TrigTauContainerCnv_p3.h" - -static TrigTauContainerCnv_tlp1 TPConverter_tlp1; -static TrigTauContainerCnv_p3 TPConverter; //createPersistent TrigTauContainer_PERS * TrigTauContainerCnv::createPersistent( TrigTauContainer *transObj) @@ -16,7 +11,7 @@ TrigTauContainer_PERS * TrigTauContainerCnv::createPersistent( TrigTauContainer mlog << MSG::DEBUG << "TrigTauContainerCnv::createPersistent called" << endmsg; - TrigTauContainer_PERS * p_TauCont = TPConverter.createPersistent( transObj, mlog ); + TrigTauContainer_PERS * p_TauCont = m_converter.createPersistent( transObj, mlog ); return p_TauCont; @@ -29,16 +24,16 @@ TrigTauContainer * TrigTauContainerCnv::createTransient() mlog << MSG::DEBUG << "TrigTauContainerCnv::createTransient called" << endmsg; - static pool::Guid p3_guid( "32FE95F3-F85E-481E-9DD6-7BBA08ABDBD7" ); - static pool::Guid tlp1_guid( "1551CECC-52C7-4B5B-876C-27005A8DCCC8" ); + static const pool::Guid p3_guid( "32FE95F3-F85E-481E-9DD6-7BBA08ABDBD7" ); + static const pool::Guid tlp1_guid( "1551CECC-52C7-4B5B-876C-27005A8DCCC8" ); if( compareClassGuid( p3_guid ) ){ std::unique_ptr< TrigTauContainer_p3 > col_vect( poolReadObject< TrigTauContainer_p3 >() ); // std::cout << "Reading IMFC p3" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( tlp1_guid ) ) { std::unique_ptr< TrigTauContainer_tlp1 > col_vect( poolReadObject< TrigTauContainer_tlp1 >() ); - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else { throw std::runtime_error( "Unsupported persistent version of TrigTauContainer" ); } }//end of create transient method diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauContainerCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauContainerCnv.h index 8baf76302a9c186c067387db3133e1217e8b96f0..6c9b7d5b498522432d79de308bdc39255163e500 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauContainerCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGTAUCONTAINER_CNV_H @@ -11,7 +11,9 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigParticle/TrigTauContainer.h" #include "TrigParticleTPCnv/TrigTauContainerCnv_p3.h" - + #include "TrigParticleTPCnv/TrigTauContainerCnv_tlp1.h" +#include "TrigParticleTPCnv/TrigTauContainerCnv_p3.h" + typedef TrigTauContainer_p3 TrigTauContainer_PERS; typedef T_AthenaPoolCustomCnv TrigTauContainerCnvBase; @@ -30,7 +32,11 @@ protected: virtual TrigTauContainer_PERS *createPersistent( TrigTauContainer *transObj); virtual TrigTauContainer *createTransient(); - + +private: + TrigTauContainerCnv_tlp1 m_converter_tlp1; + TrigTauContainerCnv_p3 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfo.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfo.cxx index 91df9b424604d755cefc04f1d7fb369d743a80c3..232843165292fcb37efc79963b43207988c3e6ef 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfo.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfo.cxx @@ -32,8 +32,8 @@ TrigTauTracksInfo* TrigTauTracksInfoCnv::createTransient() MsgStream mlog(msgSvc(), "TrigTauTracksInfoConverter" ); mlog << MSG::DEBUG << "TrigTauTracksInfoCnv::createTransient " << endmsg; - static pool::Guid tlp1_guid("ABF3C91C-A007-440E-8AEE-753FAA453352"); - static pool::Guid p0_guid("630E4944-7EDE-4938-B189-020DBC0436AE"); + static const pool::Guid tlp1_guid("ABF3C91C-A007-440E-8AEE-753FAA453352"); + static const pool::Guid p0_guid("630E4944-7EDE-4938-B189-020DBC0436AE"); TrigTauTracksInfo *trans_cont(0); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfoCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfoCollectionCnv.cxx index ca0218949bbd2fdb5e069134211f6be3b1fb7792..df4047f8cdbc3ddfba072dab7d58a9905b607b32 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfoCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfoCollectionCnv.cxx @@ -1,13 +1,8 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigTauTracksInfoCollectionCnv.h" -#include "TrigInDetEventTPCnv/TrigTauTracksInfoCollectionCnv_tlp1.h" -#include "TrigInDetEventTPCnv/TrigTauTracksInfoCollectionCnv_p2.h" - -static TrigTauTracksInfoCollectionCnv_tlp1 TPConverter_tlp1; -static TrigTauTracksInfoCollectionCnv_p2 TPConverter; //createPersistent TrigTauTracksInfoCollection_PERS * TrigTauTracksInfoCollectionCnv::createPersistent( TrigTauTracksInfoCollection *transObj) @@ -16,7 +11,7 @@ TrigTauTracksInfoCollection_PERS * TrigTauTracksInfoCollectionCnv::createPersist mlog << MSG::DEBUG << "TrigTauTracksInfoCollectionCnv::createPersistent called" << endmsg; - TrigTauTracksInfoCollection_PERS * p_cont = TPConverter.createPersistent( transObj, mlog ); + TrigTauTracksInfoCollection_PERS * p_cont = m_converter.createPersistent( transObj, mlog ); return p_cont; @@ -30,16 +25,16 @@ TrigTauTracksInfoCollection * TrigTauTracksInfoCollectionCnv::createTransient() mlog << MSG::DEBUG << "TrigTauTracksInfoCollectionCnv::createTransient called" << endmsg; - static pool::Guid p2_guid( "1AF8C4E5-4862-4625-B9B6-D9B53E716B17" ); - static pool::Guid p1_guid( "8A208FA7-C52F-4CD3-AE20-EF1C99FC92A6" ); - static pool::Guid p0_guid( "27E95E77-0D99-417D-83C7-7F1B8E6DE511" ); + static const pool::Guid p2_guid( "1AF8C4E5-4862-4625-B9B6-D9B53E716B17" ); + static const pool::Guid p1_guid( "8A208FA7-C52F-4CD3-AE20-EF1C99FC92A6" ); + static const pool::Guid p0_guid( "27E95E77-0D99-417D-83C7-7F1B8E6DE511" ); if( compareClassGuid( p2_guid ) ){ std::unique_ptr< TrigTauTracksInfoCollection_p2 > col_vect( poolReadObject< TrigTauTracksInfoCollection_p2 >() ); - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if( compareClassGuid( p1_guid ) ) { std::unique_ptr< TrigTauTracksInfoCollection_tlp1 > col_vect( poolReadObject< TrigTauTracksInfoCollection_tlp1 >() ); - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else if( compareClassGuid( p0_guid ) ){ return poolReadObject< TrigTauTracksInfoCollection >(); } else throw std::runtime_error( "Unsupported persistent version of TrigTauTracksInfoCollection" ); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfoCollectionCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfoCollectionCnv.h index a4068cca1f4e65741e389c617e651e7e2ff2d31b..e9e149b8b300f0e189aa6ba72334818e70f2460c 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfoCollectionCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTauTracksInfoCollectionCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGTAUTRACKSINFOCOLLECTION_CNV_H @@ -9,6 +9,9 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigInDetEvent/TrigTauTracksInfoCollection.h" #include "TrigInDetEventTPCnv/TrigTauTracksInfoCollection_p2.h" +#include "TrigInDetEventTPCnv/TrigTauTracksInfoCollectionCnv_tlp1.h" +#include "TrigInDetEventTPCnv/TrigTauTracksInfoCollectionCnv_p2.h" + typedef TrigTauTracksInfoCollection_p2 TrigTauTracksInfoCollection_PERS; @@ -26,7 +29,11 @@ protected: virtual TrigTauTracksInfoCollection_PERS *createPersistent( TrigTauTracksInfoCollection *transObj); virtual TrigTauTracksInfoCollection *createTransient(); - + +private: + TrigTauTracksInfoCollectionCnv_tlp1 m_converter_tlp1; + TrigTauTracksInfoCollectionCnv_p2 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrackCountsCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrackCountsCnv.cxx index 5952febbbdb5de868dcb68085085a02e96676a34..51abedf0de12ada02a59a6291ec27e580426c6b4 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrackCountsCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrackCountsCnv.cxx @@ -30,9 +30,9 @@ TrigTrackCounts* TrigTrackCountsCnv::createTransient() { mlog << MSG::DEBUG << "TrigTrackCountsCnv::createTransient " << endmsg; - static pool::Guid p2_guid("BD8BB599-AE38-45CC-93DB-27F67C23DB62"); - static pool::Guid p1_guid("2DCA396C-5CC1-4B6A-8B76-E3EBA4F81A61"); - static pool::Guid p0_guid("6277C97C-0EAA-4922-892E-E88C1FA01BA0"); + static const pool::Guid p2_guid("BD8BB599-AE38-45CC-93DB-27F67C23DB62"); + static const pool::Guid p1_guid("2DCA396C-5CC1-4B6A-8B76-E3EBA4F81A61"); + static const pool::Guid p0_guid("6277C97C-0EAA-4922-892E-E88C1FA01BA0"); if(compareClassGuid(p2_guid)) { std::unique_ptr< TrigTrackCounts_p2 > pers_ptr( poolReadObject< TrigTrackCounts_p2 >() ); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrackCountsCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrackCountsCollectionCnv.cxx index d1c218728e0ef63f507ab25c832b1078e5966402..367dd92c9eb47a5975a154ed928adbb170100236 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrackCountsCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrackCountsCollectionCnv.cxx @@ -38,8 +38,8 @@ TrigTrackCountsCollection * TrigTrackCountsCollectionCnv::createTransient() mlog << MSG::DEBUG << "TrigTrackCountsCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp1_guid( "FCEB4390-F8FB-4C93-9538-105BCABE487C" ); - static pool::Guid p0_guid( "7A4412AD-C11D-4EFD-AE15-D343D2CB28BC" ); + static const pool::Guid tlp1_guid( "FCEB4390-F8FB-4C93-9538-105BCABE487C" ); + static const pool::Guid p0_guid( "7A4412AD-C11D-4EFD-AE15-D343D2CB28BC" ); TrigTrackCountsCollection *p_collection = 0; if( compareClassGuid( tlp1_guid ) ) diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCnv.cxx index 9723f856f034d1142c10a8bde6002184610fb3a2..ce1b244402df57bdde34ff858ec0cc1a4a18bf31 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCnv.cxx @@ -23,7 +23,7 @@ TrigTrtHitCounts* TrigTrtHitCountsCnv::createTransient() { MsgStream mlog(msgSvc(), "TrigTrtHitCountsConverter" ); mlog << MSG::DEBUG << "TrigTrtHitCountsCnv::createTransient " << endmsg; - static pool::Guid p1_guid("FB33CC3C-74B8-43DF-ABDA-E56BEA1D9D61"); + static const pool::Guid p1_guid("FB33CC3C-74B8-43DF-ABDA-E56BEA1D9D61"); TrigTrtHitCounts *transObj = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCollectionCnv.cxx index 70404fe2a86aa5a1bc4d02819bbaf31fc140623f..3a416cb4b1deee9f711c7e0c14994901dd1c97c7 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCollectionCnv.cxx @@ -1,16 +1,11 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigInDetEventTPCnv/TrigTrtHitCountsCollection_p1.h" -#include "TrigInDetEventTPCnv/TrigTrtHitCountsCollectionCnv_tlp1.h" -#include "TrigTrtHitCountsCollectionCnv.h" - #include "TrigInDetEventTPCnv/TrigTrtHitCountsCollection_p2.h" -#include "TrigInDetEventTPCnv/TrigTrtHitCountsCollectionCnv_p2.h" -static TrigTrtHitCountsCollectionCnv_tlp1 TPConverter_tlp1; -static TrigTrtHitCountsCollectionCnv_p2 TPConverter; +#include "TrigTrtHitCountsCollectionCnv.h" //createPersistent TrigTrtHitCountsCollection_PERS * TrigTrtHitCountsCollectionCnv::createPersistent( TrigTrtHitCountsCollection *transObj) @@ -19,7 +14,7 @@ TrigTrtHitCountsCollection_PERS * TrigTrtHitCountsCollectionCnv::createPersisten mlog << MSG::DEBUG << "TrigTrtHitCountsCollectionCnv::createPersistent" << endmsg; - TrigTrtHitCountsCollection_PERS* persObj = TPConverter.createPersistent( transObj, mlog ); + TrigTrtHitCountsCollection_PERS* persObj = m_converter.createPersistent( transObj, mlog ); return persObj; @@ -32,26 +27,25 @@ TrigTrtHitCountsCollection* TrigTrtHitCountsCollectionCnv::createTransient() mlog << MSG::DEBUG << "TrigTrtHitCountsCollectionCnv::createTransient" << endmsg; - static pool::Guid p2_guid( "47CBB4D9-381C-423E-A560-A7B5C325A5DD" ); - static pool::Guid tlp1_guid( "A0763CCA-553C-4365-8091-04CA2036FD97" ); - static pool::Guid p1_guid( "0CC00AC1-FB95-4E69-8C6E-29B6BB713AAE" ); - static pool::Guid trans_guid( "7631C2C2-612F-4245-8C8B-D40F59222E1E" ); + static const pool::Guid p2_guid( "47CBB4D9-381C-423E-A560-A7B5C325A5DD" ); + static const pool::Guid tlp1_guid( "A0763CCA-553C-4365-8091-04CA2036FD97" ); + static const pool::Guid p1_guid( "0CC00AC1-FB95-4E69-8C6E-29B6BB713AAE" ); + static const pool::Guid trans_guid( "7631C2C2-612F-4245-8C8B-D40F59222E1E" ); if( compareClassGuid( p2_guid ) ){ std::unique_ptr< TrigTrtHitCountsCollection_p2 > col_vect( poolReadObject< TrigTrtHitCountsCollection_p2 >() ); // std::cout << "Reading IMFC p2" << std::endl; - return TPConverter.createTransient( col_vect.get(), mlog ) ; + return m_converter.createTransient( col_vect.get(), mlog ) ; } else if(compareClassGuid(tlp1_guid)) { std::unique_ptr< TrigTrtHitCountsCollection_tlp1 > col_vect( poolReadObject< TrigTrtHitCountsCollection_tlp1 >() ); // std::cout << "Reading IMFC tlp1" << std::endl; - return TPConverter_tlp1.createTransient( col_vect.get(), mlog ); + return m_converter_tlp1.createTransient( col_vect.get(), mlog ); } else if(compareClassGuid(p1_guid)) { std::unique_ptr< TrigTrtHitCountsCollection_p1 > col_vect( poolReadObject< TrigTrtHitCountsCollection_p1 >() ); - TrigTrtHitCountsCollectionCnv_p1 converter; - return converter.createTransient( col_vect.get(), mlog ); + return m_converter_p1.createTransient( col_vect.get(), mlog ); } else if(compareClassGuid(trans_guid)) { return poolReadObject(); diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCollectionCnv.h b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCollectionCnv.h index 1de02a315f7684444d7e1dbde9e262eff4354444..d8c42d283f59a05e76b1c2cfb4bb13cfe4c1d573 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCollectionCnv.h +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigTrtHitCountsCollectionCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEVENTATHENAPOOL_TRIGTRTHITCOUNTSCOLLECTION_CNV_H @@ -10,6 +10,9 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrigInDetEvent/TrigTrtHitCountsCollection.h" #include "TrigInDetEventTPCnv/TrigTrtHitCountsCollection_p2.h" +#include "TrigInDetEventTPCnv/TrigTrtHitCountsCollectionCnv_tlp1.h" +#include "TrigInDetEventTPCnv/TrigTrtHitCountsCollectionCnv_p1.h" +#include "TrigInDetEventTPCnv/TrigTrtHitCountsCollectionCnv_p2.h" typedef TrigTrtHitCountsCollection_p2 TrigTrtHitCountsCollection_PERS; @@ -27,7 +30,12 @@ protected: virtual TrigTrtHitCountsCollection_PERS *createPersistent( TrigTrtHitCountsCollection *transObj); virtual TrigTrtHitCountsCollection *createTransient(); - + +private: + TrigTrtHitCountsCollectionCnv_tlp1 m_converter_tlp1; + TrigTrtHitCountsCollectionCnv_p1 m_converter_p1; + TrigTrtHitCountsCollectionCnv_p2 m_converter; + };//end of class definitions diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCollectionCnv.cxx index 8c06b4aed98a2d4845b9b0e9d5365ee03f4da005..5843406c13ca04062ea9e65ae89488ad22e35ebd 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCollectionCnv.cxx @@ -42,10 +42,10 @@ TrigVertexCollection * TrigVertexCollectionCnv::createTransient() mlog << MSG::DEBUG << "TrigVertexCollectionCnv::createTransient called" << endmsg; - static pool::Guid tlp2_guid( "438C9232-0F3E-4A8B-A16E-6F6275388DE4" ); - static pool::Guid tlp1_guid( "10E18C4E-9BCA-4F25-993C-EBDF0642C119" ); - static pool::Guid p0_guid( "0974DF97-5B51-4416-8FBE-42BAE0C54010" ); - static pool::Guid p0_guid2( "E2C600D6-CD4B-4B7B-9C09-93CE9FF435A1" ); + static const pool::Guid tlp2_guid( "438C9232-0F3E-4A8B-A16E-6F6275388DE4" ); + static const pool::Guid tlp1_guid( "10E18C4E-9BCA-4F25-993C-EBDF0642C119" ); + static const pool::Guid p0_guid( "0974DF97-5B51-4416-8FBE-42BAE0C54010" ); + static const pool::Guid p0_guid2( "E2C600D6-CD4B-4B7B-9C09-93CE9FF435A1" ); TrigVertexCollection *p_collection = 0; if( compareClassGuid( tlp2_guid ) ) diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCountsCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCountsCnv.cxx index 8e8f3b3a5edbb567fe3fdac919b1ec4ae4231ea1..c1af33a35de06ba9a46677ce8f800e1999f71d01 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCountsCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCountsCnv.cxx @@ -23,7 +23,7 @@ TrigVertexCounts* TrigVertexCountsCnv::createTransient() { MsgStream mlog(msgSvc(), "TrigVertexCountsConverter" ); mlog << MSG::DEBUG << "TrigVertexCountsCnv::createTransient " << endmsg; - static pool::Guid p1_guid("33E83FBA-83F1-4DC5-87BE-81A09D0FD8F8"); + static const pool::Guid p1_guid("33E83FBA-83F1-4DC5-87BE-81A09D0FD8F8"); TrigVertexCounts *transObj = 0; diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCountsCollectionCnv.cxx b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCountsCollectionCnv.cxx index 7cf3ac8e50e45df74b3cf0cc9d757c8e59b9bd16..b0b7b82e363bd4ea91425600855ebc9e80b53732 100644 --- a/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCountsCollectionCnv.cxx +++ b/Trigger/TrigEvent/TrigEventAthenaPool/src/TrigVertexCountsCollectionCnv.cxx @@ -37,9 +37,9 @@ TrigVertexCountsCollection* TrigVertexCountsCollectionCnv::createTransient() mlog << MSG::DEBUG << "TrigVertexCountsCollectionCnv::createTransient" << endmsg; - static pool::Guid tlp1_guid( "2A1D4A4E-D566-4C71-B051-D5D79A856753" ); - static pool::Guid p1_guid( "232B47D0-65CA-4883-AC51-0D76EAEA3194" ); - static pool::Guid trans_guid( "7A4412AD-C11D-4EFD-AE15-D343D2CB28BC" ); + static const pool::Guid tlp1_guid( "2A1D4A4E-D566-4C71-B051-D5D79A856753" ); + static const pool::Guid p1_guid( "232B47D0-65CA-4883-AC51-0D76EAEA3194" ); + static const pool::Guid trans_guid( "7A4412AD-C11D-4EFD-AE15-D343D2CB28BC" ); TrigVertexCountsCollection *p_container = 0; diff --git a/Trigger/TrigEvent/TrigMissingEtEventTPCnv/CMakeLists.txt b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/CMakeLists.txt index 521addfa9195dd7a83b7b55aa979ea08ac2ad1f9..5a92e4ea55ea07be4d0c9af618c72b7b92f505b8 100644 --- a/Trigger/TrigEvent/TrigMissingEtEventTPCnv/CMakeLists.txt +++ b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( TrigMissingEtEventTPCnv ) @@ -18,9 +18,9 @@ atlas_add_dictionary( TrigMissingEtEventTPCnvDict atlas_add_test( TrigMissingETCnv_p2_test SOURCES test/TrigMissingETCnv_p2_test.cxx - LINK_LIBRARIES GaudiKernel TestTools TrigMissingEtEventTPCnv ) + LINK_LIBRARIES GaudiKernel TestTools TrigMissingEtEventTPCnv CxxUtils ) atlas_add_test( TrigMissingETCnv_p3_test SOURCES test/TrigMissingETCnv_p3_test.cxx - LINK_LIBRARIES GaudiKernel TestTools TrigMissingEtEventTPCnv ) + LINK_LIBRARIES GaudiKernel TestTools TrigMissingEtEventTPCnv CxxUtils ) diff --git a/Trigger/TrigEvent/TrigMissingEtEventTPCnv/TrigMissingEtEventTPCnv/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/TrigMissingEtEventTPCnv/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..28bcc9336261c846db9cc4e64e695c58e5ecfa46 --- /dev/null +++ b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/TrigMissingEtEventTPCnv/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigEvent/TrigMissingEtEventTPCnv diff --git a/Trigger/TrigEvent/TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p2_test.cxx b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p2_test.cxx index a19b1390867812670873a8a77db51178e684255f..67b0191ee4d6d71de56e131a30264d9c5bb0d433 100644 --- a/Trigger/TrigEvent/TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p2_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p2_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #undef NDEBUG #include "TrigMissingEtEventTPCnv/TrigMissingETCnv_p2.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -60,7 +59,7 @@ void testit (const TrigMissingET& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -94,7 +93,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Trigger/TrigEvent/TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p3_test.cxx b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p3_test.cxx index de22dd7d7a55496b7e3d812e2bf0b1159ee6b42f..d912f7072e5be895b57662efe0b7334e738fa54d 100644 --- a/Trigger/TrigEvent/TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p3_test.cxx +++ b/Trigger/TrigEvent/TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p3_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMissingEtEventTPCnv/test/TrigMissingETCnv_p3_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #undef NDEBUG #include "TrigMissingEtEventTPCnv/TrigMissingETCnv_p3.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -60,7 +59,7 @@ void testit (const TrigMissingET& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -94,7 +93,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { test1(); return 0; diff --git a/Trigger/TrigEvent/TrigMonitoringEventTPCnv/TrigMonitoringEventTPCnv/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigEvent/TrigMonitoringEventTPCnv/TrigMonitoringEventTPCnv/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..b12ac7d489638bb34d7637b212a24ffcf0cc1db0 --- /dev/null +++ b/Trigger/TrigEvent/TrigMonitoringEventTPCnv/TrigMonitoringEventTPCnv/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigEvent/TrigMonitoringEventTPCnv diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/CMakeLists.txt b/Trigger/TrigEvent/TrigMuonEventTPCnv/CMakeLists.txt index 593120d405deec97167e677944e17dad8589b174..bb7bd0334ceb7e3da164aed9b2989fcb48be511a 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/CMakeLists.txt +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( TrigMuonEventTPCnv ) @@ -25,7 +25,7 @@ function( _add_test test ) atlas_add_test( ${test} SOURCES test/${test}.cxx - LINK_LIBRARIES GaudiKernel TestTools TrigMuonEventTPCnv ) + LINK_LIBRARIES GaudiKernel TestTools TrigMuonEventTPCnv CxxUtils ) endfunction() _add_test( CombinedMuonFeatureCnv_p2_test ) diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/TrigMuonEventTPCnv/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigEvent/TrigMuonEventTPCnv/TrigMuonEventTPCnv/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..334651b7a293abc6e9acad54c66dff59b00985c5 --- /dev/null +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/TrigMuonEventTPCnv/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Trigger/TrigEvent/TrigMuonEventTPCnv diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/src/TrigMuonEFCbTrackCnv_p7.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/src/TrigMuonEFCbTrackCnv_p7.cxx index 7ec3ff33342707d08a58a08f4e2af47e186c344e..0111ca5fbe7b6b8cd9883ad95ad6b1a3b10d76ef 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/src/TrigMuonEFCbTrackCnv_p7.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/src/TrigMuonEFCbTrackCnv_p7.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrigMuonEvent/TrigMuonEFCbTrack.h" @@ -9,7 +9,7 @@ typedef ElementLinkCnv_p3 > TrackLinkCnv_t; /// pre-allocate the track converter -static TrackLinkCnv_t trackCnv; +static const TrackLinkCnv_t trackCnv; void TrigMuonEFCbTrackCnv_p7::persToTrans(const TrigMuonEFCbTrack_p7* persObj, TrigMuonEFCbTrack* transObj, MsgStream &log){ // std::cout << "TrigMuonEFCbTrackCnv_p7::persToTrans called " < > InfoEleLinkCnv_t; -static InfoEleLinkCnv_t infoEleLinkCnv; +static const InfoEleLinkCnv_t infoEleLinkCnv; /** * Convert persistent representation of object to the transient one diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p2_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p2_test.cxx index 8cedb1b16f9a5bc95053a21332a64d0e91e7ab0a..222db90c44d5de78d47efb70ec27fa8acd5ae59e 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p2_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p2_test.cxx @@ -13,6 +13,7 @@ #include "TrigMuonEventTPCnv/CombinedMuonFeatureCnv_p2.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -48,7 +49,7 @@ void testit (const CombinedMuonFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -65,7 +66,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p3_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p3_test.cxx index a245e2a35030b68773a04f92c246622658137b72..fd04bd4f0364d3257ada9bec2e2aa15d9c6ed975 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p3_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p3_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p3_test.cxx @@ -13,6 +13,7 @@ #include "TrigMuonEventTPCnv/CombinedMuonFeatureCnv_p3.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -48,7 +49,7 @@ void testit (const CombinedMuonFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -65,7 +66,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p4_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p4_test.cxx index 00b22805c2d8a4052a7cacb92a71505665cacf02..fb854675e6e16a43b9fdba5a7045816cea67138a 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p4_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p4_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file TrigMuonEventTPCnv/test/CombinedMuonFeatureCnv_p4_test.cxx @@ -13,6 +13,7 @@ #include "TrigMuonEventTPCnv/CombinedMuonFeatureCnv_p4.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ThreadLocalContext.h" #include @@ -46,7 +47,7 @@ void testit (const CombinedMuonFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; (void)Gaudi::Hive::currentContext(); @@ -63,7 +64,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/IsoMuonFeatureCnv_p3_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/IsoMuonFeatureCnv_p3_test.cxx index 2cc6754f79e31a3df4171bb582a7f35e8628df1c..e279df3eee5ba3a602a71c5691ce5bc9bccd6b94 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/IsoMuonFeatureCnv_p3_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/IsoMuonFeatureCnv_p3_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/IsoMuonFeatureCnv_p3_test.cxx * @author scott snyder @@ -15,6 +13,7 @@ #include "TrigMuonEventTPCnv/IsoMuonFeatureCnv_p3.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -56,7 +55,7 @@ void testit (const IsoMuonFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -70,7 +69,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p1_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p1_test.cxx index 605e3e5028c9413a4845fb8229506115e364b0d5..90468ec15130409c25165b02d8f19be910acb06e 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p1_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/MuonFeatureCnv_p1_test.cxx * @author scott snyder @@ -15,6 +13,7 @@ #include "TrigMuonEventTPCnv/MuonFeatureCnv_p1.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -81,7 +80,7 @@ void testit (const MuonFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -107,7 +106,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p2_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p2_test.cxx index 02eef7ad3ab831a7bdbd976c38687af506bfc631..0d79a439521ff9fdd7b22d78d3a6a00f4c42cbd2 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p2_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p2_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/MuonFeatureCnv_p2_test.cxx * @author scott snyder @@ -15,6 +13,7 @@ #include "TrigMuonEventTPCnv/MuonFeatureCnv_p2.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -66,7 +65,7 @@ void testit (const MuonFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -92,7 +91,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p3_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p3_test.cxx index 6ad064c113eebe93f10d4b9057ab83371d35c65c..d2ba3845c50f5c439cc16d0ab4e65ac09037a73a 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p3_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureCnv_p3_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/MuonFeatureCnv_p3_test.cxx * @author scott snyder @@ -15,6 +13,7 @@ #include "TrigMuonEventTPCnv/MuonFeatureCnv_p3.h" #include "SGTools/TestStore.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -66,7 +65,7 @@ void testit (const MuonFeature& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -92,7 +91,7 @@ void test1() } -int main() +int main ATLAS_NOT_THREAD_SAFE () { SGTest::initTestStore(); test1(); diff --git a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureDetailsCnv_p1_test.cxx b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureDetailsCnv_p1_test.cxx index 0a74bb42d75dce5bd9242b5c7191e90c63b91db3..9f53a93e68f282682a4c08e65ed1ae02f53f30d4 100644 --- a/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureDetailsCnv_p1_test.cxx +++ b/Trigger/TrigEvent/TrigMuonEventTPCnv/test/MuonFeatureDetailsCnv_p1_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file TrigMuonEventTPCnv/test/MuonFeatureDetailsCnv_p1_test.cxx * @author scott snyder @@ -14,6 +12,7 @@ #undef NDEBUG #include "TrigMuonEventTPCnv/MuonFeatureDetailsCnv_p1.h" #include "TestTools/leakcheck.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/MsgStream.h" #include #include @@ -216,7 +215,7 @@ void testit (const MuonFeatureDetails& trans1) } -void test1() +void test1 ATLAS_NOT_THREAD_SAFE () { std::cout << "test1\n"; Athena_test::Leakcheck check; @@ -372,7 +371,7 @@ void tes