diff --git a/Build/AtlasBuildScripts/build_Gaudi.sh b/Build/AtlasBuildScripts/build_Gaudi.sh index 36a2a613b57d996dd239aa1ac93775a9a1a8daab..20b648d15fe4599274294672eab73bc6f2eaf0b4 100755 --- a/Build/AtlasBuildScripts/build_Gaudi.sh +++ b/Build/AtlasBuildScripts/build_Gaudi.sh @@ -26,7 +26,7 @@ EXTPROJECT="" PLATFORM="" RPMDIR="" BUILDTYPE="Release" -EXTRACMAKE="" +EXTRACMAKE=() while getopts ":s:b:i:e:p:f:r:t:x:h" opt; do case $opt in s) @@ -54,7 +54,7 @@ while getopts ":s:b:i:e:p:f:r:t:x:h" opt; do BUILDTYPE=$OPTARG ;; x) - EXTRACMAKE=$OPTARG + EXTRACMAKE+=($OPTARG) ;; h) usage @@ -98,7 +98,7 @@ rm -f CMakeCache.txt rm -rf * # Remove the full build temporarily, to fix GAUDI-1315 cmake -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} -DCTEST_USE_LAUNCHERS:BOOL=TRUE \ -DGAUDI_ATLAS:BOOL=TRUE -DGAUDI_ATLAS_BASE_PROJECT:STRING=${EXTPROJECT} \ - -DCMAKE_INSTALL_PREFIX:PATH=/InstallArea/${PLATFORM} ${EXTRACMAKE} \ + -DCMAKE_INSTALL_PREFIX:PATH=/InstallArea/${PLATFORM} ${EXTRACMAKE[@]} \ ${SOURCEDIR} || touch $error_stamp } 2>&1 | tee cmake_config.log test -f $error_stamp && ((ERROR_COUNT++)) diff --git a/Build/AtlasBuildScripts/build_atlasexternals.sh b/Build/AtlasBuildScripts/build_atlasexternals.sh index fe370f11a699aafa74e03c2f0978babcd76b8d99..aa2c172c9df65523db8ce19aad346a2a24a76bed 100755 --- a/Build/AtlasBuildScripts/build_atlasexternals.sh +++ b/Build/AtlasBuildScripts/build_atlasexternals.sh @@ -14,7 +14,7 @@ set -o pipefail # Function printing the usage information for the script usage() { echo "Usage: build_atlasexternals.sh <-s source dir> <-b build dir> " \ - "<-i install dir> [-p project] [-r RPM dir] [-t build type] [-d (debug output)]" \ + "<-i install dir> [-p project] [-r RPM dir] [-t build type] " \ "[-x extra CMake arguments]" } @@ -26,9 +26,8 @@ PROJECT="AthenaExternals" RPMDIR="" BUILDTYPE="Release" PROJECTVERSION="" -DEBUGCMAKE="" -EXTRACMAKE="" -while getopts ":s:b:i:p:r:t:v:h:x:d" opt; do +EXTRACMAKE=() +while getopts ":s:b:i:p:r:t:v:hx:" opt; do case $opt in s) SOURCEDIR=$OPTARG @@ -49,15 +48,15 @@ while getopts ":s:b:i:p:r:t:v:h:x:d" opt; do BUILDTYPE=$OPTARG ;; x) - EXTRACMAKE=$OPTARG - ;; - d) - DEBUGCMAKE="--trace" - echo "Using the '--trace' option to debug the CMake configuration --> Verbose output!" + EXTRACMAKE+=($OPTARG) ;; v) PROJECTVERSION=$OPTARG ;; + h) + usage + exit 0 + ;; :) echo "Argument -$OPTARG requires a parameter!" usage @@ -96,9 +95,8 @@ fi error_stamp=`mktemp .tmp.error.XXXXX` ; rm -f $error_stamp { rm -f CMakeCache.txt - cmake ${DEBUGCMAKE} -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} -DCTEST_USE_LAUNCHERS:BOOL=TRUE \ - ${EXTRACONF} \ - ${EXTRACMAKE} \ + cmake -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} -DCTEST_USE_LAUNCHERS:BOOL=TRUE \ + ${EXTRACONF} ${EXTRACMAKE[@]} \ ${SOURCEDIR}/Projects/${PROJECT}/ || touch $error_stamp } 2>&1 | tee cmake_config.log test -f $error_stamp && ((ERROR_COUNT++)) diff --git a/Control/AthenaConfiguration/python/UnifyProperties.py b/Control/AthenaConfiguration/python/UnifyProperties.py index 0c48792d5d36a03797854e5b1658b2a49d5e0c1e..e75ac7e02eb53a5792b55dfab3e89e8ec59e6fa0 100644 --- a/Control/AthenaConfiguration/python/UnifyProperties.py +++ b/Control/AthenaConfiguration/python/UnifyProperties.py @@ -42,7 +42,10 @@ _propsToUnify={"GeoModelSvc.DetectorTools":unifySet, "TagInfoMgr.ExtraTagValuePairs":unifySetOfPairs, "AthenaOutputStream.ItemList":unifySet, "AthenaPoolCnvSvc.PoolAttributes":unifySet, - "*.HypoTools": unifySet + "*.HypoTools": unifySet, + "AtDSFMTGenSvc.Seeds": unifySet, + "AtRanluxGenSvc.Seeds": unifySet, + "AtRndmGenSvc.Seeds": unifySet, } def matchPropName(propname): diff --git a/Control/CxxUtils/CxxUtils/ATLAS_CHECK_THREAD_SAFETY b/Control/CxxUtils/CxxUtils/ATLAS_CHECK_THREAD_SAFETY old mode 100644 new mode 100755 diff --git a/Control/RngComps/CMakeLists.txt b/Control/RngComps/CMakeLists.txt index e2a4aa984de6ec246ce3d98269f8ebf9abc87239..8100c2c4fc18bc529d0d915e729c019e979b3e33 100644 --- a/Control/RngComps/CMakeLists.txt +++ b/Control/RngComps/CMakeLists.txt @@ -69,6 +69,9 @@ atlas_add_test( RNGWrapper_test LINK_LIBRARIES ${CLHEP_LIBRARIES} TestTools AthenaKernel StoreGateLib GaudiKernel AtlasCLHEP_RandomGenerators ) +atlas_add_test( RandomServices_test + SCRIPT python/RandomServices_test.py ) + # Install files from the package: atlas_install_python_modules( python/*.py ) atlas_install_joboptions( share/*.py ) diff --git a/Control/RngComps/python/RandomServices.py b/Control/RngComps/python/RandomServices.py new file mode 100755 index 0000000000000000000000000000000000000000..bf45c3391fe5ed24116ca0f3f585414ecec9f48d --- /dev/null +++ b/Control/RngComps/python/RandomServices.py @@ -0,0 +1,51 @@ +"""Define functions to construct random number services + +Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +""" +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from RngComps.RngCompsConf import ( + AtDSFMTGenSvc, + AtRanluxGenSvc, + AtRndmGenSvc, + AthRNGSvc, +) + +# Translate between names in AthRNGSvc and elsewhere +AthEngines = { + "dSFMT" : "AtDSFMTGenSvc", + "Ranlux64" : "AtRanluxGenSvc", + "Ranecu" : "AtRndmGenSvc", +} + +def dSFMT(seed, name="AtDSFMTGenSvc"): + """Return a ComponentAccumulator containing an AtDSFMTGenSvc with seed""" + acc = ComponentAccumulator(name) + service = AtDSFMTGenSvc() + service.Seeds.append(seed) + acc.addService(service) + return acc + +def Ranlux64(seed, name="AtRanluxGenSvc"): + """Return a ComponentAccumulator containing an AtRanluxGenSvc with seed""" + acc = ComponentAccumulator() + service = AtRanluxGenSvc(name) + service.Seeds.append(seed) + acc.addService(service) + return acc + +def Ranecu(seed, name="AtRndmGenSvc"): + """Return a ComponentAccumulator containing an AtRndmGenSvc with seed""" + acc = ComponentAccumulator() + service = AtRndmGenSvc(name) + service.Seeds.append(seed) + acc.addService(service) + return acc + +def RNG(engine="dSFMT", name="AthRNGSvc"): + """Return a ComponentAccumulator containing an AthRNGSvc""" + acc = ComponentAccumulator() + service = AthRNGSvc(name) + service.EngineType = engine + acc.addService(service) + return acc + diff --git a/Control/RngComps/python/RandomServices_test.py b/Control/RngComps/python/RandomServices_test.py new file mode 100755 index 0000000000000000000000000000000000000000..71d8eb0d4206f8589e0a35b8e6a0bad484a4b202 --- /dev/null +++ b/Control/RngComps/python/RandomServices_test.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +"""Run unit tests on RandomServices.py + +Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +""" +from AthenaCommon.Logging import log +from AthenaCommon.Constants import DEBUG +from AthenaCommon.Configurable import Configurable +from RandomServices import dSFMT, Ranlux64, Ranecu, RNG + +# Set up logging and new style config +log.setLevel(DEBUG) +Configurable.configurableRun3Behavior = True +# Make each +t1 = dSFMT("TestSeed1") +t2 = Ranlux64("TestSeed2") +t3 = Ranecu("TestSeed3") +# Make RNG with all three agruments and none +t4 = RNG(name="RNGdSFMT1") +t5 = RNG("dSFMT", name="RNGdSFMT2") +t6 = RNG("Ranlux64", name="RNGRanlux64") +t7 = RNG("Ranecu", name="RNGRanecu") +# Merge +t1.mergeAll((dSFMT("test_seed7"), t2, t3, t4, t5, t6, t7,)) +# Flag as merged to prevent error on destruction +t1._wasMerged = True + diff --git a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/CMakeLists.txt b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/CMakeLists.txt index f42c12d99eb96b540f5b6c553e0e56dde26f0ca3..de2377243ce5a7e48655e9ddcccb51550b534f9b 100644 --- a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/CMakeLists.txt +++ b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/CMakeLists.txt @@ -76,3 +76,9 @@ atlas_add_test( LUCID_SimHitCnv_p1_test INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib AthenaPoolUtilities LUCID_RawEvent LUCID_SimEvent GeneratorObjectsTPCnv TestTools Identifier GaudiKernel LUCID_EventTPCnv ) +atlas_add_test( LUCID_SimHitCnv_p2_test + SOURCES + test/LUCID_SimHitCnv_p2_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib AthenaPoolUtilities LUCID_RawEvent LUCID_SimEvent GeneratorObjectsTPCnv TestTools Identifier GaudiKernel LUCID_EventTPCnv ) + diff --git a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/share/LUCID_SimHitCnv_p2_test.ref b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/share/LUCID_SimHitCnv_p2_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..6a0927bf3bfd71b47909f10725590944a6daf6ef --- /dev/null +++ b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/share/LUCID_SimHitCnv_p2_test.ref @@ -0,0 +1,16 @@ +ApplicationMgr SUCCESS +==================================================================================================================================== + Welcome to ApplicationMgr (GaudiCoreSvc v4r1) + running on lxplus008.cern.ch on Fri Feb 9 16:59:26 2018 +==================================================================================================================================== +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +ClassIDSvc INFO getRegistryEntries: read 1130 CLIDRegistry entries for module ALL +ProxyProviderSvc INFO Initializing ProxyProviderSvc - package version SGComps-00-00-00 +ClassIDSvc INFO getRegistryEntries: read 869 CLIDRegistry entries for module ALL +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/src/LUCID_SimHitCnv_p1.cxx b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/src/LUCID_SimHitCnv_p1.cxx index f0d0eafba6f27abfa5e1be635b0ae192f2789d0b..17b8bf44d7ab65978169a089f2310956dd429539 100644 --- a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/src/LUCID_SimHitCnv_p1.cxx +++ b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/src/LUCID_SimHitCnv_p1.cxx @@ -10,13 +10,13 @@ void LUCID_SimHitCnv_p1::persToTrans(const LUCID_SimHit_p1* persObj, LUCID_SimHit* transObj, MsgStream& log) { log << MSG::DEBUG << "LUCID_SimHitCnv_p1::persToTrans called " << endmsg; - - // redundant with m_track. - //HepMcParticleLinkCnv_p1 HepMcPLCnv; - //HepMcPLCnv.persToTrans(&(persObj->m_partLink),&(transObj->m_partLink), log); + + HepMcParticleLinkCnv_p1 HepMcPLCnv; + HepMcParticleLink link; + HepMcPLCnv.persToTrans(&(persObj->m_partLink),&(link), log); *transObj = LUCID_SimHit (persObj->m_tubeID, persObj->m_pdgCode, - persObj->m_track, + link, persObj->m_genVolume, persObj->m_stepStartPosX, persObj->m_stepStartPosY, diff --git a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/src/LUCID_SimHitCnv_p2.cxx b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/src/LUCID_SimHitCnv_p2.cxx index 0926583fda90626093892677ef4d41774ae3e329..596dfad7b09a36e3b0f18765b9f3a9cba38b2e10 100644 --- a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/src/LUCID_SimHitCnv_p2.cxx +++ b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/src/LUCID_SimHitCnv_p2.cxx @@ -11,12 +11,12 @@ void LUCID_SimHitCnv_p2::persToTrans(const LUCID_SimHit_p2* persObj, LUCID_SimHi log << MSG::DEBUG << "LUCID_SimHitCnv_p2::persToTrans called " << endmsg; - // redundant with m_track. - //HepMcParticleLinkCnv_p2 HepMcPLCnv; - //HepMcPLCnv.persToTrans(&(persObj->m_partLink),&(transObj->m_partLink), log); + HepMcParticleLinkCnv_p2 HepMcPLCnv; + HepMcParticleLink link; + HepMcPLCnv.persToTrans(&(persObj->m_partLink),&(link), log); *transObj = LUCID_SimHit (persObj->m_tubeID, persObj->m_pdgCode, - persObj->m_track, + link, persObj->m_genVolume, persObj->m_stepStartPosX, persObj->m_stepStartPosY, @@ -30,6 +30,26 @@ void LUCID_SimHitCnv_p2::persToTrans(const LUCID_SimHit_p2* persObj, LUCID_SimHi persObj->m_energy); } -void LUCID_SimHitCnv_p2::transToPers(const LUCID_SimHit*, LUCID_SimHit_p2*, MsgStream& /*log*/) { - throw std::runtime_error("LUCID_SimHitCnv_p2::transToPers is not supported in this release!"); +void LUCID_SimHitCnv_p2::transToPers(const LUCID_SimHit* transObj, LUCID_SimHit_p2* persObj, MsgStream& log) { + + log << MSG::DEBUG << "LUCID_SimHitCnv_p2::transToPers called " << endmsg; + + HepMcParticleLinkCnv_p2 HepMcPLCnv; + + persObj->m_tubeID = transObj->GetTubeID(); + persObj->m_track = transObj->GetTrack(); + persObj->m_pdgCode = transObj->GetPdgCode(); + persObj->m_genVolume = transObj->GetGenVolume(); + persObj->m_stepStartPosX = transObj->GetX(); + persObj->m_stepStartPosY = transObj->GetY(); + persObj->m_stepStartPosZ = transObj->GetZ(); + persObj->m_stepEndPosX = transObj->GetEPX(); + persObj->m_stepEndPosY = transObj->GetEPY(); + persObj->m_stepEndPosZ = transObj->GetEPZ(); + persObj->m_preStepTime = transObj->GetPreStepTime(); + persObj->m_postStepTime = transObj->GetPostStepTime(); + persObj->m_wavelength = transObj->GetWavelength(); + persObj->m_energy = transObj->GetEnergy(); + + HepMcPLCnv.transToPers(&(transObj->particleLink()),&(persObj->m_partLink), log); } diff --git a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p1_test.cxx b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p1_test.cxx index 670e5f3bc3cec417815aa34f9939e0df048063e1..d6bd151226487a1f88ec0b3778fdbf55e96c25f9 100644 --- a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p1_test.cxx +++ b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p1_test.cxx @@ -73,12 +73,13 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector) std::cout << "test1\n"; const HepMC::GenParticle *particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(particle->barcode(),0); + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; const HepMC::GenParticle *pGenParticle = genPartVector.at(0); - LUCID_SimHit trans1 (1, pGenParticle->pdg_id(), pGenParticle->barcode(), 4, + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); + LUCID_SimHit trans1 (1, pGenParticle->pdg_id(), trkLink, 4, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5); diff --git a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p2_test.cxx b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p2_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..672e926e74aa5e1e5c7437daf7133f35eb08771e --- /dev/null +++ b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p2_test.cxx @@ -0,0 +1,100 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file LUCID_EventTPCnv/test/LUCID_SimHitCnv_p2_test.cxx + * @date Feb, 2018 + * @brief Tests for LUCID_SimHitCnv_p2. + */ + + +#undef NDEBUG +#include "LUCID_EventTPCnv/LUCID_SimHitCnv_p2.h" +#include "TestTools/leakcheck.h" +#include <cassert> +#include <iostream> + +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenEvent.h" +#include "HepMC/GenParticle.h" + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + + +void compare (const LUCID_SimHit& p1, + const LUCID_SimHit& p2) +{ + assert (p1.GetTubeID() == p2.GetTubeID()); + assert (p1.GetPdgCode() == p2.GetPdgCode()); + assert (p1.GetTrack() == p2.GetTrack()); + compare (p1.particleLink(), p2.particleLink()); + assert (p1.particleLink() == p2.particleLink()); + assert (p1.GetGenVolume() == p2.GetGenVolume()); + assert (p1.GetX() == p2.GetX()); + assert (p1.GetY() == p2.GetY()); + assert (p1.GetZ() == p2.GetZ()); + assert (p1.GetEPX() == p2.GetEPX()); + assert (p1.GetEPY() == p2.GetEPY()); + assert (p1.GetEPZ() == p2.GetEPZ()); + assert (p1.GetPreStepTime() == p2.GetPreStepTime()); + assert (p1.GetPostStepTime() == p2.GetPostStepTime()); + assert (p1.GetWavelength() == p2.GetWavelength()); + assert (p1.GetEnergy() == p2.GetEnergy()); +} + + +void testit (const LUCID_SimHit& trans1) +{ + MsgStream log (0, "test"); + LUCID_SimHitCnv_p2 cnv; + LUCID_SimHit_p2 pers; + cnv.transToPers (&trans1, &pers, log); + LUCID_SimHit trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*>& genPartVector) +{ + std::cout << "test1\n"; + const HepMC::GenParticle *particle = genPartVector.at(0); + // Create HepMcParticleLink outside of leak check. + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); + assert(dummyHMPL.cptr()==particle); + Athena_test::Leakcheck check; + + HepMcParticleLink trkLink(genPartVector.at(0)->barcode(),genPartVector.at(0)->parent_event()->event_number()); + LUCID_SimHit trans1 (1, genPartVector.at(0)->pdg_id(), trkLink, 4, + 5.5, 6.5, 7.5, + 8.5, 9.5, 10.5, + 11.5, 12.5, 13.5, 14.5); + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(genPartVector); + return 0; +} diff --git a/ForwardDetectors/LUCID/LUCID_SimUtils/LUCID_SimEvent/LUCID_SimEvent/LUCID_SimHit.h b/ForwardDetectors/LUCID/LUCID_SimUtils/LUCID_SimEvent/LUCID_SimEvent/LUCID_SimHit.h index f206ad5fc22016a9fb1e41b025220350502bcaa8..681c8e905f68b130f1c929f03f4f52e031ed60ec 100644 --- a/ForwardDetectors/LUCID/LUCID_SimUtils/LUCID_SimEvent/LUCID_SimEvent/LUCID_SimHit.h +++ b/ForwardDetectors/LUCID/LUCID_SimUtils/LUCID_SimEvent/LUCID_SimEvent/LUCID_SimHit.h @@ -13,62 +13,76 @@ #include "AthenaKernel/IAtRndmGenSvc.h" // LUCID_SimHit hold all information needed by the digitization algorithms -// to construct raw data objects. +// to construct raw data objects. class LUCID_SimHit { - + public: LUCID_SimHit(); LUCID_SimHit(const LUCID_SimHit&); - LUCID_SimHit(short tubeID, - int pdgCode, - int track, - int genVolume, - float stepStartPosX, - float stepStartPosY, - float stepStartPosZ, - float stepEndPosX, - float stepEndPosY, - float stepEndPosZ, - float preStepTime, - float postStepTime, - float wavelength, - float energy); - + LUCID_SimHit(short tubeID, + int pdgCode, + int track, + int genVolume, + float stepStartPosX, + float stepStartPosY, + float stepStartPosZ, + float stepEndPosX, + float stepEndPosY, + float stepEndPosZ, + float preStepTime, + float postStepTime, + float wavelength, + float energy); + LUCID_SimHit(short tubeID, + int pdgCode, + HepMcParticleLink partLink, + int genVolume, + float stepStartPosX, + float stepStartPosY, + float stepStartPosZ, + float stepEndPosX, + float stepEndPosY, + float stepEndPosZ, + float preStepTime, + float postStepTime, + float wavelength, + float energy); + std::string print() const; - + int GetTrackID() const; - + const LUCID_SimHit& operator=(const LUCID_SimHit& t); - + int operator == (const LUCID_SimHit&) const; bool operator < (const LUCID_SimHit&) const; - + const HepMcParticleLink& particleLink() const; inline float GetX() const { return m_stepStartPosX; } inline float GetY() const { return m_stepStartPosY; } inline float GetZ() const { return m_stepStartPosZ; } - + inline float GetEPX() const { return m_stepEndPosX; } inline float GetEPY() const { return m_stepEndPosY; } inline float GetEPZ() const { return m_stepEndPosZ; } - - inline short GetTubeID () const { return m_tubeID; } + + inline short GetTubeID () const { return m_tubeID; } inline int GetTrack () const { return m_track; } inline int GetPdgCode () const { return m_pdgCode; } inline int GetGenVolume () const { return m_genVolume; } - inline float GetPreStepTime () const { return m_preStepTime; } - inline float GetPostStepTime() const { return m_postStepTime; } - inline float GetWavelength () const { return m_wavelength; } + inline float GetPreStepTime () const { return m_preStepTime; } + inline float GetPostStepTime() const { return m_postStepTime; } + inline float GetWavelength () const { return m_wavelength; } inline float GetEnergy () const { return m_energy; } bool isDetected(CLHEP::HepRandomEngine* rndEngine) const; - private: + private: - short m_tubeID; + short m_tubeID; int m_pdgCode; int m_track; HepMcParticleLink m_partLink; // link to the particle generating the hit @@ -76,12 +90,12 @@ class LUCID_SimHit { float m_stepStartPosX; float m_stepStartPosY; float m_stepStartPosZ; - float m_stepEndPosX; - float m_stepEndPosY; + float m_stepEndPosX; + float m_stepEndPosY; float m_stepEndPosZ; - float m_preStepTime; - float m_postStepTime; - float m_wavelength; + float m_preStepTime; + float m_postStepTime; + float m_wavelength; float m_energy; }; diff --git a/ForwardDetectors/LUCID/LUCID_SimUtils/LUCID_SimEvent/src/LUCID_SimHit.cxx b/ForwardDetectors/LUCID/LUCID_SimUtils/LUCID_SimEvent/src/LUCID_SimHit.cxx index 0606b9fb9f1aa3b5cffa1902b05f98cc9f8f4255..de689109a6956682c9e47bd37b8f3e98f29fd65f 100644 --- a/ForwardDetectors/LUCID/LUCID_SimUtils/LUCID_SimEvent/src/LUCID_SimHit.cxx +++ b/ForwardDetectors/LUCID/LUCID_SimUtils/LUCID_SimEvent/src/LUCID_SimHit.cxx @@ -8,43 +8,74 @@ LUCID_SimHit::LUCID_SimHit(): m_partLink() { - m_tubeID = 0; + m_tubeID = 0; m_pdgCode = 0; m_track = 0; m_genVolume = 0; m_stepStartPosX = 0; m_stepStartPosY = 0; m_stepStartPosZ = 0; - m_stepEndPosX = 0; - m_stepEndPosY = 0; + m_stepEndPosX = 0; + m_stepEndPosY = 0; m_stepEndPosZ = 0; - m_preStepTime = 0; - m_postStepTime = 0; - m_wavelength = 0; + m_preStepTime = 0; + m_postStepTime = 0; + m_wavelength = 0; m_energy = 0; } LUCID_SimHit::LUCID_SimHit(const LUCID_SimHit& simhit) { *this = simhit; } LUCID_SimHit::LUCID_SimHit(short tubeID, - int pdgCode, - int track, - int genVolume, - float stepStartPosX, - float stepStartPosY, - float stepStartPosZ, - float stepEndPosX, - float stepEndPosY, - float stepEndPosZ, - float preStepTime, - float postStepTime, - float wavelength, - float energy): - + int pdgCode, + int track, + int genVolume, + float stepStartPosX, + float stepStartPosY, + float stepStartPosZ, + float stepEndPosX, + float stepEndPosY, + float stepEndPosZ, + float preStepTime, + float postStepTime, + float wavelength, + float energy): + m_tubeID (tubeID), m_pdgCode (pdgCode), - m_track (track), // Susumu Oda 2011.04.03 - m_partLink (track), + m_track (track), // Susumu Oda 2011.04.03 + m_partLink (track), + m_genVolume (genVolume), + m_stepStartPosX(stepStartPosX), + m_stepStartPosY(stepStartPosY), + m_stepStartPosZ(stepStartPosZ), + m_stepEndPosX (stepEndPosX), + m_stepEndPosY (stepEndPosY), + m_stepEndPosZ (stepEndPosZ), + m_preStepTime (preStepTime), + m_postStepTime (postStepTime), + m_wavelength (wavelength), + m_energy (energy) {} + +LUCID_SimHit::LUCID_SimHit(short tubeID, + int pdgCode, + HepMcParticleLink partLink, + int genVolume, + float stepStartPosX, + float stepStartPosY, + float stepStartPosZ, + float stepEndPosX, + float stepEndPosY, + float stepEndPosZ, + float preStepTime, + float postStepTime, + float wavelength, + float energy): + + m_tubeID (tubeID), + m_pdgCode (pdgCode), + m_track (partLink.barcode()), // Susumu Oda 2011.04.03 + m_partLink (partLink), m_genVolume (genVolume), m_stepStartPosX(stepStartPosX), m_stepStartPosY(stepStartPosY), @@ -58,9 +89,9 @@ LUCID_SimHit::LUCID_SimHit(short tubeID, m_energy (energy) {} std::string LUCID_SimHit::print() const { - + std::stringstream ss; - + ss << "LUCID_SimHit:"; ss << " tubeID: " << m_tubeID; ss << " preStepTime: " << m_preStepTime; @@ -71,12 +102,12 @@ std::string LUCID_SimHit::print() const { << "," << m_stepStartPosY << "," << m_stepStartPosZ << ")"; - + return ss.str(); } const LUCID_SimHit& LUCID_SimHit::operator=(const LUCID_SimHit& simhit) { - + m_tubeID = simhit.m_tubeID; m_pdgCode = simhit.m_pdgCode; m_track = simhit.m_track; @@ -92,7 +123,7 @@ const LUCID_SimHit& LUCID_SimHit::operator=(const LUCID_SimHit& simhit) { m_postStepTime = simhit.m_postStepTime; m_wavelength = simhit.m_wavelength; m_energy = simhit.m_energy; - + return *this; } @@ -101,7 +132,7 @@ bool LUCID_SimHit::isDetected(CLHEP::HepRandomEngine* rndEngine) const { double qef = GetQuantumEfficiencyR762(m_wavelength); double ran = CLHEP::RandFlat::shoot(rndEngine, 0., 1.); bool det = (ran<qef); - + return det; } diff --git a/Generators/GeneratorObjectsTPCnv/CMakeLists.txt b/Generators/GeneratorObjectsTPCnv/CMakeLists.txt index 14532e37407e60c863ce5004acd72ee672ae123b..ba5903714e358e0e4e5e7039802a485b054986bc 100644 --- a/Generators/GeneratorObjectsTPCnv/CMakeLists.txt +++ b/Generators/GeneratorObjectsTPCnv/CMakeLists.txt @@ -58,3 +58,9 @@ atlas_add_test( HepMcParticleLinkCnv_p1_test test/HepMcParticleLinkCnv_p1_test.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjects TestTools StoreGateLib SGtests GeneratorObjectsTPCnv ) + +atlas_add_test( HepMcParticleLinkCnv_p2_test + SOURCES + test/HepMcParticleLinkCnv_p2_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjects TestTools StoreGateLib SGtests GeneratorObjectsTPCnv ) diff --git a/Generators/GeneratorObjectsTPCnv/share/HepMcParticleLinkCnv_p2_test.ref b/Generators/GeneratorObjectsTPCnv/share/HepMcParticleLinkCnv_p2_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..8633d8ace9b4883a00f6e29e68937582b9b5e684 --- /dev/null +++ b/Generators/GeneratorObjectsTPCnv/share/HepMcParticleLinkCnv_p2_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx index 712d03d46405a3e2e4c9f80029607234d4ba7547..d3e139790d1067cf235bc070900f25fb5ef2b1d9 100755 --- a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx +++ b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx @@ -1,64 +1,45 @@ ///////////////////////// -*- C++ -*- ///////////////////////////// /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ -// HepMcParticleLinkCnv_p1.cxx -// Implementation file for class HepMcParticleLinkCnv_p1 -// Author: S.Binet<binet@cern.ch> -/////////////////////////////////////////////////////////////////// - -// STL includes - // Framework includes #include "GaudiKernel/MsgStream.h" // GeneratorObjectsAthenaPool includes #include "GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p1.h" -/////////////////////////////////////////////////////////////////// -/// Public methods: -/////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////// +/// Public methods: +/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/// Const methods: -/////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////// +/// Const methods: +/////////////////////////////////////////////////////////////////// void HepMcParticleLinkCnv_p1::persToTrans( const HepMcParticleLink_p1* persObj, - HepMcParticleLink* transObj, - MsgStream &/*msg*/ ) + HepMcParticleLink* transObj, + MsgStream &/*msg*/ ) { -// msg << MSG::DEBUG << "Loading HepMcParticleLink from persistent state..." -// << endmsg; if (transObj->m_ptrs.m_dict == nullptr) transObj->init_dict(); - transObj->m_extBarcode = + transObj->m_extBarcode = HepMcParticleLink::ExtendedBarCode( persObj->m_barcode, - persObj->m_mcEvtIndex ); - - -// msg << MSG::DEBUG << "Loaded HepMcParticleLink from persistent state [OK]" -// << endmsg; + persObj->m_mcEvtIndex ); return; } -void HepMcParticleLinkCnv_p1::transToPers( const HepMcParticleLink* transObj, - HepMcParticleLink_p1* persObj, - MsgStream &/*msg*/ ) +void HepMcParticleLinkCnv_p1::transToPers( const HepMcParticleLink* transObj, + HepMcParticleLink_p1* persObj, + MsgStream &/*msg*/ ) { -// msg << MSG::DEBUG << "Creating persistent state of HepMcParticleLink..." -// << endmsg; persObj->m_mcEvtIndex = transObj->eventIndex(); persObj->m_barcode = transObj->m_extBarcode.barcode(); - -// msg << MSG::DEBUG << "Created persistent state of HepMcGenParticleLink [OK]" -// << endmsg; return; } -/////////////////////////////////////////////////////////////////// -// Protected methods: -/////////////////////////////////////////////////////////////////// - +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// diff --git a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p2.cxx b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p2.cxx index 9d12d1b28707af5cf4e8acc2e0c9e8f3967f46e3..f515cf3d99718004c72e93612d153772b8205ec4 100755 --- a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p2.cxx +++ b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p2.cxx @@ -1,7 +1,7 @@ ///////////////////////// -*- C++ -*- ///////////////////////////// /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // Framework includes @@ -23,25 +23,22 @@ void HepMcParticleLinkCnv_p2::persToTrans( const HepMcParticleLink_p2* persObj, HepMcParticleLink* transObj, MsgStream &/*msg*/ ) { - // msg << MSG::DEBUG << "Loading HepMcParticleLink from persistent state..." - // << endmsg; if (transObj->m_ptrs.m_dict == nullptr) transObj->init_dict(); transObj->m_extBarcode = HepMcParticleLink::ExtendedBarCode( persObj->m_barcode, persObj->m_mcEvtIndex ); - - - // msg << MSG::DEBUG << "Loaded HepMcParticleLink from persistent state [OK]" - // << endmsg; return; } -void HepMcParticleLinkCnv_p2::transToPers( const HepMcParticleLink*, - HepMcParticleLink_p2*, +void HepMcParticleLinkCnv_p2::transToPers( const HepMcParticleLink* transObj, + HepMcParticleLink_p2* persObj, MsgStream &/*msg*/ ) { - throw std::runtime_error("HepMcParticleLinkCnv_p2::transToPers is not supported in this release!"); + persObj->m_mcEvtIndex = transObj->eventIndex(); + persObj->m_barcode = transObj->m_extBarcode.barcode(); + persObj->m_evtColl = 'a'; // hard-coded until we change the transient class implementation + return; } /////////////////////////////////////////////////////////////////// diff --git a/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p2_test.cxx b/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p2_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..fe8836e3357a46235884f5c8e7e2fece573eb452 --- /dev/null +++ b/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p2_test.cxx @@ -0,0 +1,102 @@ +/** + * @file GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p2_test.cxx + * @brief Tests for HepMcParticleLinkCnv_p2. + */ + + +#undef NDEBUG +#include <cassert> +#include <iostream> +// HepMC includes +#include "HepMC/GenEvent.h" + +// CLHEP includes +#include "CLHEP/Vector/LorentzVector.h" +#include "CLHEP/Units/SystemOfUnits.h" + +#include "GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p2.h" +#include "StoreGate/WriteHandle.h" +#include "GeneratorObjects/McEventCollection.h" + +#include "TestTools/initGaudi.h" + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + +HepMC::GenParticle* populateGenEvent(HepMC::GenEvent & ge) +{ + CLHEP::HepLorentzVector myPos( 0.0, 0.0, 0.0, 0.0); + HepMC::GenVertex *myVertex = new HepMC::GenVertex( myPos, -1 ); + HepMC::FourVector fourMomentum1( 0.0, 0.0, 1.0, 1.0*CLHEP::TeV); + HepMC::GenParticle* inParticle1 = new HepMC::GenParticle(fourMomentum1, 2, 10); + myVertex->add_particle_in(inParticle1); + HepMC::FourVector fourMomentum2( 0.0, 0.0, -1.0, 1.0*CLHEP::TeV); + HepMC::GenParticle* inParticle2 = new HepMC::GenParticle(fourMomentum2, -2, 10); + myVertex->add_particle_in(inParticle2); + HepMC::FourVector fourMomentum3( 0.0, 1.0, 0.0, 1.0*CLHEP::TeV); + HepMC::GenParticle* inParticle3 = new HepMC::GenParticle(fourMomentum3, 2, 10); + myVertex->add_particle_out(inParticle3); + HepMC::FourVector fourMomentum4( 0.0, -1.0, 0.0, 1.0*CLHEP::TeV); + HepMC::GenParticle* inParticle4 = new HepMC::GenParticle(fourMomentum4, -2, 10); + myVertex->add_particle_out(inParticle4); + ge.add_vertex( myVertex ); + ge.set_signal_process_vertex( myVertex ); + ge.set_beam_particles(inParticle1,inParticle2); + return inParticle3; +} + +HepMC::GenParticle* createMcEventCollectionInStoreGate() +{ + // create dummy input McEventCollection with a name that + // HepMcParticleLink knows about + SG::WriteHandle<McEventCollection> inputTestDataHandle{"TruthEvent"}; + inputTestDataHandle = std::make_unique<McEventCollection>(); + // Add a dummy GenEvent + const int process_id1(20); + const int event_number1(17); + inputTestDataHandle->push_back(new HepMC::GenEvent(process_id1, event_number1)); + HepMC::GenEvent& ge1 = *(inputTestDataHandle->at(0)); + return populateGenEvent(ge1); +} + +void testit (const HepMcParticleLink& trans1) +{ + MsgStream log (0, "test"); + HepMcParticleLinkCnv_p2 cnv; + HepMcParticleLink_p2 pers; + cnv.transToPers (&trans1, &pers, log); + HepMcParticleLink trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + +void test1() +{ + std::cout << "test1\n"; + const HepMC::GenParticle * particle = createMcEventCollectionInStoreGate(); + + HepMcParticleLink trans1(particle->barcode(),particle->parent_event()->event_number()); + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + if (!Athena_test::initGaudi(pSvcLoc)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(); + return 0; +} diff --git a/InnerDetector/InDetConditions/PixelConditionsServices/src/PixelByteStreamErrorsSvc.cxx b/InnerDetector/InDetConditions/PixelConditionsServices/src/PixelByteStreamErrorsSvc.cxx index 5b32be3258b083c3f52bce86e29b6f6a08d4cb65..ece504a6762a1cb2e99dfb66a5dffe48fe959dbd 100644 --- a/InnerDetector/InDetConditions/PixelConditionsServices/src/PixelByteStreamErrorsSvc.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsServices/src/PixelByteStreamErrorsSvc.cxx @@ -345,13 +345,6 @@ StatusCode PixelByteStreamErrorsSvc::recordData() { } StatusCode sc = StatusCode::SUCCESS; - if (cont->size()==m_max_hashes) { - m_BSErrContWrite = SG::makeHandle(m_BSErrContWriteKey); - sc = m_BSErrContWrite.record(std::move(cont)); - } - - -/* if (cont->size()==m_pixel_id->wafer_hash_max()) { m_checkError = -1; } @@ -360,7 +353,6 @@ StatusCode PixelByteStreamErrorsSvc::recordData() { m_BSErrContWrite = SG::makeHandle(m_BSErrContWriteKey); sc = m_BSErrContWrite.record(std::move(cont)); } -*/ if (sc.isFailure() ){ ATH_MSG_ERROR("Failed to record/overwrite BSErrors to SG"); diff --git a/InnerDetector/InDetDigitization/BCM_Digitization/CMakeLists.txt b/InnerDetector/InDetDigitization/BCM_Digitization/CMakeLists.txt index f0e4771a50632cd227c91db61ef48f65a16e5376..62b62dc31802814c55d6cc143b95c93bbd6cbf73 100644 --- a/InnerDetector/InDetDigitization/BCM_Digitization/CMakeLists.txt +++ b/InnerDetector/InDetDigitization/BCM_Digitization/CMakeLists.txt @@ -28,6 +28,10 @@ atlas_add_component( BCM_Digitization INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} LINK_LIBRARIES ${CLHEP_LIBRARIES} GaudiKernel AthenaBaseComps AthenaKernel PileUpToolsLib xAODEventInfo GeneratorObjects InDetBCM_RawData InDetSimData InDetSimEvent ) +atlas_add_test( BCM_DigitizationConfigNew_test + SCRIPT python/BCM_DigitizationConfigNew_test.py + PROPERTIES TIMEOUT 300 ) + # Install files from the package: atlas_install_python_modules( python/*.py ) atlas_install_joboptions( share/*.py ) diff --git a/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigFlags.py b/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigFlags.py new file mode 100755 index 0000000000000000000000000000000000000000..baf5c4b5ef20fedcc036296c111ffb1f143c31bd --- /dev/null +++ b/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigFlags.py @@ -0,0 +1,21 @@ +"""Construct ConfigFlags Beam Conditions Monitor Digitization + +Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +""" +from AthenaConfiguration.AthConfigFlags import AthConfigFlags + +def createBCMCfgFlags(): + """Return an AthConfigFlags object with required flags""" + flags = AthConfigFlags() + # Run Inner Detector noise simulation? + flags.addFlag("Digitization.DoInnerDetectorNoise", True) + # Should pile-up digitization be done one bunch crossing at a time? + # Else all bunch crossings are provided at once. + flags.addFlag("Digitization.DoXingByXingPileUp", False) + # Name of MC EvtStore to overlay + flags.addFlag("Overlay.EventStore", "BkgEvent_0_SG") + # Name of the random number service to use + # of ("dSFMT", "Ranlux64", "Ranecu",) + flags.addFlag("Random.Engine", "dSFMT") + return flags + diff --git a/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py b/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py new file mode 100755 index 0000000000000000000000000000000000000000..41f343c39fa17e5b7d1af9a2b94cfc0c95dc21e0 --- /dev/null +++ b/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py @@ -0,0 +1,78 @@ +"""Define methods to construct configured BCM Digitization tools and algs + +Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +""" +from AthenaCommon import CfgMgr +from RngComps.RandomServices import RNG, AthEngines +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from Digitization.DigitizationFlags import digitizationFlags +from OverlayCommonAlgs.OverlayFlags import overlayFlags + +# The earliest and last bunch crossing times for which interactions will be sent +# to the BCM Digitization code. +def BCM_FirstXing(): + return -25 + +def BCM_LastXing(): + return 0 + +def BCM_DigitizationToolCfg(configFlags, name="BCM_DigitizationTool", **kwargs): + """Return tuple (ComponentAccumulator, tool) configured for BCM Digitization""" + acc = ComponentAccumulator() + # Configure the random engine + Engine = configFlags.Random.Engine + acc.merge(RNG(Engine)) + # Build the argument dict + kwargs.setdefault("RndmSvc", AthEngines[Engine]) + kwargs.setdefault("HitCollName", "BCMHits") + if configFlags.Digitization.DoInnerDetectorNoise: + kwargs.setdefault("ModNoise", [90.82] * 8) + else: + kwargs.setdefault("ModNoise", [0.0] * 8) + kwargs.setdefault("ModSignal", [450.0] * 8) + kwargs.setdefault("NinoThr", [330.0] * 8) + # BCM with diamond + kwargs.setdefault("MIPDeposit", 0.33) + # Alternative BCM with graphite + # kwargs.setdefault("MIPDeposit", 0.25) + kwargs.setdefault("EffDistanceParam", 4.0) + kwargs.setdefault("EffSharpnessParam", 0.11) + kwargs.setdefault("TimeDelay", 9.0) + if configFlags.Digitization.DoXingByXingPileUp: + kwargs.setdefault("FirstXing", BCM_FirstXing()) + kwargs.setdefault("LastXing", BCM_LastXing()) + # Make the tool + tool = CfgMgr.BCM_DigitizationTool(name, **kwargs) + return (acc, tool) + +def BCM_DigitizationCfg(configFlags, name="BCM_OverlayDigitization", **kwargs): + """Return a ComponentAccumulator with BCM Digitization algorithm""" + acc, tool = BCM_DigitizationToolCfg(configFlags, **kwargs) + kwargs.setdefault("DigitizationTool", tool) + alg = CfgMgr.BCM_Digitization(name, **kwargs) + acc.addEventAlgo(alg) + return acc + +def BCM_OverlayDigitizationToolCfg(configFlags, name="BCM_OverlayDigitizationTool", **kwargs): + """Return tuple (ComponentAccumulator, tool) configured for BCM Overlay Digitization""" + kwargs.setdefault("EvtStore", configFlags.Overlay.EventStore) + return BCM_DigitizationToolCfg(configFlags, name, **kwargs) + +def BCM_OverlayDigitization(configFlags, name="BCM_OverlayDigitization", **kwargs): + """Return a ComponentAccumulator with BCM Overlay Digitization algorithm""" + acc, tool = BCM_OverlayDigitizationToolCfg(configFlags, **kwargs) + kwargs.setdefault("DigitizationTool", tool) + alg = CfgMgr.BCM_Digitization(name, **kwargs) + acc.addEventAlgo(alg) + return acc + +def getBCM_Range(name="BCM_Range" , **kwargs): + """Return a configured PileUpXingFolder tool""" + # This is the time of the xing in ns + kwargs.setdefault("FirstXing", BCM_FirstXing()) + kwargs.setdefault("LastXing", BCM_LastXing()) + # Default 0 no dataproxy reset + kwargs.setdefault("CacheRefreshFrequency", 1.0) + kwargs.setdefault("ItemList", ["SiHitCollection#BCMHits"]) + return CfgMgr.PileUpXingFolder(name, **kwargs) + diff --git a/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew_test.py b/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew_test.py new file mode 100755 index 0000000000000000000000000000000000000000..7dcdeb67033fc0a0f8c920a25dd6b4264b11dd3b --- /dev/null +++ b/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew_test.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python +"""Run tests on BCM_DigitizationConfigNew.py + +Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +""" +import os +from AthenaCommon.Logging import log +from AthenaCommon.Constants import DEBUG +from AthenaCommon.Configurable import Configurable +from AthenaConfiguration.AllConfigFlags import ConfigFlags +from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg +from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg +from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg +from BCM_DigitizationConfigFlags import createBCMCfgFlags +from BCM_DigitizationConfigNew import BCM_DigitizationCfg +# Set up logging and new style config +log.setLevel(DEBUG) +Configurable.configurableRun3Behavior = True +# Provide input +dataDir = "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art" +inputDir = os.environ.get("ATLAS_REFERENCE_DATA", dataDir) +fileDir = "/SimCoreTests/e_E50_eta34_49.EVNT.pool.root" +ConfigFlags.Input.Files = [inputDir + fileDir] +# Specify output +ConfigFlags.Output.HITFileName = "myHITS.pool.root" +ConfigFlags.lock() +# Construct ComponentAccumulator +cfg = MainServicesSerialCfg() #This syntax for storegate +cfg.merge(PoolReadCfg(ConfigFlags)) +# Use BCM tools +BCMflags = createBCMCfgFlags() +acc = BCM_DigitizationCfg(BCMflags) +cfg.merge(acc) +# Add configuration to write HITS pool file +outConfig = OutputStreamCfg(ConfigFlags, "HITS") +cfg.merge(outConfig) +cfg.getService("StoreGateSvc").Dump=True +cfg.printConfig(withDetails=True) +ConfigFlags.dump() +# Execute and finish +cfg.run(maxEvents=3) + diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_FrontEnd.cxx b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_FrontEnd.cxx index 7d3577d11e06a899714e7879661404dbb9264a1c..6873cdf64c10a3b483c9a17a52e2ac9f18155f1a 100644 --- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_FrontEnd.cxx +++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_FrontEnd.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_FrontEnd.h" @@ -999,19 +999,36 @@ StatusCode SCT_FrontEnd::doClustering(SiChargedDiodeCollection& collection) cons ++strip; // !< This is the starting point of the next cluster within this collection } while (strip < m_strip_max); } else { - do { // Expanded read out mode, one RDO/strip per cluster + // Expanded read out mode, basically one RDO/strip per cluster + // But if consecutively fired strips have the same time bin, those are converted into one cluster. + do { + clusterSize = 1; if (m_StripHitsOnWafer[strip] > 0) { - clusterSize = 1; hitStrip = m_sct_id->strip_id(collection.identify(), strip); - SiChargedDiode& HitDiode = *(collection.find(hitStrip)); - SiHelper::SetStripNum(HitDiode, clusterSize); + SiChargedDiode& hitDiode = *(collection.find(hitStrip)); + int timeBin = SiHelper::GetTimeBin(hitDiode); + SiChargedDiode* previousHitDiode = &hitDiode; + // Check if consecutively fired strips have the same time bin + for (int newStrip=strip+1; newStrip<m_strip_max; newStrip++) { + if (not (m_StripHitsOnWafer[newStrip]>0)) break; + Identifier newHitStrip = m_sct_id->strip_id(collection.identify(), newStrip); + SiChargedDiode& newHitDiode = *(collection.find(newHitStrip)); + if (timeBin!=SiHelper::GetTimeBin(newHitDiode)) break; + SiHelper::ClusterUsed(newHitDiode, true); + previousHitDiode->setNextInCluster(&newHitDiode); + previousHitDiode = &newHitDiode; + clusterSize++; + } + SiHelper::SetStripNum(hitDiode, clusterSize); #ifdef SCT_DIG_DEBUG - ATH_MSG_DEBUG("RDO Strip = " << strip << ", tbin = " << SiHelper::GetTimeBin(HitDiode) << - ", HitInfo(1=real, 2=crosstalk, 3=noise): " << m_StripHitsOnWafer[strip]); + ATH_MSG_DEBUG("RDO Strip = " << strip << ", tbin = " << + SiHelper::GetTimeBin(hitDiode) << + ", HitInfo(1=real, 2=crosstalk, 3=noise): " << + m_StripHitsOnWafer[strip]); #endif } - ++strip; // !< This is the starting point of the next cluster within this collection + strip += clusterSize; // If more than one strip fires, those following strips are skipped. } while (strip < m_strip_max); } diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.h index 1d4249e409c3bbedcd5a312710159dba4b5b9c1a..abf7ea017fef90ef6eebcb581d7870878e986f8f 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef INDETEVENTATHENAPOOLDICT_H @@ -14,20 +14,22 @@ #include "InDetEventAthenaPool/SCT3_RawData_p1.h" #include "InDetEventAthenaPool/SCT3_RawData_p2.h" #include "InDetEventAthenaPool/SCT3_RawData_p3.h" +#include "InDetEventAthenaPool/SCT3_RawData_p4.h" #include "InDetEventAthenaPool/InDetRawDataCollection_p1.h" #include "InDetEventAthenaPool/InDetRawDataContainer_p1.h" #include "InDetEventAthenaPool/InDetRawDataContainer_p2.h" #include "InDetEventAthenaPool/SCT_RawDataContainer_p1.h" #include "InDetEventAthenaPool/SCT_RawDataContainer_p2.h" #include "InDetEventAthenaPool/SCT_RawDataContainer_p3.h" +#include "InDetEventAthenaPool/SCT_RawDataContainer_p4.h" #include "InDetEventAthenaPool/SCT_FlaggedCondData_p1.h" namespace InDetEventAthenaPoolCnvDict { - std::pair<unsigned int, InDetSimData_p1> t1; - std::pair<unsigned long long, InDetSimData_p1> t2; - std::vector<std::pair<unsigned int, InDetSimData_p1> > t3; - std::vector<std::pair<unsigned long long, InDetSimData_p1> > t4; + std::pair<unsigned int, InDetSimData_p2> t1; + std::pair<unsigned long long, InDetSimData_p2> t2; + std::vector<std::pair<unsigned int, InDetSimData_p2> > t3; + std::vector<std::pair<unsigned long long, InDetSimData_p2> > t4; } #endif diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/SCT3_RawData_p4.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/SCT3_RawData_p4.h new file mode 100644 index 0000000000000000000000000000000000000000..775c807d187bd8b44d7407dd7d868665cdec5b72 --- /dev/null +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/SCT3_RawData_p4.h @@ -0,0 +1,38 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +/** S.Oda, Oct 2018 + * replace unsigned int by unsigned short for + for the premixing samples for Overlay MC. */ + +#ifndef SCT3_RAWDATA_P4_H +#define SCT3_RAWDATA_P4_H + +#include "Identifier/Identifier.h" + +class SCT3_RawData_p4 { + public: + SCT3_RawData_p4() {}; +// List of Cnv classes that convert this into Rdo objects + friend class SCT3_RawDataCnv_p4; + //private: + unsigned short m_rowStrip; // row and strip numbers from Identifier. Bits 0-12 for strip, Bits 13-15 for row + unsigned short m_word; // raw data word. Bits 0-10 for group size, Bits 11-13 for time bin + + void setRowStrip(const int row, const int strip) { + m_rowStrip = (static_cast<unsigned int>(strip) & 0x1FFF); + m_rowStrip |= ((static_cast<unsigned int>(row) & 0x7) << 13); + } + + int getRow() const { + return ((m_rowStrip >> 13) & 0x7); + } + + int getStrip() const { + return (m_rowStrip & 0x1FFF); + } + +}; + +#endif // SCT3_RAWDATA_P4_H diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/SCT_RawDataContainer_p4.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/SCT_RawDataContainer_p4.h new file mode 100644 index 0000000000000000000000000000000000000000..30983c109f95057aeaae4f4e3914913fd293be46 --- /dev/null +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/SCT_RawDataContainer_p4.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_RAWDATACONTAINER_P4_H +#define SCT_RAWDATACONTAINER_P4_H + +/** + +* Persistent represenation of an SCT_RawDataContainer. +* New version to deal with SCT_RawData_p4 +* Susumu Oda Oct 2018. + +*/ + +#include <vector> +#include <string> +#include "InDetEventAthenaPool/SCT3_RawData_p4.h" +#include "InDetEventAthenaPool/InDetRawData_p2.h" +#include "InDetEventAthenaPool/InDetRawDataCollection_p1.h" + + +class SCT_RawDataContainer_p4 +{ + public: +/// Default constructor + SCT_RawDataContainer_p4(); + friend class SCT_RawDataContainerCnv_p4; + private: + std::vector<InDetRawDataCollection_p1> m_collections; + std::vector<InDetRawData_p2> m_rawdata; + std::vector<SCT3_RawData_p4> m_sct3data; + /** because ROOT isn't good at storing vectors of vectors, + * store the individual strip errors in the persistent container + * rather than in the persistent SCT3_RawData_p4 itself.. + */ +}; + + +/** inlines */ + +inline +SCT_RawDataContainer_p4::SCT_RawDataContainer_p4() {} + +#endif // SCT_RAWDATACONTAINER_P4_H diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/selection.xml b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/selection.xml index 895861f556fccc3422f9542fcfcf87a4dbd28dd8..050ae83c487b28ae29017e39fb8e1388d904b148 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/selection.xml +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/selection.xml @@ -19,17 +19,20 @@ <class name="SCT3_RawData_p1" /> <class name="SCT3_RawData_p2" /> <class name="SCT3_RawData_p3" /> + <class name="SCT3_RawData_p4" /> <class name="InDetRawDataCollection_p1" /> <class name="std::vector<InDetRawData_p1>" /> <class name="std::vector<InDetRawData_p2>" /> <class name="std::vector<SCT3_RawData_p1>" /> <class name="std::vector<SCT3_RawData_p2>" /> <class name="std::vector<SCT3_RawData_p3>" /> + <class name="std::vector<SCT3_RawData_p4>" /> <class name="InDetRawDataContainer_p1" id="DA76970C-E019-43D2-B2F9-25660DCECD9D" /> <class name="InDetRawDataContainer_p2" id="7138342E-0A80-4A32-A387-2842A01C2539" /> <class name="SCT_RawDataContainer_p1" id="8E13963E-13E5-4D10-AA8B-73F00AFF8FA8" /> <class name="SCT_RawDataContainer_p2" id="D1258125-2CBA-476E-8578-E09D54F477E1" /> <class name="SCT_RawDataContainer_p3" id="5FBC8D4D-7B4D-433A-8487-0EA0C870CBDB" /> + <class name="SCT_RawDataContainer_p4" id="6C7540BE-E85C-4777-BC1C-A9FF11460F54" /> <class name="std::vector<InDetRawDataCollection_p1>" /> <class name="SCT_FlaggedCondData_p1" id="0C10E502-F02B-440B-9E8F-6A8C31915D7C" /> </lcgdict> diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCnv_p1.cxx index df32aa4e292408d5ba8c9c6fb03b28b5132905ce..56c9df08ce5c73854332a276151782c261582325 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCnv_p1.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCnv_p1.cxx @@ -23,10 +23,11 @@ void InDetSimDataCnv_p1::persToTrans(const InDetSimData_p1* persObj, InDetSimData* transObj, MsgStream &log) { MSG_VERBOSE(log,"InDetSimDataCnv_p1::persToTrans called "); - HepMcParticleLink mcLink (m_sg); + HepMcParticleLinkCnv_p1 HepMcPLCnv; std::vector<InDetSimData::Deposit> deposits; deposits.reserve( persObj->m_enDeposits.size() ); for (unsigned int icount=0; icount < persObj->m_enDeposits.size(); icount++) { + HepMcParticleLink mcLink(m_sg); //FIXME This is left as a note to make the new implementation thread-safe HepMcPLCnv.persToTrans(&(persObj->m_links[icount]),&mcLink, log); deposits.emplace_back (mcLink, persObj->m_enDeposits[icount]); } @@ -36,7 +37,7 @@ InDetSimDataCnv_p1::persToTrans(const InDetSimData_p1* persObj, InDetSimData* tr } void -InDetSimDataCnv_p1::transToPers(const InDetSimData* transObj, InDetSimData_p1* persObj, MsgStream &log) +InDetSimDataCnv_p1::transToPers(const InDetSimData* transObj, InDetSimData_p1* persObj, MsgStream &log) { MSG_VERBOSE(log,"InDetSimDataCnv_p1::transToPers called "); diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCnv_p2.cxx index 4d0d44214a4bc4c9746be9cc062aa66f9f7bb59d..3cbfe0c090e4e47a0122f5bcae98009677f78e5f 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCnv_p2.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCnv_p2.cxx @@ -36,9 +36,21 @@ InDetSimDataCnv_p2::persToTrans(const InDetSimData_p2* persObj, InDetSimData* tr } void -InDetSimDataCnv_p2::transToPers(const InDetSimData*, InDetSimData_p2*, MsgStream &/*log*/) +InDetSimDataCnv_p2::transToPers(const InDetSimData* transObj, InDetSimData_p2* persObj, MsgStream &log) { - throw std::runtime_error("InDetSimDataCnv_p2::transToPers is not supported in this release!");} + MSG_VERBOSE(log,"InDetSimDataCnv_p2::transToPers called "); + HepMcParticleLinkCnv_p2 HepMcPLCnv; + + persObj->m_word = transObj->word(); + const std::vector<InDetSimData::Deposit> &dep(transObj->getdeposits()); + persObj->m_links.resize(dep.size() ); + persObj->m_enDeposits.resize(dep.size() ); + depositIterator it=dep.begin(); + for (int icount=0; it != dep.end(); it++, icount++) { + HepMcPLCnv.transToPers(&(dep[icount].first), &(persObj->m_links[icount]), log); + persObj->m_enDeposits[icount] = dep[icount].second; + } +} void InDetSimDataCnv_p2::setCurrentStore (IProxyDict* store) { diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv.h index 653b709f79667dd3731c1b7b5f93c112553a1365..478a44d21f8a1c38da0ae12b1a88843681e62163 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv.h @@ -15,8 +15,8 @@ // Gaudi #include "GaudiKernel/MsgStream.h" // typedef to the latest persistent version -typedef InDetSimDataCollection_p2 InDetSimDataCollection_PERS; -typedef InDetSimDataCollectionCnv_p2 InDetSimDataCollectionCnv_PERS; +typedef InDetSimDataCollection_p3 InDetSimDataCollection_PERS; +typedef InDetSimDataCollectionCnv_p3 InDetSimDataCollectionCnv_PERS; // base class typedef T_AthenaPoolCustomCnv<InDetSimDataCollection, InDetSimDataCollection_PERS > InDetSimDataCollectionCnvBase; diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv_p3.cxx index 18268fe191b7028c3609f681e37672814c9e6500..111926bfeaa0eb9e5c1b9c0fe5285dd2f471ca0c 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv_p3.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv_p3.cxx @@ -11,9 +11,26 @@ #include "SGTools/CurrentEventStore.h" #include "MsgUtil.h" -void InDetSimDataCollectionCnv_p3::transToPers(const InDetSimDataCollection*, InDetSimDataCollection_p3*, MsgStream &/*log*/) +void InDetSimDataCollectionCnv_p3::transToPers(const InDetSimDataCollection* transCont, InDetSimDataCollection_p3* persCont, MsgStream &log) { - throw std::runtime_error("InDetSimDataCollectionCnv_p3::transToPers is not supported in this release!"); + + + typedef InDetSimDataCollection TRANS; + + InDetSimDataCnv_p2 simDataCnv; + + TRANS::const_iterator it_Coll = transCont->begin(); + TRANS::const_iterator it_CollEnd = transCont->end(); + persCont->m_simdata.resize(transCont->size()); + MSG_DEBUG(log," Preparing " << persCont->m_simdata.size() << "Collections"); + for (int collIndex=0 ; it_Coll != it_CollEnd; it_Coll++, collIndex++) { + // Add in new collection + (persCont->m_simdata[collIndex]).first = (*it_Coll).first.get_compact(); + const InDetSimData& simData = (*it_Coll).second; + InDetSimData_p2& psimData = persCont->m_simdata[collIndex].second; + simDataCnv.transToPers(&simData,&psimData,log); + } + MSG_DEBUG(log," *** Writing InDetSimdataCollection"); } void InDetSimDataCollectionCnv_p3::persToTrans(const InDetSimDataCollection_p3* persCont, InDetSimDataCollection* transCont, MsgStream &log) diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataCnv_p1.cxx index ee03f505cef6a6f824eec1ced7408ed2243ebb6a..c659d31a5a3980aefb62daaaffd08da373f471bd 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataCnv_p1.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataCnv_p1.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "InDetRawData/SCT1_RawData.h" @@ -15,17 +15,17 @@ void -SCT1_RawDataCnv_p1::persToTrans(const InDetRawData_p1* persObj, SCT1_RawData* transObj, MsgStream &log) +SCT1_RawDataCnv_p1::persToTrans(const InDetRawData_p1* persObj, SCT1_RawData* transObj, MsgStream& log) { - MSG_VERBOSE(log,"SCT1_RawDataCnv_p1::persToTrans called "); - *transObj = SCT1_RawData (Identifier(persObj->m_rdoId), - persObj->m_word); + MSG_VERBOSE(log,"SCT1_RawDataCnv_p1::persToTrans called "); + *transObj = SCT1_RawData(Identifier(persObj->m_rdoId), + persObj->m_word); } void -SCT1_RawDataCnv_p1::transToPers(const SCT1_RawData* transObj, InDetRawData_p1* persObj, MsgStream &log) +SCT1_RawDataCnv_p1::transToPers(const SCT1_RawData* transObj, InDetRawData_p1* persObj, MsgStream& log) { - MSG_VERBOSE(log,"SCT1_RawDataCnv_p1::transToPers called "); - persObj->m_rdoId = transObj->identify().get_compact(); - persObj->m_word = transObj->getWord(); + MSG_VERBOSE(log,"SCT1_RawDataCnv_p1::transToPers called "); + persObj->m_rdoId = transObj->identify().get_compact(); + persObj->m_word = transObj->getWord(); } diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataCnv_p1.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataCnv_p1.h index 21c24d32c1ff7bf4ab3263c5c5d9e874ce3bcf6b..6cb3a1dde87399743b2113b5a9bb194dc7945dfe 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataCnv_p1.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataCnv_p1.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT1_RAWDATACNV_P1_H @@ -23,8 +23,8 @@ class SCT1_RawDataCnv_p1 : public T_AthenaPoolTPCnvBase<SCT1_RawData, InDetRawD public: SCT1_RawDataCnv_p1() {} - virtual void persToTrans(const InDetRawData_p1* persObj, SCT1_RawData* transObj, MsgStream &log); - virtual void transToPers(const SCT1_RawData* transObj, InDetRawData_p1* persObj, MsgStream &log); + virtual void persToTrans(const InDetRawData_p1* persObj, SCT1_RawData* transObj, MsgStream& log); + virtual void transToPers(const SCT1_RawData* transObj, InDetRawData_p1* persObj, MsgStream& log); }; diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataCnv_p2.cxx index e2d15cb78e948d94f1d2a2d3a04c38e87e23f2a8..370b224d367f8dd30a6f116c4f5b39e7073a896f 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataCnv_p2.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataCnv_p2.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "InDetRawData/SCT1_RawData.h" @@ -15,17 +15,17 @@ void -SCT1_RawDataCnv_p2::persToTrans(const InDetRawData_p2* persObj, SCT1_RawData* transObj, MsgStream &log) +SCT1_RawDataCnv_p2::persToTrans(const InDetRawData_p2* persObj, SCT1_RawData* transObj, MsgStream& log) { - MSG_VERBOSE(log,"SCT1_RawDataCnv_p2::persToTrans called "); - *transObj = SCT1_RawData (Identifier(persObj->m_rdoId), - persObj->m_word); + MSG_VERBOSE(log,"SCT1_RawDataCnv_p2::persToTrans called "); + *transObj = SCT1_RawData(Identifier(persObj->m_rdoId), + persObj->m_word); } void -SCT1_RawDataCnv_p2::transToPers(const SCT1_RawData* transObj, InDetRawData_p2* persObj, MsgStream &log) +SCT1_RawDataCnv_p2::transToPers(const SCT1_RawData* transObj, InDetRawData_p2* persObj, MsgStream& log) { - MSG_VERBOSE(log,"SCT1_RawDataCnv_p2::transToPers called "); - persObj->m_rdoId = transObj->identify().get_compact(); - persObj->m_word = transObj->getWord(); + MSG_VERBOSE(log,"SCT1_RawDataCnv_p2::transToPers called "); + persObj->m_rdoId = transObj->identify().get_compact(); + persObj->m_word = transObj->getWord(); } diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataCnv_p2.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataCnv_p2.h index 782b2c1b25186edeca580006e52d469c0f1d24ce..bde2c7bef2992b4f011e68f9c12d53f47c24df99 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataCnv_p2.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataCnv_p2.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT1_RAWDATACNV_P2_H @@ -10,11 +10,11 @@ Transient/Persistent converter for SCT1_RawData class Author: Davide Costanzo */ +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + #include "InDetRawData/SCT1_RawData.h" #include "InDetEventAthenaPool/InDetRawData_p2.h" -#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" - class MsgStream; @@ -23,8 +23,8 @@ class SCT1_RawDataCnv_p2 : public T_AthenaPoolTPCnvBase<SCT1_RawData, InDetRawD public: SCT1_RawDataCnv_p2() {} - virtual void persToTrans(const InDetRawData_p2* persObj, SCT1_RawData* transObj, MsgStream &log); - virtual void transToPers(const SCT1_RawData* transObj, InDetRawData_p2* persObj, MsgStream &log); + virtual void persToTrans(const InDetRawData_p2* persObj, SCT1_RawData* transObj, MsgStream& log); + virtual void transToPers(const SCT1_RawData* transObj, InDetRawData_p2* persObj, MsgStream& log); }; diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataContainerCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataContainerCnv_p1.cxx index 58d267f96449cd6d0b60e733561d6f9c8d031ac6..7f6392acb3db58d392091349a4775475a9d53bde 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataContainerCnv_p1.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataContainerCnv_p1.cxx @@ -1,19 +1,21 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ -#include "InDetRawData/SCT1_RawData.h" +#include "SCT1_RawDataContainerCnv_p1.h" + +#include "CreateTransientTemplate.h" +#include "MsgUtil.h" +#include "SCT1_RawDataCnv_p1.h" + #include "InDetEventAthenaPool/InDetRawData_p1.h" #include "InDetEventAthenaPool/InDetRawDataCollection_p1.h" -#include "InDetRawData/SCT_RDO_Container.h" #include "InDetIdentifier/SCT_ID.h" +#include "InDetRawData/SCT1_RawData.h" #include "InDetRawData/SCT_RDO_Collection.h" -#include "SCT1_RawDataCnv_p1.h" -#include "SCT1_RawDataContainerCnv_p1.h" -#include "MsgUtil.h" -#include "CreateTransientTemplate.h" +#include "InDetRawData/SCT_RDO_Container.h" -void SCT1_RawDataContainerCnv_p1::transToPers(const SCT_RDO_Container* transCont, InDetRawDataContainer_p1* persCont, MsgStream &log) +void SCT1_RawDataContainerCnv_p1::transToPers(const SCT_RDO_Container* transCont, InDetRawDataContainer_p1* persCont, MsgStream& log) { // The transient model has a container holding collections and the @@ -49,7 +51,7 @@ void SCT1_RawDataContainerCnv_p1::transToPers(const SCT_RDO_Container* transCont chanEnd += collection.size(); InDetRawDataCollection_p1& pcollection = persCont->m_collections[collIndex]; pcollection.m_id = collection.identify().get_compact(); - pcollection.m_hashId = (unsigned int) collection.identifyHash(); + pcollection.m_hashId = static_cast<unsigned int>(collection.identifyHash()); pcollection.m_begin = chanBegin; pcollection.m_end = chanEnd; // Add in channels @@ -65,7 +67,7 @@ void SCT1_RawDataContainerCnv_p1::transToPers(const SCT_RDO_Container* transCont MSG_DEBUG(log," *** Writing SCT_RDO_Container (SCT1_RawData concrete type)"); } -void SCT1_RawDataContainerCnv_p1::persToTrans(const InDetRawDataContainer_p1* persCont, SCT_RDO_Container* transCont, MsgStream &log) +void SCT1_RawDataContainerCnv_p1::persToTrans(const InDetRawDataContainer_p1* persCont, SCT_RDO_Container* transCont, MsgStream& log) { // The transient model has a container holding collections and the @@ -83,8 +85,6 @@ void SCT1_RawDataContainerCnv_p1::persToTrans(const InDetRawDataContainer_p1* p // from the vector. - SCT_RDO_Collection* coll = 0; - SCT1_RawDataCnv_p1 chanCnv; MSG_DEBUG(log," Reading " << persCont->m_collections.size() << "Collections"); for (unsigned int icoll = 0; icoll < persCont->m_collections.size(); ++icoll) { @@ -94,24 +94,24 @@ void SCT1_RawDataContainerCnv_p1::persToTrans(const InDetRawDataContainer_p1* p const InDetRawDataCollection_p1& pcoll = persCont->m_collections[icoll]; Identifier collID(Identifier(pcoll.m_id)); IdentifierHash collIDHash(IdentifierHash(pcoll.m_hashId)); - coll = new SCT_RDO_Collection(collIDHash ); + std::unique_ptr<SCT_RDO_Collection> coll = std::make_unique<SCT_RDO_Collection>(collIDHash); coll->setIdentifier(Identifier(collID)); - unsigned int nchans = pcoll.m_end - pcoll.m_begin; + unsigned int nchans = pcoll.m_end - pcoll.m_begin; coll->resize(nchans); // Fill with channels for (unsigned int ichan = 0; ichan < nchans; ++ ichan) { const InDetRawData_p1* pchan = &(persCont->m_rawdata[ichan + pcoll.m_begin]); - SCT1_RawData* chan = new SCT1_RawData(); - chanCnv.persToTrans(pchan, chan, log); - (*coll)[ichan] = chan; + std::unique_ptr<SCT1_RawData> chan = std::make_unique<SCT1_RawData>(); + chanCnv.persToTrans(pchan, chan.get(), log); + (*coll)[ichan] = chan.release(); } // register the rdo collection in IDC with hash - faster addCollection - StatusCode sc = transCont->addCollection(coll, collIDHash); + StatusCode sc = transCont->addCollection(coll.release(), collIDHash); if (sc.isFailure()) { throw std::runtime_error("Failed to add collection to ID Container"); } - MSG_VERBOSE(log,"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id/coll id = " << (int) collIDHash + MSG_VERBOSE(log,"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id/coll id = " << collIDHash.value() << " / " << collID.get_compact() << ", added to Identifiable container."); } @@ -120,8 +120,7 @@ void SCT1_RawDataContainerCnv_p1::persToTrans(const InDetRawDataContainer_p1* p //================================================================ SCT_RDO_Container* SCT1_RawDataContainerCnv_p1::createTransient(const InDetRawDataContainer_p1* persObj, MsgStream& log) { - std::unique_ptr<SCT_RDO_Container> trans(new SCT_RDO_Container(m_sctId->wafer_hash_max())); + std::unique_ptr<SCT_RDO_Container> trans(std::make_unique<SCT_RDO_Container>(m_sctId->wafer_hash_max())); persToTrans(persObj, trans.get(), log); - return(trans.release()); + return trans.release(); } - diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataContainerCnv_p1.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataContainerCnv_p1.h index 1247cbf67a007f5e079bb9813ad9bd2c68ee6057..c10435799edbf3e0bff65b11632caf2d90f125e1 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataContainerCnv_p1.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT1_RawDataContainerCnv_p1.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT1_RAWDATACONTAINERCNV_P1_H @@ -25,21 +25,21 @@ class SCT_ID; class SCT1_RawDataContainerCnv_p1 : public T_AthenaPoolTPCnvBase<SCT_RDO_Container, InDetRawDataContainer_p1> { private: - const SCT_ID *m_sctId = nullptr; + const SCT_ID* m_sctId = nullptr; public: SCT1_RawDataContainerCnv_p1() {}; virtual void persToTrans(const InDetRawDataContainer_p1* persCont, SCT_RDO_Container* transCont, - MsgStream &log) ; + MsgStream& log) ; virtual void transToPers(const SCT_RDO_Container* transCont, InDetRawDataContainer_p1* persCont, - MsgStream &log) ; + MsgStream& log) ; virtual SCT_RDO_Container* createTransient(const InDetRawDataContainer_p1* persObj, MsgStream& log) ; // ID helper can't be used in the constructor, need initialize() - void initialize(const SCT_ID *idhelper) { m_sctId = idhelper; } + void initialize(const SCT_ID* idhelper) { m_sctId = idhelper; } }; diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p1.cxx index a13457515858d088706381e9e354e64818649871..1aa3f48015828a5c2acb101f3ae6e5f0c63fb570 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p1.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p1.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "InDetRawData/SCT3_RawData.h" @@ -13,25 +13,25 @@ void -SCT3_RawDataCnv_p1::persToTrans(const SCT3_RawData_p1* persObj, SCT3_RawData* transObj, MsgStream &log) +SCT3_RawDataCnv_p1::persToTrans(const SCT3_RawData_p1* persObj, SCT3_RawData* transObj, MsgStream& log) { -//#ifdef SCT_DEBUG - MSG_DEBUG(log,"SCT3_RawDataCnv_p1::persToTrans called "); -//#endif - std::vector<int> errHit; - errHit.reserve(20); - for (int ii=0; ii<20; ii++) { - if (persObj->m_errCH[ii] > 0 ) - errHit.push_back(ii); - } + MSG_DEBUG(log,"SCT3_RawDataCnv_p1::persToTrans called "); - *transObj = SCT3_RawData (Identifier(persObj->m_rdoId), - persObj->m_word, - std::move(errHit)); + std::vector<int> errHit; + errHit.reserve(20); + for (int ii=0; ii<20; ii++) { + if (persObj->m_errCH[ii] > 0) { + errHit.push_back(ii); + } + } + + *transObj = SCT3_RawData(Identifier(persObj->m_rdoId), + persObj->m_word, + std::move(errHit)); } void -SCT3_RawDataCnv_p1::transToPers(const SCT3_RawData*, SCT3_RawData_p1*, MsgStream &log) +SCT3_RawDataCnv_p1::transToPers(const SCT3_RawData*, SCT3_RawData_p1*, MsgStream& log) { - log << MSG::ERROR << "SCT3_RawDataCnv_p1::transToPers is deprecated. " << endmsg; + log << MSG::ERROR << "SCT3_RawDataCnv_p1::transToPers is deprecated. " << endmsg; } diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p1.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p1.h index fdc97de60abb5a83008f54d01ba34e9b6de08ad0..7a637f7dcf8c453507eb269e40e96f5e2a0ac789 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p1.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p1.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT3_RAWDATACNV_P1_H @@ -23,8 +23,8 @@ class SCT3_RawDataCnv_p1 : public T_AthenaPoolTPCnvBase<SCT3_RawData, SCT3_RawD public: SCT3_RawDataCnv_p1() {} - virtual void persToTrans(const SCT3_RawData_p1* persObj, SCT3_RawData* transObj, MsgStream &log); - virtual void transToPers(const SCT3_RawData* transObj, SCT3_RawData_p1* persObj, MsgStream &log); + virtual void persToTrans(const SCT3_RawData_p1* persObj, SCT3_RawData* transObj, MsgStream& log); + virtual void transToPers(const SCT3_RawData* transObj, SCT3_RawData_p1* persObj, MsgStream& log); }; diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p2.cxx index 8d21d50e80d70a9c17b1c0c246eccce687a1a782..f05462fd1c2b9afbf29c7b482ea1d9c35f4d13b6 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p2.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p2.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "InDetRawData/SCT3_RawData.h" @@ -15,24 +15,20 @@ void -SCT3_RawDataCnv_p2::persToTrans(const SCT3_RawData_p2* persObj, SCT3_RawData* transObj, MsgStream &log) +SCT3_RawDataCnv_p2::persToTrans(const SCT3_RawData_p2* persObj, SCT3_RawData* transObj, MsgStream& log) { -//#ifdef SCT_DEBUG MSG_DEBUG(log,"SCT3_RawDataCnv_p2::persToTrans called "); -//#endif - *transObj = SCT3_RawData (Identifier(persObj->m_rdoId), - persObj->m_word, - std::vector<int>()); + *transObj = SCT3_RawData(Identifier(persObj->m_rdoId), + persObj->m_word, + std::vector<int>()); } void -SCT3_RawDataCnv_p2::transToPers(const SCT3_RawData* transObj, SCT3_RawData_p2* persObj, MsgStream &log) +SCT3_RawDataCnv_p2::transToPers(const SCT3_RawData* transObj, SCT3_RawData_p2* persObj, MsgStream& log) { -//#ifdef SCT_DEBUG - MSG_DEBUG(log,"SCT3_RawDataCnv_p2::transToPers called "); -//#endif - persObj->m_rdoId = transObj->identify().get_compact(); - persObj->m_word = transObj->getWord(); + MSG_DEBUG(log,"SCT3_RawDataCnv_p2::transToPers called "); + persObj->m_rdoId = transObj->identify().get_compact(); + persObj->m_word = transObj->getWord(); } diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p2.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p2.h index bfe7c90e05881d0799c683d3bb2a6380d659676d..6ce794c74d736290e750e4557cb8b8066786c7d8 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p2.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p2.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT3_RAWDATACNV_P2_H @@ -22,8 +22,8 @@ class SCT3_RawDataCnv_p2 : public T_AthenaPoolTPCnvBase<SCT3_RawData, SCT3_RawD public: SCT3_RawDataCnv_p2() {} - virtual void persToTrans(const SCT3_RawData_p2* persObj, SCT3_RawData* transObj, MsgStream &log); - virtual void transToPers(const SCT3_RawData* transObj, SCT3_RawData_p2* persObj, MsgStream &log); + virtual void persToTrans(const SCT3_RawData_p2* persObj, SCT3_RawData* transObj, MsgStream& log); + virtual void transToPers(const SCT3_RawData* transObj, SCT3_RawData_p2* persObj, MsgStream& log); }; diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p3.cxx index d1dd8a61cb429e0de1c226115a759999c17c125e..f427e96d2efd366dffc129272891885b53133aa6 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p3.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p3.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "InDetRawData/SCT3_RawData.h" @@ -15,24 +15,20 @@ void -SCT3_RawDataCnv_p3::persToTrans(const SCT3_RawData_p3* persObj, SCT3_RawData* transObj, MsgStream &log) +SCT3_RawDataCnv_p3::persToTrans(const SCT3_RawData_p3* persObj, SCT3_RawData* transObj, MsgStream& log) { -//#ifdef SCT_DEBUG MSG_DEBUG(log,"SCT3_RawDataCnv_p3::persToTrans called "); -//#endif - *transObj = SCT3_RawData (Identifier(persObj->m_rdoId), - persObj->m_word, - std::vector<int>()); + *transObj = SCT3_RawData(Identifier(persObj->m_rdoId), + persObj->m_word, + std::vector<int>()); } void -SCT3_RawDataCnv_p3::transToPers(const SCT3_RawData* transObj, SCT3_RawData_p3* persObj, MsgStream &log) +SCT3_RawDataCnv_p3::transToPers(const SCT3_RawData* transObj, SCT3_RawData_p3* persObj, MsgStream& log) { -//#ifdef SCT_DEBUG - MSG_DEBUG(log,"SCT3_RawDataCnv_p3::transToPers called "); -//#endif - persObj->m_rdoId = transObj->identify().get_compact(); - persObj->m_word = transObj->getWord(); + MSG_DEBUG(log,"SCT3_RawDataCnv_p3::transToPers called "); + persObj->m_rdoId = transObj->identify().get_compact(); + persObj->m_word = transObj->getWord(); } diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p3.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p3.h index 39f409d243a5c8f0acde12860490cc09a7c8e11b..658cb2358ab368d26cfde1d9c74a39d5e81e5e38 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p3.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p3.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT3_RAWDATACNV_P3_H @@ -22,8 +22,8 @@ class SCT3_RawDataCnv_p3 : public T_AthenaPoolTPCnvBase<SCT3_RawData, SCT3_RawD public: SCT3_RawDataCnv_p3() {} - virtual void persToTrans(const SCT3_RawData_p3* persObj, SCT3_RawData* transObj, MsgStream &log); - virtual void transToPers(const SCT3_RawData* transObj, SCT3_RawData_p3* persObj, MsgStream &log); + virtual void persToTrans(const SCT3_RawData_p3* persObj, SCT3_RawData* transObj, MsgStream& log); + virtual void transToPers(const SCT3_RawData* transObj, SCT3_RawData_p3* persObj, MsgStream& log); }; diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p4.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p4.cxx new file mode 100644 index 0000000000000000000000000000000000000000..93d33834fab1253bf75f5f42dc1595026fb307d6 --- /dev/null +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p4.cxx @@ -0,0 +1,48 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT3_RawDataCnv_p4.h" + +#include "MsgUtil.h" + +#include "InDetEventAthenaPool/SCT3_RawData_p4.h" +#include "InDetIdentifier/SCT_ID.h" +#include "InDetRawData/SCT3_RawData.h" + +#include <vector> + +void +SCT3_RawDataCnv_p4::persToTrans(const SCT3_RawData_p4* persObj, SCT3_RawData* transObj, MsgStream& log) +{ + MSG_DEBUG(log, "SCT3_RawDataCnv_p4::persToTrans called"); + + // Convert unsigned short to unsigned int + // P: Bits 0-10 for group size, Bits 11-13 for time bin + // T: Bits 0-10 for group size, Bits 22-24 for time bin + unsigned int word = static_cast<unsigned int>(persObj->m_word); + word = ((word & 0x7FF) | (((word >> 11) & 0x7) << 22)); + + // Convert row and strip numbers to strip Identifeir using wafer Identifer + Identifier stripId = m_sctId->strip_id(m_waferId, + persObj->getRow(), + persObj->getStrip()); + + *transObj = SCT3_RawData(stripId, word, std::vector<int>()); +} + +void +SCT3_RawDataCnv_p4::transToPers(const SCT3_RawData* transObj, SCT3_RawData_p4* persObj, MsgStream& log) +{ + MSG_DEBUG(log, "SCT3_RawDataCnv_p4::transToPers called"); + + // Set row and strip numbers + persObj->setRowStrip(m_sctId->row(transObj->identify()), m_sctId->strip(transObj->identify())); + + // Convert unsigned int to unsigned short + // T: Bits 0-10 for group size, Bits 22-24 for time bin + // P: Bits 0-10 for group size, Bits 11-13 for time bin + unsigned int word = transObj->getWord(); + word = ((word & 0x7FF) | (((word >> 22) & 0x7) << 11)); + persObj->m_word = static_cast<unsigned short>(word); +} diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p4.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p4.h new file mode 100644 index 0000000000000000000000000000000000000000..970d5dc2bfa37485635745d0907bd758eb728de8 --- /dev/null +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT3_RawDataCnv_p4.h @@ -0,0 +1,33 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT3_RAWDATACNV_P4_H +#define SCT3_RAWDATACNV_P4_H + +/* + Transient/Persistent converter for SCT3_RawData class +*/ + +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +#include "Identifier/Identifier.h" +#include "InDetRawData/SCT3_RawData.h" +#include "InDetEventAthenaPool/SCT3_RawData_p4.h" + +class MsgStream; +class SCT_ID; + +class SCT3_RawDataCnv_p4 : public T_AthenaPoolTPCnvBase<SCT3_RawData, SCT3_RawData_p4> +{ + public: + SCT3_RawDataCnv_p4(const SCT_ID* sctId) { m_sctId = sctId; } + virtual void persToTrans(const SCT3_RawData_p4* persObj, SCT3_RawData* transObj, MsgStream& log); + virtual void transToPers(const SCT3_RawData* transObj, SCT3_RawData_p4* persObj, MsgStream& log); + void setWaferId(const Identifier waferId) { m_waferId = waferId; } + private: + const SCT_ID* m_sctId; + Identifier m_waferId; +}; + +#endif // SCT3_RAWDATACNV_P4_H diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_ClusterContainerCnv.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_ClusterContainerCnv.cxx index 6fb9265e5848f7c469fa35f98106616e7c341c10..0818e7b2c89c7311aee68be7474d4309cdc4a616 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_ClusterContainerCnv.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_ClusterContainerCnv.cxx @@ -1,16 +1,16 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ - -#include "StoreGate/StoreGateSvc.h" #include "SCT_ClusterContainerCnv.h" -#include "InDetIdentifier/SCT_ID.h" + #include "MsgUtil.h" -#include <memory> +#include "InDetIdentifier/SCT_ID.h" +#include "StoreGate/StoreGateSvc.h" #include <iostream> +#include <memory> SCT_ClusterContainerCnv::SCT_ClusterContainerCnv (ISvcLocator* svcloc) : SCT_ClusterContainerCnvBase(svcloc, "SCT_ClusterContainerCnv"), @@ -38,7 +38,7 @@ StatusCode SCT_ClusterContainerCnv::initialize() { } // get DetectorStore service - StoreGateSvc *detStore(0); + StoreGateSvc* detStore(nullptr); if (service("DetectorStore", detStore).isFailure()) { ATH_MSG_FATAL("DetectorStore service not found !"); return StatusCode::FAILURE; @@ -47,7 +47,7 @@ StatusCode SCT_ClusterContainerCnv::initialize() { } // Get the SCT helper from the detector store - const SCT_ID* idhelper(0); + const SCT_ID* idhelper(nullptr); if (detStore->retrieve(idhelper, "SCT_ID").isFailure()) { ATH_MSG_FATAL("Could not get SCT_ID helper !"); return StatusCode::FAILURE; @@ -75,33 +75,28 @@ InDet::SCT_ClusterContainer* SCT_ClusterContainerCnv::createTransient() { static pool::Guid p3_guid("623F5836-369F-4A94-9DD4-DAD728E93C13"); // with SCT_Cluster_p3 //ATH_MSG_DEBUG("createTransient(): main converter"); - InDet::SCT_ClusterContainer* p_collection(0); - if( compareClassGuid(p3_guid) ) { + InDet::SCT_ClusterContainer* p_collection(nullptr); + if ( compareClassGuid(p3_guid) ) { //ATH_MSG_DEBUG("createTransient(): T/P version 3 detected"); std::unique_ptr< SCT_ClusterContainer_PERS > p_coll( poolReadObject< SCT_ClusterContainer_PERS >() ); p_collection = m_TPConverter_p3.createTransient( p_coll.get(), msg() ); - } else if( compareClassGuid(p1_guid) ) { + } else if ( compareClassGuid(p1_guid) ) { //ATH_MSG_DEBUG("createTransient(): T/P version 1 detected"); std::unique_ptr< InDet::SCT_ClusterContainer_tlp1 > p_coll( poolReadObject< InDet::SCT_ClusterContainer_tlp1 >() ); p_collection = m_TPConverter.createTransient( p_coll.get(), msg() ); - } else if( compareClassGuid(p2_guid) ) { + } else if ( compareClassGuid(p2_guid) ) { //ATH_MSG_DEBUG("createTransient(): T/P version 2 detected"); std::unique_ptr< InDet::SCT_ClusterContainer_p2 > p_coll( poolReadObject< InDet::SCT_ClusterContainer_p2 >() ); p_collection = m_TPConverter_p2.createTransient( p_coll.get(), msg() ); - } - - - //---------------------------------------------------------------- - else if( compareClassGuid(p0_guid) ) { + } else if ( compareClassGuid(p0_guid) ) { //ATH_MSG_DEBUG("createTransient(): Old input file"); - - std::unique_ptr< SCT_ClusterContainer_p0 > col_vect( poolReadObject< SCT_ClusterContainer_p0 >() ); + std::unique_ptr< SCT_ClusterContainer_p0 > col_vect( poolReadObject< SCT_ClusterContainer_p0 >() ); p_collection = m_converter_p0.createTransient( col_vect.get(), msg() ); - } - else { + + } else { throw std::runtime_error("Unsupported persistent version of SCT_ClusterContainer"); } @@ -109,9 +104,7 @@ InDet::SCT_ClusterContainer* SCT_ClusterContainerCnv::createTransient() { } -SCT_ClusterContainer_PERS* SCT_ClusterContainerCnv::createPersistent (InDet::SCT_ClusterContainer* transCont) { - SCT_ClusterContainer_PERS *sctdc_p= m_TPConverter_p3.createPersistent( transCont, msg() ); +SCT_ClusterContainer_PERS* SCT_ClusterContainerCnv::createPersistent (InDet::SCT_ClusterContainer* transCont) { + SCT_ClusterContainer_PERS* sctdc_p= m_TPConverter_p3.createPersistent( transCont, msg() ); return sctdc_p; } - - diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_ClusterContainerCnv_p0.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_ClusterContainerCnv_p0.cxx index 9228055591917ef438000d752353e4bdbfadbdc9..3912a5b53ed73c257bd04b812e34c7259541e046 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_ClusterContainerCnv_p0.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_ClusterContainerCnv_p0.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_ClusterContainerCnv_p0.h" @@ -32,25 +32,25 @@ SCT_ClusterContainerCnv_p0::SCT_ClusterContainerCnv_p0(): { } -StatusCode SCT_ClusterContainerCnv_p0::initialize(MsgStream &log ) { +StatusCode SCT_ClusterContainerCnv_p0::initialize(MsgStream& log ) { - ISvcLocator* svcLocator = Gaudi::svcLocator(); + ISvcLocator* svcLocator = Gaudi::svcLocator(); - // Get the messaging service, print where you are - log << MSG::INFO << "SCT_ClusterContainerCnv::initialize()" << endmsg; + // Get the messaging service, print where you are + log << MSG::INFO << "SCT_ClusterContainerCnv::initialize()" << endmsg; - StoreGateSvc *detStore = nullptr; - CHECK( svcLocator->service("DetectorStore", detStore) ); - CHECK( detStore->retrieve(m_sctId, "SCT_ID") ); - CHECK( m_SCTDetEleCollKey.initialize() ); - MSG_DEBUG(log,"Converter initialized."); + StoreGateSvc* detStore = nullptr; + CHECK( svcLocator->service("DetectorStore", detStore) ); + CHECK( detStore->retrieve(m_sctId, "SCT_ID") ); + CHECK( m_SCTDetEleCollKey.initialize() ); + MSG_DEBUG(log,"Converter initialized."); - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; } InDet::SCT_ClusterContainer* SCT_ClusterContainerCnv_p0::createTransient(SCT_ClusterContainer_p0* persObj, MsgStream& log) { - std::unique_ptr<InDet::SCT_ClusterContainer> trans(new InDet::SCT_ClusterContainer(m_sctId->wafer_hash_max()) ); + std::unique_ptr<InDet::SCT_ClusterContainer> trans(std::make_unique<InDet::SCT_ClusterContainer>(m_sctId->wafer_hash_max()) ); // MSG_DEBUG(log,"Read PRD vector, size " << persObj->size()); SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> sctDetEleHandle(m_SCTDetEleCollKey); @@ -61,25 +61,24 @@ InDet::SCT_ClusterContainer* SCT_ClusterContainerCnv_p0::createTransient(SCT_Clu } for (InDet::SCT_ClusterCollection* dcColl : *persObj) { - // Add detElem to each drift circle - IdentifierHash collHash = dcColl->identifyHash(); - const InDetDD::SiDetectorElement * de = elements->getDetectorElement(collHash); - // MSG_DEBUG(log,"Set SCT_Cluster detector element to "<< de); - - InDet::SCT_ClusterCollection::iterator itColl = dcColl->begin(); - InDet::SCT_ClusterCollection::iterator lastColl = dcColl->end(); - for (; itColl != lastColl; ++itColl) { - (*itColl)->m_detEl = de; - } - - StatusCode sc= trans->addCollection(dcColl, collHash); - if (sc.isSuccess()){ - // MSG_VERBOSE("SCT_ClusterContainer successfully added to Container !"); - } else { - log << MSG::ERROR << "Failed to add SCT_ClusterContainer to container" << endmsg; - return 0; - } - } + // Add detElem to each drift circle + IdentifierHash collHash = dcColl->identifyHash(); + const InDetDD::SiDetectorElement * de = elements->getDetectorElement(collHash); + // MSG_DEBUG(log,"Set SCT_Cluster detector element to "<< de); + + InDet::SCT_ClusterCollection::iterator itColl = dcColl->begin(); + InDet::SCT_ClusterCollection::iterator lastColl = dcColl->end(); + for (; itColl != lastColl; ++itColl) { + (*itColl)->m_detEl = de; + } + + StatusCode sc= trans->addCollection(dcColl, collHash); + if (sc.isSuccess()){ + // MSG_VERBOSE("SCT_ClusterContainer successfully added to Container !"); + } else { + log << MSG::ERROR << "Failed to add SCT_ClusterContainer to container" << endmsg; + return nullptr; + } + } return(trans.release()); } - diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_ClusterContainerCnv_p0.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_ClusterContainerCnv_p0.h index dceb88a3775707ee0ff376fde3ba7bd04aed5afc..81657958fe36d76890cfb2a0e43a4630c9fddc77 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_ClusterContainerCnv_p0.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_ClusterContainerCnv_p0.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_CLUSTERCONTAINERCNV_P0_H @@ -21,7 +21,7 @@ class SCT_ClusterContainerCnv_p0 : public T_AthenaPoolTPCnvBase<InDet::SCT_Clus SCT_ClusterContainerCnv_p0(); // ID helper can't be used in the constructor, need initialize() - StatusCode initialize( MsgStream &log ); + StatusCode initialize( MsgStream& log ); virtual void persToTrans(const SCT_ClusterContainer_p0*, InDet::SCT_ClusterContainer*, MsgStream&) override { // everything is done in createTransient() diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_FlaggedCondDataCnv.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_FlaggedCondDataCnv.cxx index 7da4c7c5c11a5225942b5c231fb1749a94d8add0..d9224ba12851cae052f0412750fd50b75a852c6d 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_FlaggedCondDataCnv.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_FlaggedCondDataCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /** @@ -10,26 +10,28 @@ #include "SCT_FlaggedCondDataCnv.h" +#include <memory> + SCT_FlaggedCondData_PERS* SCT_FlaggedCondDataCnv::createPersistent(SCT_FlaggedCondData* transCont) { MsgStream log(msgSvc(), "SCT_FlaggedCondDataCnv"); SCT_FlaggedCondDataCnv_p1 cnv; - SCT_FlaggedCondData_PERS *persObj = new SCT_FlaggedCondData_PERS(); - cnv.transToPers(transCont, persObj, log); - return persObj; + std::unique_ptr<SCT_FlaggedCondData_PERS> persObj = std::make_unique<SCT_FlaggedCondData_PERS>(); + cnv.transToPers(transCont, persObj.get(), log); + return persObj.release(); } SCT_FlaggedCondData* SCT_FlaggedCondDataCnv::createTransient() { MsgStream log(msgSvc(), "SCT_FlaggedCondDataCnv"); static pool::Guid p1_guid("0C10E502-F02B-440B-9E8F-6A8C31915D7C"); - if( compareClassGuid(p1_guid) ) { + if (compareClassGuid(p1_guid)) { /** using auto_ptr ensures deletion of the persistent object */ std::auto_ptr<SCT_FlaggedCondData_p1> col_vect( poolReadObject< SCT_FlaggedCondData_p1 >() ); SCT_FlaggedCondDataCnv_p1 cnv; - SCT_FlaggedCondData* trasnObj = new SCT_FlaggedCondData(); - cnv.persToTrans(col_vect.get(), trasnObj, log); - return trasnObj; + std::unique_ptr<SCT_FlaggedCondData> trasnObj = std::make_unique<SCT_FlaggedCondData>(); + cnv.persToTrans(col_vect.get(), trasnObj.get(), log); + return trasnObj.release(); } throw std::runtime_error("Unsupported persistent version of Data Collection"); } diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_FlaggedCondDataCnv_p1.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_FlaggedCondDataCnv_p1.h index b72b5722b574c792a8d4076606e8d4e59d07c221..5f6dbabb8b02558d657990a393876e3b3822d3a1 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_FlaggedCondDataCnv_p1.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_FlaggedCondDataCnv_p1.h @@ -20,8 +20,8 @@ class SCT_FlaggedCondDataCnv_p1 : public T_AthenaPoolTPCnvBase<SCT_FlaggedCondDa { public: SCT_FlaggedCondDataCnv_p1() {} - virtual void persToTrans(const SCT_FlaggedCondData_p1* persObj, SCT_FlaggedCondData* transObj, MsgStream &log); - virtual void transToPers(const SCT_FlaggedCondData* transObj, SCT_FlaggedCondData_p1* persObj, MsgStream &log); + virtual void persToTrans(const SCT_FlaggedCondData_p1* persObj, SCT_FlaggedCondData* transObj, MsgStream& log); + virtual void transToPers(const SCT_FlaggedCondData* transObj, SCT_FlaggedCondData_p1* persObj, MsgStream& log); }; #endif // SCT_FlaggedCondDataCnv_p1_h diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv.cxx index 82f71227d153cbd71d101c17b4c9bd9f003e6fb9..74a877fda4ac40c994113ececfaafc2a3c034a76 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_RDO_ContainerCnv.h" @@ -14,17 +14,17 @@ //================================================================ namespace { #ifdef SCT_DEBUG - std::string shortPrint(const SCT_RDO_Container *main_input_SCT, unsigned maxprint=25) { + std::string shortPrint(const SCT_RDO_Container* main_input_SCT, unsigned maxprint=25) { std::ostringstream os; - if(main_input_SCT) { - for(unsigned i=0; i<maxprint; i++) { - SCT_RDO_Container::const_iterator p = main_input_SCT->indexFind(i); - if(p != main_input_SCT->end()) { - os<<" "<< (*p)->size(); - } - else { - os<<" *"; - } + if (main_input_SCT) { + for (unsigned i=0; i<maxprint; i++) { + SCT_RDO_Container::const_iterator p = main_input_SCT->indexFind(i); + if (p != main_input_SCT->end()) { + os<<" "<< (*p)->size(); + } + else { + os<<" *"; + } } } else { @@ -43,51 +43,52 @@ SCT_RDO_ContainerCnv::SCT_RDO_ContainerCnv (ISvcLocator* svcloc) //================================================================ StatusCode SCT_RDO_ContainerCnv::initialize() { - StatusCode sc = SCT_RDO_ContainerCnvBase::initialize(); - if (sc.isFailure()) { - ATH_MSG_FATAL("SCT_RDO_ContainerCnvBase::initialize() returned failure !"); - return StatusCode::FAILURE; - } - - ATH_MSG_DEBUG("SCT_RDO_ContainerCnv::initialize()"); - - // get StoreGate service. This is needed only for clients - // that register collections directly to the SG instead of adding - // them to the container. - sc = service("StoreGateSvc", m_storeGate); - if (sc.isFailure()) { - ATH_MSG_FATAL("StoreGate service not found !"); - return StatusCode::FAILURE; - } + StatusCode sc = SCT_RDO_ContainerCnvBase::initialize(); + if (sc.isFailure()) { + ATH_MSG_FATAL("SCT_RDO_ContainerCnvBase::initialize() returned failure !"); + return StatusCode::FAILURE; + } + + ATH_MSG_DEBUG("SCT_RDO_ContainerCnv::initialize()"); + + // get StoreGate service. This is needed only for clients + // that register collections directly to the SG instead of adding + // them to the container. + sc = service("StoreGateSvc", m_storeGate); + if (sc.isFailure()) { + ATH_MSG_FATAL("StoreGate service not found !"); + return StatusCode::FAILURE; + } - // get DetectorStore service - StoreGateSvc *detStore(0); - if (service("DetectorStore", detStore).isFailure()) { - ATH_MSG_FATAL("DetectorStore service not found !"); - return StatusCode::FAILURE; - } else { - ATH_MSG_DEBUG("Found DetectorStore."); - } + // get DetectorStore service + StoreGateSvc* detStore(nullptr); + if (service("DetectorStore", detStore).isFailure()) { + ATH_MSG_FATAL("DetectorStore service not found !"); + return StatusCode::FAILURE; + } else { + ATH_MSG_DEBUG("Found DetectorStore."); + } - // Get the sct helper from the detector store - const SCT_ID* idhelper(0); - if (detStore->retrieve(idhelper, "SCT_ID").isFailure()) { - ATH_MSG_FATAL("Could not get SCT_ID helper !"); - return StatusCode::FAILURE; - } else { - ATH_MSG_DEBUG("Found the SCT_ID helper."); - } + // Get the sct helper from the detector store + const SCT_ID* idhelper(nullptr); + if (detStore->retrieve(idhelper, "SCT_ID").isFailure()) { + ATH_MSG_FATAL("Could not get SCT_ID helper !"); + return StatusCode::FAILURE; + } else { + ATH_MSG_DEBUG("Found the SCT_ID helper."); + } - m_converter_p0.initialize(idhelper); - m_converter_TP1.initialize(idhelper); - m_converter_SCT_TP1.initialize(idhelper); - m_converter_SCT_TP2.initialize(idhelper); - m_converter_SCT_TP3.initialize(idhelper); - m_converter_PERS.initialize(idhelper); + m_converter_p0.initialize(idhelper); + m_converter_TP1.initialize(idhelper); + m_converter_SCT_TP1.initialize(idhelper); + m_converter_SCT_TP2.initialize(idhelper); + m_converter_SCT_TP3.initialize(idhelper); + m_converter_SCT_TP4.initialize(idhelper); + m_converter_PERS.initialize(idhelper); - // ATH_MSG_DEBUG("Converter initialized"); + // ATH_MSG_DEBUG("Converter initialized"); - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; } //================================================================ @@ -100,38 +101,38 @@ SCT_RDO_Container_PERS* SCT_RDO_ContainerCnv::createPersistent(SCT_RDO_Container // 1: if concrete type private data is equivalent to InDetRawData_p1 // 3: for cosmic/TB // - unsigned int converter_num(1); + unsigned int converter_num(1); SCT_RDO_Container::const_iterator it_Coll = transCont->begin(); SCT_RDO_Container::const_iterator it_CollEnd = transCont->end(); // check one element of the container. The container can't be empty for this... - if(it_Coll != it_CollEnd) { - while (it_Coll != it_CollEnd && (*it_Coll)->size() == 0 ) it_Coll++; - if(it_Coll != it_CollEnd) { - const SCT_RDORawData *test((**it_Coll)[0]); - if(dynamic_cast<const SCT1_RawData*>(test) != 0 ) { - //ATH_MSG_DEBUG("Found container with SCT1_RawData concrete type objects"); - converter_num=1; - } else if (dynamic_cast<const SCT3_RawData*>(test) != 0 ) { - //ATH_MSG_DEBUG("Found container with SCT3_RawData concrete type objects"); - converter_num=3; + if (it_Coll != it_CollEnd) { + while (it_Coll != it_CollEnd && (*it_Coll)->size() == 0) it_Coll++; + if (it_Coll != it_CollEnd) { + const SCT_RDORawData* test((**it_Coll)[0]); + if (dynamic_cast<const SCT1_RawData*>(test) != nullptr) { + //ATH_MSG_DEBUG("Found container with SCT1_RawData concrete type objects"); + converter_num=1; + } else if (dynamic_cast<const SCT3_RawData*>(test) != nullptr) { + //ATH_MSG_DEBUG("Found container with SCT3_RawData concrete type objects"); + converter_num=3; } else { - ATH_MSG_FATAL("Converter not implemented for this concrete type "); - throw "Converter not implemented"; + ATH_MSG_FATAL("Converter not implemented for this concrete type "); + throw "Converter not implemented"; } } else { - ATH_MSG_WARNING("Container has only empty collections. Using TP1 converter"); + ATH_MSG_WARNING("Container has only empty collections. Using TP1 converter"); } } else { - ATH_MSG_WARNING("Empty container. Using TP1 converter"); + ATH_MSG_WARNING("Empty container. Using TP1 converter"); } // Switch facility depending on the concrete data type of the contained objects // Should do by getting the type_info of one of the contained objects - SCT_RDO_Container_PERS *persObj(0); - if(converter_num == 1 || converter_num == 3) { - m_converter_PERS.setType(converter_num); - persObj = m_converter_PERS.createPersistent( transCont, msg() ); + SCT_RDO_Container_PERS* persObj(nullptr); + if (converter_num == 1 || converter_num == 3) { + m_converter_PERS.setType(converter_num); + persObj = m_converter_PERS.createPersistent( transCont, msg() ); } else { - ATH_MSG_FATAL("This shouldn't happen!! "); + ATH_MSG_FATAL("This shouldn't happen!! "); } #ifdef SCT_DEBUG ATH_MSG_DEBUG("Success"); @@ -147,42 +148,56 @@ SCT_RDO_Container* SCT_RDO_ContainerCnv::createTransient() { static pool::Guid SCT_TP1_guid("8E13963E-13E5-4D10-AA8B-73F00AFF8FA8"); // for t/p separated version with SCT_RawDataContainer_p1 static pool::Guid SCT_TP2_guid("D1258125-2CBA-476E-8578-E09D54F477E1"); // for t/p separated version with SCT_RawDataContainer_p2 static pool::Guid SCT_TP3_guid("5FBC8D4D-7B4D-433A-8487-0EA0C870CBDB"); // for t/p separated version with SCT_RawDataContainer_p3 + static pool::Guid SCT_TP4_guid("6C7540BE-E85C-4777-BC1C-A9FF11460F54"); // for t/p separated version with SCT_RawDataContainer_p4 #ifdef SCT_DEBUG ATH_MSG_DEBUG("createTransient(): main converter"); #endif - if( compareClassGuid(SCT_TP3_guid) ) { + if ( compareClassGuid(SCT_TP4_guid) ) { +#ifdef SCT_DEBUG + ATH_MSG_DEBUG("createTransient(): New TP version - TP4 branch"); +#endif + + std::unique_ptr< SCT_RawDataContainer_p4 > col_vect( poolReadObject< SCT_RawDataContainer_p4 >() ); + SCT_RDO_Container* res = m_converter_SCT_TP4.createTransient( col_vect.get(), msg() ); +#ifdef SCT_DEBUG + ATH_MSG_DEBUG("createTransient(), TP4 branch: returns TRANS = "<<shortPrint(res)); +#endif + return res; + + } + else if ( compareClassGuid(SCT_TP3_guid) ) { #ifdef SCT_DEBUG ATH_MSG_DEBUG("createTransient(): New TP version - TP3 branch"); #endif std::unique_ptr< SCT_RawDataContainer_p3 > col_vect( poolReadObject< SCT_RawDataContainer_p3 >() ); - SCT_RDO_Container *res = m_converter_SCT_TP3.createTransient( col_vect.get(), msg() ); + SCT_RDO_Container* res = m_converter_SCT_TP3.createTransient( col_vect.get(), msg() ); #ifdef SCT_DEBUG ATH_MSG_DEBUG("createTransient(), TP3 branch: returns TRANS = "<<shortPrint(res)); #endif return res; } - else if( compareClassGuid(SCT_TP2_guid) ) { + else if ( compareClassGuid(SCT_TP2_guid) ) { #ifdef SCT_DEBUG ATH_MSG_DEBUG("createTransient(): New TP version - TP2 branch"); #endif std::unique_ptr< SCT_RawDataContainer_p2 > col_vect( poolReadObject< SCT_RawDataContainer_p2 >() ); - SCT_RDO_Container *res = m_converter_SCT_TP2.createTransient( col_vect.get(), msg() ); + SCT_RDO_Container* res = m_converter_SCT_TP2.createTransient( col_vect.get(), msg() ); #ifdef SCT_DEBUG ATH_MSG_DEBUG("createTransient(), TP2 branch: returns TRANS = "<<shortPrint(res)); #endif return res; } - else if( compareClassGuid(SCT_TP1_guid) ) { + else if ( compareClassGuid(SCT_TP1_guid) ) { #ifdef SCT_DEBUG ATH_MSG_DEBUG("createTransient(): New TP version - TP1 branch"); #endif std::unique_ptr< SCT_RawDataContainer_p1 > col_vect( poolReadObject< SCT_RawDataContainer_p1 >() ); - SCT_RDO_Container *res = m_converter_SCT_TP1.createTransient( col_vect.get(), msg() ); + SCT_RDO_Container* res = m_converter_SCT_TP1.createTransient( col_vect.get(), msg() ); #ifdef SCT_DEBUG ATH_MSG_DEBUG("createTransient(), TP1 branch: returns TRANS = "<<shortPrint(res)); #endif @@ -190,11 +205,11 @@ SCT_RDO_Container* SCT_RDO_ContainerCnv::createTransient() { } - else if( compareClassGuid(TP1_guid) ) { + else if ( compareClassGuid(TP1_guid) ) { ATH_MSG_DEBUG("createTransient(): New TP version - TP1 branch"); std::unique_ptr< InDetRawDataContainer_p1 > col_vect( poolReadObject< InDetRawDataContainer_p1 >() ); - SCT_RDO_Container *res = m_converter_TP1.createTransient( col_vect.get(), msg() ); + SCT_RDO_Container* res = m_converter_TP1.createTransient( col_vect.get(), msg() ); #ifdef SCT_DEBUG ATH_MSG_DEBUG("createTransient(), TP1 branch: returns TRANS = "<<shortPrint(res)); #endif @@ -202,12 +217,12 @@ SCT_RDO_Container* SCT_RDO_ContainerCnv::createTransient() { } - else if( compareClassGuid(p0_guid) ) { + else if ( compareClassGuid(p0_guid) ) { #ifdef SCT_DEBUG ATH_MSG_DEBUG("createTransient(): Old input file - p0 branch"); #endif std::unique_ptr< SCT_RDO_Container_p0 > col_vect( poolReadObject< SCT_RDO_Container_p0 >() ); - SCT_RDO_Container *res = m_converter_p0.createTransient( col_vect.get(), msg() ); + SCT_RDO_Container* res = m_converter_p0.createTransient( col_vect.get(), msg() ); #ifdef SCT_DEBUG ATH_MSG_DEBUG("createTransient(), p0 branch: returns TRANS = "<<shortPrint(res)); #endif diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv.h index f45e3ab03c8c99019281ff83f62ebd0497de673d..9ec56480296b67f4616a6c6e98b635a4635da629 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_RDO_CONTAINERCNV_H @@ -7,26 +7,25 @@ #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" -#include "InDetRawData/SCT_RDO_Container.h" - -#include "InDetRawData/SCT_RDO_Collection.h" - -#include "StoreGate/StoreGateSvc.h" - -#include "SCT_RDO_ContainerCnv_p0.h" -#include "SCT1_RawDataContainerCnv_p1.h" #include "SCT_RawDataContainerCnv_p1.h" #include "SCT_RawDataContainerCnv_p2.h" #include "SCT_RawDataContainerCnv_p3.h" +#include "SCT_RawDataContainerCnv_p4.h" +#include "SCT_RDO_ContainerCnv_p0.h" +#include "SCT1_RawDataContainerCnv_p1.h" + +#include "InDetRawData/SCT_RDO_Container.h" +#include "InDetRawData/SCT_RDO_Collection.h" +#include "StoreGate/StoreGateSvc.h" // the latest persistent representation type of DataCollection: -typedef SCT_RawDataContainer_p3 SCT_RDO_Container_PERS; -typedef SCT_RawDataContainerCnv_p3 SCT_RDO_ContainerCnv_PERS; +typedef SCT_RawDataContainer_p4 SCT_RDO_Container_PERS; +typedef SCT_RawDataContainerCnv_p4 SCT_RDO_ContainerCnv_PERS; -typedef T_AthenaPoolCustomCnv<SCT_RDO_Container, SCT_RDO_Container_PERS > SCT_RDO_ContainerCnvBase; +typedef T_AthenaPoolCustomCnv<SCT_RDO_Container, SCT_RDO_Container_PERS> SCT_RDO_ContainerCnvBase; class SCT_RDO_ContainerCnv : public SCT_RDO_ContainerCnvBase { - friend class CnvFactory<SCT_RDO_ContainerCnv >; + friend class CnvFactory<SCT_RDO_ContainerCnv>; // Converters need to be initialized (use ID helpers) // Thus they can't be local @@ -35,16 +34,17 @@ class SCT_RDO_ContainerCnv : public SCT_RDO_ContainerCnvBase { SCT_RawDataContainerCnv_p1 m_converter_SCT_TP1; SCT_RawDataContainerCnv_p2 m_converter_SCT_TP2; SCT_RawDataContainerCnv_p3 m_converter_SCT_TP3; + SCT_RawDataContainerCnv_p4 m_converter_SCT_TP4; SCT_RDO_ContainerCnv_PERS m_converter_PERS; // Should not be needed at some point. StoreGateSvc* m_storeGate; -protected: -public: + protected: + public: SCT_RDO_ContainerCnv (ISvcLocator* svcloc); -protected: - virtual SCT_RDO_Container_PERS* createPersistent (SCT_RDO_Container* transCont); + protected: + virtual SCT_RDO_Container_PERS* createPersistent (SCT_RDO_Container* transCont); virtual SCT_RDO_Container* createTransient (); // Must initialize ID helpers diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv_p0.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv_p0.cxx index cd8ae923550531e12f3fbbe725f625e22b4bcd19..30c5fad506c379ea9cc9b1b5d8415f8ef4b90258 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv_p0.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv_p0.cxx @@ -1,24 +1,19 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "SCT_RDO_ContainerCnv_p0.h" +#include "CreateTransientTemplate.h" + +#include "InDetIdentifier/SCT_ID.h" #include "InDetRawData/SCT_RDO_Container.h" #include "InDetRawData/SCT_RDO_Collection.h" -#include "InDetIdentifier/SCT_ID.h" - -#include <string> -#include <iostream> -#include <sstream> -#include "CreateTransientTemplate.h" //================================================================ SCT_RDO_Container* SCT_RDO_ContainerCnv_p0::createTransient(const SCT_RDO_Container_p0* persObj, MsgStream& log) { - std::unique_ptr<SCT_RDO_Container> trans(new SCT_RDO_Container(m_sctId->wafer_hash_max())); + std::unique_ptr<SCT_RDO_Container> trans(std::make_unique<SCT_RDO_Container>(m_sctId->wafer_hash_max())); - // MSG_DEBUG(log,"Read RDO vector, size " << persObj->size()); - SCT_RDO_Container_p0::const_iterator it = persObj->begin(); SCT_RDO_Container_p0::const_iterator last = persObj->end(); for (; it != last; ++it) { @@ -26,7 +21,7 @@ SCT_RDO_Container* SCT_RDO_ContainerCnv_p0::createTransient(const SCT_RDO_Contai // Old persistent format used collection templated on the specific raw data type const InDetRawDataCollection<SCT1_RawData>* rdoCollOld = *it; - if(!rdoCollOld) { + if (rdoCollOld==nullptr) { throw std::runtime_error("Got NULL collection reading old format SCT_RDO_Container"); } @@ -40,9 +35,7 @@ SCT_RDO_Container* SCT_RDO_ContainerCnv_p0::createTransient(const SCT_RDO_Contai } } - return(trans.release()); + return trans.release(); } //================================================================ - - diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv_p0.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv_p0.h index a2d01dae8d078edc1cdf034f33373699fa680df4..37cb1172add725e06234e18b597e51345bf58c4f 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv_p0.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RDO_ContainerCnv_p0.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_RDO_CONTAINERCNV_P0_H @@ -30,7 +30,7 @@ public: virtual SCT_RDO_Container* createTransient(const SCT_RDO_Container_p0* persObj, MsgStream& log); // ID helper can't be used in the constructor, need initialize() - void initialize(const SCT_ID *idhelper) { m_sctId = idhelper; } + void initialize(const SCT_ID* idhelper) { m_sctId = idhelper; } }; #endif/*SCT_RDO_CONTAINERCNV_P0_H*/ diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p1.cxx index f3662823a53e12424435e8a053a1b24091b43d0c..25674668fe590f03246dc78994403a65f433501b 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p1.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p1.cxx @@ -1,163 +1,151 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ -#include "InDetRawData/SCT3_RawData.h" +#include "SCT_RawDataContainerCnv_p1.h" + +#include "CreateTransientTemplate.h" +#include "MsgUtil.h" +#include "SCT1_RawDataCnv_p1.h" +#include "SCT3_RawDataCnv_p1.h" + #include "InDetEventAthenaPool/SCT3_RawData_p1.h" #include "InDetEventAthenaPool/InDetRawDataCollection_p1.h" -#include "InDetRawData/SCT_RDO_Container.h" -#include "MsgUtil.h" #include "InDetIdentifier/SCT_ID.h" +#include "InDetRawData/SCT_RDO_Container.h" #include "InDetRawData/SCT_RDO_Collection.h" -#include "SCT1_RawDataCnv_p1.h" -#include "SCT3_RawDataCnv_p1.h" -#include "SCT_RawDataContainerCnv_p1.h" -#include "CreateTransientTemplate.h" +#include "InDetRawData/SCT3_RawData.h" + +#include <memory> -void SCT_RawDataContainerCnv_p1::transToPers(const SCT_RDO_Container* transCont, SCT_RawDataContainer_p1* persCont, MsgStream& log) +void SCT_RawDataContainerCnv_p1::transToPers(const SCT_RDO_Container* transCont, SCT_RawDataContainer_p1* persCont, MsgStream& log) { - // The transient model has a container holding collections and the - // collections hold channels. - // - // The persistent model flattens this so that the persistent - // container has two vectors: - // 1) all collections, and - // 2) all RDO - // - // The persistent collections, then only maintain indexes into the - // container's vector of all channels. - // - // So here we loop over all collection and add their channels - // to the container's vector, saving the indexes in the - // collection. + // The transient model has a container holding collections and the + // collections hold channels. + // + // The persistent model flattens this so that the persistent + // container has two vectors: + // 1) all collections, and + // 2) all RDO + // + // The persistent collections, then only maintain indexes into the + // container's vector of all channels. + // + // So here we loop over all collection and add their channels + // to the container's vector, saving the indexes in the + // collection. - typedef SCT_RDO_Container TRANS; + typedef SCT_RDO_Container TRANS; - SCT1_RawDataCnv_p1 chan1Cnv; - SCT3_RawDataCnv_p1 chan3Cnv; - TRANS::const_iterator it_Coll = transCont->begin(); - TRANS::const_iterator it_CollEnd = transCont->end(); - unsigned int collIndex; - unsigned int chanBegin = 0; - unsigned int chanEnd = 0; - int numColl = transCont->numberOfCollections(); - //if(numColl == transCont->fullSize() ) { // let's count how many collections we have: - // numColl = 0; - // for ( ; it_Coll != it_CollEnd; it_Coll++) - // numColl++; - // it_Coll = transCont->begin(); // reset the iterator, we used it! - // } - persCont->m_collections.resize(numColl); - // MSG_DEBUG(log," Preparing " << persCont->m_collections.size() << "Collections"); + SCT1_RawDataCnv_p1 chan1Cnv; + SCT3_RawDataCnv_p1 chan3Cnv; + TRANS::const_iterator it_Coll = transCont->begin(); + TRANS::const_iterator it_CollEnd = transCont->end(); + unsigned int collIndex; + unsigned int chanBegin = 0; + unsigned int chanEnd = 0; + int numColl = transCont->numberOfCollections(); + persCont->m_collections.resize(numColl); - for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++) { - // Add in new collection - const SCT_RDO_Collection& collection = (**it_Coll); - chanBegin = chanEnd; - chanEnd += collection.size(); - InDetRawDataCollection_p1& pcollection = persCont->m_collections[collIndex]; - pcollection.m_id = collection.identify().get_compact(); - pcollection.m_hashId = (unsigned int) collection.identifyHash(); - pcollection.m_begin = chanBegin; - pcollection.m_end = chanEnd; - // MSG_VERBOSE(log,"Writing collection number " << collIndex << " with hash" << pcollection.m_hashId); - // Add in channels - if(m_type == 1) { - persCont->m_rawdata.resize(chanEnd); - for (unsigned int i = 0; i < collection.size(); ++i) { - InDetRawData_p1* pchan = &(persCont->m_rawdata[i + chanBegin]); - const SCT1_RawData* chan = dynamic_cast<const SCT1_RawData*>(collection[i]); - if (chan) { - chan1Cnv.transToPers(chan, pchan, log); - } - } - } else if (m_type == 3) { - persCont->m_sct3data.resize(chanEnd); - for (unsigned int i = 0; i < collection.size(); ++i) { - SCT3_RawData_p1* pchan = &(persCont->m_sct3data[i + chanBegin]); - const SCT3_RawData* chan = dynamic_cast<const SCT3_RawData*>(collection[i]); - if (chan) { - chan3Cnv.transToPers(chan, pchan, log); - } - } + for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++) { + // Add in new collection + const SCT_RDO_Collection& collection = (**it_Coll); + chanBegin = chanEnd; + chanEnd += collection.size(); + InDetRawDataCollection_p1& pcollection = persCont->m_collections[collIndex]; + pcollection.m_id = collection.identify().get_compact(); + pcollection.m_hashId = static_cast<unsigned int>(collection.identifyHash()); + pcollection.m_begin = chanBegin; + pcollection.m_end = chanEnd; + // Add in channels + if (m_type == 1) { + persCont->m_rawdata.resize(chanEnd); + for (unsigned int i = 0; i < collection.size(); ++i) { + InDetRawData_p1* pchan = &(persCont->m_rawdata[i + chanBegin]); + const SCT1_RawData* chan = dynamic_cast<const SCT1_RawData*>(collection[i]); + if (chan) { + chan1Cnv.transToPers(chan, pchan, log); + } + } + } else if (m_type == 3) { + persCont->m_sct3data.resize(chanEnd); + for (unsigned int i = 0; i < collection.size(); ++i) { + SCT3_RawData_p1* pchan = &(persCont->m_sct3data[i + chanBegin]); + const SCT3_RawData* chan = dynamic_cast<const SCT3_RawData*>(collection[i]); + if (chan) { + chan3Cnv.transToPers(chan, pchan, log); } + } } - // MSG_DEBUG(log," *** Writing SCT_RDO_Container (SCT1/3_RawData concrete type)"); + } } -void SCT_RawDataContainerCnv_p1::persToTrans(const SCT_RawDataContainer_p1* persCont, SCT_RDO_Container* transCont, MsgStream &log) +void SCT_RawDataContainerCnv_p1::persToTrans(const SCT_RawDataContainer_p1* persCont, SCT_RDO_Container* transCont, MsgStream& log) { - // The transient model has a container holding collections and the - // collections hold channels. - // - // The persistent model flattens this so that the persistent - // container has two vectors: - // 1) all collections, and - // 2) all channels - // - // The persistent collections, then only maintain indexes into the - // container's vector of all channels. - // - // So here we loop over all collection and extract their channels - // from the vector. + // The transient model has a container holding collections and the + // collections hold channels. + // + // The persistent model flattens this so that the persistent + // container has two vectors: + // 1) all collections, and + // 2) all channels + // + // The persistent collections, then only maintain indexes into the + // container's vector of all channels. + // + // So here we loop over all collection and extract their channels + // from the vector. + SCT1_RawDataCnv_p1 chan1Cnv; + SCT3_RawDataCnv_p1 chan3Cnv; + // check for the type of the contained objects: + // + if (persCont->m_rawdata.size() !=0 && persCont->m_sct3data.size() != 0) { + log << MSG::FATAL << "The collection has mixed SCT1 and SCT3 elements, this is not allowed " << endmsg; + } + if (persCont->m_rawdata.size() != 0 ) m_type = 1; + if (persCont->m_sct3data.size() != 0 ) m_type = 3; - SCT_RDO_Collection* coll = 0; - - SCT1_RawDataCnv_p1 chan1Cnv; - SCT3_RawDataCnv_p1 chan3Cnv; - // check for the type of the contained objects: - // - if(persCont->m_rawdata.size() !=0 && persCont->m_sct3data.size() != 0) - log << MSG::FATAL << "The collection has mixed SCT1 and SCT3 elements, this is not allowed " << endmsg; - if(persCont->m_rawdata.size() != 0 ) m_type = 1; - if(persCont->m_sct3data.size() != 0 ) m_type = 3; - - for (unsigned int icoll = 0; icoll < persCont->m_collections.size(); ++icoll) { - - // Create trans collection - in NOT owner of SCT_RDO_RawData (SG::VIEW_ELEMENTS) - // IDet collection don't have the Ownership policy c'tor - const InDetRawDataCollection_p1& pcoll = persCont->m_collections[icoll]; - Identifier collID(pcoll.m_id); - IdentifierHash collIDHash(IdentifierHash(pcoll.m_hashId)); - coll = new SCT_RDO_Collection(collIDHash ); - coll->setIdentifier(collID); - unsigned int nchans = pcoll.m_end - pcoll.m_begin; - coll->resize(nchans); - // MSG_VERBOSE(log,"Reading collection with id = " << pcoll.m_id << " id hash= " << pcoll.m_hashId << " and num el= " << nchans); - // Fill with channels - for (unsigned int ichan = 0; ichan < nchans; ++ ichan) { - if(m_type == 1) { - const InDetRawData_p1* pchan = &(persCont->m_rawdata[ichan + pcoll.m_begin]); - SCT1_RawData* chan = new SCT1_RawData(); - chan1Cnv.persToTrans(pchan, chan, log); - (*coll)[ichan] = chan; - } else if (m_type == 3) { - const SCT3_RawData_p1* pchan = &(persCont->m_sct3data[ichan + pcoll.m_begin]); - SCT3_RawData* chan = new SCT3_RawData(); - chan3Cnv.persToTrans(pchan, chan, log); - (*coll)[ichan] = chan; - } - } - - // register the rdo collection in IDC with hash - faster addCollection - StatusCode sc = transCont->addCollection(coll, collIDHash); - if (sc.isFailure()) { - throw std::runtime_error("Failed to add collection to ID Container"); - } - MSG_VERBOSE(log,"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id/coll id = " - << (int) collIDHash << " / " << collID.get_compact() << ", added to Identifiable container."); + for (unsigned int icoll = 0; icoll < persCont->m_collections.size(); ++icoll) { + // Create trans collection - in NOT owner of SCT_RDO_RawData (SG::VIEW_ELEMENTS) + // IDet collection don't have the Ownership policy c'tor + const InDetRawDataCollection_p1& pcoll = persCont->m_collections[icoll]; + Identifier collID(pcoll.m_id); + IdentifierHash collIDHash(IdentifierHash(pcoll.m_hashId)); + std::unique_ptr<SCT_RDO_Collection> coll = std::make_unique<SCT_RDO_Collection>(collIDHash); + coll->setIdentifier(collID); + unsigned int nchans = pcoll.m_end - pcoll.m_begin; + coll->resize(nchans); + // Fill with channels + for (unsigned int ichan = 0; ichan < nchans; ++ ichan) { + if (m_type == 1) { + const InDetRawData_p1* pchan = &(persCont->m_rawdata[ichan + pcoll.m_begin]); + std::unique_ptr<SCT1_RawData> chan = std::make_unique<SCT1_RawData>(); + chan1Cnv.persToTrans(pchan, chan.get(), log); + (*coll)[ichan] = chan.release(); + } else if (m_type == 3) { + const SCT3_RawData_p1* pchan = &(persCont->m_sct3data[ichan + pcoll.m_begin]); + std::unique_ptr<SCT3_RawData> chan = std::make_unique<SCT3_RawData>(); + chan3Cnv.persToTrans(pchan, chan.get(), log); + (*coll)[ichan] = chan.release(); + } } -// MSG_DEBUG(log," *** Reading SCT_RDO_Container (SCT1/3_RawData concrete type)"); + // register the rdo collection in IDC with hash - faster addCollection + StatusCode sc = transCont->addCollection(coll.release(), collIDHash); + if (sc.isFailure()) { + throw std::runtime_error("Failed to add collection to ID Container"); + } + MSG_VERBOSE(log,"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id/coll id = " + << collIDHash.value() << " / " << collID.get_compact() << ", added to Identifiable container."); + } } //================================================================ SCT_RDO_Container* SCT_RawDataContainerCnv_p1::createTransient(const SCT_RawDataContainer_p1* persObj, MsgStream& log) { - std::unique_ptr<SCT_RDO_Container> trans(new SCT_RDO_Container(m_sctId->wafer_hash_max())); - persToTrans(persObj, trans.get(), log); - return(trans.release()); + std::unique_ptr<SCT_RDO_Container> trans(std::make_unique<SCT_RDO_Container>(m_sctId->wafer_hash_max())); + persToTrans(persObj, trans.get(), log); + return trans.release(); } - diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p1.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p1.h index c3412e929be4295a9d6c920ea367392878673570..35c5f28ab61f7cc0e087116ba0f21a54eb97fe75 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p1.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p1.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_RAWDATACONTAINERCNV_P1_H @@ -8,11 +8,11 @@ // SCT_RawDataContainerCnv_p1, T/P separation of SCT Raw data // author D.Costanzo <davide.costanzo@cern.ch> -#include "InDetRawData/SCT_RDO_Container.h" #include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" #include "InDetEventAthenaPool/SCT_RawDataContainer_p1.h" -class SCT_ID; +#include "InDetRawData/SCT_RDO_Container.h" +class SCT_ID; // We do NOT use T_AthenaPoolTPCnvIDCont because we do all of the // conversion in the .cxx. Same as for the LAr Raw Channels @@ -25,22 +25,21 @@ class SCT_ID; class SCT_RawDataContainerCnv_p1 : public T_AthenaPoolTPCnvBase<SCT_RDO_Container, SCT_RawDataContainer_p1> { private: - const SCT_ID *m_sctId = nullptr; + const SCT_ID* m_sctId = nullptr; int m_type; public: SCT_RawDataContainerCnv_p1() :m_type(0) {}; - - virtual void persToTrans(const SCT_RawDataContainer_p1* persCont, - SCT_RDO_Container* transCont, - MsgStream &log) ; - virtual void transToPers(const SCT_RDO_Container* transCont, - SCT_RawDataContainer_p1* persCont, - MsgStream &log) ; - virtual SCT_RDO_Container* createTransient(const SCT_RawDataContainer_p1* persObj, MsgStream& log) ; + virtual void persToTrans(const SCT_RawDataContainer_p1* persCont, + SCT_RDO_Container* transCont, + MsgStream& log) ; + virtual void transToPers(const SCT_RDO_Container* transCont, + SCT_RawDataContainer_p1* persCont, + MsgStream& log) ; + virtual SCT_RDO_Container* createTransient(const SCT_RawDataContainer_p1* persObj, MsgStream& log) ; // ID helper can't be used in the constructor, need initialize() - void initialize(const SCT_ID *idhelper) { m_sctId = idhelper; } + void initialize(const SCT_ID* idhelper) { m_sctId = idhelper; } void setType(int type) {m_type = type; } }; diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p2.cxx index 0969bffbb6d863b719a6581515283822758b051a..af51eaa117df6b5aab6b9d84af6b80d4864b2ca7 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p2.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p2.cxx @@ -1,23 +1,26 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ -#include "InDetRawData/SCT3_RawData.h" -#include "InDetEventAthenaPool/SCT3_RawData_p2.h" -#include "InDetEventAthenaPool/InDetRawDataCollection_p1.h" -#include "InDetRawData/SCT_RDO_Container.h" +#include "SCT_RawDataContainerCnv_p2.h" + +#include "CreateTransientTemplate.h" #include "MsgUtil.h" +#include "SCT1_RawDataCnv_p1.h" +#include "SCT3_RawDataCnv_p2.h" +#include "InDetEventAthenaPool/InDetRawDataCollection_p1.h" +#include "InDetEventAthenaPool/SCT3_RawData_p2.h" #include "InDetIdentifier/SCT_ID.h" #include "InDetRawData/SCT_RDO_Collection.h" -#include "SCT1_RawDataCnv_p1.h" -#include "SCT3_RawDataCnv_p2.h" -#include "SCT_RawDataContainerCnv_p2.h" -#include "CreateTransientTemplate.h" +#include "InDetRawData/SCT_RDO_Container.h" +#include "InDetRawData/SCT3_RawData.h" + +#include <memory> //#define SCT_DEBUG -void SCT_RawDataContainerCnv_p2::transToPers(const SCT_RDO_Container* transCont, SCT_RawDataContainer_p2* persCont, MsgStream &log) +void SCT_RawDataContainerCnv_p2::transToPers(const SCT_RDO_Container* transCont, SCT_RawDataContainer_p2* persCont, MsgStream& log) { /// The transient model has a container holding collections and the @@ -29,7 +32,7 @@ void SCT_RawDataContainerCnv_p2::transToPers(const SCT_RDO_Container* transCont, /// 2) all RDO /// /// The persistent collections, then only maintain indexes into the - /// container's vector of all channels. + /// container's vector of all channels. /// /// So here we loop over all collection and add their channels /// to the container's vector, saving the indexes in the @@ -62,23 +65,23 @@ void SCT_RawDataContainerCnv_p2::transToPers(const SCT_RDO_Container* transCont, chanEnd += collection.size(); InDetRawDataCollection_p1& pcollection = persCont->m_collections[collIndex]; pcollection.m_id = collection.identify().get_compact(); - pcollection.m_hashId = (unsigned int) collection.identifyHash(); + pcollection.m_hashId = static_cast<unsigned int>(collection.identifyHash()); pcollection.m_begin = chanBegin; pcollection.m_end = chanEnd; #ifdef SCT_DEBUG MSG_DEBUG(log,"Writing collection number " << collIndex << " with hash" << pcollection.m_hashId); #endif /** Add in channels */ - if(m_type == 1) { + if (m_type == 1) { #ifdef SCT_DEBUG MSG_DEBUG(log,"SCT_RawDataContainerCnv_p2 m_type is 1"); #endif persCont->m_rawdata.resize(chanEnd); for (unsigned int i = 0; i < collection.size(); ++i) { - InDetRawData_p1* pchan = &(persCont->m_rawdata[i + chanBegin]); - const SCT1_RawData* chan = dynamic_cast<const SCT1_RawData*>(collection[i]); + InDetRawData_p1* pchan = &(persCont->m_rawdata[i + chanBegin]); + const SCT1_RawData* chan = dynamic_cast<const SCT1_RawData*>(collection[i]); if (chan) { - chan1Cnv.transToPers(chan, pchan, log); + chan1Cnv.transToPers(chan, pchan, log); } } } else if (m_type == 3) { @@ -87,15 +90,15 @@ void SCT_RawDataContainerCnv_p2::transToPers(const SCT_RDO_Container* transCont, #endif persCont->m_sct3data.resize(chanEnd); for (unsigned int i = 0; i < collection.size(); ++i) { - SCT3_RawData_p2* pchan = &(persCont->m_sct3data[i + chanBegin]); - const SCT3_RawData* chan = dynamic_cast<const SCT3_RawData*>(collection[i]); + SCT3_RawData_p2* pchan = &(persCont->m_sct3data[i + chanBegin]); + const SCT3_RawData* chan = dynamic_cast<const SCT3_RawData*>(collection[i]); if (chan) { - chan3Cnv.transToPers(chan, pchan, log); - const std::vector<int>& errHit = chan->getErrorCondensedHit(); - persCont->m_numErrorsInRDO.push_back(errHit.size() ); - persCont->m_allErrorsInContainer.insert (persCont->m_allErrorsInContainer.end(), - errHit.begin(), - errHit.end()); + chan3Cnv.transToPers(chan, pchan, log); + const std::vector<int>& errHit = chan->getErrorCondensedHit(); + persCont->m_numErrorsInRDO.push_back(errHit.size() ); + persCont->m_allErrorsInContainer.insert (persCont->m_allErrorsInContainer.end(), + errHit.begin(), + errHit.end()); } } } @@ -105,87 +108,87 @@ void SCT_RawDataContainerCnv_p2::transToPers(const SCT_RDO_Container* transCont, #endif } -void SCT_RawDataContainerCnv_p2::persToTrans(const SCT_RawDataContainer_p2* persCont, SCT_RDO_Container* transCont, MsgStream &log) +void SCT_RawDataContainerCnv_p2::persToTrans(const SCT_RawDataContainer_p2* persCont, SCT_RDO_Container* transCont, MsgStream& log) { - /// The transient model has a container holding collections and the - /// collections hold channels. - /// - /// The persistent model flattens this so that the persistent - /// container has two vectors: - /// 1) all collections, and - /// 2) all channels - /// - /// The persistent collections, then only maintain indexes into the - /// container's vector of all channels. - /// - /// So here we loop over all collection and extract their channels - /// from the vector. - - - SCT_RDO_Collection* coll = 0; - - SCT1_RawDataCnv_p1 chan1Cnv; - SCT3_RawDataCnv_p2 chan3Cnv; - /** check for the type of the contained objects: */ + /// The transient model has a container holding collections and the + /// collections hold channels. + /// + /// The persistent model flattens this so that the persistent + /// container has two vectors: + /// 1) all collections, and + /// 2) all channels + /// + /// The persistent collections, then only maintain indexes into the + /// container's vector of all channels. + /// + /// So here we loop over all collection and extract their channels + /// from the vector. + + + SCT1_RawDataCnv_p1 chan1Cnv; + SCT3_RawDataCnv_p2 chan3Cnv; + /** check for the type of the contained objects: */ - if(persCont->m_rawdata.size() !=0 && persCont->m_sct3data.size() != 0) - log << MSG::FATAL << "The collection has mixed SCT1 and SCT3 elements, this is not allowed " << endmsg; - if(persCont->m_rawdata.size() != 0 ) m_type = 1; - if(persCont->m_sct3data.size() != 0 ) m_type = 3; + if (persCont->m_rawdata.size() !=0 && persCont->m_sct3data.size() != 0) { + log << MSG::FATAL << "The collection has mixed SCT1 and SCT3 elements, this is not allowed " << endmsg; + } + if (persCont->m_rawdata.size() != 0 ) m_type = 1; + if (persCont->m_sct3data.size() != 0 ) m_type = 3; #ifdef SCT_DEBUG - MSG_DEBUG(log," Reading " << persCont->m_collections.size() << " Collections"); + MSG_DEBUG(log," Reading " << persCont->m_collections.size() << " Collections"); #endif - int errCount = 0; - for (unsigned int icoll = 0; icoll < persCont->m_collections.size(); ++icoll) { - - /** Create trans collection - in NOT owner of SCT_RDO_RawData (SG::VIEW_ELEMENTS) - * IDet collection don't have the Ownership policy c'tor */ - const InDetRawDataCollection_p1& pcoll = persCont->m_collections[icoll]; - Identifier collID(pcoll.m_id); - IdentifierHash collIDHash(pcoll.m_hashId); - coll = new SCT_RDO_Collection(IdentifierHash(collIDHash)); - coll->setIdentifier(collID); - unsigned int nchans = pcoll.m_end - pcoll.m_begin; - - coll->resize(nchans); + int errCount = 0; + for (unsigned int icoll = 0; icoll < persCont->m_collections.size(); ++icoll) { + + /** Create trans collection - in NOT owner of SCT_RDO_RawData (SG::VIEW_ELEMENTS) + * IDet collection don't have the Ownership policy c'tor */ + const InDetRawDataCollection_p1& pcoll = persCont->m_collections[icoll]; + Identifier collID(pcoll.m_id); + IdentifierHash collIDHash(pcoll.m_hashId); + std::unique_ptr<SCT_RDO_Collection> coll = std::make_unique<SCT_RDO_Collection>(IdentifierHash(collIDHash)); + coll->setIdentifier(collID); + unsigned int nchans = pcoll.m_end - pcoll.m_begin; + + coll->resize(nchans); #ifdef SCT_DEBUG - MSG_DEBUG(log,"Reading collection with id = " << pcoll.m_id << " id hash= " << pcoll.m_hashId - << " and num el= " << nchans << " m_type is "<<m_type); + MSG_DEBUG(log,"Reading collection with id = " << pcoll.m_id << " id hash= " << pcoll.m_hashId + << " and num el= " << nchans << " m_type is "<<m_type); #endif - // Fill with channels - for (unsigned int ichan = 0; ichan < nchans; ++ ichan) { - if(m_type == 1) { - const InDetRawData_p1* pchan = &(persCont->m_rawdata[ichan + pcoll.m_begin]); - SCT1_RawData* chan = new SCT1_RawData(); - chan1Cnv.persToTrans(pchan, chan, log); - (*coll)[ichan] = chan; - } else if (m_type == 3) { - const SCT3_RawData_p2* pchan = &(persCont->m_sct3data[ichan + pcoll.m_begin]); - /** now need to fill the vector of errors for the transient RDO - * using the vectors stored in the persistent collection */ - std::vector<int> errorCondensedHit; - int errEnd = errCount + persCont->m_numErrorsInRDO[ichan + pcoll.m_begin]; - for ( ; errCount < errEnd ; ++errCount) - errorCondensedHit.push_back(persCont->m_allErrorsInContainer[errCount]); - - (*coll)[ichan] = new SCT3_RawData (Identifier (pchan->m_rdoId), - pchan->m_word, - std::move(errorCondensedHit)); - } + // Fill with channels + for (unsigned int ichan = 0; ichan < nchans; ++ ichan) { + if (m_type == 1) { + const InDetRawData_p1* pchan = &(persCont->m_rawdata[ichan + pcoll.m_begin]); + std::unique_ptr<SCT1_RawData> chan = std::make_unique<SCT1_RawData>(); + chan1Cnv.persToTrans(pchan, chan.get(), log); + (*coll)[ichan] = chan.release(); + } else if (m_type == 3) { + const SCT3_RawData_p2* pchan = &(persCont->m_sct3data[ichan + pcoll.m_begin]); + /** now need to fill the vector of errors for the transient RDO + * using the vectors stored in the persistent collection */ + std::vector<int> errorCondensedHit; + int errEnd = errCount + persCont->m_numErrorsInRDO[ichan + pcoll.m_begin]; + for ( ; errCount < errEnd ; ++errCount) { + errorCondensedHit.push_back(persCont->m_allErrorsInContainer[errCount]); } + std::unique_ptr<SCT3_RawData> chan = std::make_unique<SCT3_RawData>(Identifier(pchan->m_rdoId), + pchan->m_word, + std::move(errorCondensedHit)); + (*coll)[ichan] = chan.release(); + } + } - // register the rdo collection in IDC with hash - faster addCollection - StatusCode sc = transCont->addCollection(coll, collIDHash); - if (sc.isFailure()) { - throw std::runtime_error("Failed to add collection to ID Container"); - } - MSG_VERBOSE(log,"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id/coll id = " - << (int) collIDHash << " / " << collID.get_compact() << ", added to Identifiable container."); - + // register the rdo collection in IDC with hash - faster addCollection + StatusCode sc = transCont->addCollection(coll.release(), collIDHash); + if (sc.isFailure()) { + throw std::runtime_error("Failed to add collection to ID Container"); } + MSG_VERBOSE(log,"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id/coll id = " + << collIDHash.value() << " / " << collID.get_compact() << ", added to Identifiable container."); + + } #ifdef SCT_DEBUG - MSG_DEBUG(log," *** Reading SCT_RDO_Container (SCT1/3_RawData concrete type)"); + MSG_DEBUG(log," *** Reading SCT_RDO_Container (SCT1/3_RawData concrete type)"); #endif } @@ -194,8 +197,7 @@ SCT_RDO_Container* SCT_RawDataContainerCnv_p2::createTransient(const SCT_RawData #ifdef SCT_DEBUG MSG_DEBUG(log,"creating transient SCT_RDO_Container"); #endif - std::unique_ptr<SCT_RDO_Container> trans(new SCT_RDO_Container(m_sctId->wafer_hash_max())); + std::unique_ptr<SCT_RDO_Container> trans(std::make_unique<SCT_RDO_Container>(m_sctId->wafer_hash_max())); persToTrans(persObj, trans.get(), log); - return(trans.release()); + return trans.release(); } - diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p2.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p2.h index de4627d316d6be60ff464ca50081fa29b9c8021b..2c13183055b4b4bf3082d64bb342978d625ba0a4 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p2.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p2.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_RAWDATACONTAINERCNV_P2_H @@ -8,11 +8,12 @@ // SCT_RawDataContainerCnv_p2, T/P separation of SCT Raw data // author D.Costanzo <davide.costanzo@cern.ch> -#include "InDetRawData/SCT_RDO_Container.h" #include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + #include "InDetEventAthenaPool/SCT_RawDataContainer_p2.h" -class SCT_ID; +#include "InDetRawData/SCT_RDO_Container.h" +class SCT_ID; // We do NOT use T_AthenaPoolTPCnvIDCont because we do all of the // conversion in the .cxx. Same as for the LAr Raw Channels @@ -25,22 +26,21 @@ class SCT_ID; class SCT_RawDataContainerCnv_p2 : public T_AthenaPoolTPCnvBase<SCT_RDO_Container, SCT_RawDataContainer_p2> { private: - const SCT_ID *m_sctId = nullptr; + const SCT_ID* m_sctId = nullptr; int m_type; public: SCT_RawDataContainerCnv_p2() :m_type(0) {}; - virtual void persToTrans(const SCT_RawDataContainer_p2* persCont, - SCT_RDO_Container* transCont, - MsgStream &log) ; - virtual void transToPers(const SCT_RDO_Container* transCont, - SCT_RawDataContainer_p2* persCont, - MsgStream &log) ; + virtual void persToTrans(const SCT_RawDataContainer_p2* persCont, + SCT_RDO_Container* transCont, + MsgStream& log) ; + virtual void transToPers(const SCT_RDO_Container* transCont, + SCT_RawDataContainer_p2* persCont, + MsgStream& log) ; virtual SCT_RDO_Container* createTransient(const SCT_RawDataContainer_p2* persObj, MsgStream& log) ; - // ID helper can't be used in the constructor, need initialize() - void initialize(const SCT_ID *idhelper) { m_sctId = idhelper; } + void initialize(const SCT_ID* idhelper) { m_sctId = idhelper; } void setType(int type) {m_type = type; } }; diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p3.cxx index aea64947824145cc380fba82171c4f5e4f41e872..9c0551321701ee64a7725edcc21f515e03c3fff6 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p3.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p3.cxx @@ -1,23 +1,26 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ -#include "InDetRawData/SCT3_RawData.h" -#include "InDetEventAthenaPool/SCT3_RawData_p3.h" -#include "InDetEventAthenaPool/InDetRawDataCollection_p1.h" -#include "InDetRawData/SCT_RDO_Container.h" +#include "SCT_RawDataContainerCnv_p3.h" + +#include "CreateTransientTemplate.h" #include "MsgUtil.h" +#include "SCT1_RawDataCnv_p2.h" +#include "SCT3_RawDataCnv_p3.h" +#include "InDetEventAthenaPool/InDetRawDataCollection_p1.h" +#include "InDetEventAthenaPool/SCT3_RawData_p3.h" #include "InDetIdentifier/SCT_ID.h" #include "InDetRawData/SCT_RDO_Collection.h" -#include "SCT1_RawDataCnv_p2.h" -#include "SCT3_RawDataCnv_p3.h" -#include "SCT_RawDataContainerCnv_p3.h" -#include "CreateTransientTemplate.h" +#include "InDetRawData/SCT_RDO_Container.h" +#include "InDetRawData/SCT3_RawData.h" + +#include <memory> //#define SCT_DEBUG -void SCT_RawDataContainerCnv_p3::transToPers(const SCT_RDO_Container* transCont, SCT_RawDataContainer_p3* persCont, MsgStream &log) +void SCT_RawDataContainerCnv_p3::transToPers(const SCT_RDO_Container* transCont, SCT_RawDataContainer_p3* persCont, MsgStream& log) { /// The transient model has a container holding collections and the @@ -29,11 +32,11 @@ void SCT_RawDataContainerCnv_p3::transToPers(const SCT_RDO_Container* transCont, /// 2) all RDO /// /// The persistent collections, then only maintain indexes into the - /// container's vector of all channels. + /// container's vector of all channels. /// /// So here we loop over all collection and add their channels /// to the container's vector, saving the indexes in the - /// collection. + /// collection. typedef SCT_RDO_Container TRANS; @@ -62,14 +65,14 @@ void SCT_RawDataContainerCnv_p3::transToPers(const SCT_RDO_Container* transCont, chanEnd += collection.size(); InDetRawDataCollection_p1& pcollection = persCont->m_collections[collIndex]; pcollection.m_id = collection.identify().get_identifier32().get_compact(); - pcollection.m_hashId = (unsigned int) collection.identifyHash(); + pcollection.m_hashId = static_cast<unsigned int>(collection.identifyHash()); pcollection.m_begin = chanBegin; pcollection.m_end = chanEnd; #ifdef SCT_DEBUG MSG_DEBUG(log,"Writing collection number " << collIndex << " with hash" << pcollection.m_hashId); #endif /** Add in channels */ - if(m_type == 1) { + if (m_type == 1) { #ifdef SCT_DEBUG MSG_DEBUG(log,"SCT_RawDataContainerCnv_p3 m_type is 1"); #endif @@ -77,7 +80,7 @@ void SCT_RawDataContainerCnv_p3::transToPers(const SCT_RDO_Container* transCont, for (unsigned int i = 0; i < collection.size(); ++i) { InDetRawData_p2* pchan = &(persCont->m_rawdata[i + chanBegin]); const SCT1_RawData* chan = dynamic_cast<const SCT1_RawData*>(collection[i]); - if (0 == chan) throw std::runtime_error("SCT_RawDataContainerCnv_p3::transToPers: *** UNABLE TO DYNAMIC CAST TO SCT1_RawData"); + if (nullptr == chan) throw std::runtime_error("SCT_RawDataContainerCnv_p3::transToPers: *** UNABLE TO DYNAMIC CAST TO SCT1_RawData"); chan1Cnv.transToPers(chan, pchan, log); } } else if (m_type == 3) { @@ -88,13 +91,13 @@ void SCT_RawDataContainerCnv_p3::transToPers(const SCT_RDO_Container* transCont, for (unsigned int i = 0; i < collection.size(); ++i) { SCT3_RawData_p3* pchan = &(persCont->m_sct3data[i + chanBegin]); const SCT3_RawData* chan = dynamic_cast<const SCT3_RawData*>(collection[i]); - if (0 == chan) throw std::runtime_error("SCT_RawDataContainerCnv_p3::transToPers: *** UNABLE TO DYNAMIC CAST TO SCT3_RawData"); + if (nullptr == chan) throw std::runtime_error("SCT_RawDataContainerCnv_p3::transToPers: *** UNABLE TO DYNAMIC CAST TO SCT3_RawData"); chan3Cnv.transToPers(chan, pchan, log); const std::vector<int>& errHit = chan->getErrorCondensedHit(); persCont->m_numErrorsInRDO.push_back(errHit.size() ); - persCont->m_allErrorsInContainer.insert (persCont->m_allErrorsInContainer.end(), - errHit.begin(), - errHit.end()); + persCont->m_allErrorsInContainer.insert(persCont->m_allErrorsInContainer.end(), + errHit.begin(), + errHit.end()); } } } @@ -103,86 +106,87 @@ void SCT_RawDataContainerCnv_p3::transToPers(const SCT_RDO_Container* transCont, #endif } -void SCT_RawDataContainerCnv_p3::persToTrans(const SCT_RawDataContainer_p3* persCont, SCT_RDO_Container* transCont, MsgStream &log) +void SCT_RawDataContainerCnv_p3::persToTrans(const SCT_RawDataContainer_p3* persCont, SCT_RDO_Container* transCont, MsgStream& log) { - /// The transient model has a container holding collections and the - /// collections hold channels. - /// - /// The persistent model flattens this so that the persistent - /// container has two vectors: - /// 1) all collections, and - /// 2) all channels - /// - /// The persistent collections, then only maintain indexes into the - /// container's vector of all channels. - /// - /// So here we loop over all collection and extract their channels - /// from the vector. - - - SCT_RDO_Collection* coll = 0; - - SCT1_RawDataCnv_p2 chan1Cnv; - SCT3_RawDataCnv_p3 chan3Cnv; - /** check for the type of the contained objects: */ + /// The transient model has a container holding collections and the + /// collections hold channels. + /// + /// The persistent model flattens this so that the persistent + /// container has two vectors: + /// 1) all collections, and + /// 2) all channels + /// + /// The persistent collections, then only maintain indexes into the + /// container's vector of all channels. + /// + /// So here we loop over all collection and extract their channels + /// from the vector. + + + SCT1_RawDataCnv_p2 chan1Cnv; + SCT3_RawDataCnv_p3 chan3Cnv; + /** check for the type of the contained objects: */ - if(persCont->m_rawdata.size() !=0 && persCont->m_sct3data.size() != 0) - log << MSG::FATAL << "The collection has mixed SCT1 and SCT3 elements, this is not allowed " << endmsg; - if(persCont->m_rawdata.size() != 0 ) m_type = 1; - if(persCont->m_sct3data.size() != 0 ) m_type = 3; + if (persCont->m_rawdata.size() !=0 && persCont->m_sct3data.size() != 0) { + log << MSG::FATAL << "The collection has mixed SCT1 and SCT3 elements, this is not allowed " << endmsg; + } + if (persCont->m_rawdata.size() != 0 ) m_type = 1; + if (persCont->m_sct3data.size() != 0 ) m_type = 3; #ifdef SCT_DEBUG - MSG_DEBUG(log," Reading " << persCont->m_collections.size() << " Collections"); + MSG_DEBUG(log," Reading " << persCont->m_collections.size() << " Collections"); #endif - int errCount = 0; - for (unsigned int icoll = 0; icoll < persCont->m_collections.size(); ++icoll) { - - /** Create trans collection - in NOT owner of SCT_RDO_RawData (SG::VIEW_ELEMENTS) - * IDet collection don't have the Ownership policy c'tor */ - const InDetRawDataCollection_p1& pcoll = persCont->m_collections[icoll]; - Identifier collID(pcoll.m_id); - IdentifierHash collIDHash(pcoll.m_hashId); - coll = new SCT_RDO_Collection(IdentifierHash(collIDHash)); - coll->setIdentifier(collID); - unsigned int nchans = pcoll.m_end - pcoll.m_begin; - - coll->resize(nchans); + int errCount = 0; + for (unsigned int icoll = 0; icoll < persCont->m_collections.size(); ++icoll) { + + /** Create trans collection - in NOT owner of SCT_RDO_RawData (SG::VIEW_ELEMENTS) + * IDet collection don't have the Ownership policy c'tor */ + const InDetRawDataCollection_p1& pcoll = persCont->m_collections[icoll]; + Identifier collID(pcoll.m_id); + IdentifierHash collIDHash(pcoll.m_hashId); + std::unique_ptr<SCT_RDO_Collection> coll = std::make_unique<SCT_RDO_Collection>(IdentifierHash(collIDHash)); + coll->setIdentifier(collID); + unsigned int nchans = pcoll.m_end - pcoll.m_begin; + + coll->resize(nchans); #ifdef SCT_DEBUG - MSG_DEBUG(log,"Reading collection with id = " << pcoll.m_id << " id hash= " << pcoll.m_hashId - << " and num el= " << nchans << " m_type is "<<m_type); + MSG_DEBUG(log,"Reading collection with id = " << pcoll.m_id << " id hash= " << pcoll.m_hashId + << " and num el= " << nchans << " m_type is "<<m_type); #endif - // Fill with channels - for (unsigned int ichan = 0; ichan < nchans; ++ ichan) { - if(m_type == 1) { - const InDetRawData_p2* pchan = &(persCont->m_rawdata[ichan + pcoll.m_begin]); - SCT1_RawData* chan = new SCT1_RawData(); - chan1Cnv.persToTrans(pchan, chan, log); - (*coll)[ichan] = chan; - } else if (m_type == 3) { - const SCT3_RawData_p3* pchan = &(persCont->m_sct3data[ichan + pcoll.m_begin]); - /** now need to fill the vector of errors for the transient RDO - * using the vectors stored in the persistent collection */ - std::vector<int> errorCondensedHit; - int errEnd = errCount + persCont->m_numErrorsInRDO[ichan + pcoll.m_begin]; - for ( ; errCount < errEnd ; ++errCount) - errorCondensedHit.push_back(persCont->m_allErrorsInContainer[errCount]); - (*coll)[ichan] = new SCT3_RawData (Identifier (pchan->m_rdoId), - pchan->m_word, - std::move (errorCondensedHit)); - } + // Fill with channels + for (unsigned int ichan = 0; ichan < nchans; ++ ichan) { + if (m_type == 1) { + const InDetRawData_p2* pchan = &(persCont->m_rawdata[ichan + pcoll.m_begin]); + std::unique_ptr<SCT1_RawData> chan = std::make_unique<SCT1_RawData>(); + chan1Cnv.persToTrans(pchan, chan.get(), log); + (*coll)[ichan] = chan.release(); + } else if (m_type == 3) { + const SCT3_RawData_p3* pchan = &(persCont->m_sct3data[ichan + pcoll.m_begin]); + /** now need to fill the vector of errors for the transient RDO + * using the vectors stored in the persistent collection */ + std::vector<int> errorCondensedHit; + int errEnd = errCount + persCont->m_numErrorsInRDO[ichan + pcoll.m_begin]; + for ( ; errCount < errEnd ; ++errCount) { + errorCondensedHit.push_back(persCont->m_allErrorsInContainer[errCount]); } + std::unique_ptr<SCT3_RawData> chan = std::make_unique<SCT3_RawData>(Identifier(pchan->m_rdoId), + pchan->m_word, + std::move (errorCondensedHit)); + (*coll)[ichan] = chan.release(); + } + } - // register the rdo collection in IDC with hash - faster addCollection - StatusCode sc = transCont->addCollection(coll, collIDHash); - if (sc.isFailure()) { - throw std::runtime_error("Failed to add collection to ID Container"); - } - MSG_VERBOSE(log,"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id/coll id = " - << (int) collIDHash << " / " << collID.get_compact() << ", added to Identifiable container."); - + // register the rdo collection in IDC with hash - faster addCollection + StatusCode sc = transCont->addCollection(coll.release(), collIDHash); + if (sc.isFailure()) { + throw std::runtime_error("Failed to add collection to ID Container"); } + MSG_VERBOSE(log,"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id/coll id = " + << collIDHash.value() << " / " << collID.get_compact() << ", added to Identifiable container."); + + } #ifdef SCT_DEBUG - MSG_DEBUG(log," *** Reading SCT_RDO_Container (SCT1/3_RawData concrete type)"); + MSG_DEBUG(log," *** Reading SCT_RDO_Container (SCT1/3_RawData concrete type)"); #endif } @@ -191,8 +195,7 @@ SCT_RDO_Container* SCT_RawDataContainerCnv_p3::createTransient(const SCT_RawData #ifdef SCT_DEBUG MSG_DEBUG(log,"creating transient SCT_RDO_Container"); #endif - std::unique_ptr<SCT_RDO_Container> trans(new SCT_RDO_Container(m_sctId->wafer_hash_max())); + std::unique_ptr<SCT_RDO_Container> trans(std::make_unique<SCT_RDO_Container>(m_sctId->wafer_hash_max())); persToTrans(persObj, trans.get(), log); - return(trans.release()); + return trans.release(); } - diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p3.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p3.h index a1b11a6aeb806f6150f630173d8bdcda80c57874..7a9c292b0d1e0fea2c6f38b0fc9dc5bdbfb9a42f 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p3.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p3.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_RAWDATACONTAINERCNV_P3_H @@ -8,11 +8,12 @@ // SCT_RawDataContainerCnv_p3, T/P separation of SCT Raw data // author D.Costanzo <davide.costanzo@cern.ch> -#include "InDetRawData/SCT_RDO_Container.h" #include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + #include "InDetEventAthenaPool/SCT_RawDataContainer_p3.h" -class SCT_ID; +#include "InDetRawData/SCT_RDO_Container.h" +class SCT_ID; // We do NOT use T_AthenaPoolTPCnvIDCont because we do all of the // conversion in the .cxx. Same as for the LAr Raw Channels @@ -25,22 +26,22 @@ class SCT_ID; class SCT_RawDataContainerCnv_p3 : public T_AthenaPoolTPCnvBase<SCT_RDO_Container, SCT_RawDataContainer_p3> { private: - const SCT_ID *m_sctId; + const SCT_ID* m_sctId; int m_type; public: - SCT_RawDataContainerCnv_p3() : m_sctId(0), m_type(0) {}; + SCT_RawDataContainerCnv_p3() : m_sctId(nullptr), m_type(0) {}; - virtual void persToTrans(const SCT_RawDataContainer_p3* persCont, - SCT_RDO_Container* transCont, - MsgStream &log) ; - virtual void transToPers(const SCT_RDO_Container* transCont, - SCT_RawDataContainer_p3* persCont, - MsgStream &log) ; + virtual void persToTrans(const SCT_RawDataContainer_p3* persCont, + SCT_RDO_Container* transCont, + MsgStream& log) ; + virtual void transToPers(const SCT_RDO_Container* transCont, + SCT_RawDataContainer_p3* persCont, + MsgStream& log) ; virtual SCT_RDO_Container* createTransient(const SCT_RawDataContainer_p3* persObj, MsgStream& log) ; // ID helper can't be used in the constructor, need initialize() - void initialize(const SCT_ID *idhelper) { m_sctId = idhelper; } + void initialize(const SCT_ID* idhelper) { m_sctId = idhelper; } void setType(int type) {m_type = type; } }; diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p4.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p4.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7e4c38bbd3696c962532e98e0fac6847558d2fe4 --- /dev/null +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p4.cxx @@ -0,0 +1,185 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SCT_RawDataContainerCnv_p4.h" + +#include "CreateTransientTemplate.h" +#include "MsgUtil.h" +#include "SCT1_RawDataCnv_p2.h" +#include "SCT3_RawDataCnv_p4.h" + +#include "InDetIdentifier/SCT_ID.h" +#include "InDetEventAthenaPool/SCT3_RawData_p4.h" +#include "InDetEventAthenaPool/InDetRawDataCollection_p1.h" +#include "InDetRawData/SCT_RDO_Container.h" +#include "InDetRawData/SCT_RDO_Collection.h" +#include "InDetRawData/SCT3_RawData.h" + +#include <memory> + +//#define SCT_DEBUG + +void SCT_RawDataContainerCnv_p4::transToPers(const SCT_RDO_Container* transCont, SCT_RawDataContainer_p4* persCont, MsgStream& log) +{ + + /// The transient model has a container holding collections and the + /// collections hold channels. + /// + /// The persistent model flattens this so that the persistent + /// container has two vectors: + /// 1) all collections, and + /// 2) all RDO + /// + /// The persistent collections, then only maintain indexes into the + /// container's vector of all channels. + /// + /// So here we loop over all collection and add their channels + /// to the container's vector, saving the indexes in the + /// collection. + + typedef SCT_RDO_Container TRANS; + + SCT1_RawDataCnv_p2 chan1Cnv; + SCT3_RawDataCnv_p4 chan3Cnv(m_sctId); + TRANS::const_iterator it_Coll = transCont->begin(); + TRANS::const_iterator it_CollEnd = transCont->end(); + unsigned int collIndex; + unsigned int chanBegin = 0; + unsigned int chanEnd = 0; + int numColl = transCont->numberOfCollections(); + persCont->m_collections.resize(numColl); +#ifdef SCT_DEBUG + MSG_DEBUG(log,"SCT_RawDataContainerCnv_p4 Preparing " << persCont->m_collections.size() << "Collections"); +#endif + + /** we're going to store all the strip errors from each RDO + * in vectors in the collection */ + + for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, it_Coll++) { + /** Add in new collection */ + const SCT_RDO_Collection& collection = (**it_Coll); + chanBegin = chanEnd; + chanEnd += collection.size(); + InDetRawDataCollection_p1& pcollection = persCont->m_collections[collIndex]; + pcollection.m_id = collection.identify().get_identifier32().get_compact(); + pcollection.m_hashId = static_cast<unsigned int>(collection.identifyHash()); + pcollection.m_begin = chanBegin; + pcollection.m_end = chanEnd; +#ifdef SCT_DEBUG + MSG_DEBUG(log,"Writing collection number " << collIndex << " with hash" << pcollection.m_hashId); +#endif + /** Add in channels */ + if (m_type == 1) { +#ifdef SCT_DEBUG + MSG_DEBUG(log,"SCT_RawDataContainerCnv_p4 m_type is 1"); +#endif + persCont->m_rawdata.resize(chanEnd); + for (unsigned int i = 0; i < collection.size(); ++i) { + InDetRawData_p2* pchan = &(persCont->m_rawdata[i + chanBegin]); + const SCT1_RawData* chan = dynamic_cast<const SCT1_RawData*>(collection[i]); + chan1Cnv.transToPers(chan, pchan, log); + } + } else if (m_type == 3) { +#ifdef SCT_DEBUG + MSG_DEBUG(log,"SCT_RawDataContainerCnv_p4 m_type is 3"); +#endif + persCont->m_sct3data.resize(chanEnd); + for (unsigned int i = 0; i < collection.size(); ++i) { + SCT3_RawData_p4* pchan = &(persCont->m_sct3data[i + chanBegin]); + const SCT3_RawData* chan = dynamic_cast<const SCT3_RawData*>(collection[i]); + if (nullptr == chan) throw std::runtime_error("SCT_RawDataContainerCnv_p4::transToPers: *** UNABLE TO DYNAMIC CAST TO SCT3_RawData"); + chan3Cnv.transToPers(chan, pchan, log); + } + } + } +#ifdef SCT_DEBUG + MSG_DEBUG(log," *** Writing SCT_RDO_Container (SCT1/3_RawData concrete type)"); +#endif +} + +void SCT_RawDataContainerCnv_p4::persToTrans(const SCT_RawDataContainer_p4* persCont, SCT_RDO_Container* transCont, MsgStream& log) +{ + + /// The transient model has a container holding collections and the + /// collections hold channels. + /// + /// The persistent model flattens this so that the persistent + /// container has two vectors: + /// 1) all collections, and + /// 2) all channels + /// + /// The persistent collections, then only maintain indexes into the + /// container's vector of all channels. + /// + /// So here we loop over all collection and extract their channels + /// from the vector. + + + SCT1_RawDataCnv_p2 chan1Cnv; + SCT3_RawDataCnv_p4 chan3Cnv(m_sctId); + /** check for the type of the contained objects: */ + + if (persCont->m_rawdata.size() !=0 && persCont->m_sct3data.size() != 0) { + log << MSG::FATAL << "The collection has mixed SCT1 and SCT3 elements, this is not allowed " << endmsg; + } + if (persCont->m_rawdata.size() != 0 ) m_type = 1; + if (persCont->m_sct3data.size() != 0 ) m_type = 3; +#ifdef SCT_DEBUG + MSG_DEBUG(log," Reading " << persCont->m_collections.size() << " Collections"); +#endif + for (unsigned int icoll = 0; icoll < persCont->m_collections.size(); ++icoll) { + + /** Create trans collection - in NOT owner of SCT_RDO_RawData (SG::VIEW_ELEMENTS) + * IDet collection don't have the Ownership policy c'tor */ + const InDetRawDataCollection_p1& pcoll = persCont->m_collections[icoll]; + Identifier collID(pcoll.m_id); + chan3Cnv.setWaferId(collID); + IdentifierHash collIDHash(pcoll.m_hashId); + std::unique_ptr<SCT_RDO_Collection> coll = std::make_unique<SCT_RDO_Collection>(IdentifierHash(collIDHash)); + coll->setIdentifier(collID); + unsigned int nchans = pcoll.m_end - pcoll.m_begin; + + coll->resize(nchans); +#ifdef SCT_DEBUG + MSG_DEBUG(log,"Reading collection with id = " << pcoll.m_id << " id hash= " << pcoll.m_hashId + << " and num el= " << nchans << " m_type is "<<m_type); +#endif + // Fill with channels + for (unsigned int ichan = 0; ichan < nchans; ++ ichan) { + if (m_type == 1) { + const InDetRawData_p2* pchan = &(persCont->m_rawdata[ichan + pcoll.m_begin]); + std::unique_ptr<SCT1_RawData> chan = std::make_unique<SCT1_RawData>(); + chan1Cnv.persToTrans(pchan, chan.get(), log); + (*coll)[ichan] = chan.release(); + } else if (m_type == 3) { + const SCT3_RawData_p4* pchan = &(persCont->m_sct3data[ichan + pcoll.m_begin]); + std::unique_ptr<SCT3_RawData> chan = std::make_unique<SCT3_RawData>(); + chan3Cnv.persToTrans(pchan, chan.get(), log); + (*coll)[ichan] = chan.release(); + } + } + + // register the rdo collection in IDC with hash - faster addCollection + StatusCode sc = transCont->addCollection(coll.release(), collIDHash); + if (sc.isFailure()) { + throw std::runtime_error("Failed to add collection to ID Container"); + } + MSG_VERBOSE(log,"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id/coll id = " + << collIDHash.value() << " / " << collID.get_compact() << ", added to Identifiable container."); + + } +#ifdef SCT_DEBUG + MSG_DEBUG(log," *** Reading SCT_RDO_Container (SCT1/3_RawData concrete type)"); +#endif +} + +//================================================================ +SCT_RDO_Container* SCT_RawDataContainerCnv_p4::createTransient(const SCT_RawDataContainer_p4* persObj, MsgStream& log) { +#ifdef SCT_DEBUG + MSG_DEBUG(log,"creating transient SCT_RDO_Container"); +#endif + std::unique_ptr<SCT_RDO_Container> trans(std::make_unique<SCT_RDO_Container>(m_sctId->wafer_hash_max())); + persToTrans(persObj, trans.get(), log); + return trans.release(); +} diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p4.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p4.h new file mode 100644 index 0000000000000000000000000000000000000000..67276a43eb9ef359c07c9a400a3c6f9f03d01100 --- /dev/null +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/SCT_RawDataContainerCnv_p4.h @@ -0,0 +1,47 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SCT_RAWDATACONTAINERCNV_P4_H +#define SCT_RAWDATACONTAINERCNV_P4_H + +// SCT_RawDataContainerCnv_p4, T/P separation of SCT Raw data +// author Susumu Oda <Susumu.Oda@cern.ch> + +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +#include "InDetEventAthenaPool/SCT_RawDataContainer_p4.h" +#include "InDetRawData/SCT_RDO_Container.h" + +class SCT_ID; + +// We do NOT use T_AthenaPoolTPCnvIDCont because we do all of the +// conversion in the .cxx. Same as for the LAr Raw Channels +// Note that this is used for a container of SCT Raw Data +// that containes only SCR1_RawData concrete types +// SCT_RDO_ContainerCnv.cxx delegates the conversion to this +// converter if the objects are of the correct type + + +class SCT_RawDataContainerCnv_p4 : public T_AthenaPoolTPCnvBase<SCT_RDO_Container, SCT_RawDataContainer_p4> +{ + private: + const SCT_ID* m_sctId; + int m_type; + public: + SCT_RawDataContainerCnv_p4() : m_sctId(nullptr), m_type(0) {}; + + virtual void persToTrans(const SCT_RawDataContainer_p4* persCont, + SCT_RDO_Container* transCont, + MsgStream& log); + virtual void transToPers(const SCT_RDO_Container* transCont, + SCT_RawDataContainer_p4* persCont, + MsgStream& log); + virtual SCT_RDO_Container* createTransient(const SCT_RawDataContainer_p4* persObj, MsgStream& log); + + // ID helper can't be used in the constructor, need initialize() + void initialize(const SCT_ID* idhelper) { m_sctId = idhelper; } + void setType(int type) { m_type = type; } +}; + +#endif // SCT_RAWDATACONTAINERCNV_P4_H diff --git a/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/src/SiHitCollectionCnv.h b/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/src/SiHitCollectionCnv.h index 36f053cb2db254082f73b48897fa42758a9f36e5..77cfdc51b24bbd43edbf4d319c9966f6b083668f 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/src/SiHitCollectionCnv.h +++ b/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/src/SiHitCollectionCnv.h @@ -16,10 +16,8 @@ // Gaudi #include "GaudiKernel/MsgStream.h" // typedef to the latest persistent version -//typedef SiHitCollection_p1 SiHitCollection_PERS; -//typedef SiHitCollectionCnv_p1 SiHitCollectionCnv_PERS; -typedef SiHitCollection_p2 SiHitCollection_PERS; -typedef SiHitCollectionCnv_p2 SiHitCollectionCnv_PERS; +typedef SiHitCollection_p3 SiHitCollection_PERS; +typedef SiHitCollectionCnv_p3 SiHitCollectionCnv_PERS; class SiHitCollectionCnv : public T_AthenaPoolCustomCnv<SiHitCollection, SiHitCollection_PERS > { friend class CnvFactory<SiHitCollectionCnv>; diff --git a/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/src/TRTUncompressedHitCollectionCnv.h b/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/src/TRTUncompressedHitCollectionCnv.h index d8e393186ccd7c00d871d3647e8ba1e05a67e3b0..47405d750d6e9572adcacbbd22b10b1437c7ac58 100755 --- a/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/src/TRTUncompressedHitCollectionCnv.h +++ b/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/src/TRTUncompressedHitCollectionCnv.h @@ -23,8 +23,10 @@ //typedef TRT_HitCollectionCnv_p1 TRT_HitCollectionCnv_PERS; //typedef TRT_HitCollection_p2 TRT_HitCollection_PERS; //typedef TRT_HitCollectionCnv_p2 TRT_HitCollectionCnv_PERS; -typedef TRT_HitCollection_p3 TRT_HitCollection_PERS; -typedef TRT_HitCollectionCnv_p3 TRT_HitCollectionCnv_PERS; +//typedef TRT_HitCollection_p3 TRT_HitCollection_PERS; +//typedef TRT_HitCollectionCnv_p3 TRT_HitCollectionCnv_PERS; +typedef TRT_HitCollection_p4 TRT_HitCollection_PERS; +typedef TRT_HitCollectionCnv_p4 TRT_HitCollectionCnv_PERS; class TRTUncompressedHitCollectionCnv : public T_AthenaPoolCustomCnv<TRTUncompressedHitCollection, TRT_HitCollection_PERS > { friend class CnvFactory<TRTUncompressedHitCollectionCnv>; diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/CMakeLists.txt b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/CMakeLists.txt index 4ec1e378fedc53530dd53be0ccbdde53bfede4a7..2fd4f5c476e202374a504b60103e28f731bea51b 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/CMakeLists.txt +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/CMakeLists.txt @@ -47,6 +47,12 @@ atlas_add_test( SiHitCollectionCnv_p2_test INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv InDetSimEvent TestTools StoreGateLib SGtests Identifier InDetSimEventTPCnv ) +atlas_add_test( SiHitCollectionCnv_p3_test + SOURCES + test/SiHitCollectionCnv_p3_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv InDetSimEvent TestTools StoreGateLib SGtests Identifier InDetSimEventTPCnv ) + atlas_add_test( TRT_HitCnv_p1_test SOURCES test/TRT_HitCnv_p1_test.cxx @@ -65,3 +71,9 @@ atlas_add_test( TRT_HitCollectionCnv_p3_test INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv InDetSimEvent TestTools StoreGateLib SGtests Identifier InDetSimEventTPCnv ) + +atlas_add_test( TRT_HitCollectionCnv_p4_test + SOURCES + test/TRT_HitCollectionCnv_p4_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv InDetSimEvent TestTools StoreGateLib SGtests Identifier InDetSimEventTPCnv ) diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/SiHitCollectionCnv_p3_test.ref b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/SiHitCollectionCnv_p3_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..fe4376f9b7e70f5801e812e27c71878ba71926e3 --- /dev/null +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/SiHitCollectionCnv_p3_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p4_test.ref b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p4_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..8633d8ace9b4883a00f6e29e68937582b9b5e684 --- /dev/null +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p4_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCnv_p1.cxx index 88c7e8f8a79ae6d2cb586e1e92cfe31b75a965cd..a774507874cef45f344b1521bc550a256b585ef7 100755 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCnv_p1.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCnv_p1.cxx @@ -11,7 +11,7 @@ void -SiHitCnv_p1::persToTrans(const SiHit_p1* persObj, SiHit* transObj, +SiHitCnv_p1::persToTrans(const SiHit_p1* persObj, SiHit* transObj, MsgStream &log) { HepMcParticleLinkCnv_p1 HepMcPLCnv; @@ -26,14 +26,14 @@ MsgStream &log) persObj->m_enZ), persObj->m_energyLoss, persObj->m_meanTime, - link.barcode(), + link, persObj->m_ID ); } void -SiHitCnv_p1::transToPers(const SiHit* transObj, SiHit_p1* persObj, +SiHitCnv_p1::transToPers(const SiHit* transObj, SiHit_p1* persObj, MsgStream &log) { // if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "SiHitCnv_p1::transToPers called " << endmsg; @@ -52,5 +52,5 @@ MsgStream &log) persObj->m_energyLoss = transObj->energyLoss(); persObj->m_meanTime = transObj->meanTime(); persObj->m_ID = transObj->identify(); - HepMcPLCnv.transToPers(&(transObj->particleLink()),&(persObj->m_partLink), log); + HepMcPLCnv.transToPers(&(transObj->particleLink()),&(persObj->m_partLink), log); } diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCnv_p2.cxx index 4ae7a82cc271d539d25e45c221689fc30cfbd904..cad415780cb19487a043c6f7137b9f12f4ecc2cc 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCnv_p2.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCnv_p2.cxx @@ -25,14 +25,30 @@ SiHitCnv_p2::persToTrans(const SiHit_p2* persObj, SiHit* transObj, MsgStream &lo persObj->m_enZ), persObj->m_energyLoss, persObj->m_meanTime, - link.barcode(), + link, persObj->m_ID ); } void -SiHitCnv_p2::transToPers(const SiHit*, SiHit_p2*, MsgStream &/*log*/) +SiHitCnv_p2::transToPers(const SiHit* transObj, SiHit_p2* persObj, MsgStream &log) { - throw std::runtime_error("SiHitCnv_p2::transToPers is not supported in this release!"); +// if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "SiHitCnv_p2::transToPers called " << endmsg; + HepMcParticleLinkCnv_p2 HepMcPLCnv; + + HepGeom::Point3D<double> st = transObj->localStartPosition(); + persObj->m_stX = st.x(); + persObj->m_stY = st.y(); + persObj->m_stZ = st.z(); + + HepGeom::Point3D<double> en = transObj->localEndPosition(); + persObj->m_enX = en.x(); + persObj->m_enY = en.y(); + persObj->m_enZ = en.z(); + + persObj->m_energyLoss = transObj->energyLoss(); + persObj->m_meanTime = transObj->meanTime(); + persObj->m_ID = transObj->identify(); + HepMcPLCnv.transToPers(&(transObj->particleLink()),&(persObj->m_partLink), log); } diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p2.cxx index b6e6c588e555644c793771d287b2a38b6c8f5e51..6469d1be6b15538331f3a6aff428fc325579c1f5 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p2.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p2.cxx @@ -123,7 +123,7 @@ void SiHitCollectionCnv_p2::transToPers(const SiHitCollection* transCont, SiHitC } } - HepGeom::Point3D<double> st = siHit->localStartPosition(); + HepGeom::Point3D<double> st = siHit->localStartPosition(); HepGeom::Point3D<double> en = siHit->localEndPosition(); const double dx = st.x() - lastTransEnd.x(); diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p3.cxx index 87bc1f3ad9e62540c2b0127452957ad982880f07..1ed44137a468c62bad7c2cd2700b1f0c7d649755 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p3.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p3.cxx @@ -6,6 +6,7 @@ #include "InDetSimEvent/SiHitCollection.h" #include "InDetSimEventTPCnv/InDetHits/SiHitCollection_p3.h" #include "InDetSimEventTPCnv/InDetHits/SiHitCollectionCnv_p3.h" +#include "GeneratorObjects/HepMcParticleLink.h" #include <cmath> @@ -59,9 +60,184 @@ const double SiHitCollectionCnv_p3::m_2bHalfMaximum = pow(2.0, 15.0); const int SiHitCollectionCnv_p3::m_2bMaximum = (unsigned short)(-1); -void SiHitCollectionCnv_p3::transToPers(const SiHitCollection*, SiHitCollection_p3*, MsgStream &/*log*/) +void SiHitCollectionCnv_p3::transToPers(const SiHitCollection* transCont, SiHitCollection_p3* persCont, MsgStream &/*log*/) { - throw std::runtime_error("SiHitCollectionCnv_p3::transToPers is not supported in this release!"); + // Finds hits belonging to a "string" (in which the end point of one hit is the same as the start point of the next) and + // persistifies the end point of each hit plus the start point of the first hit in each string. + // + // Further compression is achieved by optimising the storage of the position vectors:- start (x,y,z) and (theta,phi) of + // first hit are stored as floats, (delta_theta,delta_phi) relative to the fisrst hit are stored as 2 byte numbers and + // used to specify the hit direction. All hit lengths are stored as 2 byte numbers. + // + // Additional savings are achieved by storing the energy loss for each hit as a 2 byte number and only storing the mean + // time of the first hit per string. + // + // See http://indico.cern.ch/getFile.py/access?contribId=11&resId=2&materialId=slides&confId=30893 for more info. + + static const double dRcut = 1.0e-7; + static const double dTcut = 1.0; + + const HepMcParticleLink * lastLink=nullptr; + int lastId = -1; + double stringFirstTheta = 0.0; + double stringFirstPhi = 0.0; + double lastT = 0.0; + double persSumE = 0.0; + double transSumE = 0.0; + unsigned int idx = 0; + unsigned int endBC = 0; + unsigned int endId = 0; + unsigned int endHit = 0; + HepGeom::Point3D<double> lastTransEnd(0.0, 0.0, 0.0); + HepGeom::Point3D<double> lastPersEnd(0.0, 0.0, 0.0); + + for (SiHitCollection::const_iterator it = transCont->begin(); it != transCont->end(); ++it) { + + SiHitCollection::const_iterator siHit = it; + + + if ( !lastLink || (siHit->particleLink() != *lastLink) ) { + + // store barcode once for set of consecutive hits with same barcode + + lastLink = &(siHit->particleLink()); + persCont->m_barcode.push_back(lastLink->barcode()); + persCont->m_mcEvtIndex.push_back(lastLink->eventIndex()); + persCont->m_evtColl.push_back('a'); + + if (idx > 0) { + persCont->m_nBC.push_back(idx - endBC); + endBC = idx; + } + } + + if ( (int)siHit->identify() != lastId ) { + + // store id once for set of consecutive hits with same barcode + + lastId = siHit->identify(); + persCont->m_id.push_back(lastId); + + if (idx > 0) { + persCont->m_nId.push_back(idx - endId); + endId = idx; + } + } + + HepGeom::Point3D<double> st = siHit->localStartPosition(); + HepGeom::Point3D<double> en = siHit->localEndPosition(); + + const double dx = st.x() - lastTransEnd.x(); + const double dy = st.y() - lastTransEnd.y(); + const double dz = st.z() - lastTransEnd.z(); + const double t = siHit->meanTime(); + + const double dRLast = sqrt(dx * dx + dy * dy + dz * dz); // dR between end of previous hit and start of current one + const double dTLast = fabs(t - lastT); + + CLHEP::Hep3Vector direction(0.0, 0.0, 0.0); + double theta = 0.0; + double phi = 0.0; + bool startNewString = false; + + if (dRLast < dRcut && dTLast < dTcut) { + + // hit is part of existing string + + direction = CLHEP::Hep3Vector( en.x() - lastPersEnd.x(), en.y() - lastPersEnd.y(), en.z() - lastPersEnd.z() ); + + theta = direction.theta(); + phi = phicorr( direction.phi() ); + + const int dTheta_2b = (int)( (theta - stringFirstTheta) / m_persAngUnit + m_2bHalfMaximum + 0.5 ); + const int dPhi_2b = (int)( (cycle(phi, stringFirstPhi) - stringFirstPhi) / m_persAngUnit + m_2bHalfMaximum + 0.5 ); + + if ( dTheta_2b < m_2bMaximum && dTheta_2b >= 0 && dPhi_2b < m_2bMaximum && dPhi_2b >= 0) { + persCont->m_dTheta.push_back(dTheta_2b); + persCont->m_dPhi.push_back(dPhi_2b); + theta = stringFirstTheta + ( (double)dTheta_2b - m_2bHalfMaximum ) * m_persAngUnit; + phi = stringFirstPhi + ( (double)dPhi_2b - m_2bHalfMaximum ) * m_persAngUnit; + phi = phicorr(phi); + } + else { + startNewString = true; + } + } + + if (startNewString || dRLast >= dRcut || dTLast >= dTcut) { + + // begin new hit string + + direction = CLHEP::Hep3Vector( en.x() - st.x(), en.y() - st.y(), en.z() - st.z() ); + + theta = direction.theta(); + phi = phicorr( direction.phi() ); + + persCont->m_hit1_meanTime.push_back(t); + persCont->m_hit1_x0.push_back(st.x()); + persCont->m_hit1_y0.push_back(st.y()); + persCont->m_hit1_z0.push_back(st.z()); + persCont->m_hit1_theta.push_back(theta); + persCont->m_hit1_phi.push_back(phi); + + lastPersEnd = HepGeom::Point3D<double>(st.x(), st.y(), st.z()); + + stringFirstTheta = theta; + stringFirstPhi = phi; + + if (idx > 0) { + persCont->m_nHits.push_back(idx - endHit); + endHit = idx; + } + } + + lastTransEnd = HepGeom::Point3D<double>(en.x(), en.y(), en.z()); + transSumE += siHit->energyLoss(); + + const int eneLoss_2b = (int)((transSumE - persSumE) / m_persEneUnit + 0.5); // calculated to allow recovery sum over + // whole hit string to chosen precision + + const int hitLength_2b = (int)(direction.mag() / m_persLenUnit + 0.5); // calculated to give the correct position to + // the chosen precision, NOT the length of the + // hit (small difference in practice). + double eneLoss = 0.0; + + if (eneLoss_2b >= m_2bMaximum) { + eneLoss = siHit->energyLoss(); + persCont->m_hitEne_2b.push_back(m_2bMaximum); + persCont->m_hitEne_4b.push_back(eneLoss); + } + else { + eneLoss = eneLoss_2b * m_persEneUnit; + persCont->m_hitEne_2b.push_back(eneLoss_2b); + } + + double length = 0.0; + + if (hitLength_2b >= m_2bMaximum) { + length = direction.mag(); + persCont->m_hitLength_2b.push_back(m_2bMaximum); + persCont->m_hitLength_4b.push_back(direction.mag()); + } + else { + length = hitLength_2b * m_persLenUnit; + persCont->m_hitLength_2b.push_back(hitLength_2b); + } + + CLHEP::Hep3Vector persDir(length, 0.0, 0.0); + persDir.setTheta(theta); + persDir.setPhi(phi); + + lastPersEnd = (CLHEP::Hep3Vector)lastPersEnd + persDir; + persSumE += eneLoss; + lastT = t; + + ++idx; + } + + persCont->m_nBC.push_back(idx - endBC); + persCont->m_nId.push_back(idx - endId); + persCont->m_nHits.push_back(idx - endHit); } diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCnv_p1.cxx index cc375fbef784f282d583dae7117cb19f77063220..7c7356d7e6d00290437eeed3bac59b0c2dbb2af0 100755 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCnv_p1.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCnv_p1.cxx @@ -11,47 +11,47 @@ void -TRT_HitCnv_p1::persToTrans(const TRT_Hit_p1* persObj, TRTUncompressedHit* transObj, -MsgStream &log) +TRT_HitCnv_p1::persToTrans(const TRT_Hit_p1* persObj, TRTUncompressedHit* transObj, + MsgStream &log) { HepMcParticleLinkCnv_p1 HepMcPLCnv; HepMcParticleLink link; - HepMcPLCnv.persToTrans(&(persObj->m_partLink),&link, log); - - *transObj = TRTUncompressedHit (persObj-> hitID, - link.barcode(), - persObj->particleEncoding, - persObj->kineticEnergy, - persObj->energyDeposit, - persObj->preStepX, - persObj->preStepY, - persObj->preStepZ, - persObj->postStepX, - persObj->postStepY, - persObj->postStepZ, - persObj->globalTime); + HepMcPLCnv.persToTrans(&(persObj->m_partLink),&link, log); + + *transObj = TRTUncompressedHit (persObj-> hitID, + link, + persObj->particleEncoding, + persObj->kineticEnergy, + persObj->energyDeposit, + persObj->preStepX, + persObj->preStepY, + persObj->preStepZ, + persObj->postStepX, + persObj->postStepY, + persObj->postStepZ, + persObj->globalTime); } void -TRT_HitCnv_p1::transToPers(const TRTUncompressedHit* transObj, TRT_Hit_p1* persObj, -MsgStream &log) +TRT_HitCnv_p1::transToPers(const TRTUncompressedHit* transObj, TRT_Hit_p1* persObj, + MsgStream &log) { -// if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "TRT_HitCnv_p1::transToPers called " << endmsg; - HepMcParticleLinkCnv_p1 HepMcPLCnv; - persObj->hitID = transObj-> GetHitID(); - HepMcPLCnv.transToPers(&(transObj->particleLink()),&(persObj->m_partLink), log); - persObj->particleEncoding = transObj->GetParticleEncoding(); - persObj->kineticEnergy = transObj->GetKineticEnergy(); - persObj->energyDeposit = transObj->GetEnergyDeposit(); - - persObj->preStepX = transObj->GetPreStepX(); - persObj->preStepY = transObj->GetPreStepY(); - persObj->preStepZ = transObj->GetPreStepZ(); - - persObj->postStepX = transObj->GetPostStepX(); - persObj->postStepY = transObj->GetPostStepY(); - persObj->postStepZ = transObj->GetPostStepZ(); - persObj->globalTime = transObj->GetGlobalTime(); + // if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "TRT_HitCnv_p1::transToPers called " << endmsg; + HepMcParticleLinkCnv_p1 HepMcPLCnv; + persObj->hitID = transObj-> GetHitID(); + HepMcPLCnv.transToPers(&(transObj->particleLink()),&(persObj->m_partLink), log); + persObj->particleEncoding = transObj->GetParticleEncoding(); + persObj->kineticEnergy = transObj->GetKineticEnergy(); + persObj->energyDeposit = transObj->GetEnergyDeposit(); + + persObj->preStepX = transObj->GetPreStepX(); + persObj->preStepY = transObj->GetPreStepY(); + persObj->preStepZ = transObj->GetPreStepZ(); + + persObj->postStepX = transObj->GetPostStepX(); + persObj->postStepY = transObj->GetPostStepY(); + persObj->postStepZ = transObj->GetPostStepZ(); + persObj->globalTime = transObj->GetGlobalTime(); } diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCnv_p2.cxx index e1b896bc390d57f059c57f948651578af1bb4b42..431d95f20c3d55b6aacdecae5171e22536cee6a0 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCnv_p2.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCnv_p2.cxx @@ -19,7 +19,7 @@ TRT_HitCnv_p2::persToTrans(const TRT_Hit_p2* persObj, TRTUncompressedHit* transO HepMcPLCnv.persToTrans(&(persObj->m_partLink),&link, log); *transObj = TRTUncompressedHit (persObj-> hitID, - link.barcode(), + link, persObj->particleEncoding, persObj->kineticEnergy, persObj->energyDeposit, @@ -34,7 +34,23 @@ TRT_HitCnv_p2::persToTrans(const TRT_Hit_p2* persObj, TRTUncompressedHit* transO void -TRT_HitCnv_p2::transToPers(const TRTUncompressedHit*, TRT_Hit_p2*, MsgStream &/*log*/) +TRT_HitCnv_p2::transToPers(const TRTUncompressedHit* transObj, TRT_Hit_p2* persObj, + MsgStream &log) { - throw std::runtime_error("TRT_HitCnv_p2::transToPers is not supported in this release!"); + // if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "TRT_HitCnv_p2::transToPers called " << endmsg; + HepMcParticleLinkCnv_p2 HepMcPLCnv; + persObj->hitID = transObj-> GetHitID(); + HepMcPLCnv.transToPers(&(transObj->particleLink()),&(persObj->m_partLink), log); + persObj->particleEncoding = transObj->GetParticleEncoding(); + persObj->kineticEnergy = transObj->GetKineticEnergy(); + persObj->energyDeposit = transObj->GetEnergyDeposit(); + + persObj->preStepX = transObj->GetPreStepX(); + persObj->preStepY = transObj->GetPreStepY(); + persObj->preStepZ = transObj->GetPreStepZ(); + + persObj->postStepX = transObj->GetPostStepX(); + persObj->postStepY = transObj->GetPostStepY(); + persObj->postStepZ = transObj->GetPostStepZ(); + persObj->globalTime = transObj->GetGlobalTime(); } diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p4.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p4.cxx index 464bd7a101d7d3c541cf255e00077ac950ac64b7..1d5e3a5d5633404ed16fa0894cab8fdf630a7023 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p4.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p4.cxx @@ -20,9 +20,262 @@ #include "StoreGate/StoreGateSvc.h" // Transient(Geant) to Persistent(Disk) -void TRT_HitCollectionCnv_p4::transToPers(const TRTUncompressedHitCollection*, TRT_HitCollection_p4*, MsgStream &/*log*/) +void TRT_HitCollectionCnv_p4::transToPers(const TRTUncompressedHitCollection* transCont, TRT_HitCollection_p4* persCont, MsgStream &log) { - throw std::runtime_error("TRT_HitCollectionCnv_p4::transToPers is not supported in this release!"); + + /* + Spring 2009 + Andrew Beddall - lossy TRT G4hit compression [p3] + + In p1, p2 versions, GEANT hits are persistified on disk as floats. + In the p3 version, floats are compressed to "integers"/"short-floats" before persistifying. + In the p4 version, HepMcParticleLink_p2 can identify the event index and collection. + The saving is about 75%; see http://cern.ch/beddall/TRThitCompression/ + + Spring 2008 + Rob Duxfield - lossless TRT G4hit compression [p2] + + Finds hits belonging to a "string" (in which the end point of one hit is + the same as the start point of the next) and persistifies the end point + of each hit plus the start point of the first hit in each string. + */ + + // The original units from the hit simulation are indicated in comments; + // they are all in CLHEP units except for hitEne which is in keV. + // I sometimes make use of CLHEP scales *CLHEP::mm and *CLHEP::ns (both=1) for clarity (I hope!). + // See also https://twiki.cern.ch/twiki/bin/view/Atlas/TrtSoftware#Production_of_Hits + + static const double dRcut = 1.0e-7*CLHEP::mm; + static const double dTcut = 1.0*CLHEP::ns; // redundant? + + // if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "In TRT_HitCollectionCnv_p4::transToPers()" << endmsg; + + const HepMcParticleLink * lastLink=NULL; + int lastId = -1; + double lastT = 0.0*CLHEP::ns; + unsigned int idx = 0; + unsigned int endBC = 0; + unsigned int endId = 0; + unsigned int endHit = 0; + HepGeom::Point3D<double> lastEnd(0.0, 0.0, 0.0); // mm + + for (TRTUncompressedHitCollection::const_iterator it = transCont->begin(); it != transCont->end(); ++it) { + + TRTUncompressedHitCollection::const_iterator trtHit = it; + + if ( !lastLink || (trtHit->particleLink() != *lastLink) || (idx - endBC > 65500)) { // max unsigned short = 65535; + // store barcode once for set of consecutive hits with same barcode + lastLink = &(trtHit->particleLink()); + persCont->m_barcode.push_back(lastLink->barcode()); + persCont->m_mcEvtIndex.push_back(lastLink->eventIndex()); + persCont->m_evtColl.push_back('a'); + + if ( idx > 0 ) { + persCont->m_nBC.push_back(idx - endBC); + endBC = idx; + } + } + + if ( (int)trtHit->GetParticleEncoding() != lastId || idx - endId > 65500) { // max unsigned short = 65535; + // store id once for set of consecutive hits with same id + lastId = trtHit->GetParticleEncoding(); + persCont->m_id.push_back(lastId); + if ( idx > 0 ) { + persCont->m_nId.push_back(idx - endId); + endId = idx; + } + } + + const HepGeom::Point3D<double> hitStart(trtHit->GetPreStepX(), trtHit->GetPreStepY(), trtHit->GetPreStepZ()); // mm + + const double meanTime = trtHit->GetGlobalTime(); // ns // Time of flight from the I.P. to the center of the hit. + const double dTLast = fabs(meanTime - lastT); // |d(meantime)| between the previous hit and the current one. + const double dRLast = lastEnd.distance(hitStart); // Distance between end of previous hit and start of current one; + // this is zero if the hit is a continuation of the same particle in the same straw. + + // Begin a new string if the current and previous hits are disconnected; + // it looks like dTcut is redundant (but not sure about this). + if ( dRLast >= dRcut || dTLast >= dTcut ) { + + // if ( dRLast < dRcut) std::cout << "AJBdTLastTriggeredNewString " << dRLast << " " << dTLast << std::endl; + + //////////////////// + // new hit string // + //////////////////// + + // + // Persistify string *strawId* using 24 bits. + // Assumes 0 <= strawId <= 16,777,215 (strawId appears to be < 4,000,000) + // + const unsigned int strawId = trtHit->GetHitID(); + persCont->m_strawId1b.push_back( (unsigned char)(strawId % 256) ); // 8 bits + persCont->m_strawId2b.push_back( (unsigned short)(strawId / 256) ); // 16 bits + if ( strawId>16777215 ) + log << MSG::WARNING << "TRT_HitCollectionCnv: strawId > 2^24-1 cannot be persistified correctly! " << endmsg; + + // + // Persistify string start radius using 1 bit (istartRflag) or 8 bits (startR) + // Note that the smallest value of R is the wire radius (0.0155 mm) + // + // R will be flagged as 2 mm if it is within 0.1 um of the straw wall => max error = 0.1 um, + // otherwise compress with 8 bits => max error = 3.9 um (0.078 ns), RMS error = 1.1 um (0.022 ns) + // + const double startR = sqrt( hitStart.x()*hitStart.x() + hitStart.y()*hitStart.y() ); // mm + unsigned short istartRflag; + if ( startR > 1.9999*CLHEP::mm ) { + istartRflag=1; // persistify as a 1-bit flag + } + else { + istartRflag=0; // compress to 8 bits with a span of 2 mm + persCont->m_startR.push_back( (unsigned char)(startR/(2.0*CLHEP::mm)*256.0) ); + } + + // + // Persistify string *startPhi* using 8 bits (min=-pi, max=+pi) + // Max. error = 12 mrad (< 24 um, 0.48 ns); RMS error = 7 mrad (< 14 um, 0.28 ns) + // + const double startPhi = atan2( hitStart.y(), hitStart.x() ); // returns range -pi to +pi rad + persCont->m_startPhi.push_back( (unsigned char)( (startPhi+M_PI)/(2.0*M_PI)*256.0 ) ); + + // + // Persistify *startZ* using a 4 bits (min = -365 mm, max= +365 mm) + // Max. error = 25 mm (25e-3/(0.75c) = 0.111 ns * 2 reflect = 0.222 ns) + // RMS error = 14 mm (14e-3/(0.75c) = 0.062 ns * 2 reflect = 0.124 ns) + // Also the 1-bit *istartRflag* is packed into this variable. + // + // Note: + // In the digi code we need to allow for something like 22.5 mm outside straw. + // Also because we have short straws, + // short straws are about < +-180 mm, long straws are about < +-350 mm + // The following compressions can give a large "out of straw" value; + // *don't* use these: (2.0), 32.0, 128.0, 256.0. + + unsigned char istartZ = (unsigned char)( (hitStart.z()+365.0*CLHEP::mm)/(730.0*CLHEP::mm)*16.0 ); + istartZ = (istartZ << 1) | istartRflag; + persCont->m_startZ.push_back( istartZ ); + + if ( idx > 0 ) { + persCont->m_nHits.push_back( idx - endHit ); + endHit = idx; + } + /* + // Validation output + std::cout.precision(15); + std::cout << "AJBTtoPstrawId " << strawId << std::endl; + std::cout << "AJBTtoPstartR " << startR << std::endl; + std::cout << "AJBTtoPstartPhi " << startPhi << std::endl; + std::cout << "AJBTtoPstartX " << hitStart.x() << std::endl; + std::cout << "AJBTtoPstartY " << hitStart.y() << std::endl; + std::cout << "AJBTtoPstartZ " << hitStart.z() << std::endl; + */ + } // end of "begin new hit string" + + ////////////////////////// + // Now for the end hits // + ////////////////////////// + + const HepGeom::Point3D<double> hitEnd(trtHit->GetPostStepX(), trtHit->GetPostStepY(), trtHit->GetPostStepZ()); // mm + const HepGeom::Point3D<double> hitLength = (hitEnd - hitStart); + + // + // Here both *kinEne* (kinetic energy of the particle causing the hit) and + // *steplength* (g4hit length) are persistified using a 15-bit "short float" + // (9 bit unsigned mantissa, 6 bit unsigned exponent). + // This stores values in the range 0.51*2^0 = 0.51 to 1.00*2^63 = 9.2e18. + // I enforce the limits 1.0 and 9.0e18; see below. + // Max relative error = 0.0010, RMS = 0.0004 + // + // Notes: + // + // - G4 gives kinEne in MeV; I sometimes see values ~ 1e-7 MeV (100 meV) [float round-off?] + // So I multiply by 1e9 and store in units of meV => range 1.0 meV to 9.0e18 meV (9000 TeV!) + // - About 1 in 10000 hits have steplength ~ 1e-7 mm [float round-off?] + // so again I multiply by 1e9 and store in units of pm => range 1.0 pm to 9.0e18 pm (9000 km) + // - The mantissa has maximum 9 bits, the exponent has maximum 6 bits, + // Note: a rare condition causes an 10-bit mantissa (mantissa=512). + // + double kinEne = trtHit->GetKineticEnergy() * 1.0e9; // nano Mev = meV. + double steplength = hitLength.distance() * 1.0e9; // nano mm = pm. + if ( kinEne < 1.0 ) kinEne=1.0; // Keep the value + if ( steplength < 1.0 ) steplength=1.0; // well within the + if ( kinEne > 9.0e18 ) kinEne=9.0e18; // range of the + if ( steplength > 9.0e18 ) steplength=9.0e18; // short float. + const unsigned int kexponent = (unsigned int)ceil(log10(kinEne)/0.30102999566398); + const unsigned int sexponent = (unsigned int)ceil(log10(steplength)/0.30102999566398); + const unsigned int kmantissa = (unsigned int)(kinEne/pow(2.0,kexponent)*1024) - 512; + const unsigned int smantissa = (unsigned int)(steplength/pow(2.0,sexponent)*1024) - 512; + persCont->m_kinEne.push_back( (kmantissa << 6) | kexponent ); + persCont->m_steplength.push_back( (smantissa << 6) | sexponent ); + + // + // Persistify hit end radius using 1 bit (iendRflag) or 8 bits (endR). + // Note that the smallest value of R is the wire radius (0.0155 mm) + // + // R will be flagged as 2 mm if it is within 0.1 um of the straw wall => max error = 0.1 um, + // otherwise compress with 8 bits. The errors are as for startR, but can increased greatly + // after steplength preservation in PtoT. + // + const double endR = sqrt( hitEnd.x()*hitEnd.x() + hitEnd.y()*hitEnd.y() ); // mm + unsigned short iendRflag; + if ( endR > 1.9999*CLHEP::mm ) { + iendRflag=1; // persistify as a 1-bit flag + } + else { + iendRflag=0; // compress to 8 bits with a span of 2 mm + persCont->m_endR.push_back( (unsigned char)(endR/(2.0*CLHEP::mm)*256.0) ); + } + + // + // Persistify string *endPhi* using 8 bits (min=-pi, max=+pi) + // The errors are as for startPhi, but are very different after steplength + // preservation in PtoT. + // + const double endPhi = atan2( hitEnd.y(), hitEnd.x() ); // returns range -pi to +pi rad + persCont->m_endPhi.push_back( (unsigned char)( (endPhi+M_PI)/(2.0*M_PI)*256.0 ) ); + + // + // Persistify hit *meanTime* using 10 bits (min=0.,span=75 ns) + // with float overflow for meanTime >= 75ns (the tail of the distribution). + // Max. error = 0.037 ns; RMS error = 0.021 ns. + // Also the 1-bit *iendRflag* and 1-bit *idZsign* are packed into this variable. + // + unsigned short idZsign = (hitLength.z()>0.0) ? 1 : 0; // flag the sign of dZ + unsigned short imeanTime = ( meanTime < 75.0*CLHEP::ns ) ? (unsigned short)(meanTime/(75.0*CLHEP::ns)*1024.0) : 1023; + if ( imeanTime == 1023 ) persCont->m_meanTimeof.push_back( (float)meanTime ); // "overflow flag" + imeanTime = (imeanTime << 2) | (idZsign << 1) | iendRflag; + persCont->m_meanTime.push_back( imeanTime ); + + // + // Persistify hit *hitEne* (the energy deposited by the hit in keV) using a float but only for photons + // (relatively very few of these). Digitisation does not use hitEne for charged particles. + // + if ( lastId == 22 || + (int)(abs(lastId)/100000) == 41 || + (int)(abs(lastId)/10000000) == 1 + ) persCont->m_hitEne.push_back( (float)(trtHit->GetEnergyDeposit()) ); // keV + + lastEnd = hitEnd; + lastT = meanTime; + ++idx; + /* + // Validation output + std::cout.precision(15); + std::cout << "AJBTtoPendR " << endR << std::endl; + std::cout << "AJBTtoPendPhi " << endPhi << std::endl; + std::cout << "AJBTtoPendX " << hitEnd.x() << std::endl; + std::cout << "AJBTtoPendY " << hitEnd.y() << std::endl; + std::cout << "AJBTtoPendZ " << hitEnd.z() << std::endl; + std::cout << "AJBTtoPmeanTime " << meanTime << std::endl; + std::cout << "AJBTtoPkinEne " << trtHit->GetKineticEnergy() << std::endl; + std::cout << "AJBTtoPhitEne " << trtHit->GetEnergyDeposit() << std::endl; + std::cout << "AJBTtoPsteplength " << hitLength.distance() << std::endl; + */ + } + + persCont->m_nBC.push_back(idx - endBC); + persCont->m_nId.push_back(idx - endId); + persCont->m_nHits.push_back( idx - endHit ); + } // transToPers diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCnv_p1_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCnv_p1_test.cxx index 92e6c59857a8252ea2fa7adf49d25b106bddb4ae..069909fa731055ad964dfa03a8b622c459db2e4c 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCnv_p1_test.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCnv_p1_test.cxx @@ -63,12 +63,12 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector) std::cout << "test1\n"; const HepMC::GenParticle *particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(particle->barcode(),0); + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; const HepMC::GenParticle *pGenParticle = genPartVector.at(0); - HepMcParticleLink trkLink(pGenParticle->barcode(),0); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); SiHit trans1 (HepGeom::Point3D<double> (10.5, 11.5, 12.5), HepGeom::Point3D<double> (13.5, 14.5, 15.5), 16.5, diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p3_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p3_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2428877ba06ce5f7df1ad3eefa8fa3a27a6ba78c --- /dev/null +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p3_test.cxx @@ -0,0 +1,110 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file InDetSimEventTPCnv/test/SiHitCollectionCnv_p3_test.cxx + * @date Feb, 2018 + * @brief Tests for SiHitCollectionCnv_p3. + */ + + +#undef NDEBUG +#include "InDetSimEventTPCnv/InDetHits/SiHitCollectionCnv_p3.h" +#include "TestTools/leakcheck.h" +#include <cassert> +#include <iostream> + +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenParticle.h" +#include "HepMC/GenEvent.h" + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + +void compare (const SiHit& p1, + const SiHit& p2) +{ + assert (p1.localStartPosition() == p2.localStartPosition()); + assert (p1.localEndPosition() == p2.localEndPosition()); + assert (p1.energyLoss() == p2.energyLoss()); + assert (p1.meanTime() == p2.meanTime()); + compare(p1.particleLink(), p2.particleLink()); + assert (p1.particleLink() == p2.particleLink()); + assert (p1.identify() == p2.identify()); +} + + +void compare (const SiHitCollection& p1, + const SiHitCollection& p2) +{ + //assert (p1.Name() == p2.Name()); + assert (p1.size() == p2.size()); + for (size_t i = 0; i < p1.size(); i++) + compare (p1[i], p2[i]); +} + + +void testit (const SiHitCollection& trans1) +{ + MsgStream log (0, "test"); + SiHitCollectionCnv_p3 cnv; + SiHitCollection_p3 pers; + cnv.transToPers (&trans1, &pers, log); + SiHitCollection trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*>& genPartVector) +{ + std::cout << "test1\n"; + const HepMC::GenParticle *particle = genPartVector.at(0); + // Create HepMcParticleLink outside of leak check. + HepMcParticleLink dummyHMPL(particle->barcode(),0); + assert(dummyHMPL.cptr()==particle); + // Create DVL info outside of leak check. + SiHitCollection dum ("coll"); + Athena_test::Leakcheck check; + + SiHitCollection trans1 ("coll"); + for (int i=0; i < 10; i++) { + const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),0); + int o = i*100; + trans1.Emplace (HepGeom::Point3D<double> (10.5+o, 11.5+o, 12.5+o), + HepGeom::Point3D<double> (13.5+o, 14.5+o, 15.5+o), + 16.5+o, + 17.5+o, + trkLink, + 19+o); + + } + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc, genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(genPartVector); + return 0; +} diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCnv_p1_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCnv_p1_test.cxx index ed12d1912c8e8a3d56e5e3f270a0e4ead9a39e42..e8182ac840bbd4fc5046a9136fa51cee81a23739 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCnv_p1_test.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCnv_p1_test.cxx @@ -68,12 +68,12 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector) std::cout << "test1\n"; const HepMC::GenParticle *particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(particle->barcode(),0); + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; const HepMC::GenParticle *pGenParticle = genPartVector.at(0); - HepMcParticleLink trkLink(pGenParticle->barcode(),0); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); TRTUncompressedHit trans1 (101, trkLink, pGenParticle->pdg_id(), 104.5, 105.5, 106.5, 107.5, 108.5, diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p4_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p4_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..1991aeacee2de5b54fa243d8d0d00506bb54b1b2 --- /dev/null +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p4_test.cxx @@ -0,0 +1,142 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p4_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Feb, 2016 + * @brief Tests for TRT_HitCollectionCnv_p4. + */ + + +#undef NDEBUG +#include "InDetSimEventTPCnv/InDetHits/TRT_HitCollectionCnv_p4.h" +#include "TestTools/FLOATassert.h" +#include "TestTools/leakcheck.h" +#include <cassert> +#include <iostream> +#include <cmath> + +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenParticle.h" +#include "HepMC/GenEvent.h" + +using Athena_test::isEqual; +using std::atan2; + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + +void compare (const TRTUncompressedHit& p1, + const TRTUncompressedHit& p2) +{ + assert (p1.GetHitID() == p2.GetHitID()); + compare(p1.particleLink(), p2.particleLink()); + assert (p1.particleLink() == p2.particleLink()); + assert (p1.GetParticleEncoding() == p2.GetParticleEncoding()); + assert (isEqual (p1.GetKineticEnergy(), p2.GetKineticEnergy(), 5e-4)); + if (p1.GetParticleEncoding() == 22) + assert (p1.GetEnergyDeposit() == p2.GetEnergyDeposit()); + else + assert (0 == p2.GetEnergyDeposit()); + if (p1.GetPreStepX() > 2) { + const double phi1 = atan2 (p1.GetPreStepY(), p1.GetPreStepX()); + assert (isEqual (2*cos(phi1), p2.GetPreStepX(), 1e-2)); + assert (isEqual (2*sin(phi1), p2.GetPreStepY(), 2e-2)); + + const double phi2 = atan2 (p1.GetPostStepY(), p1.GetPostStepX()); + assert (isEqual (2*cos(phi2), p2.GetPostStepX(), 2e-2)); + assert (isEqual (2*sin(phi2), p2.GetPostStepY(), 1e-2)); + } + else { + assert (isEqual (p1.GetPreStepX(), p2.GetPreStepX(), 1e-2)); + assert (isEqual (p1.GetPreStepY(), p2.GetPreStepY(), 1e-2)); + assert (isEqual (p1.GetPostStepX(), p2.GetPostStepX(), 2e-2)); + assert (isEqual (p1.GetPostStepY(), p2.GetPostStepY(), 2e-2)); + } + assert (isEqual (p1.GetPreStepZ(), p2.GetPreStepZ(), 0.1)); + assert (isEqual (p1.GetPostStepZ(), p2.GetPostStepZ(), 0.1)); + assert (p1.GetGlobalTime() == p2.GetGlobalTime()); +} + + +void compare (const TRTUncompressedHitCollection& p1, + const TRTUncompressedHitCollection& p2) +{ + //assert (p1.Name() == p2.Name()); + assert (p1.size() == p2.size()); + for (size_t i = 0; i < p1.size(); i++) + compare (p1[i], p2[i]); +} + + +void testit (const TRTUncompressedHitCollection& trans1) +{ + MsgStream log (0, "test"); + TRT_HitCollectionCnv_p4 cnv; + TRT_HitCollection_p4 pers; + cnv.transToPers (&trans1, &pers, log); + TRTUncompressedHitCollection trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*>& genPartVector) +{ + std::cout << "test1\n"; + const HepMC::GenParticle *particle = genPartVector.at(0); + // Create HepMcParticleLink outside of leak check. + HepMcParticleLink dummyHMPL(particle->barcode(),0); + assert(dummyHMPL.cptr()==particle); + // Create DVL info outside of leak check. + TRTUncompressedHitCollection dum ("coll"); + Athena_test::Leakcheck check; + + TRTUncompressedHitCollection trans1 ("coll"); + for (int i=0; i < 10; i++) { + int o = i*100; + const HepMC::GenParticle* pGenParticle = genPartVector.at(0); + HepMcParticleLink trkLink(pGenParticle->barcode(),0); + trans1.Emplace (101+o, trkLink, 20+o, + 104.5+o, 105.5+o, + (106.5+o)/1000, (107.5+o)/1000, 108.5+o, + (109.5+o)/1000, (110.5+o)/1000, 111.5+o, + 112.5+o); + } + // Special case for photons + const HepMC::GenParticle* pGenParticle = genPartVector.at(10); + HepMcParticleLink trkLink(pGenParticle->barcode(),0); + trans1.Emplace (131, trkLink, 22, + 134.5, 135.5, + 10, 3, 138.5, + 3, 10, 148.5, + 142.5); + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc, genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(genPartVector); + return 0; +} diff --git a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProviderTool.cxx b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProviderTool.cxx index 3f9692fe921adba2d6d82db87a93bc20554fecbb..fdf4c005515879ccd56de5b814e382422c18bd50 100644 --- a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProviderTool.cxx +++ b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProviderTool.cxx @@ -130,6 +130,8 @@ StatusCode PixelRawDataProviderTool::convert(std::vector<const ROBFragment*>& ve } } } - CHECK(m_bsErrSvc->recordData()); + if (isNewEvent) { + CHECK(m_bsErrSvc->recordData()); + } return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/SCT_ClusteringTool.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/SCT_ClusteringTool.cxx index 5f67a464cfab289792263327477dde5d69cc3359..63a618899df495a4e2c0a46a13f1868f8dc49391 100644 --- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/SCT_ClusteringTool.cxx +++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/SCT_ClusteringTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /** @@ -395,16 +395,12 @@ namespace InDet { if (passTiming or m_majority01X) { if (m_useRowInformation) { addStripsToClusterInclRows(firstStripId, nStrips, currentVector, idGroups, idHelper); // Note this takes the current vector only - if (stripCount < 16) hitsInThirdTimeBin |= (timePattern.test(0) << stripCount); - stripCount++; - } - else if (not m_checkBadChannels) { + } else if (not m_checkBadChannels) { addStripsToCluster(firstStripId, nStrips, currentVector, idHelper); // Note this takes the current vector only - if (stripCount < 16) hitsInThirdTimeBin |= (timePattern.test(0) << stripCount); - stripCount++; - } - else { + } else { addStripsToClusterWithChecks(firstStripId, nStrips, currentVector, idGroups, idHelper); // This one includes the groups of vectors as well + } + for (unsigned int iStrip=0; iStrip<nStrips; iStrip++) { if (stripCount < 16) hitsInThirdTimeBin |= (timePattern.test(0) << stripCount); stripCount++; } diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/CscSimDataCollectionCnv.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/CscSimDataCollectionCnv.cxx index d8fa4e644af979ce66fd3cbfb470250f7eaea6dc..d13416fb7cbfe20eebbd1ab5ba33daa07bc0911f 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/CscSimDataCollectionCnv.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/CscSimDataCollectionCnv.cxx @@ -25,7 +25,7 @@ CscSimDataCollectionCnv::~CscSimDataCollectionCnv() { CscSimDataCollection_PERS* CscSimDataCollectionCnv::createPersistent (CscSimDataCollection* transCont) { MsgStream log(msgSvc(), "CscSimDataCollectionCnv" ); ATH_MSG_DEBUG("createPersistent(): main converter"); - CscSimDataCollection_PERS *pixdc_p= m_TPConverter_p1.createPersistent( transCont, log ); + CscSimDataCollection_PERS *pixdc_p= m_TPConverter_p2.createPersistent( transCont, log ); return pixdc_p; } diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/CscSimDataCollectionCnv.h b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/CscSimDataCollectionCnv.h index 6a4259875ffab83e281e3bd31cbdf508d82cea6d..6396d43425ff58a97743410c6c2b9f88fc8181df 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/CscSimDataCollectionCnv.h +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/CscSimDataCollectionCnv.h @@ -11,7 +11,7 @@ #include "MuonEventTPCnv/MuonDigitContainer/CscSimDataCollectionCnv_p2.h" // the latest persistent representation type of DataCollection: -typedef Muon::CscSimDataCollection_p1 CscSimDataCollection_PERS; +typedef Muon::CscSimDataCollection_p2 CscSimDataCollection_PERS; typedef T_AthenaPoolCustomCnv<CscSimDataCollection,CscSimDataCollection_PERS > CscSimDataCollectionCnvBase; /** diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/MuonSimDataCollectionCnv.cxx b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/MuonSimDataCollectionCnv.cxx index 563455f8a74074b0ba544421c7f839022b076c7a..dc42bf25269c8a36ce58c96df427dca4333c1a3f 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/MuonSimDataCollectionCnv.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/MuonSimDataCollectionCnv.cxx @@ -25,7 +25,7 @@ MuonSimDataCollectionCnv::~MuonSimDataCollectionCnv() { MuonSimDataCollection_PERS* MuonSimDataCollectionCnv::createPersistent (MuonSimDataCollection* transCont) { MsgStream log(msgSvc(), "MuonSimDataCollectionCnv" ); ATH_MSG_DEBUG("createPersistent(): main converter"); - MuonSimDataCollection_PERS *pixdc_p= m_TPConverter_p1.createPersistent( transCont, log ); + MuonSimDataCollection_PERS *pixdc_p= m_TPConverter_p2.createPersistent( transCont, log ); return pixdc_p; } diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/MuonSimDataCollectionCnv.h b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/MuonSimDataCollectionCnv.h index 77785218bb33a9dd84fbe0278f7c98d3513fe8c8..86bb2824a180d2e8bd2720f831a96b11ced78c48 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/MuonSimDataCollectionCnv.h +++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/src/MuonSimDataCollectionCnv.h @@ -11,7 +11,7 @@ #include "MuonEventTPCnv/MuonDigitContainer/MuonSimDataCollectionCnv_p2.h" // the latest persistent representation type of DataCollection: -typedef Muon::MuonSimDataCollection_p1 MuonSimDataCollection_PERS; +typedef Muon::MuonSimDataCollection_p2 MuonSimDataCollection_PERS; typedef T_AthenaPoolCustomCnv<MuonSimDataCollection, MuonSimDataCollection_PERS > MuonSimDataCollectionCnvBase; /** diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/CMakeLists.txt index 0366a8b6bda59b4824c3f7c2915779feec6bec39..7b1dc3bc04abf5472340f09357009eda8b11de48 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/CMakeLists.txt @@ -91,8 +91,10 @@ set( _jobOPath "${_jobOPath}:$ENV{JOBOPTSEARCHPATH}" ) # Set up the tests of the package: foreach( name CscMcDataCnv_p1_test CscSimDataCnv_p1_test - CscSimDataCollectionCnv_p1_test MuonMCDataCnv_p1_test + CscSimDataCollectionCnv_p1_test CscSimDataCnv_p2_test + CscSimDataCollectionCnv_p2_test MuonMCDataCnv_p1_test MuonSimDataCnv_p1_test MuonSimDataCollectionCnv_p1_test + MuonSimDataCnv_p2_test MuonSimDataCollectionCnv_p2_test CscClusterOnTrackCnv_p2_test RpcClusterOnTrackCnv_p3_test TgcClusterOnTrackCnv_p2_test MM_ClusterOnTrackCnv_p1_test STGC_ClusterOnTrackCnv_p1_test MdtDriftCircleOnTrackCnv_p2_test diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCnv_p2_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..6a0927bf3bfd71b47909f10725590944a6daf6ef --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCnv_p2_test.ref @@ -0,0 +1,16 @@ +ApplicationMgr SUCCESS +==================================================================================================================================== + Welcome to ApplicationMgr (GaudiCoreSvc v4r1) + running on lxplus008.cern.ch on Fri Feb 9 16:59:26 2018 +==================================================================================================================================== +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +ClassIDSvc INFO getRegistryEntries: read 1130 CLIDRegistry entries for module ALL +ProxyProviderSvc INFO Initializing ProxyProviderSvc - package version SGComps-00-00-00 +ClassIDSvc INFO getRegistryEntries: read 869 CLIDRegistry entries for module ALL +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCollectionCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCollectionCnv_p2_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..1a2f833e338b04a5ace0e0654a15001a4191f03a --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCollectionCnv_p2_test.ref @@ -0,0 +1,9 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job + diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCnv_p2_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..8633d8ace9b4883a00f6e29e68937582b9b5e684 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCnv_p2_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCollectionCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCollectionCnv_p2_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..8633d8ace9b4883a00f6e29e68937582b9b5e684 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCollectionCnv_p2_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonDigitContainer/CscSimDataCnv_p2.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonDigitContainer/CscSimDataCnv_p2.cxx index fab46666e4a01078eeec8d3ef7a19feb07348d51..1c75c92d2f0227e1f289acdc2fddd6a4a32fbc8c 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonDigitContainer/CscSimDataCnv_p2.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonDigitContainer/CscSimDataCnv_p2.cxx @@ -24,6 +24,17 @@ void CscSimDataCnv_p2::persToTrans(const Muon::CscSimData_p2 * persObj, CscSimDa persObj->m_word); } -void CscSimDataCnv_p2::transToPers( const CscSimData *, Muon::CscSimData_p2 *, MsgStream & /*log*/){ - throw std::runtime_error("CscSimDataCnv_p2::transToPers is not supported in this release!"); +void CscSimDataCnv_p2::transToPers( const CscSimData * transObj, Muon::CscSimData_p2 * persObj, MsgStream & log){ + log << MSG::DEBUG << "CscSimDataCnv_p2::transToPers" << endmsg; + persObj->m_word = transObj->word(); + log << MSG::VERBOSE << "\tconverting m_word:\t" << transObj->word() << "\tto\t" << persObj->m_word << endmsg; + persObj->m_deposits.clear(); + persObj->m_deposits.reserve(transObj->getdeposits().size()); + for (const CscSimData::Deposit& d : transObj->getdeposits()) { + HepMcParticleLink_p2 persMcPartLink; + m_mcpartlinkCnv.transToPers(&d.first, &persMcPartLink, log); + Muon::CscMcData_p1 persMcData; + m_mcdataCnv.transToPers(&d.second, &persMcData, log); + persObj->m_deposits.emplace_back (persMcPartLink, persMcData); + } } diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonDigitContainer/CscSimDataCollectionCnv_p2.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonDigitContainer/CscSimDataCollectionCnv_p2.cxx index a57b5f857f4aab05a15993c9d8a5de29876e9e2f..fdbbfb88d0e1f154004588e5fd4d6c6d3506bec8 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonDigitContainer/CscSimDataCollectionCnv_p2.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonDigitContainer/CscSimDataCollectionCnv_p2.cxx @@ -26,6 +26,21 @@ void CscSimDataCollectionCnv_p2::persToTrans(const Muon::CscSimDataCollection_p2 } -void CscSimDataCollectionCnv_p2::transToPers(const CscSimDataCollection*, Muon::CscSimDataCollection_p2*, MsgStream &/*log*/) { - throw std::runtime_error("CscSimDataCollectionCnv_p2::transToPers is not supported in this release!"); +void CscSimDataCollectionCnv_p2::transToPers(const CscSimDataCollection* transCol, Muon::CscSimDataCollection_p2* persCol, MsgStream &log) { + + log << MSG::DEBUG << "CscSimDataCollectionCnv_p2::transToPers" << endmsg; + CscSimDataCollection::const_iterator it_Coll = transCol->begin(); + CscSimDataCollection::const_iterator it_CollEnd = transCol->end(); + + persCol->m_cscsimdata.resize(transCol->size()); + log << MSG::DEBUG << " Preparing " << persCol->m_cscsimdata.size() << " Collections" << endmsg; + + for(int collIdx=0; it_Coll != it_CollEnd; it_Coll++, collIdx++){ + (persCol->m_cscsimdata[collIdx]).first = (*it_Coll).first.get_identifier32().get_compact(); + const CscSimData &transsimData = (*it_Coll).second; + Muon::CscSimData_p2 &perssimData = persCol->m_cscsimdata[collIdx].second; + m_cscsimdataCnv.transToPers(&transsimData, &perssimData, log); + } + + log << MSG::DEBUG << " Writing CscSimDataCollection" << endmsg; } diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonDigitContainer/MuonSimDataCnv_p2.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonDigitContainer/MuonSimDataCnv_p2.cxx index 4179e11da6b61980128bee55a841a55356d5f015..1f06f56eeaab9d6035560503d263ec5b08eaa81a 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonDigitContainer/MuonSimDataCnv_p2.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonDigitContainer/MuonSimDataCnv_p2.cxx @@ -32,6 +32,21 @@ void MuonSimDataCnv_p2::persToTrans(const Muon::MuonSimData_p2 * persObj, MuonSi transObj->setTime(persObj->t); } -void MuonSimDataCnv_p2::transToPers( const MuonSimData *, Muon::MuonSimData_p2 *, MsgStream & /*log*/){ - throw std::runtime_error("MuonSimDataCnv_p2::transToPers is not supported in this release!"); +void MuonSimDataCnv_p2::transToPers( const MuonSimData * transObj, Muon::MuonSimData_p2 * persObj, MsgStream & log){ + log << MSG::DEBUG << "MuonSimDataCnv_p2::TransToPers" << endmsg; + persObj->m_word = transObj->word(); + Amg::Vector3D pos = transObj->globalPosition(); + persObj->x = pos.x(); + persObj->y = pos.y(); + persObj->z = pos.z(); + persObj->t = transObj->getTime(); + persObj->m_deposits.clear(); + persObj->m_deposits.reserve(transObj->getdeposits().size()); + for (const MuonSimData::Deposit& d : transObj->getdeposits()) { + HepMcParticleLink_p2 persMcPartLink; + m_mcpartlinkCnv.transToPers(&d.first, &persMcPartLink, log); + Muon::MuonMCData_p1 persMcData; + m_mcdataCnv.transToPers(&d.second, &persMcData, log); + persObj->m_deposits.emplace_back(persMcPartLink, persMcData); + } } diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonDigitContainer/MuonSimDataCollectionCnv_p2.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonDigitContainer/MuonSimDataCollectionCnv_p2.cxx index 6d07242ab647be0fd59fa16fdf1a4be4f5ea1ca4..0cb2ad1fada5a6d2ec4ccdb251544a085eee1648 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonDigitContainer/MuonSimDataCollectionCnv_p2.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonDigitContainer/MuonSimDataCollectionCnv_p2.cxx @@ -26,6 +26,21 @@ void MuonSimDataCollectionCnv_p2::persToTrans(const Muon::MuonSimDataCollection_ } -void MuonSimDataCollectionCnv_p2::transToPers(const MuonSimDataCollection*, Muon::MuonSimDataCollection_p2*, MsgStream &/*log*/) { - throw std::runtime_error("MuonSimDataCollectionCnv_p2::transToPers is not supported in this release!"); +void MuonSimDataCollectionCnv_p2::transToPers(const MuonSimDataCollection* transCol, Muon::MuonSimDataCollection_p2* persCol, MsgStream &log) { + + log << MSG::DEBUG << "MuonSimDataCollectionCnv_p2::transToPers" << endmsg; + MuonSimDataCollection::const_iterator it_Coll = transCol->begin(); + MuonSimDataCollection::const_iterator it_CollEnd = transCol->end(); + + persCol->m_muonsimdata.resize(transCol->size()); + log << MSG::DEBUG << " Preparing " << persCol->m_muonsimdata.size() << " Collections" << endmsg; + + for(int collIdx=0; it_Coll != it_CollEnd; it_Coll++, collIdx++){ + (persCol->m_muonsimdata[collIdx]).first = (*it_Coll).first.get_identifier32().get_compact(); + const MuonSimData &transsimData = (*it_Coll).second; + Muon::MuonSimData_p2 &perssimData = persCol->m_muonsimdata[collIdx].second; + m_muonsimdataCnv.transToPers(&transsimData, &perssimData, log); + } + + log << MSG::DEBUG << " Writing MuonSimDataCollection" << endmsg; } diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p1_test.cxx index ef454f10eb24b1fbbbbb1cb8e42d2133981cab91..2d7ec36480d032f453e392cab357ec7f77790b16 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p1_test.cxx @@ -76,16 +76,16 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector) std::cout << "test1\n"; const HepMC::GenParticle *particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(particle->barcode(),0); + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; std::vector<CscSimData::Deposit> deps; - HepMcParticleLink trkLink1(genPartVector.at(0)->barcode(),0); + HepMcParticleLink trkLink1(genPartVector.at(0)->barcode(),genPartVector.at(0)->parent_event()->event_number()); deps.emplace_back (trkLink1, CscMcData ( 2.5, 3.5, 4.5)); - HepMcParticleLink trkLink2(genPartVector.at(1)->barcode(),0); + HepMcParticleLink trkLink2(genPartVector.at(1)->barcode(),genPartVector.at(1)->parent_event()->event_number()); deps.emplace_back (trkLink2, CscMcData (12.5, 13.5, 14.5)); - HepMcParticleLink trkLink3(genPartVector.at(2)->barcode(),0); + HepMcParticleLink trkLink3(genPartVector.at(2)->barcode(),genPartVector.at(2)->parent_event()->event_number()); deps.emplace_back (trkLink3, CscMcData (22.5, 23.5, 24.5)); deps[0].second.setCharge ( 5.5); deps[1].second.setCharge (15.5); diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p2_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..0ac3952866a1e9ed2e372e8485a5ee8fcb426642 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p2_test.cxx @@ -0,0 +1,110 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventTPCnv/test/CscSimDataCnv_p2_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Dec, 2015 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "MuonEventTPCnv/MuonDigitContainer/CscSimDataCnv_p2.h" +#include "TestTools/leakcheck.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenEvent.h" +#include "HepMC/GenParticle.h" + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + + +void compare (const CscMcData& p1, + const CscMcData& p2) +{ + assert (p1.energy() == p2.energy()); + assert (p1.ypos() == p2.ypos()); + assert (p1.zpos() == p2.zpos()); + assert (p1.charge() == p2.charge()); +} + + +void compare (const CscSimData& p1, + const CscSimData& p2) +{ + assert (p1.word() == p2.word()); + const std::vector< CscSimData::Deposit >& dep1 = p1.getdeposits(); + const std::vector< CscSimData::Deposit >& dep2 = p2.getdeposits(); + assert (dep1.size() == dep2.size()); + for (size_t i = 0; i < dep1.size(); i++) { + compare (dep1[i].first, dep2[i].first); + assert (dep1[i].first == dep2[i].first); + compare (dep1[i].second, dep2[i].second); + } +} + + +void testit (const CscSimData& trans1) +{ + MsgStream log (0, "test"); + CscSimDataCnv_p2 cnv; + Muon::CscSimData_p2 pers; + cnv.transToPers (&trans1, &pers, log); + CscSimData trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*>& genPartVector) +{ + std::cout << "test1\n"; + const HepMC::GenParticle *particle = genPartVector.at(0); + // Create HepMcParticleLink outside of leak check. + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); + assert(dummyHMPL.cptr()==particle); + Athena_test::Leakcheck check; + + std::vector<CscSimData::Deposit> deps; + HepMcParticleLink trkLink1(genPartVector.at(0)->barcode(),genPartVector.at(0)->parent_event()->event_number()); + deps.emplace_back (trkLink1, CscMcData ( 2.5, 3.5, 4.5)); + HepMcParticleLink trkLink2(genPartVector.at(1)->barcode(),genPartVector.at(1)->parent_event()->event_number()); + deps.emplace_back (trkLink2, CscMcData (12.5, 13.5, 14.5)); + HepMcParticleLink trkLink3(genPartVector.at(2)->barcode(),genPartVector.at(2)->parent_event()->event_number()); + deps.emplace_back (trkLink3, CscMcData (22.5, 23.5, 24.5)); + deps[0].second.setCharge ( 5.5); + deps[1].second.setCharge (15.5); + deps[2].second.setCharge (25.5); + CscSimData trans1 (deps, 4321); + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(genPartVector); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p1_test.cxx index 1ad780392d53e1202fc3dd50eddb238df1314416..53a5486e523ca7a415490b52be3773e2aea77e5a 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p1_test.cxx @@ -90,18 +90,18 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector) std::cout << "test1\n"; const HepMC::GenParticle *particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(particle->barcode(),0); + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; CscSimDataCollection trans1; for (int i=0; i < 3; i++) { std::vector<CscSimData::Deposit> deps; - HepMcParticleLink trkLink1(genPartVector.at(0+(3*i))->barcode(),0); + HepMcParticleLink trkLink1(genPartVector.at(0+(3*i))->barcode(),genPartVector.at(0+(3*i))->parent_event()->event_number()); deps.emplace_back (trkLink1, CscMcData ( 2.5, 3.5, 4.5)); - HepMcParticleLink trkLink2(genPartVector.at(1+(3*i))->barcode(),0); + HepMcParticleLink trkLink2(genPartVector.at(1+(3*i))->barcode(),genPartVector.at(1+(3*i))->parent_event()->event_number()); deps.emplace_back (trkLink2, CscMcData (12.5, 13.5, 14.5)); - HepMcParticleLink trkLink3(genPartVector.at(2+(3*i))->barcode(),0); + HepMcParticleLink trkLink3(genPartVector.at(2+(3*i))->barcode(),genPartVector.at(2+(3*i))->parent_event()->event_number()); deps.emplace_back (trkLink3, CscMcData (22.5, 23.5, 24.5)); deps[0].second.setCharge ( 5.5+i); deps[1].second.setCharge (15.5+i); diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p2_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..3a6eb294ab88f097fa87785188d7ee47d677b300 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p2_test.cxx @@ -0,0 +1,126 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventTPCnv/test/CscSimDataCollectionCnv_p2_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Dec, 2015 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "MuonEventTPCnv/MuonDigitContainer/CscSimDataCollectionCnv_p2.h" +#include "TestTools/leakcheck.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenEvent.h" +#include "HepMC/GenParticle.h" + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + + +void compare (const CscMcData& p1, + const CscMcData& p2) +{ + assert (p1.energy() == p2.energy()); + assert (p1.ypos() == p2.ypos()); + assert (p1.zpos() == p2.zpos()); + assert (p1.charge() == p2.charge()); +} + + +void compare (const CscSimData& p1, + const CscSimData& p2) +{ + assert (p1.word() == p2.word()); + const std::vector< CscSimData::Deposit >& dep1 = p1.getdeposits(); + const std::vector< CscSimData::Deposit >& dep2 = p2.getdeposits(); + assert (dep1.size() == dep2.size()); + for (size_t i = 0; i < dep1.size(); i++) { + compare (dep1[i].first, dep2[i].first); + assert (dep1[i].first == dep2[i].first); + compare (dep1[i].second, dep2[i].second); + } +} + + +void compare (const CscSimDataCollection& p1, + const CscSimDataCollection& p2) +{ + assert (p1.size() == p2.size()); + CscSimDataCollection::const_iterator it1 = p1.begin(); + CscSimDataCollection::const_iterator it2 = p2.begin(); + for (; it1 != p1.end(); ++it1, ++it2) { + assert (it1->first == it2->first); + compare (it1->second, it2->second); + } +} + + +void testit (const CscSimDataCollection& trans1) +{ + MsgStream log (0, "test"); + CscSimDataCollectionCnv_p2 cnv; + Muon::CscSimDataCollection_p2 pers; + cnv.transToPers (&trans1, &pers, log); + CscSimDataCollection trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*>& genPartVector) +{ + std::cout << "test1\n"; + const HepMC::GenParticle *particle = genPartVector.at(0); + // Create HepMcParticleLink outside of leak check. + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); + assert(dummyHMPL.cptr()==particle); + Athena_test::Leakcheck check; + + CscSimDataCollection trans1; + for (int i=0; i < 3; i++) { + std::vector<CscSimData::Deposit> deps; + HepMcParticleLink trkLink1(genPartVector.at(0+(3*i))->barcode(),genPartVector.at(0+(3*i))->parent_event()->event_number()); + deps.emplace_back (trkLink1, CscMcData ( 2.5, 3.5, 4.5)); + HepMcParticleLink trkLink2(genPartVector.at(1+(3*i))->barcode(),genPartVector.at(1+(3*i))->parent_event()->event_number()); + deps.emplace_back (trkLink2, CscMcData (12.5, 13.5, 14.5)); + HepMcParticleLink trkLink3(genPartVector.at(2+(3*i))->barcode(),genPartVector.at(2+(3*i))->parent_event()->event_number()); + deps.emplace_back (trkLink3, CscMcData (22.5, 23.5, 24.5)); + deps[0].second.setCharge ( 5.5+i); + deps[1].second.setCharge (15.5+i); + deps[2].second.setCharge (25.5+i); + trans1[Identifier(1234+i)] = CscSimData (deps, 4321+i); + } + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(genPartVector); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p1_test.cxx index 04807c11bb78918e26a2f09c8436ada3e4d81a82..ec68ac382cc046b12b28d1ae08949998a6298ba9 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p1_test.cxx @@ -76,16 +76,16 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector) std::cout << "test1\n"; const HepMC::GenParticle *particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(particle->barcode(),0); + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; std::vector<MuonSimData::Deposit> deps; - HepMcParticleLink trkLink1(genPartVector.at(0)->barcode(),0); + HepMcParticleLink trkLink1(genPartVector.at(0)->barcode(),genPartVector.at(0)->parent_event()->event_number()); deps.emplace_back (trkLink1, MuonMCData ( 2.5, 3.5)); - HepMcParticleLink trkLink2(genPartVector.at(1)->barcode(),0); + HepMcParticleLink trkLink2(genPartVector.at(1)->barcode(),genPartVector.at(1)->parent_event()->event_number()); deps.emplace_back (trkLink2, MuonMCData (12.5, 13.5)); - HepMcParticleLink trkLink3(genPartVector.at(2)->barcode(),0); + HepMcParticleLink trkLink3(genPartVector.at(2)->barcode(),genPartVector.at(2)->parent_event()->event_number()); deps.emplace_back (trkLink3, MuonMCData (22.5, 23.5)); MuonSimData trans1 (deps, 4321); trans1.setPosition (Amg::Vector3D ( 4.5, 5.5, 6.5)); diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p2_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d16345206215f6497b4d49b97c0e85a4a0668cfd --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p2_test.cxx @@ -0,0 +1,107 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventTPCnv/test/MuonSimDataCnv_p2_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Dec, 2015 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "MuonEventTPCnv/MuonDigitContainer/MuonSimDataCnv_p2.h" +#include "TestTools/leakcheck.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + + +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenEvent.h" +#include "HepMC/GenParticle.h" + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + + +void compare (const MuonMCData& p1, + const MuonMCData& p2) +{ + assert (p1.firstEntry() == p2.firstEntry()); + assert (p1.secondEntry() == p2.secondEntry()); +} + + +void compare (const MuonSimData& p1, + const MuonSimData& p2) +{ + assert (p1.word() == p2.word()); + assert (p1.globalPosition() == p2.globalPosition()); + const std::vector< MuonSimData::Deposit >& dep1 = p1.getdeposits(); + const std::vector< MuonSimData::Deposit >& dep2 = p2.getdeposits(); + assert (dep1.size() == dep2.size()); + for (size_t i = 0; i < dep1.size(); i++) { + compare (dep1[i].first, dep2[i].first); + assert (dep1[i].first == dep2[i].first); + compare (dep1[i].second, dep2[i].second); + } +} + + +void testit (const MuonSimData& trans1) +{ + MsgStream log (0, "test"); + MuonSimDataCnv_p2 cnv; + Muon::MuonSimData_p2 pers; + cnv.transToPers (&trans1, &pers, log); + MuonSimData trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*>& genPartVector) +{ + std::cout << "test1\n"; + const HepMC::GenParticle *particle = genPartVector.at(0); + // Create HepMcParticleLink outside of leak check. + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); + assert(dummyHMPL.cptr()==particle); + Athena_test::Leakcheck check; + + std::vector<MuonSimData::Deposit> deps; + HepMcParticleLink trkLink1(genPartVector.at(0)->barcode(),genPartVector.at(0)->parent_event()->event_number()); + deps.emplace_back (trkLink1, MuonMCData ( 2.5, 3.5)); + HepMcParticleLink trkLink2(genPartVector.at(1)->barcode(),genPartVector.at(1)->parent_event()->event_number()); + deps.emplace_back (trkLink2, MuonMCData (12.5, 13.5)); + HepMcParticleLink trkLink3(genPartVector.at(2)->barcode(),genPartVector.at(2)->parent_event()->event_number()); + deps.emplace_back (trkLink3, MuonMCData (22.5, 23.5)); + MuonSimData trans1 (deps, 4321); + trans1.setPosition (Amg::Vector3D ( 4.5, 5.5, 6.5)); + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(genPartVector); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p1_test.cxx index 7edb71ecd03d2a0f0435887e65c09c2ec353dff2..0a45237534431f9ce0d92bf1d46a1abbeba89511 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p1_test.cxx @@ -89,18 +89,18 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector) std::cout << "test1\n"; const HepMC::GenParticle *particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(particle->barcode(),0); + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; MuonSimDataCollection trans1; for (int i=0; i < 3; i++) { std::vector<MuonSimData::Deposit> deps; - HepMcParticleLink trkLink1(genPartVector.at(0+(3*i))->barcode(),0); + HepMcParticleLink trkLink1(genPartVector.at(0+(3*i))->barcode(),genPartVector.at(0+(3*i))->parent_event()->event_number()); deps.emplace_back (trkLink1, MuonMCData ( 2.5+i, 3.5+i)); - HepMcParticleLink trkLink2(genPartVector.at(1+(3*i))->barcode(),0); + HepMcParticleLink trkLink2(genPartVector.at(1+(3*i))->barcode(),genPartVector.at(1+(3*i))->parent_event()->event_number()); deps.emplace_back (trkLink2, MuonMCData (12.5+i, 13.5+i)); - HepMcParticleLink trkLink3(genPartVector.at(2+(3*i))->barcode(),0); + HepMcParticleLink trkLink3(genPartVector.at(2+(3*i))->barcode(),genPartVector.at(2+(3*i))->parent_event()->event_number()); deps.emplace_back (trkLink3, MuonMCData (22.5+i, 23.5+i)); trans1[Identifier(1234+i)] = MuonSimData (deps, 4321+i); trans1[Identifier(1234+i)].setPosition (Amg::Vector3D(4.5+i, 5.5+i, 6.5+i)); diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p2_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..ff51f024e515bdc893b2aacd9f68935ad442102c --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p2_test.cxx @@ -0,0 +1,122 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonEventTPCnv/test/MuonSimDataCollectionCnv_p2_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Dec, 2015 + * @brief Regression tests. + */ + +#undef NDEBUG +#include "MuonEventTPCnv/MuonDigitContainer/MuonSimDataCollectionCnv_p2.h" +#include "TestTools/leakcheck.h" +#include "GaudiKernel/MsgStream.h" +#include <cassert> +#include <iostream> + +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenEvent.h" +#include "HepMC/GenParticle.h" + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + + +void compare (const MuonMCData& p1, + const MuonMCData& p2) +{ + assert (p1.firstEntry() == p2.firstEntry()); + assert (p1.secondEntry() == p2.secondEntry()); +} + + +void compare (const MuonSimData& p1, + const MuonSimData& p2) +{ + assert (p1.word() == p2.word()); + assert (p1.globalPosition() == p2.globalPosition()); + const std::vector< MuonSimData::Deposit >& dep1 = p1.getdeposits(); + const std::vector< MuonSimData::Deposit >& dep2 = p2.getdeposits(); + assert (dep1.size() == dep2.size()); + for (size_t i = 0; i < dep1.size(); i++) { + compare (dep1[i].first, dep2[i].first); + assert (dep1[i].first == dep2[i].first); + compare (dep1[i].second, dep2[i].second); + } +} + + +void compare (const MuonSimDataCollection& p1, + const MuonSimDataCollection& p2) +{ + assert (p1.size() == p2.size()); + MuonSimDataCollection::const_iterator it1 = p1.begin(); + MuonSimDataCollection::const_iterator it2 = p2.begin(); + for (; it1 != p1.end(); ++it1, ++it2) { + assert (it1->first == it2->first); + compare (it1->second, it2->second); + } +} + + +void testit (const MuonSimDataCollection& trans1) +{ + MsgStream log (0, "test"); + MuonSimDataCollectionCnv_p2 cnv; + Muon::MuonSimDataCollection_p2 pers; + cnv.transToPers (&trans1, &pers, log); + MuonSimDataCollection trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*>& genPartVector) +{ + std::cout << "test1\n"; + const HepMC::GenParticle *particle = genPartVector.at(0); + // Create HepMcParticleLink outside of leak check. + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); + assert(dummyHMPL.cptr()==particle); + Athena_test::Leakcheck check; + + MuonSimDataCollection trans1; + for (int i=0; i < 3; i++) { + std::vector<MuonSimData::Deposit> deps; + HepMcParticleLink trkLink1(genPartVector.at(0+(3*i))->barcode(),genPartVector.at(0+(3*i))->parent_event()->event_number()); + deps.emplace_back (trkLink1, MuonMCData ( 2.5+i, 3.5+i)); + HepMcParticleLink trkLink2(genPartVector.at(1+(3*i))->barcode(),genPartVector.at(1+(3*i))->parent_event()->event_number()); + deps.emplace_back (trkLink2, MuonMCData (12.5+i, 13.5+i)); + HepMcParticleLink trkLink3(genPartVector.at(2+(3*i))->barcode(),genPartVector.at(2+(3*i))->parent_event()->event_number()); + deps.emplace_back (trkLink3, MuonMCData (22.5+i, 23.5+i)); + trans1[Identifier(1234+i)] = MuonSimData (deps, 4321+i); + trans1[Identifier(1234+i)].setPosition (Amg::Vector3D(4.5+i, 5.5+i, 6.5+i)); + } + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(genPartVector); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/CSCSimHitCollectionCnv.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/CSCSimHitCollectionCnv.cxx index 8917fd0d87365b328d165cae1ac6f2a385bbb6f9..a4a3a106cde24790e94b77fed73542354b82a035 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/CSCSimHitCollectionCnv.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/CSCSimHitCollectionCnv.cxx @@ -29,7 +29,7 @@ CSCSimHitCollectionCnv::~CSCSimHitCollectionCnv() { CSCSimHitCollection_PERS* CSCSimHitCollectionCnv::createPersistent (CSCSimHitCollection* transCont) { MsgStream log(msgSvc(), "CSCSimHitCollectionCnv" ); if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createPersistent(): main converter"<<endmsg; - CSCSimHitCollection_PERS *pixdc_p= m_TPConverter_p2.createPersistent( transCont, log ); + CSCSimHitCollection_PERS *pixdc_p= m_TPConverter_p3.createPersistent( transCont, log ); return pixdc_p; } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/CSCSimHitCollectionCnv.h b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/CSCSimHitCollectionCnv.h index 7ae687f2706f9a0804b6340f1a0a11e2b9dbf1ad..f0c2ade2268f179b5c21f4e1c75a59d1f7e6ed22 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/CSCSimHitCollectionCnv.h +++ b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/CSCSimHitCollectionCnv.h @@ -13,7 +13,7 @@ #include "MuonSimEventTPCnv/CSCSimHitCollectionCnv_p3.h" // the latest persistent representation type of DataCollection: -typedef Muon::CSCSimHitCollection_p2 CSCSimHitCollection_PERS; +typedef Muon::CSCSimHitCollection_p3 CSCSimHitCollection_PERS; typedef T_AthenaPoolCustomCnv<CSCSimHitCollection, CSCSimHitCollection_PERS > CSCSimHitCollectionCnvBase; /** diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/GenericMuonSimHitCollectionCnv.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/GenericMuonSimHitCollectionCnv.cxx index 579f351d33855abcc52b0c98d340626248adbaf3..c72c800d6b81d9adbaaecd25b10927c23a5c5682 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/GenericMuonSimHitCollectionCnv.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/GenericMuonSimHitCollectionCnv.cxx @@ -27,7 +27,7 @@ GenericMuonSimHitCollectionCnv::~GenericMuonSimHitCollectionCnv() { GenericMuonSimHitCollection_PERS* GenericMuonSimHitCollectionCnv::createPersistent (GenericMuonSimHitCollection* transCont) { MsgStream log(msgSvc(), "GenericMuonSimHitCollectionCnv" ); ATH_MSG_DEBUG("createPersistent(): main converter"); - GenericMuonSimHitCollection_PERS *pixdc_p= m_TPConverter_p1.createPersistent( transCont, log ); + GenericMuonSimHitCollection_PERS *pixdc_p= m_TPConverter_p2.createPersistent( transCont, log ); return pixdc_p; } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/GenericMuonSimHitCollectionCnv.h b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/GenericMuonSimHitCollectionCnv.h index 7a401c468034b644011dffc6055b29c3cc135576..d6bf07b975b5bf2e1eda4231c2d096f40e8466b0 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/GenericMuonSimHitCollectionCnv.h +++ b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/GenericMuonSimHitCollectionCnv.h @@ -12,7 +12,7 @@ #include "MuonSimEventTPCnv/GenericMuonSimHitCollectionCnv_p2.h" // the latest persistent representation type of DataCollection: -typedef Muon::GenericMuonSimHitCollection_p1 GenericMuonSimHitCollection_PERS; +typedef Muon::GenericMuonSimHitCollection_p2 GenericMuonSimHitCollection_PERS; typedef T_AthenaPoolCustomCnv<GenericMuonSimHitCollection, GenericMuonSimHitCollection_PERS > GenericMuonSimHitCollectionCnvBase; /** diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/MDTSimHitCollectionCnv.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/MDTSimHitCollectionCnv.cxx index 1229f30cc2b21ecea43d75f9c1a48b65ff3150ae..8af15fee70b8c436836e2a44c52221095e62f3d2 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/MDTSimHitCollectionCnv.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/MDTSimHitCollectionCnv.cxx @@ -27,7 +27,7 @@ MDTSimHitCollectionCnv::~MDTSimHitCollectionCnv() { MDTSimHitCollection_PERS* MDTSimHitCollectionCnv::createPersistent (MDTSimHitCollection* transCont) { MsgStream log(msgSvc(), "MDTSimHitCollectionCnv" ); ATH_MSG_DEBUG("createPersistent(): main converter"); - MDTSimHitCollection_PERS *pixdc_p= m_TPConverter_p2.createPersistent( transCont, log ); + MDTSimHitCollection_PERS *pixdc_p= m_TPConverter_p3.createPersistent( transCont, log ); return pixdc_p; } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/MDTSimHitCollectionCnv.h b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/MDTSimHitCollectionCnv.h index 80092feb9d557cc777d74f775b4c9f5e0f03c8e9..0daa28e63d35485efe23e6bf456d593b02d2e5aa 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/MDTSimHitCollectionCnv.h +++ b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/MDTSimHitCollectionCnv.h @@ -13,7 +13,7 @@ #include "MuonSimEventTPCnv/MDTSimHitCollectionCnv_p3.h" // the latest persistent representation type of DataCollection: -typedef Muon::MDTSimHitCollection_p2 MDTSimHitCollection_PERS; +typedef Muon::MDTSimHitCollection_p3 MDTSimHitCollection_PERS; typedef T_AthenaPoolCustomCnv<MDTSimHitCollection, MDTSimHitCollection_PERS > MDTSimHitCollectionCnvBase; /** diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/RPCSimHitCollectionCnv.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/RPCSimHitCollectionCnv.cxx index d10406a4aa120b7238ebc6f7cd97231a19bedec3..62fb3074db56ce815b46da51914883b1b1e508ac 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/RPCSimHitCollectionCnv.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/RPCSimHitCollectionCnv.cxx @@ -29,7 +29,7 @@ RPCSimHitCollectionCnv::~RPCSimHitCollectionCnv() { RPCSimHitCollection_PERS* RPCSimHitCollectionCnv::createPersistent (RPCSimHitCollection* transCont) { MsgStream log(msgSvc(), "RPCSimHitCollectionCnv" ); if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createPersistent(): main converter"<<endmsg; - RPCSimHitCollection_PERS *pixdc_p= m_TPConverter_p2.createPersistent( transCont, log ); + RPCSimHitCollection_PERS *pixdc_p= m_TPConverter_p3.createPersistent( transCont, log ); return pixdc_p; } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/RPCSimHitCollectionCnv.h b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/RPCSimHitCollectionCnv.h index 2cea76b739c78b30603c90217c3cb74f0b400903..8446237fdeee3b4237b3384bd3b44f9ff66e7c7f 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/RPCSimHitCollectionCnv.h +++ b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/RPCSimHitCollectionCnv.h @@ -14,7 +14,7 @@ // the latest persistent representation type of DataCollection: -typedef Muon::RPCSimHitCollection_p2 RPCSimHitCollection_PERS; +typedef Muon::RPCSimHitCollection_p3 RPCSimHitCollection_PERS; typedef T_AthenaPoolCustomCnv<RPCSimHitCollection, RPCSimHitCollection_PERS > RPCSimHitCollectionCnvBase; /** diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/TGCSimHitCollectionCnv.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/TGCSimHitCollectionCnv.cxx index b92a05fa5c228bd7470073e93f6b49391851f21d..8da5e51fe29fbee04a61a7bb97945ea750feb338 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/TGCSimHitCollectionCnv.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/TGCSimHitCollectionCnv.cxx @@ -27,7 +27,7 @@ TGCSimHitCollectionCnv::~TGCSimHitCollectionCnv() { TGCSimHitCollection_PERS* TGCSimHitCollectionCnv::createPersistent (TGCSimHitCollection* transCont) { MsgStream log(msgSvc(), "TGCSimHitCollectionCnv" ); log<<MSG::DEBUG<<"createPersistent(): main converter"<<endmsg; - TGCSimHitCollection_PERS *pixdc_p= m_TPConverter_p3.createPersistent( transCont, log ); + TGCSimHitCollection_PERS *pixdc_p= m_TPConverter_p4.createPersistent( transCont, log ); return pixdc_p; } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/TGCSimHitCollectionCnv.h b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/TGCSimHitCollectionCnv.h index 27e7d9119ef4830a6d07d38405e11693413756a3..47c015a689c0ab3fb81d7e1cffad1bbf4cb2fe13 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/TGCSimHitCollectionCnv.h +++ b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/src/TGCSimHitCollectionCnv.h @@ -14,7 +14,7 @@ #include "MuonSimEventTPCnv/TGCSimHitCollectionCnv_p4.h" // the latest persistent representation type of DataCollection: -typedef Muon::TGCSimHitCollection_p3 TGCSimHitCollection_PERS; +typedef Muon::TGCSimHitCollection_p4 TGCSimHitCollection_PERS; typedef T_AthenaPoolCustomCnv<TGCSimHitCollection, TGCSimHitCollection_PERS > TGCSimHitCollectionCnvBase; /** diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/CMakeLists.txt index e8888b3c98a4e120c50ba1bb5762efc49a1b50f0..e6bad227031f3b4b4f9f7632ebd784a529903c04 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/CMakeLists.txt @@ -52,12 +52,24 @@ atlas_add_test( CSCSimHitCollectionCnv_p2_test INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv MuonSimEvent TestTools StoreGateLib SGtests GeoPrimitives MuonSimEventTPCnv ) +atlas_add_test( CSCSimHitCollectionCnv_p3_test + SOURCES + test/CSCSimHitCollectionCnv_p3_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv MuonSimEvent TestTools StoreGateLib SGtests GeoPrimitives MuonSimEventTPCnv ) + atlas_add_test( GenericMuonSimHitCollectionCnv_p1_test SOURCES test/GenericMuonSimHitCollectionCnv_p1_test.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv MuonSimEvent TestTools StoreGateLib SGtests GeoPrimitives MuonSimEventTPCnv ) +atlas_add_test( GenericMuonSimHitCollectionCnv_p2_test + SOURCES + test/GenericMuonSimHitCollectionCnv_p2_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv MuonSimEvent TestTools StoreGateLib SGtests GeoPrimitives MuonSimEventTPCnv ) + atlas_add_test( MDTSimHitCollectionCnv_p1_test SOURCES test/MDTSimHitCollectionCnv_p1_test.cxx @@ -70,6 +82,12 @@ atlas_add_test( MDTSimHitCollectionCnv_p2_test INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv MuonSimEvent TestTools StoreGateLib SGtests GeoPrimitives MuonSimEventTPCnv ) +atlas_add_test( MDTSimHitCollectionCnv_p3_test + SOURCES + test/MDTSimHitCollectionCnv_p3_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv MuonSimEvent TestTools StoreGateLib SGtests GeoPrimitives MuonSimEventTPCnv ) + atlas_add_test( RPCSimHitCollectionCnv_p1_test SOURCES test/RPCSimHitCollectionCnv_p1_test.cxx @@ -82,6 +100,12 @@ atlas_add_test( RPCSimHitCollectionCnv_p2_test INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv MuonSimEvent TestTools StoreGateLib SGtests GeoPrimitives MuonSimEventTPCnv ) +atlas_add_test( RPCSimHitCollectionCnv_p3_test + SOURCES + test/RPCSimHitCollectionCnv_p3_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv MuonSimEvent TestTools StoreGateLib SGtests GeoPrimitives MuonSimEventTPCnv ) + atlas_add_test( TGCSimHitCollectionCnv_p1_test SOURCES test/TGCSimHitCollectionCnv_p1_test.cxx @@ -100,11 +124,11 @@ atlas_add_test( TGCSimHitCollectionCnv_p3_test INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv MuonSimEvent TestTools StoreGateLib SGtests GeoPrimitives MuonSimEventTPCnv ) -#atlas_add_test( TGCSimHitCollectionCnv_p4_test -# SOURCES -# test/TGCSimHitCollectionCnv_p4_test.cxx -# INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} -# LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv MuonSimEvent TestTools StoreGateLib SGtests GeoPrimitives MuonSimEventTPCnv ) +atlas_add_test( TGCSimHitCollectionCnv_p4_test + SOURCES + test/TGCSimHitCollectionCnv_p4_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthenaPoolCnvSvcLib GaudiKernel GeneratorObjectsTPCnv MuonSimEvent TestTools StoreGateLib SGtests GeoPrimitives MuonSimEventTPCnv ) atlas_add_test( sTGCSimHitCollectionCnv_p1_test SOURCES diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p3_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p3_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..8633d8ace9b4883a00f6e29e68937582b9b5e684 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p3_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/GenericMuonSimHitCollectionCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/GenericMuonSimHitCollectionCnv_p2_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..8633d8ace9b4883a00f6e29e68937582b9b5e684 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/GenericMuonSimHitCollectionCnv_p2_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p3_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p3_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..8633d8ace9b4883a00f6e29e68937582b9b5e684 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p3_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p3_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p3_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..8633d8ace9b4883a00f6e29e68937582b9b5e684 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p3_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p4_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p4_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..8633d8ace9b4883a00f6e29e68937582b9b5e684 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p4_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/CSCSimHitCollectionCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/CSCSimHitCollectionCnv_p1.cxx index 835ebd25da29a5af027d23a53f7a4b5494b02713..ce1b930ac155899c6483c37abeeef3b5ae11f9a1 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/CSCSimHitCollectionCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/CSCSimHitCollectionCnv_p1.cxx @@ -77,7 +77,7 @@ void CSCSimHitCollectionCnv_p1::persToTrans(const Muon::CSCSimHitCollection_p1* hepMcPLCnv.persToTrans(&persCont->m_partLink[i],&link, log); transCont->Emplace (persCont->m_CSCid[i], persCont->m_globalTime[i], persCont->m_energyDeposit[i], start, end, persCont->m_particleID[i], - link.barcode()); + link,-1.); } } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/CSCSimHitCollectionCnv_p2.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/CSCSimHitCollectionCnv_p2.cxx index 69833c0ab807dd20e908cb522542bbae5def3b89..740030214a34b588b96d63c0d8b251036ce6b2c7 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/CSCSimHitCollectionCnv_p2.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/CSCSimHitCollectionCnv_p2.cxx @@ -78,7 +78,7 @@ void CSCSimHitCollectionCnv_p2::persToTrans(const Muon::CSCSimHitCollection_p2* hepMcPLCnv.persToTrans(&persCont->m_partLink[i],&link, log); transCont->Emplace (persCont->m_CSCid[i], persCont->m_globalTime[i], persCont->m_energyDeposit[i], start, end, persCont->m_particleID[i], - link.barcode(), persCont->m_kineticEnergy[i]); + link, persCont->m_kineticEnergy[i]); } } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/CSCSimHitCollectionCnv_p3.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/CSCSimHitCollectionCnv_p3.cxx index 417576ed3aaad4d7e7d57be9b30609815296e4c8..2c555a7a34e5df059476229d9448ab23c97685c6 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/CSCSimHitCollectionCnv_p3.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/CSCSimHitCollectionCnv_p3.cxx @@ -15,9 +15,46 @@ // Athena #include "StoreGate/StoreGateSvc.h" -void CSCSimHitCollectionCnv_p3::transToPers(const CSCSimHitCollection*, Muon::CSCSimHitCollection_p3*, MsgStream &/*log*/) +void CSCSimHitCollectionCnv_p3::transToPers(const CSCSimHitCollection* transCont, Muon::CSCSimHitCollection_p3* persCont, MsgStream &log) { - throw std::runtime_error("CSCSimHitCollectionCnv_p3::transToPers is not supported in this release!"); + // for reasons of efficiency, set size before hand + unsigned int size=transCont->size(); + persCont->m_CSCid.reserve(size); + persCont->m_globalTime.reserve(size); + persCont->m_energyDeposit.reserve(size); + persCont->m_stX.reserve(size); + persCont->m_stY.reserve(size); + persCont->m_stZ.reserve(size); + persCont->m_enX.reserve(size); + persCont->m_enY.reserve(size); + persCont->m_enZ.reserve(size); + persCont->m_particleID.reserve(size); + // persCont->m_meanTime.reserve(size); + persCont->m_partLink.reserve(size); + + // make convertor to handle HepMcParticleLinks + HepMcParticleLinkCnv_p2 hepMcPLCnv; + HepMcParticleLink_p2 persLink; // will use this as a temp object inside the loop + + // loop through container, filling pers object + CSCSimHitCollection::const_iterator it = transCont->begin(), itEnd = transCont->end(); + for (; it != itEnd; ++it) { + persCont->m_CSCid.push_back(it->CSCid()); + persCont->m_globalTime.push_back(it->globalTime()); + persCont->m_energyDeposit.push_back(it->energyDeposit()); + persCont->m_stX.push_back(it->getHitStart().x()); + persCont->m_stY.push_back(it->getHitStart().y()); + persCont->m_stZ.push_back(it->getHitStart().z()); + persCont->m_enX.push_back(it->getHitEnd().x()); + persCont->m_enY.push_back(it->getHitEnd().y()); + persCont->m_enZ.push_back(it->getHitEnd().z()); + persCont->m_particleID.push_back(it->particleID()); + // persCont->m_meanTime.push_back(hit->m_meanTime); + + hepMcPLCnv.transToPers(&(it->particleLink()),&persLink, log); + persCont->m_partLink.push_back(persLink); + persCont->m_kineticEnergy.push_back(it->kineticEnergy()); + } } @@ -41,6 +78,6 @@ void CSCSimHitCollectionCnv_p3::persToTrans(const Muon::CSCSimHitCollection_p3* hepMcPLCnv.persToTrans(&persCont->m_partLink[i],&link, log); transCont->Emplace (persCont->m_CSCid[i], persCont->m_globalTime[i], persCont->m_energyDeposit[i], start, end, persCont->m_particleID[i], - link.barcode(), persCont->m_kineticEnergy[i]); + link, persCont->m_kineticEnergy[i]); } } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/GenericMuonSimHitCollectionCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/GenericMuonSimHitCollectionCnv_p1.cxx index b81b10d41e880f105ce2fc1f42ad66ad31a5660f..0734fefec8eb2a075093e82a6588d891179aa20b 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/GenericMuonSimHitCollectionCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/GenericMuonSimHitCollectionCnv_p1.cxx @@ -112,7 +112,7 @@ void GenericMuonSimHitCollectionCnv_p1::persToTrans(const Muon::GenericMuonSimHi HepMcParticleLink link; hepMcPLCnv.persToTrans(&persCont->m_partLink[i],&link, log); - transCont->Emplace(persCont->m_GenericId[i], persCont->m_globalTime[i], persCont->m_globalpreTime[i], position, loc_position, preposition, loc_preposition, persCont->m_particleEncoding[i], persCont->m_kineticEnergy[i], direction, persCont->m_depositEnergy[i], persCont->m_StepLength[i], link.barcode()); + transCont->Emplace(persCont->m_GenericId[i], persCont->m_globalTime[i], persCont->m_globalpreTime[i], position, loc_position, preposition, loc_preposition, persCont->m_particleEncoding[i], persCont->m_kineticEnergy[i], direction, persCont->m_depositEnergy[i], persCont->m_StepLength[i], link); } } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/GenericMuonSimHitCollectionCnv_p2.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/GenericMuonSimHitCollectionCnv_p2.cxx index c673f7f1ccdbe4a66ac15badef0bb26ae8e8e907..7fa22e0904bb4f480f2e36953024f437a47ac2ea 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/GenericMuonSimHitCollectionCnv_p2.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/GenericMuonSimHitCollectionCnv_p2.cxx @@ -15,9 +15,76 @@ // Athena #include "StoreGate/StoreGateSvc.h" -void GenericMuonSimHitCollectionCnv_p2::transToPers(const GenericMuonSimHitCollection*, Muon::GenericMuonSimHitCollection_p2*, MsgStream &/*log*/) +void GenericMuonSimHitCollectionCnv_p2::transToPers(const GenericMuonSimHitCollection* transCont, Muon::GenericMuonSimHitCollection_p2* persCont, MsgStream &log) { - throw std::runtime_error("GenericMuonSimHitCollectionCnv_p2::transToPers is not supported in this release!"); + // for reasons of efficiency, set size before hand + unsigned int size=transCont->size(); + persCont->m_GenericId.reserve(size); + persCont->m_globalTime.reserve(size); + persCont->m_globalpreTime.reserve(size); + // preStep Global + persCont->m_prestX.reserve(size); + persCont->m_prestY.reserve(size); + persCont->m_prestZ.reserve(size); + // preStep Local + persCont->m_prelocX.reserve(size); + persCont->m_prelocY.reserve(size); + persCont->m_prelocZ.reserve(size); + // postStep Global + persCont->m_stX.reserve(size); + persCont->m_stY.reserve(size); + persCont->m_stZ.reserve(size); + // postStep Local + persCont->m_locX.reserve(size); + persCont->m_locY.reserve(size); + persCont->m_locZ.reserve(size); + persCont->m_kineticEnergy.reserve(size); + persCont->m_particleEncoding.reserve(size); + persCont->m_ptX.reserve(size); + persCont->m_ptY.reserve(size); + persCont->m_ptZ.reserve(size); + persCont->m_depositEnergy.reserve(size); + persCont->m_StepLength.reserve(size); + persCont->m_partLink.reserve(size); + + // make convertor to handle HepMcParticleLinks + HepMcParticleLinkCnv_p2 hepMcPLCnv; + HepMcParticleLink_p2 persLink; // will use this as a temp object inside the loop + + // loop through container, filling pers object + GenericMuonSimHitCollection::const_iterator it = transCont->begin(), itEnd = transCont->end(); + for (; it != itEnd; ++it) { + persCont->m_GenericId.push_back(it->GenericId()); + persCont->m_globalTime.push_back(it->globalTime()); + persCont->m_globalpreTime.push_back(it->globalpreTime()); + // preStep Global + persCont->m_prestX.push_back(it->globalPrePosition().x()); + persCont->m_prestY.push_back(it->globalPrePosition().y()); + persCont->m_prestZ.push_back(it->globalPrePosition().z()); + // preStep Local + persCont->m_prelocX.push_back(it->localPrePosition().x()); + persCont->m_prelocY.push_back(it->localPrePosition().y()); + persCont->m_prelocZ.push_back(it->localPrePosition().z()); + // postStep Global + persCont->m_stX.push_back(it->globalPosition().x()); + persCont->m_stY.push_back(it->globalPosition().y()); + persCont->m_stZ.push_back(it->globalPosition().z()); + // postStep Local + persCont->m_locX.push_back(it->localPosition().x()); + persCont->m_locY.push_back(it->localPosition().y()); + persCont->m_locZ.push_back(it->localPosition().z()); + persCont->m_kineticEnergy.push_back(it->kineticEnergy()); + persCont->m_particleEncoding.push_back(it->particleEncoding()); + persCont->m_ptX.push_back(it->globalDirection().x()); + persCont->m_ptY.push_back(it->globalDirection().y()); + persCont->m_ptZ.push_back(it->globalDirection().z()); + persCont->m_depositEnergy.push_back(it->depositEnergy()); + persCont->m_StepLength.push_back(it->StepLength()); + + hepMcPLCnv.transToPers(&it->particleLink(),&persLink, log); + persCont->m_partLink.push_back(persLink); + + } } @@ -45,6 +112,7 @@ void GenericMuonSimHitCollectionCnv_p2::persToTrans(const Muon::GenericMuonSimHi HepMcParticleLink link; hepMcPLCnv.persToTrans(&persCont->m_partLink[i],&link, log); - transCont->Emplace(persCont->m_GenericId[i], persCont->m_globalTime[i], persCont->m_globalpreTime[i], position, loc_position, preposition, loc_preposition, persCont->m_particleEncoding[i], persCont->m_kineticEnergy[i], direction, persCont->m_depositEnergy[i], persCont->m_StepLength[i], link.barcode()); + transCont->Emplace(persCont->m_GenericId[i], persCont->m_globalTime[i], persCont->m_globalpreTime[i], position, loc_position, preposition, loc_preposition, persCont->m_particleEncoding[i], persCont->m_kineticEnergy[i], direction, persCont->m_depositEnergy[i], persCont->m_StepLength[i], link); } } + diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/MDTSimHitCollectionCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/MDTSimHitCollectionCnv_p1.cxx index 60e027787fca6a2d338269717590fc1501891e4d..8c3c1758e9c1a92a0f531e43b01e3d2ac187ddf5 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/MDTSimHitCollectionCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/MDTSimHitCollectionCnv_p1.cxx @@ -68,7 +68,7 @@ void MDTSimHitCollectionCnv_p1::persToTrans(const Muon::MDTSimHitCollection_p1* hepMcPLCnv.persToTrans(&persCont->m_partLink[i],&link, log); transCont->Emplace(persCont->m_MDTid[i], persCont->m_globalTime[i], persCont->m_driftRadius[i], position, - link.barcode()); + link,-9999999.,-1.,0,-1.); } } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/MDTSimHitCollectionCnv_p2.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/MDTSimHitCollectionCnv_p2.cxx index 0ce3bfd83af401c618d910be905d6ac7c8863b2d..1ecd7e78c48f170df2f473774290fec4cf860b65 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/MDTSimHitCollectionCnv_p2.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/MDTSimHitCollectionCnv_p2.cxx @@ -77,7 +77,7 @@ void MDTSimHitCollectionCnv_p2::persToTrans(const Muon::MDTSimHitCollection_p2* hepMcPLCnv.persToTrans(&persCont->m_partLink[i],&link, log); transCont->Emplace(persCont->m_MDTid[i], persCont->m_globalTime[i], persCont->m_driftRadius[i], position, - link.barcode(), + link, persCont->m_stepLength[i], persCont->m_energyDeposit[i], persCont->m_particleEncoding[i], persCont->m_kineticEnergy[i]); } } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/MDTSimHitCollectionCnv_p3.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/MDTSimHitCollectionCnv_p3.cxx index f5049e4536c837f6782cc057d312a7a0ab58b966..b1ffe1bfa37c6d70ac4cb5cf9ec75780da4f17f3 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/MDTSimHitCollectionCnv_p3.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/MDTSimHitCollectionCnv_p3.cxx @@ -15,9 +15,46 @@ // Athena #include "StoreGate/StoreGateSvc.h" -void MDTSimHitCollectionCnv_p3::transToPers(const MDTSimHitCollection*, Muon::MDTSimHitCollection_p3*, MsgStream &/*log*/) +void MDTSimHitCollectionCnv_p3::transToPers(const MDTSimHitCollection* transCont, Muon::MDTSimHitCollection_p3* persCont, MsgStream &log) { - throw std::runtime_error("MDTSimHitCollectionCnv_p3::transToPers is not supported in this release!"); + // for reasons of efficiency, set size before hand + unsigned int size=transCont->size(); + persCont->m_MDTid.reserve(size); + persCont->m_globalTime.reserve(size); + persCont->m_driftRadius.reserve(size); + persCont->m_stX.reserve(size); + persCont->m_stY.reserve(size); + persCont->m_stZ.reserve(size); + persCont->m_stepLength.reserve(size); + persCont->m_energyDeposit.reserve(size); + persCont->m_particleEncoding.reserve(size); + persCont->m_kineticEnergy.reserve(size); + // persCont->m_meanTime.reserve(size); + persCont->m_partLink.reserve(size); + + // make convertor to handle HepMcParticleLinks + HepMcParticleLinkCnv_p2 hepMcPLCnv; + HepMcParticleLink_p2 persLink; // will use this as a temp object inside the loop + + // loop through container, filling pers object + MDTSimHitCollection::const_iterator it = transCont->begin(), itEnd = transCont->end(); + for (; it != itEnd; ++it) { + persCont->m_MDTid.push_back(it->MDTid()); + persCont->m_globalTime.push_back(it->globalTime()); + persCont->m_driftRadius.push_back(it->driftRadius()); + persCont->m_stX.push_back(it->localPosition().x()); + persCont->m_stY.push_back(it->localPosition().y()); + persCont->m_stZ.push_back(it->localPosition().z()); + // persCont->m_meanTime.push_back(hit->m_meanTime); + persCont->m_stepLength.push_back(it->stepLength()); + persCont->m_energyDeposit.push_back(it->energyDeposit()); + persCont->m_particleEncoding.push_back(it->particleEncoding()); + persCont->m_kineticEnergy.push_back(it->kineticEnergy()); + + hepMcPLCnv.transToPers(&it->particleLink(),&persLink, log); + persCont->m_partLink.push_back(persLink); + + } } @@ -40,7 +77,8 @@ void MDTSimHitCollectionCnv_p3::persToTrans(const Muon::MDTSimHitCollection_p3* hepMcPLCnv.persToTrans(&persCont->m_partLink[i],&link, log); transCont->Emplace(persCont->m_MDTid[i], persCont->m_globalTime[i], persCont->m_driftRadius[i], position, - link.barcode(), + link, persCont->m_stepLength[i], persCont->m_energyDeposit[i], persCont->m_particleEncoding[i], persCont->m_kineticEnergy[i]); } } + diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/RPCSimHitCollectionCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/RPCSimHitCollectionCnv_p1.cxx index a92dc6f9e950c381ff3190183153abe512ac8f91..d6c12b83a6f9257d305514d9b9d06116f1c07d15 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/RPCSimHitCollectionCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/RPCSimHitCollectionCnv_p1.cxx @@ -67,7 +67,7 @@ void RPCSimHitCollectionCnv_p1::persToTrans(const Muon::RPCSimHitCollection_p1* hepMcPLCnv.persToTrans(&persCont->m_partLink[i],&link, log); transCont->Emplace(persCont->m_RPCid[i], persCont->m_globalTime[i], position, - link.barcode()); + link,Amg::Vector3D(0.,0.,0.),-1,-1,0,-1); } } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/RPCSimHitCollectionCnv_p2.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/RPCSimHitCollectionCnv_p2.cxx index c97821d354f8496c769c4a672f6c3e79ed86e666..9cdaa9e1864435b6e7a0d4e28a7ccec060ff60b3 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/RPCSimHitCollectionCnv_p2.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/RPCSimHitCollectionCnv_p2.cxx @@ -80,7 +80,7 @@ void RPCSimHitCollectionCnv_p2::persToTrans(const Muon::RPCSimHitCollection_p2* hepMcPLCnv.persToTrans(&persCont->m_partLink[i],&link, log); transCont->Emplace(persCont->m_RPCid[i], persCont->m_globalTime[i], position, - link.barcode(), postPosition, + link, postPosition, persCont->m_energyDeposit[i], persCont->m_stepLength[i], persCont->m_particleEncoding[i], persCont->m_kineticEnergy[i]); } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/RPCSimHitCollectionCnv_p3.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/RPCSimHitCollectionCnv_p3.cxx index 30c466a2f4865162a7fd61614ee9501e281a5f8c..c0157c2dc802f731ff9222e13b1ca0831f5a4a7a 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/RPCSimHitCollectionCnv_p3.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/RPCSimHitCollectionCnv_p3.cxx @@ -15,9 +15,47 @@ // Athena #include "StoreGate/StoreGateSvc.h" -void RPCSimHitCollectionCnv_p3::transToPers(const RPCSimHitCollection*, Muon::RPCSimHitCollection_p3*, MsgStream &/*log*/) +void RPCSimHitCollectionCnv_p3::transToPers(const RPCSimHitCollection* transCont, Muon::RPCSimHitCollection_p3* persCont, MsgStream &log) { - throw std::runtime_error("RPCSimHitCollectionCnv_p3::transToPers is not supported in this release!"); + // for reasons of efficiency, set size before hand + unsigned int size=transCont->size(); + persCont->m_RPCid.reserve(size); + persCont->m_globalTime.reserve(size); + persCont->m_stX.reserve(size); + persCont->m_stY.reserve(size); + persCont->m_stZ.reserve(size); + persCont->m_partLink.reserve(size); + persCont->m_stopX.reserve(size); + persCont->m_stopY.reserve(size); + persCont->m_stopZ.reserve(size); + persCont->m_energyDeposit.reserve(size); + persCont->m_stepLength.reserve(size); + persCont->m_particleEncoding.reserve(size); + persCont->m_kineticEnergy.reserve(size); + + // make convertor to handle HepMcParticleLinks + HepMcParticleLinkCnv_p2 hepMcPLCnv; + HepMcParticleLink_p2 persLink; // will use this as a temp object inside the loop + + // loop through container, filling pers object + RPCSimHitCollection::const_iterator it = transCont->begin(), itEnd = transCont->end(); + for (; it != itEnd; ++it) { + persCont->m_RPCid.push_back(it->RPCid()); + persCont->m_globalTime.push_back(it->globalTime()); + persCont->m_stX.push_back(it->localPosition().x()); + persCont->m_stY.push_back(it->localPosition().y()); + persCont->m_stZ.push_back(it->localPosition().z()); + + hepMcPLCnv.transToPers(&it->particleLink(),&persLink, log); + persCont->m_partLink.push_back(persLink); + persCont->m_stopX.push_back(it->postLocalPosition().x()); + persCont->m_stopY.push_back(it->postLocalPosition().y()); + persCont->m_stopZ.push_back(it->postLocalPosition().z()); + persCont->m_energyDeposit.push_back(it->energyDeposit()); + persCont->m_stepLength.push_back(it->stepLength()); + persCont->m_particleEncoding.push_back(it->particleEncoding()); + persCont->m_kineticEnergy.push_back(it->kineticEnergy()); + } } @@ -42,8 +80,9 @@ void RPCSimHitCollectionCnv_p3::persToTrans(const Muon::RPCSimHitCollection_p3* hepMcPLCnv.persToTrans(&persCont->m_partLink[i],&link, log); transCont->Emplace(persCont->m_RPCid[i], persCont->m_globalTime[i], position, - link.barcode(), postPosition, + link, postPosition, persCont->m_energyDeposit[i], persCont->m_stepLength[i], persCont->m_particleEncoding[i], persCont->m_kineticEnergy[i]); } } + diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/TGCSimHitCollectionCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/TGCSimHitCollectionCnv_p1.cxx index a43442116066ba27057c709902b33cdd310099d4..66247ed31e8642a94d0fdc3f537f0efeec162e7c 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/TGCSimHitCollectionCnv_p1.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/TGCSimHitCollectionCnv_p1.cxx @@ -71,7 +71,7 @@ void TGCSimHitCollectionCnv_p1::persToTrans(const Muon::TGCSimHitCollection_p1* hepMcPLCnv.persToTrans(&persCont->m_partLink[i],&link, log); transCont->Emplace(persCont->m_TGCid[i], persCont->m_globalTime[i], position, localDireCos, - link.barcode(), 0, 0); + link, 0, 0); } } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/TGCSimHitCollectionCnv_p2.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/TGCSimHitCollectionCnv_p2.cxx index 9145bb977b0983527f036dead1a6e84de833b976..878a29b72b0da91e3fbf8b9f61aae64ff2b5b51e 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/TGCSimHitCollectionCnv_p2.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/TGCSimHitCollectionCnv_p2.cxx @@ -75,7 +75,7 @@ void TGCSimHitCollectionCnv_p2::persToTrans(const Muon::TGCSimHitCollection_p2* hepMcPLCnv.persToTrans(&persCont->m_partLink[i],&link, log); transCont->Emplace(persCont->m_TGCid[i], persCont->m_globalTime[i], position, localDireCos, - link.barcode(), + link, persCont->m_energyDeposit[i], persCont->m_stepLength[i]); } } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/TGCSimHitCollectionCnv_p3.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/TGCSimHitCollectionCnv_p3.cxx index 4aff5a1901ada34d4722755070d6009ef1b5546d..836e412617c38b3196d24b9281f78789ac66b4ff 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/TGCSimHitCollectionCnv_p3.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/TGCSimHitCollectionCnv_p3.cxx @@ -79,7 +79,7 @@ void TGCSimHitCollectionCnv_p3::persToTrans(const Muon::TGCSimHitCollection_p3* hepMcPLCnv.persToTrans(&persCont->m_partLink[i],&link, log); transCont->Emplace(persCont->m_TGCid[i], persCont->m_globalTime[i], position, localDireCos, - link.barcode(), + link, persCont->m_energyDeposit[i], persCont->m_stepLength[i], persCont->m_particleEncoding[i], persCont->m_kineticEnergy[i]); } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/TGCSimHitCollectionCnv_p4.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/TGCSimHitCollectionCnv_p4.cxx index 804495e22b18903dd6674778db6340e5adb8a7b0..48eb4f732c79c0afffe240d052570461a240f853 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/TGCSimHitCollectionCnv_p4.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/TGCSimHitCollectionCnv_p4.cxx @@ -15,9 +15,47 @@ // Athena #include "StoreGate/StoreGateSvc.h" -void TGCSimHitCollectionCnv_p4::transToPers(const TGCSimHitCollection*, Muon::TGCSimHitCollection_p4*, MsgStream &/*log*/) +void TGCSimHitCollectionCnv_p4::transToPers(const TGCSimHitCollection* transCont, Muon::TGCSimHitCollection_p4* persCont, MsgStream &log) { - throw std::runtime_error("TGCSimHitCollectionCnv_p3::transToPers is not supported in this release!"); + // for reasons of efficiency, set size before hand + unsigned int size=transCont->size(); + persCont->m_TGCid.reserve(size); + persCont->m_globalTime.reserve(size); + persCont->m_stX.reserve(size); + persCont->m_stY.reserve(size); + persCont->m_stZ.reserve(size); + persCont->m_enX.reserve(size); + persCont->m_enY.reserve(size); + persCont->m_enZ.reserve(size); + persCont->m_partLink.reserve(size); + persCont->m_energyDeposit.reserve(size); + persCont->m_stepLength.reserve(size); + persCont->m_particleEncoding.reserve(size); + persCont->m_kineticEnergy.reserve(size); + + // make convertor to handle HepMcParticleLinks + HepMcParticleLinkCnv_p2 hepMcPLCnv; + HepMcParticleLink_p2 persLink; // will use this as a temp object inside the loop + + // loop through container, filling pers object + TGCSimHitCollection::const_iterator it = transCont->begin(), itEnd = transCont->end(); + for (; it != itEnd; ++it) { + persCont->m_TGCid.push_back(it->TGCid()); + persCont->m_globalTime.push_back(it->globalTime()); + persCont->m_stX.push_back(it->localPosition().x()); + persCont->m_stY.push_back(it->localPosition().y()); + persCont->m_stZ.push_back(it->localPosition().z()); + persCont->m_enX.push_back(it->localDireCos().x()); + persCont->m_enY.push_back(it->localDireCos().y()); + persCont->m_enZ.push_back(it->localDireCos().z()); + persCont->m_energyDeposit.push_back(it->energyDeposit()); + persCont->m_stepLength.push_back(it->stepLength()); + persCont->m_particleEncoding.push_back(it->particleEncoding()); + persCont->m_kineticEnergy.push_back(it->kineticEnergy()); + + hepMcPLCnv.transToPers(&it->particleLink(),&persLink, log); + persCont->m_partLink.push_back(persLink); + } } @@ -41,8 +79,9 @@ void TGCSimHitCollectionCnv_p4::persToTrans(const Muon::TGCSimHitCollection_p4* hepMcPLCnv.persToTrans(&persCont->m_partLink[i],&link, log); transCont->Emplace(persCont->m_TGCid[i], persCont->m_globalTime[i], position, localDireCos, - link.barcode(), + link, persCont->m_energyDeposit[i], persCont->m_stepLength[i], persCont->m_particleEncoding[i], persCont->m_kineticEnergy[i]); } } + diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/sTGCSimHitCollectionCnv_p2.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/sTGCSimHitCollectionCnv_p2.cxx index 759962a38052f55a83108f5fae54717b170e5b2d..f25704dca5b9f88b9f1c2e3c8c9bf2913ce2da36 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/sTGCSimHitCollectionCnv_p2.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/src/sTGCSimHitCollectionCnv_p2.cxx @@ -16,11 +16,48 @@ #include "StoreGate/StoreGateSvc.h" -//** This function is not supported in master because HepMcParticleLinkCnv_p2::transToPers(..) -//** is not supported either. -void sTGCSimHitCollectionCnv_p2::transToPers(const sTGCSimHitCollection* , Muon::sTGCSimHitCollection_p2* , MsgStream &/*log*/ ) +void sTGCSimHitCollectionCnv_p2::transToPers(const sTGCSimHitCollection* transCont, Muon::sTGCSimHitCollection_p2* persCont, MsgStream &log) { - throw std::runtime_error("sTGCSimHitCollectionCnv_p2::transToPers is not supported in this release!"); + // for reasons of efficiency, set size before hand + unsigned int size=transCont->size(); + persCont->m_sTGCId.reserve(size); + persCont->m_globalTime.reserve(size); + // postStep Global + persCont->m_stX.reserve(size); + persCont->m_stY.reserve(size); + persCont->m_stZ.reserve(size); + // postStep Local + persCont->m_particleEncoding.reserve(size); + persCont->m_ptX.reserve(size); + persCont->m_ptY.reserve(size); + persCont->m_ptZ.reserve(size); + persCont->m_depositEnergy.reserve(size); + persCont->m_partLink.reserve(size); + + // make convertor to handle HepMcParticleLinks + HepMcParticleLinkCnv_p2 hepMcPLCnv; + HepMcParticleLink_p2 persLink; // will use this as a temp object inside the loop + + // loop through container, filling pers object + sTGCSimHitCollection::const_iterator it = transCont->begin(), itEnd = transCont->end(); + for (; it != itEnd; ++it) { + persCont->m_sTGCId.push_back(it->sTGCId()); + persCont->m_globalTime.push_back(it->globalTime()); + // postStep Global + persCont->m_stX.push_back(it->globalPosition().x()); + persCont->m_stY.push_back(it->globalPosition().y()); + persCont->m_stZ.push_back(it->globalPosition().z()); + // postStep Local + persCont->m_particleEncoding.push_back(it->particleEncoding()); + persCont->m_ptX.push_back(it->globalDirection().x()); + persCont->m_ptY.push_back(it->globalDirection().y()); + persCont->m_ptZ.push_back(it->globalDirection().z()); + persCont->m_depositEnergy.push_back(it->depositEnergy()); + + hepMcPLCnv.transToPers(&it->particleLink(),&persLink, log); + persCont->m_partLink.push_back(persLink); + + } } @@ -31,20 +68,19 @@ sTGCSimHitCollection* sTGCSimHitCollectionCnv_p2::createTransient(const Muon::sT } -void sTGCSimHitCollectionCnv_p2::persToTrans(const Muon::sTGCSimHitCollection_p2* persCont, sTGCSimHitCollection* transCont, MsgStream &log) +void sTGCSimHitCollectionCnv_p2::persToTrans(const Muon::sTGCSimHitCollection_p2* persCont, sTGCSimHitCollection* transCont, MsgStream &log) { HepMcParticleLinkCnv_p2 hepMcPLCnv; - + //transCont->reserve(persCont->m_sTGCId.size());//done in createTransient - for (unsigned int i = 0; i < persCont->m_sTGCId.size(); i++) { + for (unsigned int i = 0; i < persCont->m_sTGCId.size(); i++) { //post Amg::Vector3D position(persCont->m_stX[i], persCont->m_stY[i], persCont->m_stZ[i]); - Amg::Vector3D direction(persCont->m_ptX[i], persCont->m_ptY[i], persCont->m_ptZ[i]); + Amg::Vector3D direction(persCont->m_ptX[i], persCont->m_ptY[i], persCont->m_ptZ[i]); HepMcParticleLink link; - hepMcPLCnv.persToTrans(&persCont->m_partLink[i],&link, log); + hepMcPLCnv.persToTrans(&persCont->m_partLink[i],&link, log); transCont->Emplace(persCont->m_sTGCId[i], persCont->m_globalTime[i], position, persCont->m_particleEncoding[i], direction, persCont->m_depositEnergy[i], link); } } - diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p1_test.cxx index e4de5037fdb22dca1b3e948fedb233afb2d99860..bc6b72cb6f8e8aa219d81ba9f1295fc28f5508ec 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p1_test.cxx @@ -83,7 +83,7 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector) std::cout << "test1\n"; const HepMC::GenParticle *particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(particle->barcode(),0); + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. CSCSimHitCollection dum ("coll"); @@ -92,10 +92,11 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector) CSCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); trans1.Emplace (123, 10.5, 11.5, Amg::Vector3D (12.5, 13.5, 14.5), Amg::Vector3D (15.5, 16.5, 17.5), - lundCode(pGenParticle->pdg_id()), pGenParticle->barcode(), 20.5 + lundCode(pGenParticle->pdg_id()), trkLink, 20.5 ); } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p2_test.cxx index 1f1335c9f96763338ee9afa349ad8da4ae10a7aa..692c225e1646c74107380d4dc48944b862e24d91 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p2_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p2_test.cxx @@ -83,7 +83,7 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector) std::cout << "test1\n"; const HepMC::GenParticle *particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(particle->barcode(),0); + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. CSCSimHitCollection dum ("coll"); @@ -92,10 +92,11 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector) CSCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); trans1.Emplace (123, 10.5, 11.5, Amg::Vector3D (12.5, 13.5, 14.5), Amg::Vector3D (15.5, 16.5, 17.5), - lundCode(pGenParticle->pdg_id()), pGenParticle->barcode(), 20.5 + lundCode(pGenParticle->pdg_id()), trkLink, 20.5 ); } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p3_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p3_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..ca87a4dfd3c305444c61f896aee23662417c5808 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p3_test.cxx @@ -0,0 +1,118 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p3_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Mar, 2016 + * @brief Tests for CSCSimHitCollectionCnv_p3. + */ + + +#undef NDEBUG +#include "MuonSimEventTPCnv/CSCSimHitCollectionCnv_p3.h" +#include "TestTools/leakcheck.h" +#include <cassert> +#include <iostream> + +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenEvent.h" +#include "HepMC/GenParticle.h" + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + +void compare (const CSCSimHit& p1, + const CSCSimHit& p2) +{ + assert (p1.CSCid() == p2.CSCid()); + assert (p1.globalTime() == p2.globalTime()); + assert (p1.energyDeposit() == p2.energyDeposit()); + assert (p1.getHitStart() == p2.getHitStart()); + assert (p1.getHitEnd() == p2.getHitEnd()); + assert (p1.particleID() == p2.particleID()); + compare(p1.particleLink(), p2.particleLink()); + assert (p1.particleLink() == p2.particleLink()); + assert (p1.kineticEnergy() == p2.kineticEnergy()); +} + + +void compare (const CSCSimHitCollection& p1, + const CSCSimHitCollection& p2) +{ + //assert (p1.Name() == p2.Name()); + assert (p1.size() == p2.size()); + for (size_t i=0; i < p1.size(); i++) + compare (p1[i], p2[i]); +} + + +void testit (const CSCSimHitCollection& trans1) +{ + MsgStream log (0, "test"); + CSCSimHitCollectionCnv_p3 cnv; + Muon::CSCSimHitCollection_p3 pers; + cnv.transToPers (&trans1, &pers, log); + CSCSimHitCollection trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + +int lundCode(int pdgid) { + if(pdgid==22) { return 1; } + if(pdgid==11) { return 2; } + if(pdgid==-11) { return 3; } + if(pdgid==13) { return 5; } + if(pdgid==-13) { return 6; } + return -1; +} + +void test1(std::vector<HepMC::GenParticle*>& genPartVector) +{ + std::cout << "test1\n"; + const HepMC::GenParticle *particle = genPartVector.at(0); + // Create HepMcParticleLink outside of leak check. + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); + assert(dummyHMPL.cptr()==particle); + // Create DVL info outside of leak check. + CSCSimHitCollection dum ("coll"); + Athena_test::Leakcheck check; + + CSCSimHitCollection trans1 ("coll"); + for (int i=0; i < 10; i++) { + const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); + trans1.Emplace (123, 10.5, 11.5, + Amg::Vector3D (12.5, 13.5, 14.5), + Amg::Vector3D (15.5, 16.5, 17.5), + lundCode(pGenParticle->pdg_id()), trkLink, 20.5 + ); + } + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(genPartVector); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p1_test.cxx index cf4caba238741952dc74e42a60f02bb4298302b4..834e29f59d5de6f42a65a8240a3bf65b45569ddd 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p1_test.cxx @@ -80,7 +80,7 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) std::cout << "test1\n"; const HepMC::GenParticle *particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(particle->barcode(),0); + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. GenericMuonSimHitCollection dum ("coll"); @@ -89,6 +89,7 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) GenericMuonSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); trans1.Emplace (123, 10.5, 11.5, Amg::Vector3D (12.5, 13.5, 14.5), Amg::Vector3D (15.5, 16.5, 17.5), @@ -96,7 +97,7 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) Amg::Vector3D (21.5, 22.5, 23.5), pGenParticle->pdg_id(), 25.5, Amg::Vector3D (26.5, 27.5, 28.5), - 29.5, 30.5, pGenParticle->barcode() + 29.5, 30.5, trkLink ); } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p2_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..a17aca581dddb8b8a7a537fab82686af9c91c2a8 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p2_test.cxx @@ -0,0 +1,117 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p2_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Mar, 2016 + * @brief Tests for GenericMuonSimHitCollectionCnv_p2. + */ + + +#undef NDEBUG +#include "MuonSimEventTPCnv/GenericMuonSimHitCollectionCnv_p2.h" +#include "TestTools/leakcheck.h" +#include <cassert> +#include <iostream> + +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenEvent.h" +#include "HepMC/GenParticle.h" + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + +void compare (const GenericMuonSimHit& p1, + const GenericMuonSimHit& p2) +{ + assert (p1.GenericId() == p2.GenericId()); + assert (p1.globalTime() == p2.globalTime()); + assert (p1.globalpreTime() == p2.globalpreTime()); + assert (p1.globalPosition() == p2.globalPosition()); + assert (p1.localPosition() == p2.localPosition()); + assert (p1.globalPrePosition() == p2.globalPrePosition()); + assert (p1.localPrePosition() == p2.localPrePosition()); + assert (p1.particleEncoding() == p2.particleEncoding()); + assert (p1.kineticEnergy() == p2.kineticEnergy()); + assert (p1.globalDirection() == p2.globalDirection()); + assert (p1.depositEnergy() == p2.depositEnergy()); + assert (p1.StepLength() == p2.StepLength()); + compare(p1.particleLink(), p2.particleLink()); + assert (p1.particleLink() == p2.particleLink()); +} + + +void compare (const GenericMuonSimHitCollection& p1, + const GenericMuonSimHitCollection& p2) +{ + //assert (p1.Name() == p2.Name()); + assert (p1.size() == p2.size()); + for (size_t i=0; i < p1.size(); i++) + compare (p1[i], p2[i]); +} + + +void testit (const GenericMuonSimHitCollection& trans1) +{ + MsgStream log (0, "test"); + GenericMuonSimHitCollectionCnv_p2 cnv; + Muon::GenericMuonSimHitCollection_p2 pers; + cnv.transToPers (&trans1, &pers, log); + GenericMuonSimHitCollection trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*> genPartVector) +{ + std::cout << "test1\n"; + const HepMC::GenParticle *particle = genPartVector.at(0); + // Create HepMcParticleLink outside of leak check. + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); + assert(dummyHMPL.cptr()==particle); + // Create DVL info outside of leak check. + GenericMuonSimHitCollection dum ("coll"); + + GenericMuonSimHitCollection trans1 ("coll"); + for (int i=0; i < 10; i++) { + const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); + trans1.Emplace (123, 10.5, 11.5, + Amg::Vector3D (12.5, 13.5, 14.5), + Amg::Vector3D (15.5, 16.5, 17.5), + Amg::Vector3D (18.5, 19.5, 20.5), + Amg::Vector3D (21.5, 22.5, 23.5), + pGenParticle->pdg_id(), 25.5, + Amg::Vector3D (26.5, 27.5, 28.5), + 29.5, 30.5, trkLink + ); + } + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(genPartVector); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p1_test.cxx index ad50eee492da9afb5f83eccbc0462f97640bc0bb..9f12d9f79450db9d1a7ae262aa7ae7cd32b9059c 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p1_test.cxx @@ -76,7 +76,7 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) std::cout << "test1\n"; const HepMC::GenParticle *particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(particle->barcode(),0); + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. MDTSimHitCollection dum ("coll"); @@ -85,9 +85,10 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) MDTSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); trans1.Emplace (123, 10.5, 11.5, Amg::Vector3D (12.5, 13.5, 14.5), - pGenParticle->barcode(), 19.5, 20.5, pGenParticle->pdg_id(), 22.5 + trkLink, 19.5, 20.5, pGenParticle->pdg_id(), 22.5 ); } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p2_test.cxx index bfaf4a7bb5ea2355538c2854ce50d15d6667c57e..9b3aeb2dbca8bb82d407a58c25412c0847bf7f87 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p2_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p2_test.cxx @@ -76,7 +76,7 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) std::cout << "test1\n"; const HepMC::GenParticle *particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(particle->barcode(),0); + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. MDTSimHitCollection dum ("coll"); @@ -85,9 +85,10 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) MDTSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); trans1.Emplace (123, 10.5, 11.5, Amg::Vector3D (12.5, 13.5, 14.5), - pGenParticle->barcode(), 19.5, 20.5, pGenParticle->pdg_id(), 22.5 + trkLink, 19.5, 20.5, pGenParticle->pdg_id(), 22.5 ); } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p3_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p3_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..a18618673f315be844f2cb73858ae0cd102de571 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p3_test.cxx @@ -0,0 +1,110 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p3_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Mar, 2016 + * @brief Tests for MDTSimHitCollectionCnv_p3. + */ + + +#undef NDEBUG +#include "MuonSimEventTPCnv/MDTSimHitCollectionCnv_p3.h" +#include "TestTools/leakcheck.h" +#include <cassert> +#include <iostream> + +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenEvent.h" +#include "HepMC/GenParticle.h" + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + +void compare (const MDTSimHit& p1, + const MDTSimHit& p2) +{ + assert (p1.MDTid() == p2.MDTid()); + assert (p1.globalTime() == p2.globalTime()); + assert (p1.driftRadius() == p2.driftRadius()); + assert (p1.localPosition() == p2.localPosition()); + compare(p1.particleLink(), p2.particleLink()); + assert (p1.particleLink() == p2.particleLink()); + assert (p1.stepLength() == p2.stepLength()); + assert (p1.energyDeposit() == p2.energyDeposit()); + assert (p1.particleEncoding() == p2.particleEncoding()); + assert (p1.kineticEnergy() == p2.kineticEnergy()); +} + + +void compare (const MDTSimHitCollection& p1, + const MDTSimHitCollection& p2) +{ + //assert (p1.Name() == p2.Name()); + assert (p1.size() == p2.size()); + for (size_t i=0; i < p1.size(); i++) + compare (p1[i], p2[i]); +} + + +void testit (const MDTSimHitCollection& trans1) +{ + MsgStream log (0, "test"); + MDTSimHitCollectionCnv_p3 cnv; + Muon::MDTSimHitCollection_p3 pers; + cnv.transToPers (&trans1, &pers, log); + MDTSimHitCollection trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*> genPartVector) +{ + std::cout << "test1\n"; + const HepMC::GenParticle *particle = genPartVector.at(0); + // Create HepMcParticleLink outside of leak check. + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); + assert(dummyHMPL.cptr()==particle); + // Create DVL info outside of leak check. + MDTSimHitCollection dum ("coll"); + Athena_test::Leakcheck check; + + MDTSimHitCollection trans1 ("coll"); + for (int i=0; i < 10; i++) { + const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); + trans1.Emplace (123, 10.5, 11.5, + Amg::Vector3D (12.5, 13.5, 14.5), + trkLink, 19.5, 20.5, pGenParticle->pdg_id(), 22.5 + ); + } + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(genPartVector); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p1_test.cxx index d05cc1177bec20d50d0e943300a4ecc41b65084a..5fad00aaaeacb81c9d1ef05dfa049c0251abdbe2 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p1_test.cxx @@ -76,7 +76,7 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) std::cout << "test1\n"; const HepMC::GenParticle *particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(particle->barcode(),0); + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. RPCSimHitCollection dum ("coll"); @@ -85,9 +85,10 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) RPCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), - pGenParticle->barcode(), + trkLink, Amg::Vector3D (16.5, 17.5, 18.5), 19.5, 20.5, pGenParticle->pdg_id(), 22.5); } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p2_test.cxx index 635f225b10113229570f2b1b93f4cadc644a9ef8..98501c7383dd278c6e53293132ba3e86ef7f6aad 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p2_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p2_test.cxx @@ -76,7 +76,7 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) std::cout << "test1\n"; const HepMC::GenParticle *particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(particle->barcode(),0); + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. RPCSimHitCollection dum ("coll"); @@ -85,9 +85,10 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) RPCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), - pGenParticle->barcode(), + trkLink, Amg::Vector3D (16.5, 17.5, 18.5), 19.5, 20.5, pGenParticle->pdg_id(), 22.5); } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p3_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p3_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b42dbf0fab2621c5088c96763aa54cbf141afbf5 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p3_test.cxx @@ -0,0 +1,111 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p2_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Mar, 2016 + * @brief Tests for RPCSimHitCollectionCnv_p3. + */ + + +#undef NDEBUG +#include "MuonSimEventTPCnv/RPCSimHitCollectionCnv_p3.h" +#include "TestTools/leakcheck.h" +#include <cassert> +#include <iostream> + +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenEvent.h" +#include "HepMC/GenParticle.h" + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + +void compare (const RPCSimHit& p1, + const RPCSimHit& p2) +{ + assert (p1.RPCid() == p2.RPCid()); + assert (p1.globalTime() == p2.globalTime()); + assert (p1.localPosition() == p2.localPosition()); + compare(p1.particleLink(), p2.particleLink()); + assert (p1.particleLink() == p2.particleLink()); + assert (p1.postLocalPosition() == p2.postLocalPosition()); + assert (p1.energyDeposit() == p2.energyDeposit()); + assert (p1.stepLength() == p2.stepLength()); + assert (p1.particleEncoding() == p2.particleEncoding()); + assert (p1.kineticEnergy() == p2.kineticEnergy()); +} + + +void compare (const RPCSimHitCollection& p1, + const RPCSimHitCollection& p2) +{ + //assert (p1.Name() == p2.Name()); + assert (p1.size() == p2.size()); + for (size_t i=0; i < p1.size(); i++) + compare (p1[i], p2[i]); +} + + +void testit (const RPCSimHitCollection& trans1) +{ + MsgStream log (0, "test"); + RPCSimHitCollectionCnv_p3 cnv; + Muon::RPCSimHitCollection_p3 pers; + cnv.transToPers (&trans1, &pers, log); + RPCSimHitCollection trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*> genPartVector) +{ + std::cout << "test1\n"; + const HepMC::GenParticle *particle = genPartVector.at(0); + // Create HepMcParticleLink outside of leak check. + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); + assert(dummyHMPL.cptr()==particle); + // Create DVL info outside of leak check. + RPCSimHitCollection dum ("coll"); + Athena_test::Leakcheck check; + + RPCSimHitCollection trans1 ("coll"); + for (int i=0; i < 10; i++) { + const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); + trans1.Emplace (123, 10.5, + Amg::Vector3D (12.5, 13.5, 14.5), + trkLink, + Amg::Vector3D (16.5, 17.5, 18.5), + 19.5, 20.5, pGenParticle->pdg_id(), 22.5); + } + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(genPartVector); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p1_test.cxx index 55adc9176a6796cad831491907d66c86806d24fa..f601db0c1d2b67e60062d6d9594df9103b2f49e5 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p1_test.cxx @@ -76,7 +76,7 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) std::cout << "test1\n"; const HepMC::GenParticle *particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(particle->barcode(),0); + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. TGCSimHitCollection dum ("coll"); @@ -85,10 +85,11 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) TGCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), Amg::Vector3D (16.5, 17.5, 18.5), - pGenParticle->barcode(), 20.5, 21.5, pGenParticle->pdg_id(), 23.5); + trkLink, 20.5, 21.5, pGenParticle->pdg_id(), 23.5); } testit (trans1); diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p2_test.cxx index 87253ad37e927fff1d507956befe9b56fadfefca..f7adcfbce9de148b590c8ebe2c3e28fd16f146bb 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p2_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p2_test.cxx @@ -76,7 +76,7 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) std::cout << "test1\n"; const HepMC::GenParticle *particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(particle->barcode(),0); + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. TGCSimHitCollection dum ("coll"); @@ -85,10 +85,11 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) TGCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), Amg::Vector3D (16.5, 17.5, 18.5), - pGenParticle->barcode(), 20.5, 21.5, pGenParticle->pdg_id(), 23.5); + trkLink, 20.5, 21.5, pGenParticle->pdg_id(), 23.5); } testit (trans1); diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p3_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p3_test.cxx index e7170e041446284549c5da2dd9ace6b85a99d817..c3baa29f0e6132c1e5f2edb101edfa0f4858c3d7 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p3_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p3_test.cxx @@ -76,7 +76,7 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector) std::cout << "test1\n"; const HepMC::GenParticle *particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(particle->barcode(),0); + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. TGCSimHitCollection dum ("coll"); @@ -85,10 +85,11 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector) TGCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), Amg::Vector3D (16.5, 17.5, 18.5), - pGenParticle->barcode(), 20.5, 21.5, pGenParticle->pdg_id(), 23.5); + trkLink, 20.5, 21.5, pGenParticle->pdg_id(), 23.5); } testit (trans1); diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p4_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p4_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..1ab0281b7f1754f55470206f1b5778e1e0c141f2 --- /dev/null +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p4_test.cxx @@ -0,0 +1,110 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p4_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Mar, 2016 + * @brief Tests for TGCSimHitCollectionCnv_p4. + */ + + +#undef NDEBUG +#include "MuonSimEventTPCnv/TGCSimHitCollectionCnv_p4.h" +#include "TestTools/leakcheck.h" +#include <cassert> +#include <iostream> + +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenEvent.h" +#include "HepMC/GenParticle.h" + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + +void compare (const TGCSimHit& p1, + const TGCSimHit& p2) +{ + assert (p1.TGCid() == p2.TGCid()); + assert (p1.globalTime() == p2.globalTime()); + assert (p1.localPosition() == p2.localPosition()); + assert (p1.localDireCos() == p2.localDireCos()); + compare(p1.particleLink(), p2.particleLink()); + assert (p1.particleLink() == p2.particleLink()); + assert (p1.energyDeposit() == p2.energyDeposit()); + assert (p1.stepLength() == p2.stepLength()); + assert (p1.particleEncoding() == p2.particleEncoding()); + assert (p1.kineticEnergy() == p2.kineticEnergy()); +} + + +void compare (const TGCSimHitCollection& p1, + const TGCSimHitCollection& p2) +{ + //assert (p1.Name() == p2.Name()); + assert (p1.size() == p2.size()); + for (size_t i=0; i < p1.size(); i++) + compare (p1[i], p2[i]); +} + + +void testit (const TGCSimHitCollection& trans1) +{ + MsgStream log (0, "test"); + TGCSimHitCollectionCnv_p4 cnv; + Muon::TGCSimHitCollection_p4 pers; + cnv.transToPers (&trans1, &pers, log); + TGCSimHitCollection trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*> genPartVector) +{ + std::cout << "test1\n"; + const HepMC::GenParticle *particle = genPartVector.at(0); + // Create HepMcParticleLink outside of leak check. + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); + assert(dummyHMPL.cptr()==particle); + // Create DVL info outside of leak check. + TGCSimHitCollection dum ("coll"); + Athena_test::Leakcheck check; + + TGCSimHitCollection trans1 ("coll"); + for (int i=0; i < 10; i++) { + const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); + trans1.Emplace (123, 10.5, + Amg::Vector3D (12.5, 13.5, 14.5), + Amg::Vector3D (16.5, 17.5, 18.5), + trkLink, 20.5, 21.5, pGenParticle->pdg_id(), 23.5); + } + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(genPartVector); + return 0; +} diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p1_test.cxx index 7e5f395c4a07d71db57f58dcabe4b531dbc7f34c..7bf1e66c66711b238947cbb9e22e8e17d2efceab 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p1_test.cxx @@ -82,11 +82,12 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) sTGCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { const HepMC::GenParticle* pGenParticle = genPartVector.at(i); - trans1.Emplace (123, 10.5, + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); + trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), pGenParticle->pdg_id(), Amg::Vector3D (26.5, 27.5, 28.5), - 29.5, pGenParticle->barcode() + 29.5, trkLink ); } diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p2_test.cxx index 6e753630b8dde5254b249b9c7b9669186b1dc4e7..04918d01d9cb2d9c868344f3ae1f2cb169fd709f 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p2_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p2_test.cxx @@ -64,16 +64,16 @@ void compare (const sTGCSimHitCollection& p1, //** The test is empty because sTGCSimHitCollectionCnv_p2 //** is not supported yet -void testit (const sTGCSimHitCollection& /*trans1*/) +void testit (const sTGCSimHitCollection& trans1) { MsgStream log (0, "test"); -// sTGCSimHitCollectionCnv_p2 cnv; -// Muon::sTGCSimHitCollection_p2 pers; -// cnv.transToPers (&trans1, &pers, log); -// sTGCSimHitCollection trans2; -// cnv.persToTrans (&pers, &trans2, log); -// -// compare (trans1, trans2); + sTGCSimHitCollectionCnv_p2 cnv; + Muon::sTGCSimHitCollection_p2 pers; + cnv.transToPers (&trans1, &pers, log); + sTGCSimHitCollection trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); } @@ -91,11 +91,12 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) sTGCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { const HepMC::GenParticle* pGenParticle = genPartVector.at(i); - trans1.Emplace (123, 10.5, + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); + trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), pGenParticle->pdg_id(), Amg::Vector3D (26.5, 27.5, 28.5), - 29.5, pGenParticle->barcode() + 29.5, trkLink ); } diff --git a/Projects/AnalysisBase/externals.txt b/Projects/AnalysisBase/externals.txt index 906a80a35591f0363dd1d9fb76a61bdbd7c5f672..9a2a23b5125f752d48de471144064110acd3076c 100644 --- a/Projects/AnalysisBase/externals.txt +++ b/Projects/AnalysisBase/externals.txt @@ -6,4 +6,4 @@ # forbidden. # The version of atlas/atlasexternals to use: -AnalysisBaseExternalsVersion = 2.0.19 +AnalysisBaseExternalsVersion = 2.0.20 diff --git a/Projects/AnalysisTop/externals.txt b/Projects/AnalysisTop/externals.txt index a2c0daa67e09bb64441f0d0be674058a2cf0b321..b05c766d18f829cb8970aaf42fce91932d5d13c0 100644 --- a/Projects/AnalysisTop/externals.txt +++ b/Projects/AnalysisTop/externals.txt @@ -1,4 +1,4 @@ # Versions of the various externals to build before starting the build of # this project, when doing a full stack nightly build. -AnalysisBaseExternalsVersion = 2.0.19 +AnalysisBaseExternalsVersion = 2.0.20 diff --git a/Projects/AthDataQuality/externals.txt b/Projects/AthDataQuality/externals.txt index ad81da93110521ca0fadd8855c1f747300d84e09..905a85343618c2d95999498b3a4390d0b4914226 100644 --- a/Projects/AthDataQuality/externals.txt +++ b/Projects/AthDataQuality/externals.txt @@ -5,4 +5,4 @@ # an "origin/" prefix before it. For tags however this is explicitly # forbidden. -AtlasExternalsVersion = 2.0.19 +AtlasExternalsVersion = 2.0.20 diff --git a/Projects/AthSimulation/build_externals.sh b/Projects/AthSimulation/build_externals.sh index cbcdd322d9ec8df6061173be9760ee2e8d65e308..6d14a4c12e05e278b67eea7c8919b0a9961084b2 100755 --- a/Projects/AthSimulation/build_externals.sh +++ b/Projects/AthSimulation/build_externals.sh @@ -11,6 +11,8 @@ usage() { echo " build" echo " -c: Build the externals for the continuous integration (CI) system," echo " skipping the build of the externals RPMs." + echo " -x: Extra cmake argument(s) to provide for the build(configuration)" + echo " of all externals needed by AthSimulation." echo "If a build_dir is not given the default is '../build'" echo "relative to the athena checkout" } @@ -20,7 +22,8 @@ BUILDDIR="" BUILDTYPE="RelWithDebInfo" FORCE="" CI="" -while getopts ":t:b:fch" opt; do +EXTRACMAKE=() +while getopts ":t:b:x:fch" opt; do case $opt in t) BUILDTYPE=$OPTARG @@ -34,6 +37,9 @@ while getopts ":t:b:fch" opt; do c) CI="1" ;; + x) + EXTRACMAKE+=($OPTARG) + ;; h) usage exit 0 @@ -51,25 +57,6 @@ while getopts ":t:b:fch" opt; do esac done -# Version comparison function. Taken from a StackOverflow article. -verlte() { - if [ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]; then - return 1 - fi - return 0 -} - -# First off, check that we are using a new enough version of Git. We need -# at least version 1.8.1. -git_min_version=1.8.1 -git_version=`git --version | awk '{print $3}'` -verlte "${git_min_version}" "${git_version}" -if [ $? = 0 ]; then - echo "Detected git version (${git_version}) not new enough." - echo "Need at least: ${git_min_version}" - exit 1 -fi - # Stop on errors from here on out: set -e set -o pipefail @@ -131,7 +118,7 @@ ${scriptsdir}/build_atlasexternals.sh \ -b ${BUILDDIR}/build/AthSimulationExternals \ -i ${BUILDDIR}/install/AthSimulationExternals/${NICOS_PROJECT_VERSION} \ -p AthSimulationExternals ${RPMOPTIONS} -t ${BUILDTYPE} \ - -v ${NICOS_PROJECT_VERSION} + ${EXTRACMAKE[@]/#/-x } -v ${NICOS_PROJECT_VERSION} # Get the "platform name" from the directory created by the AthSimulationExternals # build: @@ -152,4 +139,5 @@ ${scriptsdir}/build_Gaudi.sh \ -b ${BUILDDIR}/build/GAUDI \ -i ${BUILDDIR}/install/GAUDI/${NICOS_PROJECT_VERSION} \ -e ${BUILDDIR}/install/AthSimulationExternals/${NICOS_PROJECT_VERSION}/InstallArea/${platform} \ - -p AthSimulationExternals -f ${platform} ${RPMOPTIONS} -t ${BUILDTYPE} + -p AthSimulationExternals -f ${platform} ${EXTRACMAKE[@]/#/-x } \ + ${RPMOPTIONS} -t ${BUILDTYPE} diff --git a/Projects/AthSimulation/externals.txt b/Projects/AthSimulation/externals.txt index de55b62f23759ab53e42124ca69167eecff015e7..c0e7ed4de0b04033b19adaea5473fb48483ad735 100644 --- a/Projects/AthSimulation/externals.txt +++ b/Projects/AthSimulation/externals.txt @@ -6,7 +6,7 @@ # forbidden. # The version of atlas/atlasexternals to use: -AthSimulationExternalsVersion = 2.0.19 +AthSimulationExternalsVersion = 2.0.20 # The version of atlas/Gaudi to use: GaudiVersion = v31r0.000 diff --git a/Projects/Athena/build_externals.sh b/Projects/Athena/build_externals.sh index 9683078b6b6d6deafdae6c3a0ac5232daaf91358..f0e7d8a043387f986ad9a1f047b47bdaa90d19e4 100755 --- a/Projects/Athena/build_externals.sh +++ b/Projects/Athena/build_externals.sh @@ -11,8 +11,8 @@ usage() { echo " build" echo " -c: Build the externals for the continuous integration (CI) system," echo " skipping the build of the externals RPMs." - echo " -d: For debugging the CMake configuration: run 'cmake' with the '--trace' option (very verbose output!)" - echo " -x: To pass arbitrary extra arguments to the CMake configuration" + echo " -x: Extra cmake argument(s) to provide for the build(configuration)" + echo " of all externals needed by Athena." echo "If a build_dir is not given the default is '../build'" echo "relative to the athena checkout" } @@ -22,9 +22,8 @@ BUILDDIR="" BUILDTYPE="RelWithDebInfo" FORCE="" CI="" -DEBUG_CMAKE_CONFIG="" -EXTRACMAKE="" -while getopts ":t:b:fchdx:" opt; do +EXTRACMAKE=(-DLCG_VERSION_NUMBER=94 -DLCG_VERSION_POSTFIX="") +while getopts ":t:b:x:fch" opt; do case $opt in t) BUILDTYPE=$OPTARG @@ -38,11 +37,8 @@ while getopts ":t:b:fchdx:" opt; do c) CI="1" ;; - d) - DEBUG_CMAKE_CONFIG="-d" - ;; x) - EXTRACMAKE="-x $OPTARG" + EXTRACMAKE+=($OPTARG) ;; h) usage @@ -61,30 +57,10 @@ while getopts ":t:b:fchdx:" opt; do esac done -# Version comparison function. Taken from a StackOverflow article. -verlte() { - if [ "$1" = "`echo -e $1'\n'$2 | sort -V | head -n1`" ]; then - return 1 - fi - return 0 -} - -# First off, check that we are using a new enough version of Git. We need -# at least version 1.8.1. -git_min_version=1.8.1 -git_version=`git --version | awk '{print $3}'` -verlte "${git_min_version}" "${git_version}" -if [ $? = 0 ]; then - echo "Detected git version (${git_version}) not new enough." - echo "Need at least: ${git_min_version}" - exit 1 -fi - # Stop on errors from here on out set -e set -o pipefail - # We are in BASH, get the path of this script in a simple way: thisdir=$(dirname ${BASH_SOURCE[0]}) thisdir=$(cd ${thisdir};pwd) @@ -167,8 +143,7 @@ ${scriptsdir}/build_atlasexternals.sh \ -i ${BUILDDIR}/install/AthenaExternals/${NICOS_PROJECT_VERSION} \ -p AthenaExternals ${RPMOPTIONS} -t ${BUILDTYPE} \ -v ${NICOS_PROJECT_VERSION} \ - ${DEBUG_CMAKE_CONFIG} \ - ${EXTRACMAKE} + ${EXTRACMAKE[@]/#/-x } { test "X${NIGHTLY_STATUS}" != "X" && { @@ -206,7 +181,8 @@ ${scriptsdir}/build_Gaudi.sh \ -b ${BUILDDIR}/build/GAUDI \ -i ${BUILDDIR}/install/GAUDI/${NICOS_PROJECT_VERSION} \ -e ${BUILDDIR}/install/AthenaExternals/${NICOS_PROJECT_VERSION}/InstallArea/${platform} \ - -p AthenaExternals -f ${platform} ${RPMOPTIONS} -t ${BUILDTYPE} ${EXTRACMAKE} + -p AthenaExternals -f ${platform} ${RPMOPTIONS} -t ${BUILDTYPE} \ + ${EXTRACMAKE[@]/#/-x } { test "X${NIGHTLY_STATUS}" != "X" && { @@ -216,4 +192,3 @@ ${scriptsdir}/build_Gaudi.sh \ ) } || true } - diff --git a/Projects/Athena/externals.txt b/Projects/Athena/externals.txt index a477e3dd1733fafdf915b64b500ea784fbb3fce4..ed4578a542e8e32673b32f83ace7c7e7331cb153 100644 --- a/Projects/Athena/externals.txt +++ b/Projects/Athena/externals.txt @@ -6,7 +6,7 @@ # forbidden. # The version of atlas/atlasexternals to use: -AthenaExternalsVersion = 2.0.19 +AthenaExternalsVersion = 2.0.20 -# The version of atlas/Gaudi to use: +# The version of atlas/Gaudi to use: GaudiVersion = v31r0.000 diff --git a/Reconstruction/TrackParticleTruthAthenaPool/src/TrackParticleTruthCollectionCnv.cxx b/Reconstruction/TrackParticleTruthAthenaPool/src/TrackParticleTruthCollectionCnv.cxx index 0bb193c0f6f0200be169ef16d3e52f6faa65f1bb..d09a9d01bf1fb704bd84aa95f664b20ca03aae77 100755 --- a/Reconstruction/TrackParticleTruthAthenaPool/src/TrackParticleTruthCollectionCnv.cxx +++ b/Reconstruction/TrackParticleTruthAthenaPool/src/TrackParticleTruthCollectionCnv.cxx @@ -33,9 +33,9 @@ TrackParticleTruthCollectionCnv::TrackParticleTruthCollectionCnv(ISvcLocator* sv //================================================================ TrackParticleTruthCollectionPERS* TrackParticleTruthCollectionCnv::createPersistent(TrackParticleTruthCollection* trans) { MsgStream log(msgSvc(), "TrackParticleTruthCollectionCnv"); - log<<MSG::DEBUG<<"Writing TrackParticleTruthCollection_p1"<<endmsg; + log<<MSG::DEBUG<<"Writing TrackParticleTruthCollection_p2"<<endmsg; TrackParticleTruthCollectionPERS* pers=new TrackParticleTruthCollectionPERS(); - m_converter_p1.transToPers(trans,pers,log); + m_converter_p2.transToPers(trans,pers,log); return pers; } diff --git a/Reconstruction/TrackParticleTruthAthenaPool/src/TrackParticleTruthCollectionCnv.h b/Reconstruction/TrackParticleTruthAthenaPool/src/TrackParticleTruthCollectionCnv.h index e4a93064981acd7faba707f6b1a2face8afd728a..8c20a4ffff79e861e20b2b0c9d109c44f99f00a0 100644 --- a/Reconstruction/TrackParticleTruthAthenaPool/src/TrackParticleTruthCollectionCnv.h +++ b/Reconstruction/TrackParticleTruthAthenaPool/src/TrackParticleTruthCollectionCnv.h @@ -13,9 +13,9 @@ #include "TrackParticleTruthTPCnv/TrackParticleTruthCollectionCnv_p1.h" #include "TrackParticleTruthTPCnv/TrackParticleTruthCollectionCnv_p0.h" -namespace Trk { class TrackParticleTruthCollection_p1; } +namespace Trk { class TrackParticleTruthCollection_p2; } -typedef Rec::TrackParticleTruthCollection_p1 TrackParticleTruthCollectionPERS; +typedef Rec::TrackParticleTruthCollection_p2 TrackParticleTruthCollectionPERS; typedef T_AthenaPoolCustomCnv<TrackParticleTruthCollection, TrackParticleTruthCollectionPERS> TrackParticleTruthCollectionCnvBase; diff --git a/Reconstruction/TrackParticleTruthAthenaPool/src/TrackParticleTruthCollectionContainerCnv.cxx b/Reconstruction/TrackParticleTruthAthenaPool/src/TrackParticleTruthCollectionContainerCnv.cxx index e89ac9b14e1ce7bc63e29e68cb9770709243dbe2..94cfb6a9019eb02273f0c014546931809f6b21cd 100644 --- a/Reconstruction/TrackParticleTruthAthenaPool/src/TrackParticleTruthCollectionContainerCnv.cxx +++ b/Reconstruction/TrackParticleTruthAthenaPool/src/TrackParticleTruthCollectionContainerCnv.cxx @@ -28,9 +28,9 @@ TrackParticleTruthCollectionContainerCnv::~TrackParticleTruthCollectionContainer TrackParticleTruthCollectionContainerPERS* TrackParticleTruthCollectionContainerCnv::createPersistent(TrackParticleTruthCollectionContainer* trans) { MsgStream log(msgSvc(), "TrackParticleTruthCollectionContainerCnv"); - log<<MSG::DEBUG<<"Writing TrackParticleTruthCollectionContainer_tlp1"<<endmsg; + log<<MSG::DEBUG<<"Writing TrackParticleTruthCollectionContainer_tlp2"<<endmsg; - TrackParticleTruthCollectionContainerPERS* p_cont = m_converter_p1->createPersistent( trans, log ); + TrackParticleTruthCollectionContainerPERS* p_cont = m_converter_p2->createPersistent( trans, log ); return p_cont; } diff --git a/Reconstruction/TrackParticleTruthAthenaPool/src/TrackParticleTruthCollectionContainerCnv.h b/Reconstruction/TrackParticleTruthAthenaPool/src/TrackParticleTruthCollectionContainerCnv.h index 0100c6b18eecfe0fbd47f8cc4b690a9f8f124e3a..8a8e2a014c3f83e62886ee2c592a8b40a9913758 100644 --- a/Reconstruction/TrackParticleTruthAthenaPool/src/TrackParticleTruthCollectionContainerCnv.h +++ b/Reconstruction/TrackParticleTruthAthenaPool/src/TrackParticleTruthCollectionContainerCnv.h @@ -15,9 +15,9 @@ #include "ParticleTruth/TrackParticleTruthCollectionContainer.h" #include "ParticleTruth/TrackParticleTruthVector.h" -class TrackParticleTruthCollectionContainer_tlp1; +class TrackParticleTruthCollectionContainer_tlp2; -typedef TrackParticleTruthCollectionContainer_tlp1 TrackParticleTruthCollectionContainerPERS; +typedef TrackParticleTruthCollectionContainer_tlp2 TrackParticleTruthCollectionContainerPERS; typedef T_AthenaPoolCustomCnv<TrackParticleTruthCollectionContainer, TrackParticleTruthCollectionContainerPERS> TrackParticleTruthCollectionContainerCnvBase; diff --git a/Reconstruction/TrackParticleTruthTPCnv/CMakeLists.txt b/Reconstruction/TrackParticleTruthTPCnv/CMakeLists.txt index 7a9f9f5dda7e26880c02542692adb02616ff3447..493a73cf0fdbdcc9a31a8facc01d27a8f4c24142 100644 --- a/Reconstruction/TrackParticleTruthTPCnv/CMakeLists.txt +++ b/Reconstruction/TrackParticleTruthTPCnv/CMakeLists.txt @@ -43,3 +43,9 @@ atlas_add_test( TrackParticleTruthCollectionCnv_p1_test INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} AthContainers AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib AthenaPoolUtilities GeneratorObjectsTPCnv Particle ParticleTruth TestTools AthenaKernel SGTools StoreGateLib SGtests TrackParticleTruthTPCnv ) +atlas_add_test( TrackParticleTruthCollectionCnv_p2_test + SOURCES + test/TrackParticleTruthCollectionCnv_p2_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} AthContainers AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib AthenaPoolUtilities GeneratorObjectsTPCnv Particle ParticleTruth TestTools AthenaKernel SGTools StoreGateLib SGtests TrackParticleTruthTPCnv ) + diff --git a/Reconstruction/TrackParticleTruthTPCnv/share/TrackParticleTruthCollectionCnv_p2_test.ref b/Reconstruction/TrackParticleTruthTPCnv/share/TrackParticleTruthCollectionCnv_p2_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..15b0f8802aa26b7a3f64465fab4e96e9cd6a04d7 --- /dev/null +++ b/Reconstruction/TrackParticleTruthTPCnv/share/TrackParticleTruthCollectionCnv_p2_test.ref @@ -0,0 +1,13 @@ +ApplicationMgr SUCCESS +==================================================================================================================================== + Welcome to ApplicationMgr (GaudiCoreSvc v4r1) + running on lxplus055.cern.ch on Sat Feb 17 16:55:20 2018 +==================================================================================================================================== +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/Reconstruction/TrackParticleTruthTPCnv/src/TrackParticleTruthTPCnv.cxx b/Reconstruction/TrackParticleTruthTPCnv/src/TrackParticleTruthTPCnv.cxx index 11ff128a9f5ca03db761376a1c74f4df0e638ead..2e585a4b0ecc5ff012d76fe3334465d6c13c529b 100644 --- a/Reconstruction/TrackParticleTruthTPCnv/src/TrackParticleTruthTPCnv.cxx +++ b/Reconstruction/TrackParticleTruthTPCnv/src/TrackParticleTruthTPCnv.cxx @@ -26,19 +26,19 @@ DECLARE_TPCNV_FACTORY(TrackParticleTruthCollectionContainerCnv_tlp1, DataVector<TrackParticleTruthCollection>, TrackParticleTruthCollectionContainer_tlp1, - Athena::TPCnvVers::Current) + Athena::TPCnvVers::Old) DECLARE_TPCNV_FACTORY(TrackParticleTruthCollectionContainerCnv_tlp2, DataVector<TrackParticleTruthCollection>, TrackParticleTruthCollectionContainer_tlp2, - Athena::TPCnvVers::Old) + Athena::TPCnvVers::Current) DECLARE_TPCNV_FACTORY(TrackParticleTruthCollectionCnv_p1, TrackParticleTruthCollection, Rec::TrackParticleTruthCollection_p1, - Athena::TPCnvVers::Current) + Athena::TPCnvVers::Old) DECLARE_TPCNV_FACTORY(TrackParticleTruthCollectionCnv_p2, TrackParticleTruthCollection, Rec::TrackParticleTruthCollection_p2, - Athena::TPCnvVers::Old) + Athena::TPCnvVers::Current) diff --git a/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p1_test.cxx b/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p1_test.cxx index 300eb943f8be0c8e0914ca57885586f828e156fd..17e9ccbe68e74179a93274f456fda04a9a7f74f7 100644 --- a/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p1_test.cxx +++ b/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p1_test.cxx @@ -77,7 +77,7 @@ void test1(std::vector<HepMC::GenParticle*> genPartVector) TrackParticleTruthCollection trans1 (DataLink<Rec::TrackParticleContainer>("tpc")); for (int i=0; i<10; i++) { const HepMC::GenParticle* pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(pGenParticle->barcode()); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); Rec::TrackParticleTruthKey key (ElementLink<Rec::TrackParticleContainer> ("tpc", i)); TrackParticleTruth val (trkLink, (float)i/10); trans1[key] = val; diff --git a/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p2_test.cxx b/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p2_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..df5bf61d34fe8a9a8dcb547714963842e8aaf383 --- /dev/null +++ b/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p2_test.cxx @@ -0,0 +1,93 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file InDetSimEventTPCnv/test/TrackParticleTruthCollectionCnv_p2_test.cxx + * @author scott snyder <snyder@bnl.gov> + * @date Feb, 2016 + * @brief Tests for TrackParticleTruthCollectionCnv_p2. + */ + + +#undef NDEBUG +#include "TrackParticleTruthTPCnv/TrackParticleTruthCollectionCnv_p2.h" +#include "TrackParticleTruthTPCnv/TrackParticleTruthCollection_p2.h" +#include "ParticleTruth/TrackParticleTruthCollection.h" +#include "SGTools/TestStore.h" +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenEvent.h" +#include "HepMC/GenParticle.h" +#include <cassert> +#include <iostream> + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + +void compare (const TrackParticleTruthCollection& p1, + const TrackParticleTruthCollection& p2) +{ + assert (p1.trackParticleContainerLink() == p2.trackParticleContainerLink()); + assert (p1.size() == p2.size()); + TrackParticleTruthCollection::const_iterator i1 = p1.begin(); + TrackParticleTruthCollection::const_iterator i2 = p2.begin(); + for (; i1 != p1.end(); ++i1, ++i2) { + assert (i1->first.link() == i2->first.link()); + compare (i1->second.particleLink(), i2->second.particleLink()); + assert (i1->second.particleLink() == i2->second.particleLink()); + assert (i1->second.probability() == i2->second.probability()); + } +} + + +void testit (const TrackParticleTruthCollection& trans1) +{ + MsgStream log (0, "test"); + TrackParticleTruthCollectionCnv_p2 cnv; + Rec::TrackParticleTruthCollection_p2 pers; + cnv.transToPers (&trans1, &pers, log); + TrackParticleTruthCollection trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*> genPartVector) +{ + std::cout << "test1\n"; + + TrackParticleTruthCollection trans1 (DataLink<Rec::TrackParticleContainer>("tpc")); + for (int i=0; i<10; i++) { + const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); + Rec::TrackParticleTruthKey key (ElementLink<Rec::TrackParticleContainer> ("tpc", i)); + TrackParticleTruth val (trkLink, (float)i/10); + trans1[key] = val; + } + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(genPartVector); + return 0; +} diff --git a/TileCalorimeter/TileConditions/TileConditions/TileBadChannels.h b/TileCalorimeter/TileConditions/TileConditions/TileBadChannels.h index 7065e2f983cdaad1ea2cf2c64f3c321a9252c8d8..a7a60bac2fbc107c80e2d34d29721da46c19a33a 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileBadChannels.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileBadChannels.h @@ -19,6 +19,7 @@ */ #include <map> +#include <vector> class TileBadChannels { @@ -54,7 +55,7 @@ class TileBadChannels { * @brief Store trips probabilities for all Tile drawers * @param tripsProbs Trips probabilites for all Tile drawers */ - void setTripsProbabilities(std::vector<std::vector<float>>& tripsProbs); + void setTripsProbabilities(std::vector<std::vector<float>>&& tripsProbs); /** * @brief Return trips probabilities for all Tile drawers @@ -67,7 +68,7 @@ class TileBadChannels { * @brief Store Tile drawers masked completely * @param maskedDrawers Array of Tile drawers (frag identifiers) masked comletely */ - void setMaskedDrawers(std::vector<int>& maskedDrawers); + void setMaskedDrawers(std::vector<int>&& maskedDrawers); /** * @brief Return Tile drawers masked completely @@ -80,8 +81,9 @@ class TileBadChannels { TileBchStatus m_defaultStatus; - std::map<const HWIdentifier, TileBchStatus> m_adcStatus; - std::map<const HWIdentifier, TileBchStatus> m_channelStatus; + typedef std::map<const HWIdentifier, TileBchStatus> BchMap; + BchMap m_adcStatus; + BchMap m_channelStatus; std::vector<std::vector<float>> m_tripsProbs; std::vector<int> m_maskedDrawers; @@ -96,13 +98,8 @@ CONDCONT_DEF ( TileBadChannels, 136686108); // inlines inline -void TileBadChannels::setTripsProbabilities(std::vector<std::vector<float>>& tripsProbs) { +void TileBadChannels::setTripsProbabilities(std::vector<std::vector<float>>&& tripsProbs) { m_tripsProbs = std::move(tripsProbs); } -inline -void TileBadChannels::setMaskedDrawers(std::vector<int>& maskedDrawers) { - m_maskedDrawers = std::move(maskedDrawers); -} - #endif // TILECONDITIONS_TILEBADCHANNELS_H diff --git a/TileCalorimeter/TileConditions/src/TileBadChanTool.cxx b/TileCalorimeter/TileConditions/src/TileBadChanTool.cxx index b99aeecd081209f83aaaf16c66b2a1869cd78e58..a53fa190623f7cd8f0091f124a80656b21a54359 100644 --- a/TileCalorimeter/TileConditions/src/TileBadChanTool.cxx +++ b/TileCalorimeter/TileConditions/src/TileBadChanTool.cxx @@ -229,5 +229,7 @@ bool TileBadChanTool::isDrawerMasked(unsigned int frag_id) const { SG::ReadCondHandle<TileBadChannels> badChannels(m_badChannelsKey); const std::vector<int>& maskedDrawers = badChannels->getMaskedDrawers(); - return (std::find(maskedDrawers.begin(), maskedDrawers.end(), frag_id) != maskedDrawers.end()); + return std::binary_search (maskedDrawers.begin(), + maskedDrawers.end(), + frag_id); } diff --git a/TileCalorimeter/TileConditions/src/TileBadChannels.cxx b/TileCalorimeter/TileConditions/src/TileBadChannels.cxx index fe2c5726e825d5d2fc596725f35fdcd9fb2104fd..bf3abbf5d8d412a855e8746fce11f33e4b9b886f 100644 --- a/TileCalorimeter/TileConditions/src/TileBadChannels.cxx +++ b/TileCalorimeter/TileConditions/src/TileBadChannels.cxx @@ -1,8 +1,9 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "TileConditions/TileBadChannels.h" +#include <algorithm> TileBadChannels::TileBadChannels() { @@ -22,7 +23,7 @@ void TileBadChannels::addAdcStatus(const HWIdentifier channel_id, const HWIdenti const TileBchStatus& TileBadChannels::getAdcStatus(const HWIdentifier adc_id) const { - std::map<const HWIdentifier, TileBchStatus>::const_iterator adcStatus = m_adcStatus.find(adc_id); + BchMap::const_iterator adcStatus = m_adcStatus.find(adc_id); if (adcStatus == m_adcStatus.end()) { return m_defaultStatus; } else { @@ -33,7 +34,7 @@ const TileBchStatus& TileBadChannels::getAdcStatus(const HWIdentifier adc_id) co const TileBchStatus& TileBadChannels::getChannelStatus(const HWIdentifier channel_id) const { - std::map<const HWIdentifier, TileBchStatus>::const_iterator channelStatus = m_channelStatus.find(channel_id); + BchMap::const_iterator channelStatus = m_channelStatus.find(channel_id); if (channelStatus == m_channelStatus.end()) { return m_defaultStatus; } else { @@ -41,3 +42,9 @@ const TileBchStatus& TileBadChannels::getChannelStatus(const HWIdentifier channe } } + + +void TileBadChannels::setMaskedDrawers(std::vector<int>&& maskedDrawers) { + m_maskedDrawers = std::move(maskedDrawers); + std::sort (m_maskedDrawers.begin(), m_maskedDrawers.end()); +} diff --git a/TileCalorimeter/TileConditions/src/TileBadChannelsCondAlg.cxx b/TileCalorimeter/TileConditions/src/TileBadChannelsCondAlg.cxx index b70a68ccccae68ce7ff5358d9b096d9b9ee83988..c979b49b7d5e6c96a9945aae454b9c81e8132c2e 100644 --- a/TileCalorimeter/TileConditions/src/TileBadChannelsCondAlg.cxx +++ b/TileCalorimeter/TileConditions/src/TileBadChannelsCondAlg.cxx @@ -255,7 +255,7 @@ StatusCode TileBadChannelsCondAlg::execute() { } } - if (!maskedDrawers.empty()) badChannelsData->setMaskedDrawers(maskedDrawers); + if (!maskedDrawers.empty()) badChannelsData->setMaskedDrawers(std::move(maskedDrawers)); // Check if drawer trips probabilities for simulation are exist in DB. // By special convention trips probabilities are stored in drawer number: 2 @@ -287,7 +287,7 @@ StatusCode TileBadChannelsCondAlg::execute() { } } - badChannelsData->setTripsProbabilities(tripsProbs); + badChannelsData->setTripsProbabilities(std::move(tripsProbs)); } else { ATH_MSG_INFO("No drawer trips probabilities found in DB"); diff --git a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/DetailedTrackTruthCollectionCnv.cxx b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/DetailedTrackTruthCollectionCnv.cxx index b6868cdc8f7edcf4a63b3c3f04b996d07668142f..fffb9a3f9f2ac48b1ae46d00956b2a04e1f5c289 100755 --- a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/DetailedTrackTruthCollectionCnv.cxx +++ b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/DetailedTrackTruthCollectionCnv.cxx @@ -31,12 +31,12 @@ DetailedTrackTruthCollectionCnv::DetailedTrackTruthCollectionCnv(ISvcLocator* sv //================================================================ DetailedTrackTruthCollectionPERS* DetailedTrackTruthCollectionCnv::createPersistent(DetailedTrackTruthCollection* trans) { MsgStream log(msgSvc(), "DetailedTrackTruthCollectionCnv"); - log<<MSG::DEBUG<<"Writing DetailedTrackTruthCollection_p2"<<endmsg; + log<<MSG::DEBUG<<"Writing DetailedTrackTruthCollection_p3"<<endmsg; //orig: return new DetailedTrackTruthCollectionPERS( *reinterpret_cast<DetailedTrackTruthCollectionPERS*>(trans) ); DetailedTrackTruthCollectionPERS* pers=new DetailedTrackTruthCollectionPERS(); - m_converter_p2.transToPers(trans,pers,log); + m_converter_p3.transToPers(trans,pers,log); return pers; } diff --git a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/DetailedTrackTruthCollectionCnv.h b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/DetailedTrackTruthCollectionCnv.h index 39b0e21d3192a32cd8566e642677d5e82134bdd6..04d98ab49ab61b5df70e64f80972a9391e1e667a 100644 --- a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/DetailedTrackTruthCollectionCnv.h +++ b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/DetailedTrackTruthCollectionCnv.h @@ -13,10 +13,9 @@ #include "TrkTruthTPCnv/DetailedTrackTruthCollectionCnv_p2.h" #include "TrkTruthTPCnv/DetailedTrackTruthCollectionCnv_p3.h" #include "TrkTruthTPCnv/DetailedTrackTruthCollection_p2.h" +#include "TrkTruthTPCnv/DetailedTrackTruthCollection_p3.h" -// namespace Trk { class DetailedTrackTruthCollection_p2; } - -typedef Trk::DetailedTrackTruthCollection_p2 DetailedTrackTruthCollectionPERS; +typedef Trk::DetailedTrackTruthCollection_p3 DetailedTrackTruthCollectionPERS; typedef T_AthenaPoolCustomCnv<DetailedTrackTruthCollection, DetailedTrackTruthCollectionPERS> DetailedTrackTruthCollectionCnvBase; diff --git a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/PRD_MultiTruthCollectionCnv.cxx b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/PRD_MultiTruthCollectionCnv.cxx index 38c0bac9f4cfcdae31b34ba48fb654f585f81d35..c0b67d92ae3db88847be183bf479f1521e382cfd 100755 --- a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/PRD_MultiTruthCollectionCnv.cxx +++ b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/PRD_MultiTruthCollectionCnv.cxx @@ -24,9 +24,9 @@ PRD_MultiTruthCollectionCnv::PRD_MultiTruthCollectionCnv(ISvcLocator* svcLoc) : //================================================================ PRD_MultiTruthCollectionPERS* PRD_MultiTruthCollectionCnv::createPersistent(PRD_MultiTruthCollection* trans) { MsgStream log(msgSvc(), "PRD_MultiTruthCollectionCnv"); - log<<MSG::DEBUG<<"Writing PRD_MultiTruthCollection_p2"<<endmsg; + log<<MSG::DEBUG<<"Writing PRD_MultiTruthCollection_p3"<<endmsg; PRD_MultiTruthCollectionPERS* pers=new PRD_MultiTruthCollectionPERS(); - m_converter_p2.transToPers(trans,pers,log); + m_converter_p3.transToPers(trans,pers,log); return pers; } diff --git a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/PRD_MultiTruthCollectionCnv.h b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/PRD_MultiTruthCollectionCnv.h index 15dfd020fef5f67e50e144cccc23586c42416ec5..f9be3f684a6cdcb8608a4f385235588f3d8a70fe 100644 --- a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/PRD_MultiTruthCollectionCnv.h +++ b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/PRD_MultiTruthCollectionCnv.h @@ -12,9 +12,9 @@ #include "TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p3.h" #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" -namespace Trk { class PRD_MultiTruthCollection_p2; } +namespace Trk { class PRD_MultiTruthCollection_p3; } -typedef Trk::PRD_MultiTruthCollection_p2 PRD_MultiTruthCollectionPERS; +typedef Trk::PRD_MultiTruthCollection_p3 PRD_MultiTruthCollectionPERS; typedef T_AthenaPoolCustomCnv<PRD_MultiTruthCollection,PRD_MultiTruthCollectionPERS> PRD_MultiTruthCollectionCnvBase; diff --git a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/TrackTruthCollectionCnv.cxx b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/TrackTruthCollectionCnv.cxx index 779a6f155faf0325d44c7c6bdd358e180d9fe8bb..16843da67d4d52bcb7957987a24e0884bde3b987 100755 --- a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/TrackTruthCollectionCnv.cxx +++ b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/TrackTruthCollectionCnv.cxx @@ -34,9 +34,9 @@ TrackTruthCollectionCnv::TrackTruthCollectionCnv(ISvcLocator* svcLoc) : //================================================================ TrackTruthCollectionPERS* TrackTruthCollectionCnv::createPersistent(TrackTruthCollection* trans) { MsgStream log(msgSvc(), "TrackTruthCollectionCnv"); - log<<MSG::DEBUG<<"Writing TrackTruthCollection_p1"<<endmsg; + log<<MSG::DEBUG<<"Writing TrackTruthCollection_p2"<<endmsg; TrackTruthCollectionPERS* pers=new TrackTruthCollectionPERS(); - m_converter_p1.transToPers(trans,pers,log); + m_converter_p2.transToPers(trans,pers,log); return pers; } diff --git a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/TrackTruthCollectionCnv.h b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/TrackTruthCollectionCnv.h index d64e43427a8cfb10a7c3a28403963883b6a229fd..1b4809dd58a9dfdcccb4f523fcd6f8bbf9e8cdcf 100644 --- a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/TrackTruthCollectionCnv.h +++ b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/TrackTruthCollectionCnv.h @@ -15,9 +15,9 @@ #include "TrkTruthTPCnv/TrackTruthCollectionCnv_p1.h" #include "TrkTruthTPCnv/TrackTruthCollectionCnv_p0.h" -namespace Trk { class TrackTruthCollection_p1; } +namespace Trk { class TrackTruthCollection_p2; } -typedef Trk::TrackTruthCollection_p1 TrackTruthCollectionPERS; +typedef Trk::TrackTruthCollection_p2 TrackTruthCollectionPERS; typedef T_AthenaPoolCustomCnv<TrackTruthCollection, TrackTruthCollectionPERS> TrackTruthCollectionCnvBase; diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/CMakeLists.txt b/Tracking/TrkEventCnv/TrkTruthTPCnv/CMakeLists.txt index 25f571822f5885d0d97d31a7851662266e0e5d1b..dc02d02c4407d9b4e8b36d961d85c6cab4ca567b 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/CMakeLists.txt +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/CMakeLists.txt @@ -19,6 +19,7 @@ atlas_depends_on_subdirs( PUBLIC Tracking/TrkEvent/TrkTrack Tracking/TrkEvent/TrkTruthData PRIVATE + AtlasTest/TestTools Control/AthenaKernel Control/CxxUtils ) @@ -30,11 +31,46 @@ atlas_add_tpcnv_library( TrkTruthTPCnv src/*.cxx PUBLIC_HEADERS TrkTruthTPCnv PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks AthContainers DataModelAthenaPoolLib AthenaKernel StoreGateLib SGtests AthenaPoolCnvSvcLib GeneratorObjects GeneratorObjectsTPCnv InDetIdentifier TrkTrack TrkTruthData AthenaKernel CxxUtils ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks AthContainers DataModelAthenaPoolLib AthenaKernel StoreGateLib SGtests AthenaPoolCnvSvcLib GeneratorObjects GeneratorObjectsTPCnv InDetIdentifier TrkTrack TrkTruthData TestTools CxxUtils ) atlas_add_dictionary( TrkTruthTPCnvDict src/TrkTruthTPCnvDict.h TrkTruthTPCnv/selection.xml INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks AthContainers DataModelAthenaPoolLib AthenaKernel StoreGateLib SGtests AthenaPoolCnvSvcLib GeneratorObjects GeneratorObjectsTPCnv InDetIdentifier TrkTrack TrkTruthData AthenaKernel CxxUtils TrkTruthTPCnv ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks AthContainers DataModelAthenaPoolLib AthenaKernel StoreGateLib SGtests AthenaPoolCnvSvcLib GeneratorObjects GeneratorObjectsTPCnv InDetIdentifier TrkTrack TrkTruthData TestTools CxxUtils TrkTruthTPCnv ) +atlas_add_test( TrackTruthCollectionCnv_p1_test + SOURCES + test/TrackTruthCollectionCnv_p1_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks AthContainers DataModelAthenaPoolLib AthenaKernel StoreGateLib SGtests AthenaPoolCnvSvcLib GeneratorObjectsTPCnv InDetIdentifier TrkTrack TrkTruthData TestTools TrkTruthTPCnv ) + +atlas_add_test( TrackTruthCollectionCnv_p2_test + SOURCES + test/TrackTruthCollectionCnv_p2_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks AthContainers DataModelAthenaPoolLib AthenaKernel StoreGateLib SGtests AthenaPoolCnvSvcLib GeneratorObjectsTPCnv InDetIdentifier TrkTrack TrkTruthData TestTools TrkTruthTPCnv ) + +atlas_add_test( TruthTrajectoryCnv_p1_test + SOURCES + test/TruthTrajectoryCnv_p1_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks AthContainers DataModelAthenaPoolLib AthenaKernel StoreGateLib SGtests AthenaPoolCnvSvcLib AthenaPoolUtilities GeneratorObjectsTPCnv InDetIdentifier TrkTrack TrkTruthData TestTools TrkTruthTPCnv ) + +atlas_add_test( TruthTrajectoryCnv_p2_test + SOURCES + test/TruthTrajectoryCnv_p2_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks AthContainers DataModelAthenaPoolLib AthenaKernel StoreGateLib SGtests AthenaPoolCnvSvcLib AthenaPoolUtilities GeneratorObjectsTPCnv InDetIdentifier TrkTrack TrkTruthData TestTools TrkTruthTPCnv ) + +atlas_add_test( PRD_MultiTruthCollectionCnv_p2_test + SOURCES + test/PRD_MultiTruthCollectionCnv_p2_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks AthContainers DataModelAthenaPoolLib AthenaKernel StoreGateLib SGtests AthenaPoolCnvSvcLib AthenaPoolUtilities GeneratorObjectsTPCnv InDetIdentifier TrkTrack TrkTruthData TestTools TrkTruthTPCnv ) + +atlas_add_test( PRD_MultiTruthCollectionCnv_p3_test + SOURCES + test/PRD_MultiTruthCollectionCnv_p3_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks AthContainers DataModelAthenaPoolLib AthenaKernel StoreGateLib SGtests AthenaPoolCnvSvcLib AthenaPoolUtilities GeneratorObjectsTPCnv InDetIdentifier TrkTrack TrkTruthData TestTools TrkTruthTPCnv ) diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p2_test.ref b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p2_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..8633d8ace9b4883a00f6e29e68937582b9b5e684 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p2_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p3_test.ref b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p3_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..8633d8ace9b4883a00f6e29e68937582b9b5e684 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p3_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p1_test.ref b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p1_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..8633d8ace9b4883a00f6e29e68937582b9b5e684 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p1_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p2_test.ref b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p2_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..8633d8ace9b4883a00f6e29e68937582b9b5e684 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p2_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p1_test.ref b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p1_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..8633d8ace9b4883a00f6e29e68937582b9b5e684 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p1_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p2_test.ref b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p2_test.ref new file mode 100644 index 0000000000000000000000000000000000000000..8633d8ace9b4883a00f6e29e68937582b9b5e684 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p2_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/DetailedTrackTruthCnv_p3.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/DetailedTrackTruthCnv_p3.cxx index f6f6b582da5cee54cb4fac96433814ded791c435..840fc5b45a6bc7ab6c99e8210c1565ea611878a5 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/DetailedTrackTruthCnv_p3.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/DetailedTrackTruthCnv_p3.cxx @@ -35,9 +35,16 @@ void DetailedTrackTruthCnv_p3::persToTrans( const Trk::DetailedTrackTruth_p3* pe msg<<MSG::DEBUG<<"DetailedTrackTruthCnv_p3::persToTrans() DONE"<<endmsg; } -void DetailedTrackTruthCnv_p3::transToPers( const DetailedTrackTruth*, - Trk::DetailedTrackTruth_p3*, - MsgStream& /*msg*/ ) +void DetailedTrackTruthCnv_p3::transToPers( const DetailedTrackTruth* trans, + Trk::DetailedTrackTruth_p3* pers, + MsgStream& msg ) { - throw std::runtime_error("DetailedTrackTruthCnv_p3::transToPers is not supported in this release!"); + msg<<MSG::DEBUG<<"DetailedTrackTruthCnv_p3::transToPers()"<<endmsg; + + subDetHitStatConverter.transToPers(&trans->statsCommon(), &pers->m_hitsCommon, msg); + subDetHitStatConverter.transToPers(&trans->statsTrack(), &pers->m_hitsTrack, msg); + subDetHitStatConverter.transToPers(&trans->statsTruth(), &pers->m_hitsTruth, msg); + truthTrajConverter.transToPers(&trans->trajectory(), &pers->m_trajectory, msg); + + msg<<MSG::DEBUG<<"DetailedTrackTruthCnv_p3::transToPers() DONE"<<endmsg; } diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/DetailedTrackTruthCollectionCnv_p3.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/DetailedTrackTruthCollectionCnv_p3.cxx index 1f9d62f0d54486b10016a5043302e25683a3d495..79b61d7950bbb1332189d1779d730f946d566b7b 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/DetailedTrackTruthCollectionCnv_p3.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/DetailedTrackTruthCollectionCnv_p3.cxx @@ -43,9 +43,23 @@ void DetailedTrackTruthCollectionCnv_p3::persToTrans( const Trk::DetailedTrackTr msg<<MSG::DEBUG<<"DetailedTrackTruthCollectionCnv_p3::persToTrans() DONE"<<endmsg; } -void DetailedTrackTruthCollectionCnv_p3::transToPers( const DetailedTrackTruthCollection*, - Trk::DetailedTrackTruthCollection_p3*, - MsgStream& /*msg*/ ) +void DetailedTrackTruthCollectionCnv_p3::transToPers( const DetailedTrackTruthCollection* trans, + Trk::DetailedTrackTruthCollection_p3* pers, + MsgStream& msg ) { - throw std::runtime_error("DetailedTrackTruthCollectionCnv_p3::transToPers is not supported in this release!"); + msg<<MSG::DEBUG<<"DetailedTrackTruthCollectionCnv_p3::transToPers()"<<endmsg; + msg<<MSG::DEBUG<<"DetailedTrackTruthCollectionCnv_p3::transToPers(): input size = "<<trans->size()<<endmsg; + + dataLinkConverter.transToPers(trans->trackCollectionLink(), pers->m_trackCollectionLink, msg); + + pers->m_entries.resize(trans->size()); + Trk::DetailedTrackTruthCollection_p3::CollectionType::size_type ipers(0); + + for(DetailedTrackTruthCollection::const_iterator itrans=trans->begin(); itrans!=trans->end(); itrans++, ipers++) { + Trk::DetailedTrackTruthCollection_p3::Entry& current = pers->m_entries[ipers]; + current.key.m_index = itrans->first.index(); // extract index from ElementLink + detailedTruthConverter.transToPers(&itrans->second, ¤t.detailedTruth, msg); + } + + msg<<MSG::DEBUG<<"DetailedTrackTruthCollectionCnv_p3::transToPers() DONE"<<endmsg; } diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/PRD_MultiTruthCollectionCnv_p3.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/PRD_MultiTruthCollectionCnv_p3.cxx index a6d8795493a8251cf7bace14f2fbf086a762dbc5..bf3ea85668be97697bc3a313d64adb0b5297e349 100755 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/PRD_MultiTruthCollectionCnv_p3.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/PRD_MultiTruthCollectionCnv_p3.cxx @@ -33,9 +33,19 @@ void PRD_MultiTruthCollectionCnv_p3::persToTrans( const Trk::PRD_MultiTruthColle msg<<MSG::DEBUG<<"PRD_MultiTruthCollectionCnv_p3::persToTrans() DONE"<<endmsg; } -void PRD_MultiTruthCollectionCnv_p3::transToPers( const PRD_MultiTruthCollection*, - Trk::PRD_MultiTruthCollection_p3*, - MsgStream& /*msg */) +void PRD_MultiTruthCollectionCnv_p3::transToPers( const PRD_MultiTruthCollection* trans, + Trk::PRD_MultiTruthCollection_p3* pers, + MsgStream& msg ) { - throw std::runtime_error("PRD_MultiTruthCollectionCnv_p3::transToPers is not supported in this release!"); + msg<<MSG::DEBUG<<"PRD_MultiTruthCollectionCnv_p3::transToPers()"<<endmsg; + + pers->m_entries.reserve(trans->size()); + + for(PRD_MultiTruthCollection::const_iterator i=trans->begin(); i!=trans->end(); i++) { + HepMcParticleLink_p2 link; + particleLinkConverter.transToPers(&i->second, &link, msg); + pers->m_entries.push_back(Trk::PRD_MultiTruthCollection_p3::Entry(i->first.get_compact(), link)); + } + + msg<<MSG::DEBUG<<"PRD_MultiTruthCollectionCnv_p3::transToPers() DONE"<<endmsg; } diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TrackTruthCollectionCnv_p2.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TrackTruthCollectionCnv_p2.cxx index 5ad6a5a874a8e99d494d7b3abc17ee4013407bf3..dc34936c0ff51327f9b620004eaddb58c5b0eb4d 100755 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TrackTruthCollectionCnv_p2.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TrackTruthCollectionCnv_p2.cxx @@ -40,9 +40,24 @@ void TrackTruthCollectionCnv_p2::persToTrans( const Trk::TrackTruthCollection_p2 msg<<MSG::DEBUG<<"TrackTruthCollectionCnv_p2::persToTrans() DONE"<<endmsg; } -void TrackTruthCollectionCnv_p2::transToPers( const TrackTruthCollection*, - Trk::TrackTruthCollection_p2*, - MsgStream& /*msg*/ ) +void TrackTruthCollectionCnv_p2::transToPers( const TrackTruthCollection* trans, + Trk::TrackTruthCollection_p2* pers, + MsgStream& msg ) { - throw std::runtime_error("TrackTruthCollectionCnv_p2::transToPers is not supported in this release!"); + msg<<MSG::DEBUG<<"TrackTruthCollectionCnv_p2::transToPers()"<<endmsg; + msg<<MSG::DEBUG<<"TrackTruthCollectionCnv_p2::transToPers(): input size = "<<trans->size()<<endmsg; + + dataLinkConverter.transToPers(trans->trackCollectionLink(), pers->m_trackCollectionLink, msg); + + pers->m_entries.resize(trans->size()); + Trk::TrackTruthCollection_p2::CollectionType::size_type ipers(0); + for(TrackTruthCollection::const_iterator itrans=trans->begin(); itrans!=trans->end(); itrans++, ipers++) { + Trk::TrackTruthCollection_p2::Entry& current = pers->m_entries[ipers]; + const TrackTruth& truth = itrans->second; + current.index = itrans->first.index(); // extract index from ElementLink + current.probability = truth.probability(); + particleLinkConverter.transToPers(&itrans->second.particleLink(), ¤t.particle, msg); + } + + msg<<MSG::DEBUG<<"TrackTruthCollectionCnv_p2::transToPers() DONE"<<endmsg; } diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TruthTrajectoryCnv_p2.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TruthTrajectoryCnv_p2.cxx index 28a581c2a608545c34807af79cb084a44d164a57..3fd6246d75fa9a014a8be0b93d9a95afae7bb436 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TruthTrajectoryCnv_p2.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TruthTrajectoryCnv_p2.cxx @@ -26,9 +26,12 @@ void TruthTrajectoryCnv_p2::persToTrans( const Trk::TruthTrajectory_p2* pers, } } -void TruthTrajectoryCnv_p2::transToPers( const TruthTrajectory*, - Trk::TruthTrajectory_p2*, - MsgStream& /*msg*/ ) +void TruthTrajectoryCnv_p2::transToPers( const TruthTrajectory* trans, + Trk::TruthTrajectory_p2* pers, + MsgStream& msg ) { - throw std::runtime_error("TruthTrajectoryCnv_p2::transToPers is not supported in this release!"); + pers->resize(trans->size()); + for(TruthTrajectory::size_type i=0; i<trans->size(); i++) { + particleLinkConverter.transToPers( &((*trans)[i]), &((*pers)[i]), msg); + } } diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p2_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p2_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..69aafc4c4a3322880b5c49f1b2782e66b0dffe4d --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p2_test.cxx @@ -0,0 +1,91 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p2_test.cxx + * @date Feb, 2018 + * @brief Tests for PRD_MultiTruthCollectionCnv_p2. + */ + + +#undef NDEBUG +#include "TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p2.h" +#include "TrkTruthTPCnv/PRD_MultiTruthCollection_p2.h" +#include "TrkTruthData/PRD_MultiTruthCollection.h" +#include "StoreGate/StoreGateSvc.h" +#include "SGTools/TestStore.h" +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenEvent.h" +#include "HepMC/GenParticle.h" +#include <cassert> +#include <iostream> + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + + +void compare (const PRD_MultiTruthCollection& p1, + const PRD_MultiTruthCollection& p2) +{ + assert (p1.size() == p2.size()); + PRD_MultiTruthCollection::const_iterator i1 = p1.begin(); + PRD_MultiTruthCollection::const_iterator i2 = p2.begin(); + for (; i1 != p1.end(); ++i1, ++i2) { + assert (i1->first == i2->first); + compare (i1->second, i2->second); + assert (i1->second == i2->second); + } +} + + +void testit (const PRD_MultiTruthCollection& trans1) +{ + MsgStream log (0, "test"); + PRD_MultiTruthCollectionCnv_p2 cnv; + Trk::PRD_MultiTruthCollection_p2 pers; + cnv.transToPers (&trans1, &pers, log); + PRD_MultiTruthCollection trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*> genPartVector) +{ + std::cout << "test1\n"; + + PRD_MultiTruthCollection trans1; + for (int i=0; i<10; i++) { + const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); + const Identifier chanId(i+100); + trans1.insert(trans1.end(), std::make_pair(chanId, trkLink) ); + } + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + //SGTest::initTestStore(); + test1(genPartVector); + return 0; +} diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p3_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p3_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7f951db5a53dd296b76f13cbc55b63e496d90cbe --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p3_test.cxx @@ -0,0 +1,91 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p3_test.cxx + * @date Feb, 2018 + * @brief Tests for PRD_MultiTruthCollectionCnv_p3. + */ + + +#undef NDEBUG +#include "TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p3.h" +#include "TrkTruthTPCnv/PRD_MultiTruthCollection_p3.h" +#include "TrkTruthData/PRD_MultiTruthCollection.h" +#include "StoreGate/StoreGateSvc.h" +#include "SGTools/TestStore.h" +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenEvent.h" +#include "HepMC/GenParticle.h" +#include <cassert> +#include <iostream> + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + + +void compare (const PRD_MultiTruthCollection& p1, + const PRD_MultiTruthCollection& p2) +{ + assert (p1.size() == p2.size()); + PRD_MultiTruthCollection::const_iterator i1 = p1.begin(); + PRD_MultiTruthCollection::const_iterator i2 = p2.begin(); + for (; i1 != p1.end(); ++i1, ++i2) { + assert (i1->first == i2->first); + compare (i1->second, i2->second); + assert (i1->second == i2->second); + } +} + + +void testit (const PRD_MultiTruthCollection& trans1) +{ + MsgStream log (0, "test"); + PRD_MultiTruthCollectionCnv_p3 cnv; + Trk::PRD_MultiTruthCollection_p3 pers; + cnv.transToPers (&trans1, &pers, log); + PRD_MultiTruthCollection trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*> genPartVector) +{ + std::cout << "test1\n"; + + PRD_MultiTruthCollection trans1; + for (int i=0; i<10; i++) { + const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); + const Identifier chanId(i+100); + trans1.insert(trans1.end(), std::make_pair(chanId, trkLink) ); + } + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + //SGTest::initTestStore(); + test1(genPartVector); + return 0; +} diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p1_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p1_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..42a0f3b3ae3f477d16999226726ed29fd9e42e63 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p1_test.cxx @@ -0,0 +1,94 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file TrkTruthTPCnv/test/TrackTruthCollectionCnv_p1_test.cxx + * @date Feb, 2018 + * @brief Tests for TrackTruthCollectionCnv_p1. + */ + + +#undef NDEBUG +#include "TrkTruthTPCnv/TrackTruthCollectionCnv_p1.h" +#include "TrkTruthTPCnv/TrackTruthCollection_p1.h" +#include "TrkTruthData/TrackTruthCollection.h" +#include "SGTools/TestStore.h" +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenEvent.h" +#include "HepMC/GenParticle.h" +#include <cassert> +#include <iostream> + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + + +void compare (const TrackTruthCollection& p1, + const TrackTruthCollection& p2) +{ + assert (p1.trackCollectionLink() == p2.trackCollectionLink()); + assert (p1.size() == p2.size()); + TrackTruthCollection::const_iterator i1 = p1.begin(); + TrackTruthCollection::const_iterator i2 = p2.begin(); + for (; i1 != p1.end(); ++i1, ++i2) { + assert (i1->first.index() == i2->first.index()); + compare (i1->second.particleLink(), i2->second.particleLink()); + assert (i1->second.particleLink() == i2->second.particleLink()); + assert (i1->second.probability() == i2->second.probability()); + } +} + + +void testit (const TrackTruthCollection& trans1) +{ + MsgStream log (0, "test"); + TrackTruthCollectionCnv_p1 cnv; + Trk::TrackTruthCollection_p1 pers; + cnv.transToPers (&trans1, &pers, log); + TrackTruthCollection trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*> genPartVector) +{ + std::cout << "test1\n"; + + TrackTruthCollection trans1 (DataLink<TrackCollection>("tpc")); + for (int i=0; i<10; i++) { + const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); + Trk::TrackTruthKey key (ElementLink<TrackCollection> ("tpc", i)); + TrackTruth val (trkLink, (float)i/10); + trans1[key] = val; + } + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + //SGTest::initTestStore(); + test1(genPartVector); + return 0; +} diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p2_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p2_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d26a7783794d6407b6674637577e32cfb2fe4e0c --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p2_test.cxx @@ -0,0 +1,94 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file TrkTruthTPCnv/test/TrackTruthCollectionCnv_p2_test.cxx + * @date Feb, 2018 + * @brief Tests for TrackTruthCollectionCnv_p2. + */ + + +#undef NDEBUG +#include "TrkTruthTPCnv/TrackTruthCollectionCnv_p2.h" +#include "TrkTruthTPCnv/TrackTruthCollection_p2.h" +#include "TrkTruthData/TrackTruthCollection.h" +#include "SGTools/TestStore.h" +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenEvent.h" +#include "HepMC/GenParticle.h" +#include <cassert> +#include <iostream> + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + + +void compare (const TrackTruthCollection& p1, + const TrackTruthCollection& p2) +{ + assert (p1.trackCollectionLink() == p2.trackCollectionLink()); + assert (p1.size() == p2.size()); + TrackTruthCollection::const_iterator i1 = p1.begin(); + TrackTruthCollection::const_iterator i2 = p2.begin(); + for (; i1 != p1.end(); ++i1, ++i2) { + assert (i1->first.index() == i2->first.index()); + compare (i1->second.particleLink(), i2->second.particleLink()); + assert (i1->second.particleLink() == i2->second.particleLink()); + assert (i1->second.probability() == i2->second.probability()); + } +} + + +void testit (const TrackTruthCollection& trans1) +{ + MsgStream log (0, "test"); + TrackTruthCollectionCnv_p2 cnv; + Trk::TrackTruthCollection_p2 pers; + cnv.transToPers (&trans1, &pers, log); + TrackTruthCollection trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*> genPartVector) +{ + std::cout << "test1\n"; + + TrackTruthCollection trans1 (DataLink<TrackCollection>("tpc")); + for (int i=0; i<10; i++) { + const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); + Trk::TrackTruthKey key (ElementLink<TrackCollection> ("tpc", i)); + TrackTruth val (trkLink, (float)i/10); + trans1[key] = val; + } + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + //SGTest::initTestStore(); + test1(genPartVector); + return 0; +} diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p1_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p1_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..e9d28f4fb2397f68c3066ed157956b6bd2c7652e --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p1_test.cxx @@ -0,0 +1,89 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file TrkTruthTPCnv/test/TruthTrajectoryCnv_p1_test.cxx + * @date Feb, 2018 + * @brief Tests for TruthTrajectoryCnv_p1. + */ + + +#undef NDEBUG +#include "TrkTruthTPCnv/TruthTrajectoryCnv_p1.h" +#include "TrkTruthTPCnv/TruthTrajectory_p1.h" +#include "TrkTruthData/TruthTrajectory.h" +#include "SGTools/TestStore.h" +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenEvent.h" +#include "HepMC/GenParticle.h" +#include <cassert> +#include <iostream> + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + + +void compare (const TruthTrajectory& p1, + const TruthTrajectory& p2) +{ + assert (p1.size() == p2.size()); + TruthTrajectory::const_iterator i1 = p1.begin(); + TruthTrajectory::const_iterator i2 = p2.begin(); + for (; i1 != p1.end(); ++i1, ++i2) { + compare (*i1, *i2); + assert (*i1 == *i2); + } +} + + +void testit (const TruthTrajectory& trans1) +{ + MsgStream log (0, "test"); + TruthTrajectoryCnv_p1 cnv; + Trk::TruthTrajectory_p1 pers; + cnv.transToPers (&trans1, &pers, log); + TruthTrajectory trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*> genPartVector) +{ + std::cout << "test1\n"; + + TruthTrajectory trans1; + for (int i=0; i<10; i++) { + const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); + trans1.push_back(trkLink); + } + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + //SGTest::initTestStore(); + test1(genPartVector); + return 0; +} diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p2_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p2_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d65640f18d4b4e016fabd44b9664341791bcb8bb --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p2_test.cxx @@ -0,0 +1,89 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file TrkTruthTPCnv/test/TruthTrajectoryCnv_p2_test.cxx + * @date Feb, 2018 + * @brief Tests for TruthTrajectoryCnv_p2. + */ + + +#undef NDEBUG +#include "TrkTruthTPCnv/TruthTrajectoryCnv_p2.h" +#include "TrkTruthTPCnv/TruthTrajectory_p2.h" +#include "TrkTruthData/TruthTrajectory.h" +#include "SGTools/TestStore.h" +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenEvent.h" +#include "HepMC/GenParticle.h" +#include <cassert> +#include <iostream> + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + + +void compare (const TruthTrajectory& p1, + const TruthTrajectory& p2) +{ + assert (p1.size() == p2.size()); + TruthTrajectory::const_iterator i1 = p1.begin(); + TruthTrajectory::const_iterator i2 = p2.begin(); + for (; i1 != p1.end(); ++i1, ++i2) { + compare (*i1, *i2); + assert (*i1 == *i2); + } +} + + +void testit (const TruthTrajectory& trans1) +{ + MsgStream log (0, "test"); + TruthTrajectoryCnv_p2 cnv; + Trk::TruthTrajectory_p2 pers; + cnv.transToPers (&trans1, &pers, log); + TruthTrajectory trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticle*> genPartVector) +{ + std::cout << "test1\n"; + + TruthTrajectory trans1; + for (int i=0; i<10; i++) { + const HepMC::GenParticle* pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number()); + trans1.push_back(trkLink); + } + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + //SGTest::initTestStore(); + test1(genPartVector); + return 0; +} diff --git a/Trigger/TrigFTK/FTK_RecTools/CMakeLists.txt b/Trigger/TrigFTK/FTK_RecTools/CMakeLists.txt index c6c91eacac4469eab0aa8d5fc56d402d584d51cf..ba5a2caca446deb1f4a41cc412e3f534048decb6 100644 --- a/Trigger/TrigFTK/FTK_RecTools/CMakeLists.txt +++ b/Trigger/TrigFTK/FTK_RecTools/CMakeLists.txt @@ -40,7 +40,9 @@ atlas_depends_on_subdirs( PUBLIC # External dependencies: -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread Eigen CLHEP ) +find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) +find_package( Eigen ) +find_package( CLHEP ) # Component(s) in the package: atlas_add_library( FTK_RecToolsLib diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigL2CaloRingerFexMTInit.py b/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigL2CaloRingerFexMTInit.py index 909d66d0864b675b3445c1b2036382bc92a777bf..6953a89590b8efa24041aae1ee87676bde960918 100755 --- a/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigL2CaloRingerFexMTInit.py +++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigL2CaloRingerFexMTInit.py @@ -21,7 +21,7 @@ def init_ringer(): #MultiLayerPerceptron configuration ringer.Nodes = theRingerConfig.Nodes - ringer.Threshold = theRingerConfig.Thresholds + ringer.Threshold = theRingerConfig.Thresholds ringer.Bias = theRingerConfig.Bias ringer.Weights = theRingerConfig.Weights ringer.EtaBins = theRingerConfig.EtaBins @@ -39,13 +39,15 @@ def add_monitoring(tool): from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool, defineHistogram monTool = GenericMonitoringTool("RingerFexMon") - monTool.Histograms = [ defineHistogram('Et', type='TH1F', title="", xbins=80, xmin=-10, xmax=10), - defineHistogram('Eta', type='TH1F', title="", xbins=80, xmin=-10, xmax=10), - defineHistogram('rnnOut', type='TH1F', title="", xbins=80, xmin=-1, xmax=1), + monTool.Histograms = [ defineHistogram('Et', type='TH1F', title="E_{T}", xbins=50, xmin=0, xmax=50), + defineHistogram('Eta', type='TH1F', title="#eta", xbins=25, xmin=0, xmax=2.5), + defineHistogram('rnnOut', type='TH1F', title="NN output", xbins=80, xmin=-1, xmax=1), + defineHistogram('Eta,rnnOut', type='TH2F', title="NN output as function of #eta", xbins=15, xmin=0, xmax=2.5, ybins=80, ymin=-1, ymax=1), + defineHistogram('Et,rnnOut', type='TH2F', title="NN output as function of E_{T}", xbins=20, xmin=0, xmax=50, ybins=80, ymin=-1, ymax=1), defineHistogram( "TIME_total", title="Total Time;time[ms]", xbins=50, xmin=0, xmax=100 ), defineHistogram( "TIME_preprocess", title="Preprocessing Time;time[ms]", xbins=50, xmin=0, xmax=50 ), defineHistogram( "TIME_decision", title="Decision Time;time[ms]", xbins=50, xmin=0, xmax=50 )] - ringer.MonTool = monTool + tool.MonTool = monTool monTool.HistPath = 'TrigL2CaloRinger/'+tool.name() tool.MonTool = monTool diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py b/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py index 264274099b956627542058663a3984ed91c7a46c..16cbb43a828583c2b2a35d3fae26a4c042742d9b 100644 --- a/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py +++ b/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py @@ -269,7 +269,7 @@ if not isOnline: #conddb.addFolder('TRIGGER', "/TRIGGER/LVL1/BunchGroupContent") # already added by some other alg if LHCFillStateAvailable: conddb.addFolder('DCS_OFL', "/LHC/DCS/FILLSTATE") - conddb.addFolder('TDAQ', "/TDAQ/RunCtrl/DataTakingMode") + conddb.addFolder('TDAQ', '/TDAQ/RunCtrl/DataTakingMode', className='AthenaAttributeList') conddb.addFolder('TRIGGER', "/TRIGGER/LVL1/RFPhase") conddb.addFolder('TRIGGER', '/TRIGGER/LVL1/CTPCoreInputMapping') diff --git a/Trigger/TrigTools/IDScanZFinder/IDScanZFinder/TrigZFinderInternal.h b/Trigger/TrigTools/IDScanZFinder/IDScanZFinder/TrigZFinderInternal.h index 9e812929b2297aff69563cbaecf33f847f15a02e..b336ea20a55b24fd533d06a5e76720e058724f1c 100755 --- a/Trigger/TrigTools/IDScanZFinder/IDScanZFinder/TrigZFinderInternal.h +++ b/Trigger/TrigTools/IDScanZFinder/IDScanZFinder/TrigZFinderInternal.h @@ -18,8 +18,8 @@ //////////////////////////////////////////////////////////////////////////////// -#ifndef __TRIGZFINDERINTERNAL_H__ -#define __TRIGZFINDERINTERNAL_H__ +#ifndef TRIGZFINDERINTERNAL_H +#define TRIGZFINDERINTERNAL_H #include <cmath> #include <vector> diff --git a/Trigger/TrigTools/IDScanZFinder/src/TrigZFinderInternal.cxx b/Trigger/TrigTools/IDScanZFinder/src/TrigZFinderInternal.cxx index f6940f2b3cb1f9b7a5697d8a3bee53c54ea6c641..e1ad6be56f604221e6c4a9a05419ca4f8d73e824 100644 --- a/Trigger/TrigTools/IDScanZFinder/src/TrigZFinderInternal.cxx +++ b/Trigger/TrigTools/IDScanZFinder/src/TrigZFinderInternal.cxx @@ -639,7 +639,7 @@ std::vector<typename TrigZFinderInternal::vertex>* TrigZFinderInternal::findZInt zHisto[bending][bestPhi][binMax-1] ) /maxh; /// if found a vertex flag the bins so we don't use them again - if ( m_numberOfPeaks>1 ) { + if ( m_numberOfPeaks>0 ) { nHisto[bending][bestPhi][binMax] = -1; nHisto[bending][bestPhi][binMax-1] = -1; nHisto[bending][bestPhi][binMax+1] = -1; @@ -669,7 +669,7 @@ std::vector<typename TrigZFinderInternal::vertex>* TrigZFinderInternal::findZInt double significance = 0; if ( bg>0 ) { significance = (maxh-bg)/std::sqrt(bg); - if ( significance < m_minVtxSignificance ) addvtx = false; + if ( significance < m_minVtxSignificance ) break; // if this vertex is not significant then no subsequent vertex could be either } if ( addvtx ) { diff --git a/Trigger/TrigTools/TrigInDetConf/python/TrigInDetSequence.py b/Trigger/TrigTools/TrigInDetConf/python/TrigInDetSequence.py index d57de60c11d4beacfb6c4baba08149e139af3412..da4bb8f6ca23d791ad3d6329641f297bc4bde5a8 100644 --- a/Trigger/TrigTools/TrigInDetConf/python/TrigInDetSequence.py +++ b/Trigger/TrigTools/TrigInDetConf/python/TrigInDetSequence.py @@ -173,7 +173,7 @@ class TrigInDetSequence(TrigInDetSequenceBase): signatureName="Electron", signature="electron", sequenceType="IDTrig", - sequenceFlavour="Fast"): + sequenceFlavour=["Fast"]): TrigInDetSequenceBase.__init__(self) self.__signatureName__ = signatureName @@ -182,7 +182,11 @@ class TrigInDetSequence(TrigInDetSequenceBase): self.__sequenceFlavour__ = sequenceFlavour self.__step__ = [signature] - if self.__sequenceFlavour__ =="2step": + if type(sequenceFlavour)!=type(list()): + log.error("TrigInDetSequence invoked with a non-list sequenceFlavour argument %s" ) + + + if "2step" in self.__sequenceFlavour__: if self.__signature__ == "tau": self.__step__ = ["tauCore","tauIso","tau"]; elif self.__signature__ == "muon": @@ -206,7 +210,7 @@ class TrigInDetSequence(TrigInDetSequenceBase): cnvname = "InDetTrigTrackingxAODCnv_%s_FTF" cnvptname = "" - if sequenceFlavour=="2step": + if "2step" in self.__sequenceFlavour__: ftfname = "TrigFastTrackFinder_%sCore"; ftf2name = "TrigFastTrackFinder_%sIso"; cnvname = "InDetTrigTrackingxAODCnv_%sCore_FTF"; cnv2name = "InDetTrigTrackingxAODCnv_%sIso_FTF"; roiupdater = "IDTrigRoiUpdater_%sCore_IDTrig"; roi2updater="IDTrigRoiUpdater_%sIso_IDTrig" @@ -237,7 +241,7 @@ class TrigInDetSequence(TrigInDetSequenceBase): if vertexXAODCnvNeeded(): algos += [("InDetTrigVertexxAODCnv","")] - if sequenceFlavour=="2step" and self.__signature__=="bjet": + if "2step" in self.__sequenceFlavour__ and self.__signature__=="bjet": algos += [("TrigVxPrimary","")] if vertexXAODCnvNeeded(): algos += [("InDetTrigVertexxAODCnv","")] @@ -245,7 +249,7 @@ class TrigInDetSequence(TrigInDetSequenceBase): fullseq.append(algos) - if sequenceFlavour=="2step": + if "2step" in self.__sequenceFlavour__: algos = [("IDTrigRoiUpdater", roi2updater)] algos += dataprep algos += [("TrigFastTrackFinder",ftf2name), @@ -254,20 +258,23 @@ class TrigInDetSequence(TrigInDetSequenceBase): fullseq.append(algos) - if sequenceFlavour != "FTF": + if not ("FTF" in self.__sequenceFlavour__): algos = [("TrigAmbiguitySolver",""), ("TRTDriftCircleMaker","TRTDriftCircleMaker_IDTrig"), ("InDetTrigPRD_MultiTruthMaker",""), ("TRTTrackExtAlg",""), ("TrigExtProcessor",""), - #("InDetTrigTrackSlimmer",""), ("InDetTrigTrackingxAODCnv",cnvptname), ("InDetTrigDetailedTrackTruthMaker",""), - #("TrigVxPrimary",""), - #("InDetTrigParticleCreation",""), - #("InDetTrigTrackParticleTruthMaker",""), - #("InDetTrigVertexxAODCnv","") ] + if 'noTRT' in self.__sequenceFlavour__: + algos = [("TrigAmbiguitySolver",""), + ("InDetTrigPRD_MultiTruthMaker",""), + ("InDetTrigTrackingxAODCnv",cnvptname), + ("InDetTrigDetailedTrackTruthMaker",""), + ] + + if self.__signature__ != "bjet": algos += [("TrigVxPrimary","")] if vertexXAODCnvNeeded(): diff --git a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/share/TrigInDetTrackTruthCnv_p1_test.ref b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/share/TrigInDetTrackTruthCnv_p1_test.ref index a5bce3fd2565d8f458555a0c6f42d0504a848bd5..8633d8ace9b4883a00f6e29e68937582b9b5e684 100644 --- a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/share/TrigInDetTrackTruthCnv_p1_test.ref +++ b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/share/TrigInDetTrackTruthCnv_p1_test.ref @@ -1 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready test1 +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/share/TrigInDetTrackTruthMapCnv_p1_test.ref b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/share/TrigInDetTrackTruthMapCnv_p1_test.ref index ed569d566d2887fdb8e2f35b076cef8319f42787..8633d8ace9b4883a00f6e29e68937582b9b5e684 100644 --- a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/share/TrigInDetTrackTruthMapCnv_p1_test.ref +++ b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/share/TrigInDetTrackTruthMapCnv_p1_test.ref @@ -1,5 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready test1 -Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout -Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout -Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout -Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout +HepMcParticleLink INFO find_hostkey: Using TruthEvent as McEventCollection key for this job diff --git a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/src/TrigTruthEventTPCnv.cxx b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/src/TrigTruthEventTPCnv.cxx index 4603cb752845da7514295603e5bd7287a3a79590..1fa397579e803991101117bf6d823e20e6d338f6 100644 --- a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/src/TrigTruthEventTPCnv.cxx +++ b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/src/TrigTruthEventTPCnv.cxx @@ -28,9 +28,9 @@ DECLARE_TPCNV_FACTORY(TrigInDetTrackTruthMapCnv_tlp1, DECLARE_TPCNV_FACTORY(TrigInDetTrackTruthMapCnv_tlp2, TrigInDetTrackTruthMap, TrigInDetTrackTruthMap_tlp2, - Athena::TPCnvVers::Current) + Athena::TPCnvVers::Old) DECLARE_TPCNV_FACTORY(TrigInDetTrackTruthMapCnv_tlp3, TrigInDetTrackTruthMap, TrigInDetTrackTruthMap_tlp3, - Athena::TPCnvVers::Old) + Athena::TPCnvVers::Current) diff --git a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthCnv_p1_test.cxx b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthCnv_p1_test.cxx index a3438cd56a34be742f2e3d4505a89c22d2fe3445..4aeac823ed6775766f7eebc1f5af8263f4f142a9 100644 --- a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthCnv_p1_test.cxx +++ b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthCnv_p1_test.cxx @@ -19,6 +19,9 @@ #include <cassert> #include <iostream> +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenParticle.h" +#include "HepMC/GenEvent.h" void compare (const TrigIDHitStats& p1, const TrigIDHitStats& p2) @@ -92,9 +95,13 @@ void testit (const TrigInDetTrackTruth& trans1) } -void test1() +void test1(std::vector<HepMC::GenParticle*>& genPartVector) { std::cout << "test1\n"; + const HepMC::GenParticle *particle = genPartVector.at(0); + // Create HepMcParticleLink outside of leak check. + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); + assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; TrigInDetTrackTruth trans1; @@ -106,6 +113,13 @@ void test1() int main() { - test1(); + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc, genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(genPartVector); return 0; } diff --git a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthMapCnv_p1_test.cxx b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthMapCnv_p1_test.cxx index 6c5a95efc509136f74237b41a4119f232ee9b9bc..dbdec220123123258a5de4ba6533b2b1a38f7ba2 100644 --- a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthMapCnv_p1_test.cxx +++ b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthMapCnv_p1_test.cxx @@ -14,13 +14,16 @@ #undef NDEBUG #include "TrigTruthEventTPCnv/TrigInDetTrackTruthMapCnv_p1.h" #include "TrigTruthEventTPCnv/TrigInDetTrackTruthMapCnv_tlp2.h" -#include "SGTools/TestStore.h" -#include "CxxUtils/make_unique.h" +#include "StoreGate/WriteHandle.h" #include "GaudiKernel/MsgStream.h" #include "TestTools/leakcheck.h" #include <cassert> #include <iostream> +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "HepMC/GenParticle.h" +#include "HepMC/GenEvent.h" + void compare (const TrigIDHitStats& p1, const TrigIDHitStats& p2) @@ -106,11 +109,16 @@ void testit (const TrigInDetTrackTruthMap& trans1) } -void test1() +void test1(std::vector<HepMC::GenParticle*>& genPartVector) { std::cout << "test1\n"; + const HepMC::GenParticle *particle = genPartVector.at(0); + // Create HepMcParticleLink outside of leak check. + HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number()); + assert(dummyHMPL.cptr()==particle); - auto coll = CxxUtils::make_unique<TrigInDetTrackCollection>(); + SG::WriteHandle<TrigInDetTrackCollection> coll{"coll"}; + coll = std::make_unique<TrigInDetTrackCollection>(); for (int i=0; i<10; i++) { int o = i*10; auto param = CxxUtils::make_unique<TrigInDetTrackFitPar> @@ -119,8 +127,7 @@ void test1() trk->algorithmId (static_cast<TrigInDetTrack::AlgoId>(i+1)); coll->push_back (std::move (trk)); } - const TrigInDetTrackCollection* collp = coll.get(); - SGTest::store.record (coll.release(), "coll"); + const TrigInDetTrackCollection* collp = coll.ptr(); Athena::getMessageSvc(); Athena_test::Leakcheck check; @@ -145,7 +152,13 @@ void test1() int main() { - SGTest::initTestStore(); - test1(); + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticle*> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc, genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + test1(genPartVector); return 0; } diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py index 40ac54bc2fffa9a6ad85f8d189ea06d771251660..3d10aa7f6e01c4fb3858fe098d923a1367e88e9b 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py @@ -620,7 +620,7 @@ def muEFCBRecoSequence( RoIs, OutputLevel=INFO ): #Build muon candidates theCandidateToolCB = getPublicToolClone("MuonCandidateTool_CB", "MuonCandidateTool", TrackBuilder=theTrackBuilderTool) - theMuonCandidateAlgCB=CfgMgr.MuonCombinedMuonCandidateAlg("MuonCandidateAlgCB",MuonCandidateTool=theCandidateToolCB,MuonCandidateLocation="MuonCandidates") + theMuonCandidateAlgCB=CfgMgr.MuonCombinedMuonCandidateAlg("MuonCandidateAlgCB",MuonCandidateTool=theCandidateToolCB,MuonCandidateLocation="MuonCandidates", MSOnlyExtrapolatedTrackLocation="MSOnlyMuonTracksForCB") #Create xAOD Muons thecreatortoolCB= getPublicToolClone("MuonCreatorTool_triggerCB", "MuonCreatorTool", ScatteringAngleTool="", CaloMaterialProvider='TMEF_TrkMaterialProviderTool', MuonSelectionTool="", FillTimingInformation=False, OutputLevel=DEBUG, DoCaloNoiseCut=False, UseCaloCells=False) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py index 963be4a6522612c38355317c751f50226a324210..a20e9cc7cbbb6b10b213bb82a5cb78f6afe8fce4 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py @@ -69,14 +69,14 @@ def createFastCaloSequence(rerun=False): clusterMaker.ClustersName=clustersKey svcMgr.ToolSvc.TrigDataAccess.ApplyOffsetCorrection=False - # from TrigMultiVarHypo.TrigL2CaloRingerFexMTInit import init_ringer - # trigL2CaloRingerFexMT = init_ringer() - # trigL2CaloRingerFexMT.ClustersKey = clusterMaker.ClustersName - # trigL2CaloRingerFexMT.OutputLevel = DEBUG + from TrigMultiVarHypo.TrigL2CaloRingerFexMTInit import init_ringer + trigL2CaloRingerFexMT = init_ringer() + trigL2CaloRingerFexMT.ClustersKey = clusterMaker.ClustersName + trigL2CaloRingerFexMT.OutputLevel = DEBUG - #fastCaloInViewAlgs = seqAND( __prefix+"fastCaloInViewAlgs", [ clusterMaker, trigL2CaloRingerFexMT ]) - fastCaloInViewAlgs = seqAND( __prefix+"fastCaloInViewAlgs", [ clusterMaker ]) + fastCaloInViewAlgs = seqAND( __prefix+"fastCaloInViewAlgs", [ clusterMaker, trigL2CaloRingerFexMT ]) + filterL1RoIsAlg = RoRSeqFilter( __prefix+"filterL1RoIsAlg") filterL1RoIsAlg.Input = [__l1RoIDecisions] diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/mu.withViews.py b/Trigger/TrigValidation/TrigUpgradeTest/share/mu.withViews.py index 528f0562e493fc7f219311b3c1eb8cea6a00d53f..eead17529d0ad9c1dd2cddb520ac84f5cfc706be 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/mu.withViews.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/mu.withViews.py @@ -19,6 +19,8 @@ if not 'doL2ISO' in dir(): doL2ISO = True if not 'doEFSA' in dir(): doEFSA = True +if not 'doEFCB' in dir(): + doEFCB = True if not 'doEFISO' in dir(): doEFISO=True @@ -108,7 +110,6 @@ from InDetRecExample.InDetKeys import InDetKeys include("InDetRecExample/InDetRecConditionsAccess.py") ### Load data from Muon detectors ### -import MuonRecExample.MuonRecStandaloneOnlySetup from MuonCombinedRecExample.MuonCombinedRecFlags import muonCombinedRecFlags muonRecFlags.doTrackPerformance = True muonRecFlags.TrackPerfSummaryLevel = 2 @@ -136,7 +137,7 @@ if TriggerFlags.doMuon: ### set up L1RoIsFilter ### filterL1RoIsAlg = RoRSeqFilter("filterL1RoIsAlg") - filterL1RoIsAlg.Input = ["MURoIDecisions"] + filterL1RoIsAlg.Input = ["L1MU"] filterL1RoIsAlg.Output = ["FilteredMURoIDecisions"] filterL1RoIsAlg.Chains = testChains filterL1RoIsAlg.OutputLevel = DEBUG @@ -228,24 +229,28 @@ if TriggerFlags.doMuon: ### RoRSeqFilter step2 ### filterEFSAAlg = RoRSeqFilter("filterEFSAAlg") + ### set the EVCreator ### + efMuViewsMaker = EventViewCreatorAlgorithm("efMuViewsMaker", OutputLevel=DEBUG) + efMuViewsMaker.ViewFallThrough = True + if doL2CB and doL2SA: filterEFSAAlg.Input = [trigmuCombHypo.HypoOutputDecisions] filterEFSAAlg.Output = ["Filtered"+trigmuCombHypo.HypoOutputDecisions] + efMuViewsMaker.InputMakerInputDecisions = [ filterEFSAAlg.Output[0] ] + efMuViewsMaker.RoIsLink = "roi" # -||- else : # for now just use the L1 input when L2 is not running - filterEFSAAlg.Input = ["MURoIDecisions"] + filterEFSAAlg.Input = ["L1MU"] filterEFSAAlg.Output = ["FilteredMURoIDecisionsForEF"] + efMuViewsMaker.InputMakerInputDecisions = filterL1RoIsAlg.Output + efMuViewsMaker.RoIsLink = "initialRoI" # -||- + filterEFSAAlg.Chains = testChains filterEFSAAlg.OutputLevel = DEBUG - ### set the EVCreator ### - efMuViewsMaker = EventViewCreatorAlgorithm("efMuViewsMaker", OutputLevel=DEBUG) - efMuViewsMaker.ViewFallThrough = True - # probably wrong input to the EVMaker - efMuViewsMaker.InputMakerInputDecisions = filterL1RoIsAlg.Output + efMuViewsMaker.InputMakerOutputDecisions = ["MURoIDecisionsOutputEF"] - efMuViewsMaker.RoIsLink = "initialRoI" # -||- - efMuViewsMaker.InViewRoIs = "MURoIs" # contract with the consumer + efMuViewsMaker.InViewRoIs = "EFMURoIs" # contract with the consumer efMuViewsMaker.Views = "EFMUViewRoIs" ### get EF reco sequence ### @@ -274,6 +279,50 @@ if TriggerFlags.doMuon: muonEFSAStep = stepSeq("muonEFSAStep", filterEFSAAlg, [muEFSASequence, muonEFSADecisionsDumper]) + if doEFCB: + + ### RoRSeqFilter step2 ### + filterEFCBAlg = RoRSeqFilter("filterEFCBAlg") + filterEFCBAlg.Input = [trigMuonEFSAHypo.HypoOutputDecisions] + filterEFCBAlg.Output = ["Filtered"+trigMuonEFSAHypo.HypoOutputDecisions] + filterEFCBAlg.Chains = testChains + filterEFCBAlg.OutputLevel = DEBUG + + ### set the EVCreator ### + efCBMuViewsMaker = EventViewCreatorAlgorithm("efCBMuViewsMaker", OutputLevel=DEBUG) + efCBMuViewsMaker.ViewFallThrough = True + efCBMuViewsMaker.InputMakerInputDecisions = [ filterEFCBAlg.Output[0] ] + efCBMuViewsMaker.InputMakerOutputDecisions = ["MuonEFSADecisionsOutput"] + efCBMuViewsMaker.RoIsLink = "roi" # -||- + efCBMuViewsMaker.InViewRoIs = "MUCBRoIs" # contract with the consumer + efCBMuViewsMaker.Views = "EFMUCBViewRoIs" + + ### get EF reco sequence ### + from TrigUpgradeTest.MuonSetup import muEFCBRecoSequence + muEFCBRecoSequence, muEFCBSequenceOut = muEFCBRecoSequence( efCBMuViewsMaker.InViewRoIs, OutputLevel=DEBUG ) + + efCBMuViewsMaker.ViewNodeName = muEFCBRecoSequence.name() + + #Setup EF CB hypo + from TrigMuonHypo.TrigMuonHypoConfigMT import TrigMuonEFCombinerHypoConfig + trigMuonEFCBHypo = TrigMuonEFCombinerHypoConfig("TrigMuonEFCBHypoAlg") + trigMuonEFCBHypo.OutputLevel = DEBUG + trigMuonEFCBHypo.MuonDecisions = muEFCBSequenceOut + trigMuonEFCBHypo.HypoOutputDecisions = "EFMuonCBDecisions" + trigMuonEFCBHypo.HypoInputDecisions = efCBMuViewsMaker.InputMakerOutputDecisions[0] + + trigMuonEFCBHypo.HypoTools = [ trigMuonEFCBHypo.TrigMuonEFCombinerHypoToolFromName( "TrigMuonEFCombinerHypoTool", c ) for c in testChains ] + + ### set the dumper ### + muonEFCBDecisionsDumper = DumpDecisions("muonEFCBDecisionsDumper", OutputLevel=DEBUG, Decisions = trigMuonEFCBHypo.HypoOutputDecisions ) + + ### make sequence ### + muEFCBSequence = seqAND("muEFCBSequence", [efCBMuViewsMaker, muEFCBRecoSequence, trigMuonEFCBHypo]) + + ### make step ### + muonEFCBStep = stepSeq("muonEFCBStep", filterEFCBAlg, [muEFCBSequence, muonEFCBDecisionsDumper]) + + if doL2CB and doL2ISO: ### RoRSeqFilter step2 for muIso ### @@ -358,6 +407,12 @@ def muonViewsMergers( name ): muonViewsMerger.MuonContainerInViews = [ muEFSASequenceOut ] muonViewsMerger.MuonContainer = [ muEFSASequenceOut ] + if doEFCB==True: + muonViewsMerger.TrigCompositeContainer += [ filterEFCBAlg.Output[0], trigMuonEFCBHypo.HypoOutputDecisions ] + muonViewsMerger.MuonContainerViews = [ efCBMuViewsMaker.Views ] + muonViewsMerger.MuonContainerInViews = [ muEFCBSequenceOut ] + muonViewsMerger.MuonContainer = [ muEFCBSequenceOut ] + if doL2CB==True and doL2ISO==True: # L2CB should be also executed with L2ISO muonViewsMerger.TrigCompositeContainer += [ filterL2MuisoAlg.Output[0], trigmuIsoHypo.HypoOutputDecisions ] muonViewsMerger.L2IsoMuonContainerViews = [ l2muIsoViewsMaker.Views ] @@ -405,6 +460,10 @@ def muonStreamESD( muonViewsMerger ): StreamESD.ItemList += [ "xAOD::MuonContainer#"+muEFSASequenceOut ] StreamESD.ItemList += [ "xAOD::MuonAuxContainer#"+muEFSASequenceOut+"Aux." ] + if doEFCB==True: + StreamESD.ItemList += [ "xAOD::MuonContainer#"+muEFCBSequenceOut ] + StreamESD.ItemList += [ "xAOD::MuonAuxContainer#"+muEFCBSequenceOut+"Aux." ] + if doL2CB==True and doL2ISO==True: StreamESD.ItemList += [ "xAOD::L2IsoMuonContainer#"+l2muIsoSequenceOut ] StreamESD.ItemList += [ "xAOD::L2IsoMuonAuxContainer#"+l2muIsoSequenceOut+"Aux." ] @@ -419,7 +478,7 @@ def muonStreamESD( muonViewsMerger ): -### NO Trackinhg ### +### NO Tracking ### if TriggerFlags.doMuon==True and TriggerFlags.doID==False: from DecisionHandling.DecisionHandlingConf import TriggerSummaryAlg if doL2SA==True and doL2CB==False and doEFSA==False and doL2ISO==False: @@ -503,28 +562,31 @@ if TriggerFlags.doMuon==True and TriggerFlags.doID==True: topSequence += hltTop - if doL2SA==True and doL2CB==True and doEFSA==True and doL2ISO==False: + if doL2SA==True and doL2CB==True and doEFSA==True and doEFCB==True and doL2ISO==False: summary0 = summarySteps("Step1", ["L2MuonFastDecisions"] ) step0 = parOR("step0", [ muFastStep, summary0 ] ) summary1 = summarySteps("Step2", ["MuonL2CBDecisions"] ) step1 = parOR("step1", [ muCombStep, summary1 ] ) summary2 = summarySteps("Step3", ["EFMuonSADecisions"] ) step2 = parOR("step2", [ muonEFSAStep, summary2 ] ) + summary3 = summarySteps("Step4", ["EFMuonCBDecisions"] ) + step3 = parOR("step3", [ muonEFCBStep, summary3 ] ) step0filter = parOR("step0filter", [ filterL1RoIsAlg ] ) step1filter = parOR("step1filter", [ filterL2SAAlg ] ) step2filter = parOR("step2filter", [ filterEFSAAlg] ) - HLTsteps = seqAND("HLTsteps", [ step0filter, step0, step1filter, step1, step2filter, step2 ] ) + step3filter = parOR("step3filter", [ filterEFCBAlg] ) + HLTsteps = seqAND("HLTsteps", [ step0filter, step0, step1filter, step1, step2filter, step2, step3filter, step3 ] ) - muonViewsMerger = muonViewsMergers("L2SAandL2CBandEFSA") + muonViewsMerger = muonViewsMergers("L2SAandL2CBandEFSAandEFCB") ### final summary - summary = summarySteps("FinalAlg", ["EFMuonSADecisions"] ) + summary = summarySteps("FinalAlg", ["EFMuonCBDecisions"] ) summary.OutputTools = [ muonViewsMerger ] StreamESD = muonStreamESD(muonViewsMerger) - hltTop = seqOR( "hltTop", [ HLTsteps ] + __mon( "EFMuonSADecisions", [ "L2MuonFastDecisions", "MuonL2CBDecisions", "EFMuonSADecisions"]) + [summary, StreamESD ] ) + hltTop = seqOR( "hltTop", [ HLTsteps ] + __mon( "EFMuonCBDecisions", [ "L2MuonFastDecisions", "MuonL2CBDecisions", "EFMuonSADecisions", "EFMuonCBDecisions"]) + [summary, StreamESD ] ) topSequence += hltTop @@ -552,27 +614,30 @@ if TriggerFlags.doMuon==True and TriggerFlags.doID==True: topSequence += hltTop - if doL2SA==True and doL2CB==True and doEFSA==True and doL2ISO==True: + if doL2SA==True and doL2CB==True and doEFSA==True and doEFCB==True and doL2ISO==True: summary0 = summarySteps("Step1", ["L2MuonFastDecisions"] ) step0 = parOR("step0", [ muFastStep, summary0 ] ) summary1 = summarySteps("Step2", ["MuonL2CBDecisions"] ) step1 = parOR("step1", [ muCombStep, summary1 ] ) - summary2 = summarySteps("Step3", ["EFMuonSADecisions", "MuonL2IsoDecisions"] ) - step2 = parOR("step2", [ muonEFSAStep, l2muIsoStep, summary2 ] ) + summary2 = summarySteps("Step3", ["EFMuonSADecisions"] ) + step2 = parOR("step2", [ muonEFSAStep, summary2 ] ) + summary3 = summarySteps("Step4", ["EFMuonCBDecisions", "MuonL2IsoDecisions"] ) + step3 = parOR("step3", [ muonEFCBStep, l2muIsoStep, summary3 ] ) step0filter = parOR("step0filter", [ filterL1RoIsAlg ] ) step1filter = parOR("step1filter", [ filterL2SAAlg ] ) - step2filter = parOR("step2filter", [ filterEFSAAlg, filterL2MuisoAlg] ) - HLTsteps = seqAND("HLTsteps", [ step0filter, step0, step1filter, step1, step2filter, step2 ] ) + step2filter = parOR("step2filter", [ filterEFSAAlg] ) + step3filter = parOR("step3filter", [ filterEFCBAlg, filterL2MuisoAlg] ) + HLTsteps = seqAND("HLTsteps", [ step0filter, step0, step1filter, step1, step2filter, step2, step3filter, step3 ] ) muonViewsMerger = muonViewsMergers("all") ### final summary - summary = summarySteps("FinalAlg", ["EFMuonSADecisions", "MuonL2IsoDecisions"] ) + summary = summarySteps("FinalAlg", ["EFMuonCBDecisions", "MuonL2IsoDecisions"] ) summary.OutputTools = [ muonViewsMerger ] StreamESD = muonStreamESD(muonViewsMerger) - hltTop = seqOR( "hltTop", [ HLTsteps ] + __mon("EFMuonSADecisions", ["L2MuonFastDecisions", "MuonL2CBDecisions", "EFMuonSADecisions"]) +[ summary, StreamESD ] ) + hltTop = seqOR( "hltTop", [ HLTsteps ] + __mon("EFMuonCBDecisions", ["L2MuonFastDecisions", "MuonL2CBDecisions", "EFMuonSADecisions", "EFMuonCBDecisions"]) +[ summary, StreamESD ] ) topSequence += hltTop diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref index 54d5c62e35a74e702787160d9847107afe0cbc40..80164ce5ecf32f541d4d139dd8d091fee3a90a26 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref @@ -1,24 +1,30 @@ -TriggerSummaryStep1 0 0 DEBUG +++ HLT_mu6Comb ID#393364983 -TriggerSummaryStep1 0 0 DEBUG +++ HLT_mu6 ID#1672162766 -TriggerSummaryStep1 0 0 DEBUG +++ HLT_mu6fast ID#2393852230 -TriggerSummaryStep1 0 0 DEBUG +++ HLT_2mu6Comb ID#2762422737 -TriggerSummaryStep1 0 0 DEBUG +++ HLT_2mu6 ID#3347104206 -TriggerSummaryStep1 2 0 DEBUG +++ HLT_mu6Comb ID#393364983 -TriggerSummaryStep1 2 0 DEBUG +++ HLT_mu6 ID#1672162766 -TriggerSummaryStep1 2 0 DEBUG +++ HLT_mu6fast ID#2393852230 -TriggerSummaryStep1 5 0 DEBUG +++ HLT_mu20_ivar ID#267444585 -TriggerSummaryStep1 5 0 DEBUG +++ HLT_mu6Comb ID#393364983 -TriggerSummaryStep1 5 0 DEBUG +++ HLT_mu6 ID#1672162766 -TriggerSummaryStep1 5 0 DEBUG +++ HLT_mu6fast ID#2393852230 -TrigSignatureMoniMT INFO HLT_2mu6 10 10 1 0 0 0 0 -TrigSignatureMoniMT INFO HLT_2mu6 decisions 2 0 0 0 -TrigSignatureMoniMT INFO HLT_2mu6Comb 10 10 1 0 0 0 0 -TrigSignatureMoniMT INFO HLT_2mu6Comb decisions 2 0 0 0 +TriggerSummaryStep1 4 0 DEBUG +++ HLT_mu20_ivar ID#267444585 +TriggerSummaryStep1 4 0 DEBUG +++ HLT_mu6Comb ID#393364983 +TriggerSummaryStep1 4 0 DEBUG +++ HLT_mu6 ID#1672162766 +TriggerSummaryStep1 4 0 DEBUG +++ HLT_mu6fast ID#2393852230 +TriggerSummaryStep2 4 0 DEBUG +++ HLT_mu6Comb ID#393364983 +TriggerSummaryStep2 4 0 DEBUG +++ HLT_mu6 ID#1672162766 +TriggerSummaryStep1 6 0 DEBUG +++ HLT_mu6Comb ID#393364983 +TriggerSummaryStep1 6 0 DEBUG +++ HLT_mu6 ID#1672162766 +TriggerSummaryStep1 6 0 DEBUG +++ HLT_mu6fast ID#2393852230 +TriggerSummaryStep1 6 0 DEBUG +++ HLT_2mu6Comb ID#2762422737 +TriggerSummaryStep1 6 0 DEBUG +++ HLT_2mu6 ID#3347104206 +TriggerSummaryStep2 6 0 DEBUG +++ HLT_mu6Comb ID#393364983 +TriggerSummaryStep2 6 0 DEBUG +++ HLT_mu6 ID#1672162766 +TriggerSummaryStep2 6 0 DEBUG +++ HLT_2mu6Comb ID#2762422737 +TriggerSummaryStep2 6 0 DEBUG +++ HLT_2mu6 ID#3347104206 +TriggerSummaryStep3 6 0 DEBUG +++ HLT_mu6 ID#1672162766 +TriggerSummaryStep3 6 0 DEBUG +++ HLT_2mu6 ID#3347104206 +TriggerSummaryStep4 6 0 DEBUG +++ HLT_mu6 ID#1672162766 +TrigSignatureMoniMT INFO HLT_2mu6 10 10 1 1 1 0 0 +TrigSignatureMoniMT INFO HLT_2mu6 decisions 2 2 2 0 +TrigSignatureMoniMT INFO HLT_2mu6Comb 10 10 1 1 0 0 1 +TrigSignatureMoniMT INFO HLT_2mu6Comb decisions 2 2 0 0 TrigSignatureMoniMT INFO HLT_mu20_ivar 10 10 1 0 0 0 0 TrigSignatureMoniMT INFO HLT_mu20_ivar decisions 1 0 0 0 -TrigSignatureMoniMT INFO HLT_mu6 10 10 3 0 0 0 0 -TrigSignatureMoniMT INFO HLT_mu6 decisions 4 0 0 0 -TrigSignatureMoniMT INFO HLT_mu6Comb 10 10 3 0 0 0 0 -TrigSignatureMoniMT INFO HLT_mu6Comb decisions 4 0 0 0 -TrigSignatureMoniMT INFO HLT_mu6fast 10 10 3 0 0 0 3 -TrigSignatureMoniMT INFO HLT_mu6fast decisions 4 0 0 0 +TrigSignatureMoniMT INFO HLT_mu6 10 10 2 2 1 1 1 +TrigSignatureMoniMT INFO HLT_mu6 decisions 3 3 2 1 +TrigSignatureMoniMT INFO HLT_mu6Comb 10 10 2 2 0 0 2 +TrigSignatureMoniMT INFO HLT_mu6Comb decisions 3 3 0 0 +TrigSignatureMoniMT INFO HLT_mu6fast 10 10 2 0 0 0 2 +TrigSignatureMoniMT INFO HLT_mu6fast decisions 3 0 0 0 diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_mu_menu.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_mu_menu.sh index 9b7c0023b5e56d9f0d0654871b48fcbaadbcfe85..6086c9fb2dfe2ab658d8ee147c46aa50509a1cdd 100755 --- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_mu_menu.sh +++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_mu_menu.sh @@ -4,6 +4,6 @@ ### BSfile ### -athena --threads=1 --skipEvents=30 --evtMax=10 --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" TrigUpgradeTest/mu.menu.py +athena --threads=1 --skipEvents=50 --evtMax=10 --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" TrigUpgradeTest/mu.menu.py ### RDOfile ### #athena --threads=1 -c 'EvtMax=50;FilesInput="/afs/cern.ch/user/s/shhayash/workspace/public/RDOfile/ttbar/RDO_TRIG.root"' TrigUpgradeTest/mu.withViews.py diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_mu_run_data.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_mu_run_data.sh index 4c224f5d6eab67e56b4a02c8bc63dbf0bf338252..59ae48c813f8c9c6678e8299109053b265f3ad6a 100755 --- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_mu_run_data.sh +++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_mu_run_data.sh @@ -4,6 +4,6 @@ ### BSfile ### -athena --threads=1 --skipEvents=30 --evtMax=10 --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" -c 'doL2CB=False;doL2ISO=False' TrigUpgradeTest/mu.withViews.py +athena --threads=1 --skipEvents=50 --evtMax=10 --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" -c 'doL2ISO=False' TrigUpgradeTest/mu.withViews.py ### RDOfile ### #athena --threads=1 -c 'EvtMax=50;FilesInput="/afs/cern.ch/user/s/shhayash/workspace/public/RDOfile/ttbar/RDO_TRIG.root"' TrigUpgradeTest/mu.withViews.py diff --git a/Trigger/TrigValidation/TriggerTest/test/exec_art_triggertest_post.sh b/Trigger/TrigValidation/TriggerTest/test/exec_art_triggertest_post.sh index 50494cd371d813c1bbd5825f7fedcfcbafeeba0c..85a0d3c6bf34cdd764ffaa1e92cad5f5c6015c84 100755 --- a/Trigger/TrigValidation/TriggerTest/test/exec_art_triggertest_post.sh +++ b/Trigger/TrigValidation/TriggerTest/test/exec_art_triggertest_post.sh @@ -66,23 +66,26 @@ else echo $(date "+%FT%H:%M %Z")" file trig_cost.root does not exist thus RunTrigCostD3PD will not be run" fi - +# SKIP_CHAIN_DUMP=1 skips this step +# SKIP_CHAIN_DUMP=2 skips the L1 and HLTTE checks, but does the HLTChain check echo "trigedm SKIP_CHAIN_DUMP" $[SKIP_CHAIN_DUMP] if [ $[SKIP_CHAIN_DUMP] != 1 ]; then echo $(date "+%FT%H:%M %Z")" Running check for zero L1, HLT or TE counts" export COUNT_EXIT=0 - if [[ `sed 's|.*\(.* \)|\1|' L1AV.txt | sed 's/^[ \t]*//' | sed '/^0/'d | wc -l` == 0 ]]; then - echo "L1 counts ERROR : all entires are ZERO please consult L1AV.txt" - (( COUNT_EXIT = COUNT_EXIT || 1 )) + if [ $[SKIP_CHAIN_DUMP] != 2 ]; then + if [[ `sed 's|.*\(.* \)|\1|' L1AV.txt | sed 's/^[ \t]*//' | sed '/^0/'d | wc -l` == 0 ]]; then + echo "L1 counts ERROR : all entires are ZERO please consult L1AV.txt" + (( COUNT_EXIT = COUNT_EXIT || 1 )) + fi + if [[ `sed 's|.*\(.* \)|\1|' HLTTE.txt | sed 's/^[ \t]*//' | sed '/^0/'d | wc -l` == 0 ]]; then + echo "HLTTE counts ERROR : all entires are ZERO please consult HLTTE.txt" + (( COUNT_EXIT = COUNT_EXIT || 1 )) + fi fi - if [[ `sed 's|.*\(.* \)|\1|' HLTChain.txt | sed 's/^[ \t]*//' | sed '/^0/'d | wc -l` == 0 ]]; then + if [[ `sed 's|.*\(.* \)|\1|' HLTChain.txt | sed 's/^[ \t]*//' | sed '/^0/'d | wc -l` == 0 ]]; then echo "HLTChain counts ERROR : all entires are ZERO please consult HLTChain.txt" (( COUNT_EXIT = COUNT_EXIT || 1 )) fi - if [[ `sed 's|.*\(.* \)|\1|' HLTTE.txt | sed 's/^[ \t]*//' | sed '/^0/'d | wc -l` == 0 ]]; then - echo "HLTTE counts ERROR : all entires are ZERO please consult HLTTE.txt" - (( COUNT_EXIT = COUNT_EXIT || 1 )) - fi echo "art-result: ${COUNT_EXIT} ZeroCounts" else echo $(date "+%FT%H:%M %Z")" Do not run ZERO counts for this test, SKIP_CHAIN_DUMP=1" diff --git a/Trigger/TrigValidation/TriggerTest/test/exec_athena_art_trigger_validation.sh b/Trigger/TrigValidation/TriggerTest/test/exec_athena_art_trigger_validation.sh index 0f04271c04e593fa22ce2ac186ed331100c1d4ce..01e24f2c124a836016d6e8cd5eb519945d4dd2ca 100755 --- a/Trigger/TrigValidation/TriggerTest/test/exec_athena_art_trigger_validation.sh +++ b/Trigger/TrigValidation/TriggerTest/test/exec_athena_art_trigger_validation.sh @@ -13,7 +13,11 @@ if [ -z ${EVENTS} ]; then fi if [ -z ${JOBOPTION} ]; then - export JOBOPTION="TriggerTest/testCommonSliceAthenaTrigRDO.py" + if [[ $INPUT == "data" ]]; then + export JOBOPTION="TriggerRelease/runHLT_standalone.py" + else + export JOBOPTION="TriggerTest/testCommonSliceAthenaTrigRDO.py" + fi fi if [ -z ${JOB_LOG} ]; then @@ -45,6 +49,9 @@ elif [[ $INPUT == "mubphysics" ]]; then elif [[ $INPUT == "minbias" ]]; then export DS='["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/mc15_13TeV.361203.Pythia8_A2_MSTW2008LO_ND_minbias.recon.RDO.e3639_s2606_s2174_r7661_tid07858100_00/RDO.07858100._000087.pool.root.1"]' +elif [[ $INPUT == 'data' ]]; then + export DS='["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1"]' + else # Default - ttbar export DS='["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1","/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000002.pool.root.1"]' @@ -54,18 +61,29 @@ trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG ###################################### -athena.py -b -c \ -"enableCostMonitoring=${COST_MONITORING};\ -RunningRTT=True;\ -menu=\"${MENU}\";\ -sliceName=\"${SLICE}\";\ -jp.AthenaCommonFlags.FilesInput=${DS};\ -jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(${EVENTS});\ -jp.Rec.OutputLevel=WARNING;\ -${EXTRA}\ -LVL1OutputLevel=WARNING;\ -HLTOutputLevel=WARNING;" \ -${JOBOPTION} &> ${JOB_LOG} +if [[ $INPUT == 'data' ]]; then + athena.py -b -c \ + "setMenu=\"${MENU}\";\ + BSRDOInput=${DS};\ + EvtMax=${EVENTS};\ + ${EXTRA}\ + LVL1OutputLevel=WARNING;\ + HLTOutputLevel=WARNING;" \ + ${JOBOPTION} &> ${JOB_LOG} +else + athena.py -b -c \ + "enableCostMonitoring=${COST_MONITORING};\ + RunningRTT=True;\ + menu=\"${MENU}\";\ + sliceName=\"${SLICE}\";\ + jp.AthenaCommonFlags.FilesInput=${DS};\ + jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(${EVENTS});\ + jp.Rec.OutputLevel=WARNING;\ + ${EXTRA}\ + LVL1OutputLevel=WARNING;\ + HLTOutputLevel=WARNING;" \ + ${JOBOPTION} &> ${JOB_LOG} +fi ###################################### diff --git a/Trigger/TrigValidation/TriggerTest/test/test_data_physics_pp_v7_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_data_physics_pp_v7_build.sh new file mode 100755 index 0000000000000000000000000000000000000000..a351b19e96de361fcfc3fb1686a485d82e5baa16 --- /dev/null +++ b/Trigger/TrigValidation/TriggerTest/test/test_data_physics_pp_v7_build.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# art-description: Physics v7 TriggerTest on data +# art-type: build +# art-include: 21.0/Athena +# art-include: 21.3/Athena +# art-include: master/Athena +# art-output: HLTChain.txt +# art-output: HLTTE.txt +# art-output: L1AV.txt +# art-output: HLTconfig_*.xml +# art-output: L1Topoconfig*.xml +# art-output: LVL1config*.xml +# art-output: *.log +# art-output: costMonitoring_* +# art-output: *.root +# art-output: ntuple.pmon.gz +# art-output: *perfmon* +# art-output: TotalEventsProcessed.txt +# art-output: *.regtest.new + +export NAME="data_physics_pp_v7_build" +export MENU="Physics_pp_v7" +export EVENTS="100" +export INPUT="data" + +# The flag below skips HLTTE and L1 counts checks, but keeps the HLTChain counts check. +# This is needed because we run on data without rerunLvl1, so we only produce HLTChain counts. +export SKIP_CHAIN_DUMP=2 + +source exec_athena_art_trigger_validation.sh +source exec_art_triggertest_post.sh diff --git a/Trigger/TrigValidation/TriggerTest/test/test_data_physics_pp_v7_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_data_physics_pp_v7_grid.sh new file mode 100755 index 0000000000000000000000000000000000000000..7a16c122adaa701da890e4837d93dc47c78bb140 --- /dev/null +++ b/Trigger/TrigValidation/TriggerTest/test/test_data_physics_pp_v7_grid.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# art-description: Physics v7 TriggerTest on data +# art-type: grid +# art-include: 21.0/Athena +# art-include: 21.3/Athena +# art-include: master/Athena +# art-output: HLTChain.txt +# art-output: HLTTE.txt +# art-output: L1AV.txt +# art-output: HLTconfig_*.xml +# art-output: L1Topoconfig*.xml +# art-output: LVL1config*.xml +# art-output: *.log +# art-output: costMonitoring_* +# art-output: *.root +# art-output: ntuple.pmon.gz +# art-output: *perfmon* +# art-output: TotalEventsProcessed.txt +# art-output: *.regtest.new + +export NAME="data_physics_pp_v7_grid" +export MENU="Physics_pp_v7" +export EVENTS="500" +export INPUT="data" + +# The flag below skips HLTTE and L1 counts checks, but keeps the HLTChain counts check. +# This is needed because we run on data without rerunLvl1, so we only produce HLTChain counts. +export SKIP_CHAIN_DUMP=2 + +source exec_athena_art_trigger_validation.sh +source exec_art_triggertest_post.sh diff --git a/Trigger/TrigValidation/TriggerTest/test/test_data_physics_pp_v7_primaries_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_data_physics_pp_v7_primaries_build.sh new file mode 100755 index 0000000000000000000000000000000000000000..43a76526a9e8735098a0e28e07f46011e1139d64 --- /dev/null +++ b/Trigger/TrigValidation/TriggerTest/test/test_data_physics_pp_v7_primaries_build.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# art-description: Physics v7 primaries TriggerTest on data +# art-type: build +# art-include: 21.0/Athena +# art-include: 21.3/Athena +# art-include: master/Athena +# art-output: HLTChain.txt +# art-output: HLTTE.txt +# art-output: L1AV.txt +# art-output: HLTconfig_*.xml +# art-output: L1Topoconfig*.xml +# art-output: LVL1config*.xml +# art-output: *.log +# art-output: costMonitoring_* +# art-output: *.root +# art-output: ntuple.pmon.gz +# art-output: *perfmon* +# art-output: TotalEventsProcessed.txt +# art-output: *.regtest.new + +export NAME="data_physics_pp_v7_primaries_build" +export MENU="Physics_pp_v7_primaries" +export EVENTS="100" +export INPUT="data" + +# The flag below skips HLTTE and L1 counts checks, but keeps the HLTChain counts check. +# This is needed because we run on data without rerunLvl1, so we only produce HLTChain counts. +export SKIP_CHAIN_DUMP=2 + +source exec_athena_art_trigger_validation.sh +source exec_art_triggertest_post.sh diff --git a/Trigger/TrigValidation/TriggerTest/test/test_data_physics_pp_v7_primaries_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_data_physics_pp_v7_primaries_grid.sh new file mode 100755 index 0000000000000000000000000000000000000000..032d20e9a55527f6da575f443989e33d4c2b4a98 --- /dev/null +++ b/Trigger/TrigValidation/TriggerTest/test/test_data_physics_pp_v7_primaries_grid.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# art-description: Physics v7 primaries TriggerTest on data +# art-type: grid +# art-include: 21.0/Athena +# art-include: 21.3/Athena +# art-include: master/Athena +# art-output: HLTChain.txt +# art-output: HLTTE.txt +# art-output: L1AV.txt +# art-output: HLTconfig_*.xml +# art-output: L1Topoconfig*.xml +# art-output: LVL1config*.xml +# art-output: *.log +# art-output: costMonitoring_* +# art-output: *.root +# art-output: ntuple.pmon.gz +# art-output: *perfmon* +# art-output: TotalEventsProcessed.txt +# art-output: *.regtest.new + +export NAME="data_physics_pp_v7_primaries_grid" +export MENU="Physics_pp_v7_primaries" +export EVENTS="500" +export INPUT="data" + +# The flag below skips HLTTE and L1 counts checks, but keeps the HLTChain counts check. +# This is needed because we run on data without rerunLvl1, so we only produce HLTChain counts. +export SKIP_CHAIN_DUMP=2 + +source exec_athena_art_trigger_validation.sh +source exec_art_triggertest_post.sh diff --git a/Trigger/TrigValidation/TriggerTest/test/test_mc_hi_v4_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_mc_hi_v4_grid.sh index d09c06a6120f88166ee963a6424c07d7a87a08c1..312302ae49032ebc9d71fc22395e275c0312c72a 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_mc_hi_v4_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_mc_hi_v4_grid.sh @@ -3,11 +3,9 @@ # art-description: Heavy ion MC v4 TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_mc_hi_v5_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_mc_hi_v5_grid.sh index 6262c768fd933c55a219916b3a33ec830f0755a8..c80c8a9a3e954a74c47cd7126a625385813e308a 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_mc_hi_v5_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_mc_hi_v5_grid.sh @@ -3,7 +3,6 @@ # art-description: Heavy ion MC v5 TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-output: HLTChain.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_build.sh index 66a961e466290f02483fc3ca6f6abe41b2de6466..98e1edfe46c2eee8e0cff51a6ca5127ad6eec6e2 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_build.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_build.sh @@ -3,11 +3,9 @@ # art-description: MC v7 TriggerTest on MC # art-type: build # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_bulkmcprod_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_bulkmcprod_grid.sh index 4f37f5321d6bec52414de297e86ff025dfe4e01e..d38d95a92816948f86c2bfeda2f888500bd69a31 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_bulkmcprod_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_bulkmcprod_grid.sh @@ -3,11 +3,9 @@ # art-description: MC v7 tight TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_cpsampleprod_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_cpsampleprod_grid.sh index 27adba5c91672eeddf160e65657b54c71f1459e2..d952a7d80c6a63e576ddfecff36c37927832bfe6 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_cpsampleprod_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_cpsampleprod_grid.sh @@ -3,11 +3,10 @@ # art-description: MC v7 tight TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena +# art-include: 21.3/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_grid.sh index fe8720d2788bb9c769c54fdb92eb75d348a91ce0..92df649dcad064d07024912d10bcc8951e3b1463 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_grid.sh @@ -3,12 +3,10 @@ # art-description: MC v7 TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.3/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_nops_aod_ftk_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_nops_aod_ftk_build.sh index 98577c38dee1853fa08d3d7520dd20b52886b551..1635ce0c5b00ebdbfa325a6c588913f443dac37e 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_nops_aod_ftk_build.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_nops_aod_ftk_build.sh @@ -3,11 +3,9 @@ # art-description: MC v7 no prescales TriggerTest on FTK MC to AOD # art-type: build # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_nops_aod_ftk_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_nops_aod_ftk_grid.sh index d8a691801658402d6ce3e2859440b1650a1bf59f..febbdbe9c4592d5506355a2958b89ed8a59c4867 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_nops_aod_ftk_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_nops_aod_ftk_grid.sh @@ -3,11 +3,9 @@ # art-description: MC v7 no prescales TriggerTest on FTK MC to AOD # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_triggervalidation_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_triggervalidation_grid.sh index e09a3cfd38fd3618ee854c1295dd45c8f9357045..15932de08036ad4caa503d0ed89ea64a0bc2a416 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_triggervalidation_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_mc_pp_v7_triggervalidation_grid.sh @@ -3,11 +3,10 @@ # art-description: MC v7 tight TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena +# art-include: 21.3/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_physics_hi_v4_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_physics_hi_v4_build.sh index e767ec41ee5a9fa8ec4413d2553dc56bcad1a05f..dc95c864e3aa4102a437e1abb8d3d8748e32ce65 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_physics_hi_v4_build.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_physics_hi_v4_build.sh @@ -3,11 +3,9 @@ # art-description: Heavy ion physics v4 TriggerTest on MC # art-type: build # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_physics_hi_v4_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_physics_hi_v4_grid.sh index f6266e655fa61275b52e56dce706f911179f2df5..ef4b3d08d59dd097f60175621b6cc7ecc4999142 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_physics_hi_v4_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_physics_hi_v4_grid.sh @@ -3,11 +3,9 @@ # art-description: Heavy ion physics v4 TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_physics_hi_v5_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_physics_hi_v5_build.sh index f4c5094c686c72d96dc4a53e692ddcb5025b8343..153c148ec501ec50bf8ae98d0b23ce74f994a179 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_physics_hi_v5_build.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_physics_hi_v5_build.sh @@ -3,7 +3,6 @@ # art-description: Heavy ion physics v5 TriggerTest on MC # art-type: build # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-output: HLTChain.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_physics_hi_v5_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_physics_hi_v5_grid.sh index 48c24aea1574624c669e7f066bd11b056cc455b5..a05c767494257686b008fbd8852ef4701688a011 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_physics_hi_v5_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_physics_hi_v5_grid.sh @@ -3,7 +3,6 @@ # art-description: Heavy ion physics v5 TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-output: HLTChain.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_aod_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_aod_grid.sh index 10c9c3b2a0df24af3e2d654abc7d1f1c51bc5c20..774978c999f7d588dea3ffcdcec3ac950c8293ec 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_aod_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_aod_grid.sh @@ -3,11 +3,9 @@ # art-description: Physics v7 TriggerTest on MC to AOD # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_build.sh index 003761568b4e117a17a841de67becc6a6b8c14e5..981273336795f2711c5bbcc6e32451cbdaf94a0c 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_build.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_build.sh @@ -3,11 +3,9 @@ # art-description: Physics v7 TriggerTest on MC # art-type: build # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_chainorder_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_chainorder_build.sh index d560ee9791cf51d409ea924d0cea9a1ad92bf3ea..372c3b1fdb3cb4a094b16bef3b99dadc1de452b1 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_chainorder_build.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_chainorder_build.sh @@ -3,11 +3,9 @@ # art-description: TriggerTest on changes coming through the order of execution # art-type: build # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_grid.sh index 2583f66e75d04738b99b868463dceb84f57d95f2..1bc8e0df879c76f58e1c842637a451e49c7f0922 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_grid.sh @@ -3,12 +3,10 @@ # art-description: Physics v7 TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.3/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_build.sh index 66b54150a41c1acb9f00685629baa8e82ceaa69a..8f687226bdc88a1e897867da224c8259fcb2d38b 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_build.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_build.sh @@ -3,6 +3,8 @@ # art-description: Physics v7 TriggerTest on MC # art-type: build # art-include: 21.1/AthenaP1 +# art-include: 21.0/Athena +# art-include: 21.3/Athena # art-include: master/Athena # art-output: HLTChain.txt # art-output: HLTTE.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_grid.sh index 2fb43fd56d7187ce5cb9f2022db4687d9b4723c5..ddfeb13b59c590432331a36badd052e86137af64 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_primaries_grid.sh @@ -3,6 +3,8 @@ # art-description: Physics v7 TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 +# art-include: 21.0/Athena +# art-include: 21.3/Athena # art-include: master/Athena # art-output: HLTChain.txt # art-output: HLTTE.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_tight_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_tight_grid.sh index deca2daacfd6d6dbb7a63c9574fb3885c64723e4..4b475272e7db588ea4b64ddccf40dd40ba1a35e9 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_tight_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_physics_pp_v7_tight_grid.sh @@ -3,11 +3,9 @@ # art-description: Physics v7 tight TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_bjet_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_bjet_build.sh index 5d6a36647bc9c6ebd7898b6cffd55c1266a74ba9..604cebd95f1bfd4fbb2c8981e7fd4761f2d9874e 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_bjet_build.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_bjet_build.sh @@ -3,11 +3,9 @@ # art-description: Bjet slice TriggerTest on MC # art-type: build # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_bjet_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_bjet_grid.sh index cc999f2a49ef1b8107160e3f7949971a406003f4..f4d850b816194db931cd8e9b989e50ddc92232d1 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_bjet_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_bjet_grid.sh @@ -3,11 +3,9 @@ # art-description: Bjet slice TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysics_aod_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysics_aod_grid.sh index 45164f8868ffdd63356d654c157ce38787a7760c..a789a520c4d76680cb75ac5f3972d477832f3982 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysics_aod_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysics_aod_grid.sh @@ -3,11 +3,9 @@ # art-description: Bphysics slice TriggerTest on MC using Jpsimu6mu6 to AOD # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysics_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysics_build.sh index 2316b366a9809dc177678224c6932223ab2a79e8..72b925941d2989ecc9c60647bd93d433f8f5a7c2 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysics_build.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysics_build.sh @@ -3,11 +3,9 @@ # art-description: Bphysics slice TriggerTest on MC using Jpsimu6mu6 to AOD # art-type: build # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysics_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysics_grid.sh index c6ce938851d139cb7e9102de702b8918aea94470..f142fd56ee9ccd5e7f407c3b5807818d8db2685e 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysics_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysics_grid.sh @@ -3,11 +3,9 @@ # art-description: Bphysics slice TriggerTest on MC using Jpsimu6mu6 to AOD # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysicsexo_aod_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysicsexo_aod_grid.sh index aeadbb07fa4963ee6bc7bd95a880f4fa627e351f..458eada11c99723630afaf44115f515b02a05865 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysicsexo_aod_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_bphysicsexo_aod_grid.sh @@ -3,11 +3,9 @@ # art-description: Bphysics and muon slice TriggerTest on MC using Wtaunu_3mu to AOD # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_electron_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_electron_build.sh index 22ed460c8526bc44a189d7da3491d53867bc7dfd..821e2812e97a5c61b5308545a3eb183d2d19249f 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_electron_build.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_electron_build.sh @@ -3,11 +3,9 @@ # art-description: Electron slice TriggerTest on MC # art-type: build # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_electron_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_electron_grid.sh index f2bfb416ae25d1b1c2d42aefe5d3d3850de3b7f0..c087f0d02c6f9729b1acb4091bb7b8ee175b8c64 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_electron_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_electron_grid.sh @@ -3,11 +3,9 @@ # art-description: Electron slice TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_id_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_id_build.sh index 365c531d84d95a59b76770b7cfa5f27d1bd36605..2c719a9a537813ac78d8305ce823a3988a5a6dd5 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_id_build.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_id_build.sh @@ -3,11 +3,9 @@ # art-description: ID TriggerTest over e28_lhtight_idperf on MC # art-type: build # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_jet_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_jet_build.sh index e9b5c6d7a44696cbcc58a2695e24933665213529..d1e504164e7e6fedc67d12aa853af6391cab0c04 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_jet_build.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_jet_build.sh @@ -3,11 +3,9 @@ # art-description: Jet slice TriggerTest on MC # art-type: build # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_jet_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_jet_grid.sh index 8e21cda5ea4df2e70fb3f6758ad21b88d7ec3395..3f9652192515a8e64fb6363d45432dbf438d3968 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_jet_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_jet_grid.sh @@ -3,11 +3,9 @@ # art-description: Jet slice TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_l1_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_l1_build.sh index 6fab21a12abcaab4634e77ca9f0c068179f5c411..e214de732741b53fd9ccabc4526056b4c64ced8e 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_l1_build.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_l1_build.sh @@ -3,11 +3,9 @@ # art-description: No menu (L1) TriggerTest on MC # art-type: build # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_l1_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_l1_grid.sh index 1c4c7a0be06990154b2d89d9f104739b78e01885..1e0988945ab932adfcdf27b9c308f1ed485c9ac5 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_l1_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_l1_grid.sh @@ -3,11 +3,9 @@ # art-description: No menu (L1) TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_met_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_met_build.sh index dd669c39099d8a5bf6047a15bdbc1c8ff466b449..916c6b06d5fceae7c69a6ca7458a535503fcddb1 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_met_build.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_met_build.sh @@ -3,11 +3,9 @@ # art-description: MET slice TriggerTest on MC # art-type: build # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_met_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_met_grid.sh index 23e6e1b1cc3f3a924ba452fea19872c7a3a3a0c0..74d31245b2b60278cad4088ddb82f6be0f94aa2b 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_met_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_met_grid.sh @@ -3,11 +3,9 @@ # art-description: MET slice TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_minbias_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_minbias_build.sh index 8f3fe85823928459430e514a803bca701a8c9f1d..20049a3882516b0f6d8767e0e8825d3475029f43 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_minbias_build.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_minbias_build.sh @@ -3,11 +3,9 @@ # art-description: MinBias slice TriggerTest on MinBias MC # art-type: build # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_minbias_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_minbias_grid.sh index 8c22738628b534219055b3a2b67bb2526f3636b4..39915d32a7123a75b8e74a94a2fb6d1f6482c945 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_minbias_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_minbias_grid.sh @@ -3,11 +3,9 @@ # art-description: MinBias slice TriggerTest on MinBias MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_minbias_hmt_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_minbias_hmt_grid.sh index 791d453328aa334a8f1704f2811c639af782d9c3..4fb004319d49173772420bf61042be6638c25d1a 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_minbias_hmt_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_minbias_hmt_grid.sh @@ -3,11 +3,9 @@ # art-description: MinBias Enhanced (High Multiplicity Trigger) slice TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_muon_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_muon_build.sh index 21755b3193c12a3f3cdd3911be55298d0ef759aa..c2f65a8eb2d21135ceb36281c04a30f9186a5e88 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_muon_build.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_muon_build.sh @@ -3,11 +3,9 @@ # art-description: Muon slice TriggerTest on MC # art-type: build # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_muon_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_muon_grid.sh index d2becffc2da914fd1267888e5e0a5ca51038584c..90f577ed1f6e3e78fc6f76c4ad6d1079a1779b60 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_muon_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_muon_grid.sh @@ -3,11 +3,9 @@ # art-description: Muon slice TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_tau_build.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_tau_build.sh index 2ee6d99e31cca9426a1c495d8578e364ac456542..a978e7abef5a3e58fcf3070c74261a3449e6ceb0 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_tau_build.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_tau_build.sh @@ -3,11 +3,9 @@ # art-description: Tau slice TriggerTest on MC # art-type: build # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/Athena # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TrigValidation/TriggerTest/test/test_slice_tau_grid.sh b/Trigger/TrigValidation/TriggerTest/test/test_slice_tau_grid.sh index 167a490f06c2eb4589f2425394a781cd27f1b828..01ae58d8ab5c6180cd5241f1e595e8af214f9937 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_slice_tau_grid.sh +++ b/Trigger/TrigValidation/TriggerTest/test/test_slice_tau_grid.sh @@ -3,11 +3,9 @@ # art-description: Tau slice TriggerTest on MC # art-type: grid # art-include: 21.1/AthenaP1 -# art-include: 21.1-dev/AthenaP1 # art-include: 21.0/Athena # art-include: 21.0-TrigMC/Athena # art-include: master/Athena -# art-include: master/AthenaP1 # art-output: HLTChain.txt # art-output: HLTTE.txt # art-output: L1AV.txt diff --git a/Trigger/TriggerCommon/TriggerMenu/python/bjet/generateBjetChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/bjet/generateBjetChainDefs.py index 8155cece968cdc6596dbf94a33c755eeb97b495e..d37d770741394f41ea8a05e4ca28feeca3b2b0a4 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/bjet/generateBjetChainDefs.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/bjet/generateBjetChainDefs.py @@ -237,9 +237,9 @@ def buildBjetChainsAllTE(theChainDef, bjetdict, numberOfSubChainDicts=1): # PV Tracking # if useTRT : - [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", "2step").getSequence() + [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", sequenceFlavour=["2step"]).getSequence() else : - [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", "2step","noTRT").getSequence() + [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", sequenceFlavour=["2step","noTRT"]).getSequence() tracking = "IDTrig" if not useTRT : tracking = tracking + "_noTRT" @@ -453,10 +453,9 @@ def myBjetConfig_split(theChainDef, chainDict, inputTEsEF,numberOfSubChainDicts= elif 'FTK' in chainParts['bTracking']: [ftkvtx, trkftf, trkprec] = TrigInDetFTKSequence("Bjet", "bjet", sequenceFlavour=["FTKVtx","PT"]).getSequence() # new elif useTRT : - [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", "2step").getSequence() # new + [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", sequenceFlavour=["2step"]).getSequence() else : - [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", "2step","noTRT").getSequence() # new - + [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", sequenceFlavour=["2step","noTRT"]).getSequence() # for b-tagging theBjetTracks = trkftf+trkprec @@ -680,9 +679,9 @@ def myBjetConfig1(theChainDef, chainDict, inputTEsEF,numberOfSubChainDicts=1): # tracking if useTRT : - [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", "2step").getSequence() + [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", sequenceFlavour=["2step"]).getSequence() else : - [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", "2step","noTRT").getSequence() + [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", sequenceFlavour=["2step","noTRT"]).getSequence() ef_bjet_tracks = trkftf+trkprec diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/BeamspotDef.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/BeamspotDef.py index bf0654721d41df4302524b64c34f782c12efbee2..cd748a61be636b33ccfc4bcce1c6ae06955450d6 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/BeamspotDef.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/BeamspotDef.py @@ -128,7 +128,7 @@ class L2EFChain_Beamspot(L2EFChainDef): mlog.error('Cannot assemble chain %s - only configured for trkFS,allTE and activeTE' % (self.chainPartName)) from TrigInDetConf.TrigInDetSequence import TrigInDetSequence - [trk_alg] = TrigInDetSequence("BeamSpot", "beamSpot", "IDTrig", "FTF").getSequence() + [trk_alg] = TrigInDetSequence("BeamSpot", "beamSpot", "IDTrig", sequenceFlavour=["FTF"]).getSequence() teaddition = 'trkfast' elif ('FTK' in self.l2IDAlg): @@ -152,8 +152,7 @@ class L2EFChain_Beamspot(L2EFChainDef): if 'idperf' in self.chainPart['addInfo']: from TrigInDetConf.TrigInDetSequence import TrigInDetSequence - [trk_alg] = TrigInDetSequence("BeamSpot", "beamSpot", "IDTrig", "FTF").getSequence() - + [trk_alg] = TrigInDetSequence("BeamSpot", "beamSpot", "IDTrig", sequenceFlavour=["FTF"]).getSequence() from TrigInDetConf.TrigInDetFTKSequence import TrigInDetFTKSequence [ftk_alg] = TrigInDetFTKSequence("BeamSpot", "beamSpot", "mon").getSequence() if 'mon' in self.chainPart['addInfo']: @@ -184,7 +183,7 @@ class L2EFChain_Beamspot(L2EFChainDef): if 'idperf' in self.chainPart['addInfo']: from TrigInDetConf.TrigInDetSequence import TrigInDetSequence - [trk_alg] = TrigInDetSequence("BeamSpot", "beamSpot", "IDTrig", "FTF").getSequence() + [trk_alg] = TrigInDetSequence("BeamSpot", "beamSpot", "IDTrig", sequenceFlavour=["FTF"]).getSequence() from TrigInDetConf.TrigInDetFTKSequence import TrigInDetFTKSequence [ftk_alg] = TrigInDetFTKSequence("BeamSpot", "beamSpot", "refit").getSequence() else: diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/generateJetChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/generateJetChainDefs.py index 4ec6e1b5d890fb7dbdd63a71f97c125c2a7804ac..6680189517f2bf2230d805303f4ae5ec857d225c 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/jet/generateJetChainDefs.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/generateJetChainDefs.py @@ -117,7 +117,7 @@ def generateMuonClusterLLPchain(theChainDef, chainDict, inputTEsL2, inputTEsEF, # tracking from TrigInDetConf.TrigInDetSequence import TrigInDetSequence - [trkcore,trkiso,trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", "2step").getSequence() + [trkcore,trkiso,trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", sequenceFlavour=["2step"]).getSequence() # muon cluster from TrigL2LongLivedParticles.TrigL2LongLivedParticlesConfig import MuonClusterConfig @@ -176,7 +176,7 @@ def generateCaloRatioLLPchain(theChainDef, chainDict, inputTEsL2, inputTEsEF, to # tracking from TrigInDetConf.TrigInDetSequence import TrigInDetSequence - [trkcore, trkiso, trkprec] = TrigInDetSequence("Tau", "tau", "IDTrig", "2step").getSequence() + [trkcore, trkiso, trkprec] = TrigInDetSequence("Tau", "tau", "IDTrig", sequenceFlavour=["2step"]).getSequence() # calo-ratio from TrigLongLivedParticlesHypo.TrigLongLivedParticlesHypoConfig import getCaloRatioHypoInstance @@ -238,7 +238,7 @@ def generateReversedCaloRatioLLPchain(theChainDef, chainDict, inputTEsL2, inputT # tracking from TrigInDetConf.TrigInDetSequence import TrigInDetSequence - [trkcore, trkiso, trkprec] = TrigInDetSequence("Tau", "tau", "IDTrig", "2step").getSequence() + [trkcore, trkiso, trkprec] = TrigInDetSequence("Tau", "tau", "IDTrig", sequenceFlavour=["2step"]).getSequence() # reversed calo-ratio from TrigLongLivedParticlesHypo.TrigLongLivedParticlesHypoConfig import getCaloRatioHypoInstance diff --git a/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py b/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py index 8319523b276cd3e223bad304153e8f4ee7c9237e..c31ef78847df5ec491e01df3005bf636e34e2ab3 100755 --- a/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py @@ -303,7 +303,7 @@ class L2EFChain_mu(L2EFChainDef): log.error("Chain built with %s but so far only l2muonSA is supported." % (self.chainPart['L2SAAlg'])) return False - [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", sequenceFlavour="2step").getSequence() + [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", sequenceFlavour=["2step"]).getSequence() @@ -1063,7 +1063,7 @@ class L2EFChain_mu(L2EFChainDef): return False from TrigMuonHypo.TrigMuonHypoConfig import TrigMuonEFExtrapolatorHypoConfig theTrigMuonEFExtrapolatorHypoConfig = TrigMuonEFExtrapolatorHypoConfig(EFRecoAlgName, EFExtrapolatorThresh) - [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", sequenceFlavour="2step").getSequence() + [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", sequenceFlavour=["2step"]).getSequence() if "wOvlpRm" in self.chainPart['overlapRemoval']: from TrigMuonHypo.TrigEFMuonOverlapRemoverConfig import TrigEFMuonOverlapRemoverConfig theEFOvlpRmConfig = TrigEFMuonOverlapRemoverConfig('MuExtr','loose') @@ -2267,7 +2267,7 @@ class L2EFChain_mu(L2EFChainDef): theL2StandAloneHypo = MufastHypoConfig(L2AlgName, muFastThresh) from TrigInDetConf.TrigInDetSequence import TrigInDetSequence - [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", sequenceFlavour="2step").getSequence() + [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", sequenceFlavour=["2step"]).getSequence() theTrigMuSuperEF = CfgGetter.getAlgorithm("TrigMuSuperEF") EFRecoAlgName = "Muon" diff --git a/Trigger/TriggerCommon/TriggerMenu/python/tau/TauDef.py b/Trigger/TriggerCommon/TriggerMenu/python/tau/TauDef.py index 9cbe3cc06663c6c167b9f776388365ce1d432c75..c4a37f2a27f2f420f40e4310bdbee0d63072d870 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/tau/TauDef.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/tau/TauDef.py @@ -168,7 +168,7 @@ class L2EFChain_tau(L2EFChainDef): [trkfast, trkprec[:]] = TrigInDetSequence("Tau", "tau", "IDTrig").getSequence() # Use cosmic-specific tracking algorithm if selection == 'cosmic': - [trkfast] = TrigInDetSequence("Cosmics", "cosmics", "IDTrig", "FTF").getSequence() + [trkfast] = TrigInDetSequence("Cosmics", "cosmics", "IDTrig", sequenceFlavour=["FTF"]).getSequence() # Run fast-tracking self.EFsequenceList += [[[ self.currentItem ], @@ -230,7 +230,7 @@ class L2EFChain_tau(L2EFChainDef): def addTwoStepTrackingSequence(self,threshold,selection,preselection,idperf,trkprec): # Get the necessary fexes # use [:] so the list trkprec is modified by this function - [trkcore, trkiso, trkprec[:]] = TrigInDetSequence("Tau", "tau", "IDTrig", "2step").getSequence() + [trkcore, trkiso, trkprec[:]] = TrigInDetSequence("Tau", "tau", "IDTrig", sequenceFlavour=["2step"]).getSequence() # Get the HLTTrackTauHypo_rejectNoTracks tauRejectEmpty = HLTTrackTauHypo_rejectNoTracks("TauRejectEmpty")